From 532b476c4eeaae14b955676e616317d6fc2fdb3a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 3 Jun 2022 13:59:34 +0900 Subject: [PATCH] Revert "internal/graphicsdriver/directx: pass nil for pReadRange at Map" This reverts commit 3b13158cc03c780afbff90c14f0d593ec746e894. Reason: Specifying nil for reading ranges is not efficient --- internal/graphicsdriver/directx/graphics_windows.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/graphicsdriver/directx/graphics_windows.go b/internal/graphicsdriver/directx/graphics_windows.go index 3354c0d5a..b763940bb 100644 --- a/internal/graphicsdriver/directx/graphics_windows.go +++ b/internal/graphicsdriver/directx/graphics_windows.go @@ -824,14 +824,14 @@ func (g *Graphics) SetVertices(vertices []float32, indices []uint16) (ferr error }() } - m, err := g.vertices[g.frameIndex][vidx].Map(0, nil) + m, err := g.vertices[g.frameIndex][vidx].Map(0, &_D3D12_RANGE{0, 0}) if err != nil { return err } copyFloat32s(m, vertices) g.vertices[g.frameIndex][vidx].Unmap(0, nil) - m, err = g.indices[g.frameIndex][iidx].Map(0, nil) + m, err = g.indices[g.frameIndex][iidx].Map(0, &_D3D12_RANGE{0, 0}) if err != nil { return err } @@ -1329,7 +1329,7 @@ func (i *Image) ReadPixels(buf []byte) error { i.transiteState(i.graphics.copyCommandList, _D3D12_RESOURCE_STATE_COPY_SOURCE) - m, err := i.readingStagingBuffer.Map(0, nil) + m, err := i.readingStagingBuffer.Map(0, &_D3D12_RANGE{0, 0}) if err != nil { return err } @@ -1388,7 +1388,7 @@ func (i *Image) ReplacePixels(args []*graphicsdriver.ReplacePixelsArgs) error { i.transiteState(i.graphics.copyCommandList, _D3D12_RESOURCE_STATE_COPY_DEST) - m, err := i.uploadingStagingBuffer.Map(0, nil) + m, err := i.uploadingStagingBuffer.Map(0, &_D3D12_RANGE{0, 0}) if err != nil { return err }