Commit 3c2454b8 by Tim Van Patten Committed by Commit Bot

Vulkan: Only count descriptor set resources once

The descriptor set resource counts for monolithic programs already have all of the counts combined for all shader stages, rather than needing to loop through and combine them all like program pipeline objects. Bug: angleproject:3570 Test: CQ Change-Id: Ib8a2fe7af991a8d9d5edcef346352c7bac0703fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2375869Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent 9a64f307
...@@ -807,14 +807,18 @@ angle::Result ProgramExecutableVk::createPipelineLayout(const gl::Context *glCon ...@@ -807,14 +807,18 @@ angle::Result ProgramExecutableVk::createPipelineLayout(const gl::Context *glCon
{ {
const gl::ProgramState *programState = programStates[shaderType]; const gl::ProgramState *programState = programStates[shaderType];
ASSERT(programState); ASSERT(programState);
// TODO(timvp): http://anglebug.com/3570: These counts will be too high for monolithic
// programs, since it's the same ProgramState for each shader type.
uniformBlockCount += static_cast<uint32_t>(programState->getUniformBlocks().size()); uniformBlockCount += static_cast<uint32_t>(programState->getUniformBlocks().size());
storageBlockCount += static_cast<uint32_t>(programState->getShaderStorageBlocks().size()); storageBlockCount += static_cast<uint32_t>(programState->getShaderStorageBlocks().size());
atomicCounterBufferCount += atomicCounterBufferCount +=
static_cast<uint32_t>(programState->getAtomicCounterBuffers().size()); static_cast<uint32_t>(programState->getAtomicCounterBuffers().size());
imageCount += static_cast<uint32_t>(programState->getImageBindings().size()); imageCount += static_cast<uint32_t>(programState->getImageBindings().size());
textureCount += static_cast<uint32_t>(programState->getSamplerBindings().size()); textureCount += static_cast<uint32_t>(programState->getSamplerBindings().size());
if (!programState->isSeparable())
{
// Monolithic programs already have all of the counts combined for all shader stages.
break;
}
} }
if (renderer->getFeatures().bindEmptyForUnusedDescriptorSets.enabled) if (renderer->getFeatures().bindEmptyForUnusedDescriptorSets.enabled)
......
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