summaryrefslogtreecommitdiffstats
path: root/tools/gfx/debug-layer.cpp
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-03-08 12:47:32 -0800
committerGitHub <noreply@github.com>2022-03-08 15:47:32 -0500
commit771f29435d664f7344bc5596056146af5d64d352 (patch)
tree035fba1641088d75381e9a7140dab2d6f21223f9 /tools/gfx/debug-layer.cpp
parent2a80bcfa96089967b299eea0454d9debe52fa0f6 (diff)
Expose API-specific row alignment values (#2151)
* Added function to IDevice that retrieves the row alignment for the particular API; Added rowDstStride argument to copyTextureToBuffer and changed D3D12 footprint row pitch to check that the user-supplied stride is correctly aligned before assigning to the footprint's row pitch * Changed alignment from Uint to size_t Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'tools/gfx/debug-layer.cpp')
-rw-r--r--tools/gfx/debug-layer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp
index ec51dbee3..341f0034a 100644
--- a/tools/gfx/debug-layer.cpp
+++ b/tools/gfx/debug-layer.cpp
@@ -841,6 +841,12 @@ Result DebugDevice::getTextureAllocationInfo(
return baseObject->getTextureAllocationInfo(desc, outSize, outAlignment);
}
+Result DebugDevice::getTextureRowAlignment(size_t* outAlignment)
+{
+ SLANG_GFX_API_FUNC;
+ return baseObject->getTextureRowAlignment(outAlignment);
+}
+
Result DebugDevice::createShaderTable(const IShaderTable::Desc& desc, IShaderTable** outTable)
{
SLANG_GFX_API_FUNC;
@@ -1407,6 +1413,7 @@ void DebugResourceCommandEncoderImpl::copyTextureToBuffer(
IBufferResource* dst,
size_t dstOffset,
size_t dstSize,
+ size_t dstRowStride,
ITextureResource* src,
ResourceState srcState,
SubresourceRange srcSubresource,
@@ -1415,7 +1422,7 @@ void DebugResourceCommandEncoderImpl::copyTextureToBuffer(
{
SLANG_GFX_API_FUNC;
getBaseResourceEncoder()->copyTextureToBuffer(
- getInnerObj(dst), dstOffset, dstSize, getInnerObj(src), srcState, srcSubresource, srcOffset, extent);
+ getInnerObj(dst), dstOffset, dstSize, dstRowStride, getInnerObj(src), srcState, srcSubresource, srcOffset, extent);
}
void DebugResourceCommandEncoderImpl::textureSubresourceBarrier(