Skip to content

Commit

Permalink
D3D12 Copy Pass (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut authored and flibitijibibo committed Aug 23, 2024
1 parent 7539485 commit b123f3f
Show file tree
Hide file tree
Showing 2 changed files with 467 additions and 53 deletions.
6 changes: 3 additions & 3 deletions src/gpu/d3d11/SDL_gpu_d3d11.c
Original file line number Diff line number Diff line change
Expand Up @@ -2786,7 +2786,7 @@ static void D3D11_DownloadFromTexture(
Uint32 bufferStride = destination->imagePitch;
Uint32 bufferImageHeight = destination->imageHeight;
Uint32 bytesPerRow, bytesPerDepthSlice;
D3D11_BOX srcBox = { source->x, source->y, source->z, source->x + source->w, source->y + source->h, 1 };
D3D11_BOX srcBox = { source->x, source->y, source->z, source->x + source->w, source->y + source->h, source->z + source->d };
HRESULT res;

if (d3d11TransferBuffer->textureDownloadCount >= d3d11TransferBuffer->textureDownloadCapacity) {
Expand Down Expand Up @@ -2939,7 +2939,7 @@ static void D3D11_CopyTextureToTexture(
D3D11TextureContainer *srcContainer = (D3D11TextureContainer *)source->textureSlice.texture;
D3D11TextureContainer *dstContainer = (D3D11TextureContainer *)destination->textureSlice.texture;

D3D11_BOX srcBox = { source->x, source->y, source->z, source->x + w, source->y + h, 1 };
D3D11_BOX srcBox = { source->x, source->y, source->z, source->x + w, source->y + h, source->z + d };

D3D11TextureSubresource *srcSubresource = D3D11_INTERNAL_FetchTextureSubresource(
srcContainer,
Expand Down Expand Up @@ -4548,7 +4548,7 @@ static void D3D11_INTERNAL_MapAndCopyTextureDownload(
D3D11_MAP_READ,
0,
&subres);
ERROR_CHECK_RETURN("Could not map staging textre", )
ERROR_CHECK_RETURN("Could not map staging texture", )

for (depth = 0; depth < textureDownload->depth; depth += 1) {
dataPtrOffset = textureDownload->bufferOffset + (depth * textureDownload->bytesPerDepthSlice);
Expand Down
Loading

0 comments on commit b123f3f

Please sign in to comment.