Skip to content

Commit

Permalink
[d3d9] Handle DS texture uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
K0bin authored and misyltoad committed Nov 21, 2022
1 parent 2c53459 commit d0a10cc
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4611,18 +4611,33 @@ namespace dxvk {
slice.mapPtr, srcData, extentBlockCount, formatInfo->elementSize,
pitch, pitch * srcTexLevelExtentBlockCount.height);


VkFormat packedFormat = GetPackedDepthStencilFormat(pDestTexture->Desc()->Format);

EmitCs([
cSrcSlice = slice.slice,
cDstImage = image,
cDstLayers = dstLayers,
cDstLevelExtent = alignedExtent,
cOffset = alignedDestOffset
cOffset = alignedDestOffset,
cPackedFormat = packedFormat
] (DxvkContext* ctx) {
ctx->copyBufferToImage(
cDstImage, cDstLayers,
cOffset, cDstLevelExtent,
cSrcSlice.buffer(), cSrcSlice.offset(),
1, 1);
if (cDstLayers.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
ctx->copyBufferToImage(
cDstImage, cDstLayers,
cOffset, cDstLevelExtent,
cSrcSlice.buffer(), cSrcSlice.offset(),
1, 1);
} else {
ctx->copyPackedBufferToDepthStencilImage(
cDstImage, cDstLayers,
VkOffset2D { cOffset.x, cOffset.y },
VkExtent2D { cDstLevelExtent.width, cDstLevelExtent.height },
cSrcSlice.buffer(), cSrcSlice.offset(),
VkOffset2D { 0, 0 },
VkExtent2D { cDstLevelExtent.width, cDstLevelExtent.height },
cPackedFormat);
}
});

TrackTextureMappingBufferSequenceNumber(pSrcTexture, SrcSubresource);
Expand Down

0 comments on commit d0a10cc

Please sign in to comment.