Commit f630b253 by Alexis Hetu Committed by Alexis Hétu

Fixed PipelineLayout creation on 32 bit

The assumption that Cast(VkDescriptorSetLayout) is nothing but a noop cast no longer hold on 32 bit, since the handle and the pointer don't have the same size. Used the Cast() function to solve the issue. Bug chromium:968313 Change-Id: I0349d1f4f00ca983bbc4ca9c39be77d3a0b3d5bc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32229Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 37bc82ac
......@@ -25,7 +25,10 @@ PipelineLayout::PipelineLayout(const VkPipelineLayoutCreateInfo* pCreateInfo, vo
size_t setLayoutsSize = pCreateInfo->setLayoutCount * sizeof(DescriptorSetLayout*);
setLayouts = reinterpret_cast<DescriptorSetLayout**>(hostMem);
memcpy(setLayouts, pCreateInfo->pSetLayouts, setLayoutsSize); // Assumes Cast(VkDescriptorSetLayout) is nothing but a cast
for(uint32_t i = 0; i < pCreateInfo->setLayoutCount; i++)
{
setLayouts[i] = Cast(pCreateInfo->pSetLayouts[i]);
}
hostMem += setLayoutsSize;
size_t pushConstantRangesSize = pCreateInfo->pushConstantRangeCount * sizeof(VkPushConstantRange);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment