Fix workgroup builtins size NumWorkgroups, WorkgroupId, and WorkgroupSize are uniform globals with three components. While we store them in a 4-component vector, they must not be stored in a SIMD::Int. PointCoord was corrected to a 2-component vector (per lane). The X, Y, and Z enums were replaced by explicit numeric indexes. Also the loops for multi-component builtins were replaced with explicit assignment of each component. The asserts for single-component builtins have been removed since these are checked by spirv-val. Bug: b/214583550 Change-Id: Iecc81f1f255978e160712fbaa0f069b8e7065705 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/66510 Reviewed-by: Alexis Hétu <sugoi@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/ComputeProgram.hpp b/src/Pipeline/ComputeProgram.hpp index 3fc6d97..9af300c 100644 --- a/src/Pipeline/ComputeProgram.hpp +++ b/src/Pipeline/ComputeProgram.hpp
@@ -72,8 +72,8 @@ { vk::DescriptorSet::Bindings descriptorSets; vk::DescriptorSet::DynamicOffsets descriptorDynamicOffsets; - uint4 numWorkgroups; // [x, y, z, 0] - uint4 workgroupSize; // [x, y, z, 0] + uint4 numWorkgroups; // [x, y, z, -] + uint4 workgroupSize; // [x, y, z, -] uint32_t invocationsPerSubgroup; // SPIR-V: "SubgroupSize" uint32_t subgroupsPerWorkgroup; // SPIR-V: "NumSubgroups" uint32_t invocationsPerWorkgroup; // Total number of invocations per workgroup.