Plumb PipelineLayouts down to SpirvRoutine This initializes arrays to hold the descriptor sets in the routine. Nothing uses this yet. Bug: b/126330097 Change-Id: If052d0b93e62e4f32e88ed02f9bc21f4203587f5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25553 Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com> Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp index ecac7a7..76400c0 100644 --- a/src/Pipeline/SpirvShader.hpp +++ b/src/Pipeline/SpirvShader.hpp
@@ -15,11 +15,13 @@ #ifndef sw_SpirvShader_hpp #define sw_SpirvShader_hpp -#include "System/Types.hpp" -#include "Vulkan/VkDebug.hpp" #include "ShaderCore.hpp" #include "SpirvID.hpp" +#include "System/Types.hpp" +#include "Vulkan/VkDebug.hpp" +#include "Vulkan/VkConfig.h" +#include <array> #include <cstring> #include <string> #include <vector> @@ -30,6 +32,11 @@ #include <spirv/unified1/spirv.hpp> #include <Device/Config.hpp> +namespace vk +{ + class PipelineLayout; +} // namespace vk + namespace sw { // Forward declarations. @@ -412,8 +419,12 @@ class SpirvRoutine { public: + SpirvRoutine(vk::PipelineLayout const *pipelineLayout); + using Value = Array<SIMD::Float>; + vk::PipelineLayout const * const pipelineLayout; + std::unordered_map<SpirvShader::ObjectID, Value> lvalues; std::unordered_map<SpirvShader::ObjectID, Intermediate> intermediates; @@ -421,6 +432,8 @@ Value inputs = Value{MAX_INTERFACE_COMPONENTS}; Value outputs = Value{MAX_INTERFACE_COMPONENTS}; + std::array<Pointer<Byte>, vk::MAX_BOUND_DESCRIPTOR_SETS> descriptorSets; + void createLvalue(SpirvShader::ObjectID id, uint32_t size) { lvalues.emplace(id, Value(size));