Commit 2cd983da by Ben Clayton

Assign the DeviceIndex builtIn (ext: SPV_KHR_device_group).

Tests: dEQP-VK.compute.device_group.device_index Bug: b/130937460 Change-Id: I994632be31b7c8c53dc86b0de900ab9f9ff62ae3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31111Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 44741083
...@@ -97,6 +97,13 @@ namespace sw ...@@ -97,6 +97,13 @@ namespace sw
ASSERT(builtin.SizeInComponents == 1); ASSERT(builtin.SizeInComponents == 1);
value[builtin.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 1, 2, 3)); value[builtin.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 1, 2, 3));
}); });
setInputBuiltin(spv::BuiltInDeviceIndex, [&](const SpirvShader::BuiltinMapping& builtin, Array<SIMD::Float>& value)
{
ASSERT(builtin.SizeInComponents == 1);
// Only a single physical device is supported.
value[builtin.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 0, 0, 0));
});
} }
void ComputeProgram::setSubgroupBuiltins(Int workgroupID[3], SIMD::Int localInvocationIndex, Int subgroupIndex) void ComputeProgram::setSubgroupBuiltins(Int workgroupID[3], SIMD::Int localInvocationIndex, Int subgroupIndex)
......
...@@ -50,6 +50,14 @@ namespace sw ...@@ -50,6 +50,14 @@ namespace sw
ASSERT(it->second.SizeInComponents == 1); ASSERT(it->second.SizeInComponents == 1);
routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 1, 2, 3)); routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 1, 2, 3));
} }
it = spirvShader->inputBuiltins.find(spv::BuiltInDeviceIndex);
if (it != spirvShader->inputBuiltins.end())
{
ASSERT(it->second.SizeInComponents == 1);
// Only a single physical device is supported.
routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 0, 0, 0));
}
} }
void PixelProgram::applyShader(Int cMask[4]) void PixelProgram::applyShader(Int cMask[4])
......
...@@ -932,6 +932,7 @@ namespace sw ...@@ -932,6 +932,7 @@ namespace sw
if (!strcmp(ext, "SPV_KHR_shader_draw_parameters")) break; if (!strcmp(ext, "SPV_KHR_shader_draw_parameters")) break;
if (!strcmp(ext, "SPV_KHR_16bit_storage")) break; if (!strcmp(ext, "SPV_KHR_16bit_storage")) break;
if (!strcmp(ext, "SPV_KHR_variable_pointers")) break; if (!strcmp(ext, "SPV_KHR_variable_pointers")) break;
if (!strcmp(ext, "SPV_KHR_device_group")) break;
UNSUPPORTED("SPIR-V Extension: %s", ext); UNSUPPORTED("SPIR-V Extension: %s", ext);
break; break;
} }
......
...@@ -59,6 +59,14 @@ namespace sw ...@@ -59,6 +59,14 @@ namespace sw
ASSERT(it->second.SizeInComponents == 1); ASSERT(it->second.SizeInComponents == 1);
routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 1, 2, 3)); routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 1, 2, 3));
} }
it = spirvShader->inputBuiltins.find(spv::BuiltInDeviceIndex);
if (it != spirvShader->inputBuiltins.end())
{
ASSERT(it->second.SizeInComponents == 1);
// Only a single physical device is supported.
routine.getVariable(it->second.Id)[it->second.FirstComponent] = As<SIMD::Float>(SIMD::Int(0, 0, 0, 0));
}
} }
VertexProgram::~VertexProgram() VertexProgram::~VertexProgram()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment