internal/graphicsdriver/directx: refactoring

This makes more explicit that the pixels are sent after the slice
for the pixels finishes modification.
This commit is contained in:
Hajime Hoshi 2022-09-19 00:29:12 +09:00
parent cfdf59ef8d
commit c7fcfe5bf7

View File

@ -1627,7 +1627,9 @@ func (i *Image) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
for j := 0; j < a.Height; j++ { for j := 0; j < a.Height; j++ {
copy(srcBytes[(a.Y+j)*int(i.layouts.Footprint.RowPitch)+a.X*4:], a.Pixels[j*a.Width*4:(j+1)*a.Width*4]) copy(srcBytes[(a.Y+j)*int(i.layouts.Footprint.RowPitch)+a.X*4:], a.Pixels[j*a.Width*4:(j+1)*a.Width*4])
} }
}
for _, a := range args {
dst := _D3D12_TEXTURE_COPY_LOCATION_SubresourceIndex{ dst := _D3D12_TEXTURE_COPY_LOCATION_SubresourceIndex{
pResource: i.texture, pResource: i.texture,
Type: _D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, Type: _D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX,