Vulkan: Plumb bound descriptor sets down to SpirvRoutine.
Choice of tests is slightly odd -- but there are a number of tests in
this group which *don't* use the derivative instructions (glslang is
smart enough to not emit them when the expression is known to be uniform).
Bug: b/126330097
Test: dEQP-VK.glsl.derivate.*
Test: dEQP-VK.ubo.*
Change-Id: I8864149104f2ea9b62c75ceae59da4ff8adebc32
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26548
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/VertexProgram.cpp b/src/Pipeline/VertexProgram.cpp
index 9a40f79..d286718 100644
--- a/src/Pipeline/VertexProgram.cpp
+++ b/src/Pipeline/VertexProgram.cpp
@@ -20,6 +20,8 @@
#include "System/Half.hpp"
#include "Vulkan/VkDebug.hpp"
+#include "Vulkan/VkPipelineLayout.hpp"
+
namespace sw
{
VertexProgram::VertexProgram(
@@ -45,6 +47,13 @@
}
routine.pushConstants = data + OFFSET(DrawData, pushConstants);
+
+ Pointer<Pointer<Byte>> descriptorSets = Pointer<Pointer<Byte>>(data + OFFSET(DrawData, descriptorSets));
+ auto numDescriptorSets = routine.pipelineLayout->getNumDescriptorSets();
+ for(unsigned int i = 0; i < numDescriptorSets; i++)
+ {
+ routine.descriptorSets[i] = descriptorSets[i];
+ }
}
VertexProgram::~VertexProgram()