Commit b01b4802 by Jamie Madill Committed by Commit Bot

Vulkan: Apply driver uniforms descriptor set.

Also modifies the ProgramVk to initialize the Pipeline and Desriptor Set layouts with driver uniforms enabled. Bug: angleproject:2717 Change-Id: I24f7bf6f89b450d1dcb62dcfa7411555ebe3a937 Reviewed-on: https://chromium-review.googlesource.com/1131568Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent c0bb36cb
...@@ -236,11 +236,10 @@ gl::Error ContextVk::setupDraw(const gl::Context *context, ...@@ -236,11 +236,10 @@ gl::Error ContextVk::setupDraw(const gl::Context *context,
// TODO(jmadill): Handle multiple command buffers. // TODO(jmadill): Handle multiple command buffers.
const auto &descriptorSets = programVk->getDescriptorSets(); const auto &descriptorSets = programVk->getDescriptorSets();
const gl::RangeUI &usedRange = programVk->getUsedDescriptorSetRange(); const gl::RangeUI &usedRange = programVk->getUsedDescriptorSetRange();
const vk::PipelineLayout &pipelineLayout = programVk->getPipelineLayout();
if (!usedRange.empty()) if (!usedRange.empty())
{ {
ASSERT(!descriptorSets.empty()); ASSERT(!descriptorSets.empty());
const vk::PipelineLayout &pipelineLayout = programVk->getPipelineLayout();
(*commandBufferOut) (*commandBufferOut)
->bindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, usedRange.low(), ->bindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, usedRange.low(),
usedRange.length(), &descriptorSets[usedRange.low()], usedRange.length(), &descriptorSets[usedRange.low()],
...@@ -248,6 +247,11 @@ gl::Error ContextVk::setupDraw(const gl::Context *context, ...@@ -248,6 +247,11 @@ gl::Error ContextVk::setupDraw(const gl::Context *context,
programVk->getDynamicOffsets()); programVk->getDynamicOffsets());
} }
(*commandBufferOut)
->bindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout,
kDriverUniformsDescriptorSetIndex, 1, &mDriverUniformsDescriptorSet, 0,
nullptr);
return gl::NoError(); return gl::NoError();
} }
......
...@@ -302,9 +302,16 @@ gl::LinkResult ProgramVk::link(const gl::Context *glContext, ...@@ -302,9 +302,16 @@ gl::LinkResult ProgramVk::link(const gl::Context *glContext,
ANGLE_TRY(renderer->getDescriptorSetLayout(texturesSetDesc, ANGLE_TRY(renderer->getDescriptorSetLayout(texturesSetDesc,
&mDescriptorSetLayouts[kTextureDescriptorSetIndex])); &mDescriptorSetLayouts[kTextureDescriptorSetIndex]));
vk::DescriptorSetLayoutDesc driverUniformsSetDesc;
driverUniformsSetDesc.update(0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1);
ANGLE_TRY(renderer->getDescriptorSetLayout(
driverUniformsSetDesc, &mDescriptorSetLayouts[kDriverUniformsDescriptorSetIndex]));
vk::PipelineLayoutDesc pipelineLayoutDesc; vk::PipelineLayoutDesc pipelineLayoutDesc;
pipelineLayoutDesc.updateDescriptorSetLayout(kUniformsDescriptorSetIndex, uniformsSetDesc); pipelineLayoutDesc.updateDescriptorSetLayout(kUniformsDescriptorSetIndex, uniformsSetDesc);
pipelineLayoutDesc.updateDescriptorSetLayout(kTextureDescriptorSetIndex, texturesSetDesc); pipelineLayoutDesc.updateDescriptorSetLayout(kTextureDescriptorSetIndex, texturesSetDesc);
pipelineLayoutDesc.updateDescriptorSetLayout(kDriverUniformsDescriptorSetIndex,
driverUniformsSetDesc);
ANGLE_TRY( ANGLE_TRY(
renderer->getPipelineLayout(pipelineLayoutDesc, mDescriptorSetLayouts, &mPipelineLayout)); renderer->getPipelineLayout(pipelineLayoutDesc, mDescriptorSetLayouts, &mPipelineLayout));
......
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