Commit a15fcf44 by Ben Clayton

SpirvShader: Implement GLSLstd450Radians

Bug: b/126873455 Tests: dEQP-VK.glsl.builtin.precision.radians.* Change-Id: Iae78dac21165967d305a54157f60d95d13de5984 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28649Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 20f6ba8b
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
namespace namespace
{ {
constexpr float PI = 3.141592653589793f;
rr::RValue<rr::Bool> AnyTrue(rr::RValue<sw::SIMD::Int> const &ints) rr::RValue<rr::Bool> AnyTrue(rr::RValue<sw::SIMD::Int> const &ints)
{ {
return rr::SignMask(ints) != 0; return rr::SignMask(ints) != 0;
...@@ -3264,6 +3266,15 @@ namespace sw ...@@ -3264,6 +3266,15 @@ namespace sw
} }
break; break;
} }
case GLSLstd450Radians:
{
auto degrees = GenericValue(this, routine, insn.word(5));
for (auto i = 0u; i < type.sizeInComponents; i++)
{
dst.move(i, degrees.Float(i) * SIMD::Float(PI / 180.0f));
}
break;
}
default: default:
UNIMPLEMENTED("Unhandled ExtInst %d", extInstIndex); UNIMPLEMENTED("Unhandled ExtInst %d", extInstIndex);
} }
......
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