Fix BuiltInSubgroupSize in graphics pipeline
This had previously been masked by other failures, so we didn't notice.
Bitcasting Int to Float4 is incorrect.
Test: dEQP-VK.subgroups.*
Change-Id: Ib66fb3a458d44c6689977006454bbc7719a1373f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30089
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index dca8704..f1a490d 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -41,7 +41,7 @@
if (it != spirvShader->inputBuiltins.end())
{
ASSERT(it->second.SizeInComponents == 1);
- routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(Int(SIMD::Width));
+ routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(SIMD::Width));
}
it = spirvShader->inputBuiltins.find(spv::BuiltInSubgroupLocalInvocationId);
diff --git a/src/Pipeline/VertexProgram.cpp b/src/Pipeline/VertexProgram.cpp
index 686db48..dc575b2 100644
--- a/src/Pipeline/VertexProgram.cpp
+++ b/src/Pipeline/VertexProgram.cpp
@@ -50,7 +50,7 @@
if (it != spirvShader->inputBuiltins.end())
{
ASSERT(it->second.SizeInComponents == 1);
- routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(Int(SIMD::Width));
+ routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(SIMD::Width));
}
it = spirvShader->inputBuiltins.find(spv::BuiltInSubgroupLocalInvocationId);