Make sw::Constants a member of vk::Device
This refactoring allows each device to have custom "constants", so we
can have run-time configurable device limits.
It also lets us obtain the constants from the device pointer, instead
of having to stow it into structures like sw::DrawCall.
Bug: b/204560787
Change-Id: I2ed193947fd91931c2a38337b7826df8bb9192d0
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/59308
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index b8fc2f7..42fefc1 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -18,6 +18,7 @@
#include "SamplerCore.hpp"
#include "Device/Primitive.hpp"
#include "Device/Renderer.hpp"
+#include "Vulkan/VkDevice.hpp"
namespace sw {
@@ -141,7 +142,7 @@
routine.descriptorSets = data + OFFSET(DrawData, descriptorSets);
routine.descriptorDynamicOffsets = data + OFFSET(DrawData, descriptorDynamicOffsets);
routine.pushConstants = data + OFFSET(DrawData, pushConstants);
- routine.constants = *Pointer<Pointer<Byte>>(data + OFFSET(DrawData, constants));
+ routine.constants = device + OFFSET(vk::Device, constants);
auto it = spirvShader->inputBuiltins.find(spv::BuiltInFrontFacing);
if(it != spirvShader->inputBuiltins.end())