KhronosGroup/Vulkan-ExtensionLayer

Potential use of pipeline with different shaders than requested

qbojj opened this issue · 0 comments

qbojj commented

Because Shaders are allocated on the heap two different Shaders might have the same address if one was deallocated before the other one was allocated, even if they might not have identical contents.

Because stale Shaders might be stored inside FullDrawStateDatas inside vertex/mesh shader's Shader::pipelines, equality test of FullDrawStateData might return true when their Shaders are not equal as argumented above.

If such thing happens a pipeline with wrong shaders attached might be used.

for (uint32_t i = 0; i < NUM_SHADERS; ++i) {
if (!(o.shaders_[i] == shaders_[i])) {
return false;
}
}