From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/spirv.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 56c89f762..86cf678a5 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7020,6 +7020,15 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil SpvOp op = SpvOpMax; unsigned int i;
+ if (src->reg.data_type == VKD3D_DATA_UINT64 && instruction->handler_idx == VKD3DSIH_COUNTBITS) + { + /* At least some drivers support this anyway, but if validation is enabled it will fail. */ + FIXME("Unsupported 64-bit source for bit count.\n"); + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_NOT_IMPLEMENTED, + "64-bit source for bit count is not supported."); + return VKD3D_ERROR_INVALID_SHADER; + } + if (src->reg.data_type == VKD3D_DATA_BOOL) { if (dst->reg.data_type == VKD3D_DATA_BOOL)
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/spirv.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 86cf678a5..bd0bfb8e0 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7169,6 +7169,16 @@ static void spirv_compiler_emit_ext_glsl_instruction(struct spirv_compiler *comp unsigned int i, component_count; enum GLSLstd450 glsl_inst;
+ if (src[0].reg.data_type == VKD3D_DATA_UINT64 && (instruction->handler_idx == VKD3DSIH_FIRSTBIT_HI + || instruction->handler_idx == VKD3DSIH_FIRSTBIT_LO || instruction->handler_idx == VKD3DSIH_FIRSTBIT_SHI)) + { + /* At least some drivers support this anyway, but if validation is enabled it will fail. */ + FIXME("Unsupported 64-bit source for handler %#x.\n", instruction->handler_idx); + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_NOT_IMPLEMENTED, + "64-bit source for handler %#x is not supported.", instruction->handler_idx); + return; + } + glsl_inst = spirv_compiler_map_ext_glsl_instruction(instruction); if (glsl_inst == GLSLstd450Bad) {
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/hlsl/bitwise.shader_test | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/tests/hlsl/bitwise.shader_test b/tests/hlsl/bitwise.shader_test index 34362feda..ae2ce771d 100644 --- a/tests/hlsl/bitwise.shader_test +++ b/tests/hlsl/bitwise.shader_test @@ -161,6 +161,25 @@ float4 main() : SV_TARGET draw quad probe all rgba (0.0, 1.0, 1.0, 0.0)
+[pixel shader todo] +uint u; +int i; + +uint4 main() : sv_target +{ + return uint4(countbits(u), firstbitlow(u), firstbithigh(u), firstbithigh(i)); +} + +[test] +uniform 0 uint4 0 0 0 0 +todo(sm<6) draw quad +probe all rgbaui (0, 0xffffffff, 0xffffffff, 0xffffffff) +uniform 0 uint4 0xffffffff 0xffffffff 0 0 +todo(sm<6) draw quad +probe all rgbaui (32, 0, 31, 0xffffffff) +uniform 0 uint4 0xcccccccc 0xcccccccc 0 0 +todo(sm<6) draw quad +probe all rgbaui (16, 2, 31, 29)
[require] shader model >= 6.0 @@ -245,3 +264,23 @@ float4 main() : sv_target uniform 0 uint64_t2 0x300000000 0x500000000 draw quad probe all rgba (25769803776.0, 4294967296.0, 30064771072.0, 1.844674404e19) 1 + +[pixel shader] +uint64_t u; +int64_t i; + +uint4 main() : sv_target +{ + return uint4(0, firstbitlow(u), firstbithigh(u), firstbithigh(i)); +} + +[test] +uniform 0 uint64_t2 0 0 +todo draw quad +probe all rgbaui (0, 0xffffffff, 0xffffffff, 0xffffffff) +uniform 0 int64_t2 -1 -1 +todo draw quad +probe all rgbaui (64, 0, 63, 0xffffffff) +uniform 0 uint64_t2 0xcccccccccccccccc 0xcccccccccccccccc +todo draw quad +probe all rgbaui (32, 2, 63, 61)
This merge request was approved by Giovanni Mascellani.
This merge request was approved by Henri Verbeet.