diff options
author | rdb <git@rdb.name> | 2020-11-03 23:04:22 +0300 |
---|---|---|
committer | rdb <git@rdb.name> | 2020-11-03 23:28:07 +0300 |
commit | 854f5668694d17555b8ead2b9e164d17a8c0c07b (patch) | |
tree | 75cd924bee0205d4e119bd60cae13a1e2d5d22af /spirv_hlsl.cpp | |
parent | 2e1bdeb2129a089874226f973ef08337c400693c (diff) |
HLSL: Support roundEven() in HLSL SM 4.0 and above
Diffstat (limited to 'spirv_hlsl.cpp')
-rw-r--r-- | spirv_hlsl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp index e0c0b078..9d465e5a 100644 --- a/spirv_hlsl.cpp +++ b/spirv_hlsl.cpp @@ -3444,7 +3444,10 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, break; case GLSLstd450RoundEven: - SPIRV_CROSS_THROW("roundEven is not supported on HLSL."); + if (hlsl_options.shader_model < 40) + SPIRV_CROSS_THROW("roundEven is not supported in HLSL shader model 2/3."); + emit_unary_func_op(result_type, id, args[0], "round"); + break; case GLSLstd450Acosh: case GLSLstd450Asinh: |