summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gfx-unit-test/ray-tracing-tests.cpp3
-rw-r--r--tools/gfx/vulkan/vk-shader-table.cpp6
2 files changed, 3 insertions, 6 deletions
diff --git a/tools/gfx-unit-test/ray-tracing-tests.cpp b/tools/gfx-unit-test/ray-tracing-tests.cpp
index 558c700d3..97a6ad7d1 100644
--- a/tools/gfx-unit-test/ray-tracing-tests.cpp
+++ b/tools/gfx-unit-test/ray-tracing-tests.cpp
@@ -488,11 +488,8 @@ namespace gfx_test
runTestImpl(rayTracingTestImpl<RayTracingTestB>, unitTestContext, Slang::RenderApiFlag::D3D12);
}
-#if 0
- //TODO: fix test failure.
SLANG_UNIT_TEST(RayTracingTestBVulkan)
{
runTestImpl(rayTracingTestImpl<RayTracingTestB>, unitTestContext, Slang::RenderApiFlag::Vulkan);
}
-#endif
}
diff --git a/tools/gfx/vulkan/vk-shader-table.cpp b/tools/gfx/vulkan/vk-shader-table.cpp
index 89225f7c2..a47750ddb 100644
--- a/tools/gfx/vulkan/vk-shader-table.cpp
+++ b/tools/gfx/vulkan/vk-shader-table.cpp
@@ -22,8 +22,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer(
auto vkApi = m_device->m_api;
auto rtProps = vkApi.m_rtProperties;
uint32_t handleSize = rtProps.shaderGroupHandleSize;
- m_raygenTableSize = (uint32_t)VulkanUtil::calcAligned(
- m_rayGenShaderCount * handleSize, rtProps.shaderGroupBaseAlignment);
+ m_raygenTableSize = m_rayGenShaderCount * rtProps.shaderGroupBaseAlignment;
m_missTableSize = (uint32_t)VulkanUtil::calcAligned(
m_missShaderCount * handleSize, rtProps.shaderGroupBaseAlignment);
m_hitTableSize = (uint32_t)VulkanUtil::calcAligned(
@@ -75,7 +74,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer(
// index in the buffer of handles.
for (uint32_t i = 0; i < m_rayGenShaderCount; i++)
{
- auto dstHandlePtr = subTablePtr + i * handleSize;
+ auto dstHandlePtr = subTablePtr + i * rtProps.shaderGroupBaseAlignment;
auto shaderGroupName = m_shaderGroupNames[shaderTableEntryCounter++];
auto shaderGroupIndexPtr =
pipelineImpl->shaderGroupNameToIndex.TryGetValue(shaderGroupName);
@@ -85,6 +84,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer(
auto shaderGroupIndex = *shaderGroupIndexPtr;
auto srcHandlePtr = handles.getBuffer() + shaderGroupIndex * handleSize;
memcpy(dstHandlePtr, srcHandlePtr, handleSize);
+ memset(dstHandlePtr + handleSize, 0, rtProps.shaderGroupBaseAlignment - handleSize);
}
subTablePtr += m_raygenTableSize;