Merge pull request #626 from VZout/master

Cleaned up the createShaderBindingTable for the raytracing examples
This commit is contained in:
Sascha Willems 2020-04-23 07:45:26 +02:00 committed by GitHub
commit cb50a95547
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View file

@ -412,7 +412,6 @@ public:
VkDeviceSize copyShaderIdentifier(uint8_t* data, const uint8_t* shaderHandleStorage, uint32_t groupIndex) {
const uint32_t shaderGroupHandleSize = rayTracingProperties.shaderGroupHandleSize;
memcpy(data, shaderHandleStorage + groupIndex * shaderGroupHandleSize, shaderGroupHandleSize);
data += shaderGroupHandleSize;
return shaderGroupHandleSize;
}
@ -434,7 +433,6 @@ public:
VK_CHECK_RESULT(vkGetRayTracingShaderGroupHandlesNV(device, pipeline, 0, NUM_SHADER_GROUPS, sbtSize, shaderHandleStorage));
auto* data = static_cast<uint8_t*>(shaderBindingTable.mapped);
// Copy the shader identifiers to the shader binding table
VkDeviceSize offset = 0;
data += copyShaderIdentifier(data, shaderHandleStorage, INDEX_RAYGEN);
data += copyShaderIdentifier(data, shaderHandleStorage, INDEX_MISS);
data += copyShaderIdentifier(data, shaderHandleStorage, INDEX_SHADOW_MISS);