Vulkan: Use push constants in PipelineLayoutCache.
This removes the internal pipeline layout for the masked clear shaders.
Instead use the PipelineLayoutCache.
Bug: angleproject:2462
Change-Id: I8f8365b866098ece3e964fd12447dfdea55c20ba
Reviewed-on: https://chromium-review.googlesource.com/1090758
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index 2fcf5a6..38f91fc 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -596,8 +596,17 @@
ANGLE_TRY(shaderLibrary->getShader(renderer, vk::InternalShaderID::PushConstantColor_frag,
&pushConstantColor));
- const vk::PipelineLayout *pipelineLayout = nullptr;
- ANGLE_TRY(renderer->getInternalPushConstantPipelineLayout(&pipelineLayout));
+ // The shader uses a simple pipeline layout with a push constant range.
+ vk::PipelineLayoutDesc pipelineLayoutDesc;
+ pipelineLayoutDesc.updatePushConstantRange(gl::ShaderType::Fragment, 0,
+ sizeof(VkClearColorValue));
+
+ // The shader does not use any descriptor sets.
+ vk::DescriptorSetLayoutPointerArray descriptorSetLayouts;
+
+ vk::BindingPointer<vk::PipelineLayout> pipelineLayout;
+ ANGLE_TRY(
+ renderer->getPipelineLayout(pipelineLayoutDesc, descriptorSetLayouts, &pipelineLayout));
vk::RecordingMode recordingMode = vk::RecordingMode::Start;
vk::CommandBuffer *drawCommands = nullptr;
@@ -630,15 +639,16 @@
}
vk::PipelineAndSerial *pipeline = nullptr;
- ANGLE_TRY(renderer->getInternalPipeline(*fullScreenQuad, *pushConstantColor, *pipelineLayout,
- pipelineDesc, gl::AttributesMask(), &pipeline));
+ ANGLE_TRY(renderer->getInternalPipeline(*fullScreenQuad, *pushConstantColor,
+ pipelineLayout.get(), pipelineDesc,
+ gl::AttributesMask(), &pipeline));
pipeline->updateSerial(renderer->getCurrentQueueSerial());
vk::CommandBuffer *writeCommands = nullptr;
ANGLE_TRY(appendWriteResource(renderer, &writeCommands));
VkClearColorValue clearColorValue = contextVk->getClearColorValue().color;
- drawCommands->pushConstants(*pipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0,
+ drawCommands->pushConstants(pipelineLayout.get(), VK_SHADER_STAGE_FRAGMENT_BIT, 0,
sizeof(VkClearColorValue), clearColorValue.float32);
// TODO(jmadill): Masked combined color and depth/stencil clear. http://anglebug.com/2455