From a4844ef73562a7ace5fcc98d240525a6a4a073da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Mon, 24 Jan 2022 13:03:15 +0100 Subject: [PATCH] shader: return the corresponding type when translating TGSI_SEMANTIC_SAMPLEMASK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SAMPLEMASK is always returning an integer, we previously always had another instruction that would convert it to a float but this is no longer the case so always convert it to a floating number. Signed-off-by: Corentin Noël Part-of: --- .../host/piglit-virgl-gl-fails.txt | 18 ------------------ .../host/piglit-virgl-gles-fails.txt | 14 -------------- .../virt/piglit-virgl-gl-fails.txt | 18 ------------------ .../virt/piglit-virgl-gles-fails.txt | 14 -------------- src/vrend_shader.c | 11 +++++++---- 5 files changed, 7 insertions(+), 68 deletions(-) diff --git a/.gitlab-ci/expectations/host/piglit-virgl-gl-fails.txt b/.gitlab-ci/expectations/host/piglit-virgl-gl-fails.txt index cc86543..ac1c9a1 100644 --- a/.gitlab-ci/expectations/host/piglit-virgl-gl-fails.txt +++ b/.gitlab-ci/expectations/host/piglit-virgl-gl-fails.txt @@ -131,24 +131,6 @@ spec@arb_point_sprite@arb_point_sprite-mipmap,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex@'vs_input2[1][0]' on GL_PROGRAM_INPUT,Fail spec@arb_sample_shading@builtin-gl-sample-position 2,Fail -spec@arb_sample_shading@samplemask 2@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 2@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 2 all@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 2 all@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 2 all,Fail -spec@arb_sample_shading@samplemask 2 all@sample partition,Fail -spec@arb_sample_shading@samplemask 2,Fail -spec@arb_sample_shading@samplemask 2@sample partition,Fail -spec@arb_sample_shading@samplemask 4@0.250000 partition,Fail -spec@arb_sample_shading@samplemask 4@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 4@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 4 all@0.250000 partition,Fail -spec@arb_sample_shading@samplemask 4 all@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 4 all@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 4 all,Fail -spec@arb_sample_shading@samplemask 4 all@sample partition,Fail -spec@arb_sample_shading@samplemask 4,Fail -spec@arb_sample_shading@samplemask 4@sample partition,Fail spec@arb_shader_image_load_store@early-z,Fail spec@arb_shader_image_load_store@early-z@occlusion query test/early-z pass,Fail spec@arb_shader_image_load_store@layer,Fail diff --git a/.gitlab-ci/expectations/host/piglit-virgl-gles-fails.txt b/.gitlab-ci/expectations/host/piglit-virgl-gles-fails.txt index da92bad..5f927d6 100644 --- a/.gitlab-ci/expectations/host/piglit-virgl-gles-fails.txt +++ b/.gitlab-ci/expectations/host/piglit-virgl-gles-fails.txt @@ -207,45 +207,31 @@ spec@arb_program_interface_query@arb_program_interface_query-getprogramresourcei spec@arb_provoking_vertex@arb-provoking-vertex-render,Fail spec@arb_provoking_vertex@clipped-strip-first,Fail spec@arb_sample_shading@samplemask 2@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2@0.500000 partition,Fail spec@arb_sample_shading@samplemask 2@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2@1.000000 partition,Fail spec@arb_sample_shading@samplemask 2 all@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2 all@0.500000 partition,Fail spec@arb_sample_shading@samplemask 2 all@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2 all@1.000000 partition,Fail spec@arb_sample_shading@samplemask 2 all,Fail spec@arb_sample_shading@samplemask 2 all@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 2 all@noms partition,Fail spec@arb_sample_shading@samplemask 2 all@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 2 all@sample partition,Fail spec@arb_sample_shading@samplemask 2,Fail spec@arb_sample_shading@samplemask 2@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 2@noms partition,Fail spec@arb_sample_shading@samplemask 2@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 2@sample partition,Fail spec@arb_sample_shading@samplemask 4@0.250000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@0.250000 partition,Fail spec@arb_sample_shading@samplemask 4@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@0.500000 partition,Fail spec@arb_sample_shading@samplemask 4@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@1.000000 partition,Fail spec@arb_sample_shading@samplemask 4 all@0.250000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@0.250000 partition,Fail spec@arb_sample_shading@samplemask 4 all@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@0.500000 partition,Fail spec@arb_sample_shading@samplemask 4 all@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@1.000000 partition,Fail spec@arb_sample_shading@samplemask 4 all,Fail spec@arb_sample_shading@samplemask 4 all@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 4 all@noms partition,Fail spec@arb_sample_shading@samplemask 4 all@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@sample partition,Fail spec@arb_sample_shading@samplemask 4,Fail spec@arb_sample_shading@samplemask 4@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 4@noms partition,Fail spec@arb_sample_shading@samplemask 4@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@sample partition,Fail spec@arb_seamless_cube_map@arb_seamless_cubemap,Fail spec@arb_shader_atomic_counter_ops@execution@add,Fail spec@arb_shader_atomic_counter_ops@execution@all_touch_test,Fail diff --git a/.gitlab-ci/expectations/virt/piglit-virgl-gl-fails.txt b/.gitlab-ci/expectations/virt/piglit-virgl-gl-fails.txt index 865da71..9799270 100644 --- a/.gitlab-ci/expectations/virt/piglit-virgl-gl-fails.txt +++ b/.gitlab-ci/expectations/virt/piglit-virgl-gl-fails.txt @@ -131,24 +131,6 @@ spec@arb_point_sprite@arb_point_sprite-mipmap,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex@'vs_input2[1][0]' on GL_PROGRAM_INPUT,Fail spec@arb_sample_shading@builtin-gl-sample-position 2,Fail -spec@arb_sample_shading@samplemask 2@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 2@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 2 all@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 2 all@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 2 all,Fail -spec@arb_sample_shading@samplemask 2 all@sample partition,Fail -spec@arb_sample_shading@samplemask 2,Fail -spec@arb_sample_shading@samplemask 2@sample partition,Fail -spec@arb_sample_shading@samplemask 4@0.250000 partition,Fail -spec@arb_sample_shading@samplemask 4@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 4@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 4 all@0.250000 partition,Fail -spec@arb_sample_shading@samplemask 4 all@0.500000 partition,Fail -spec@arb_sample_shading@samplemask 4 all@1.000000 partition,Fail -spec@arb_sample_shading@samplemask 4 all,Fail -spec@arb_sample_shading@samplemask 4 all@sample partition,Fail -spec@arb_sample_shading@samplemask 4,Fail -spec@arb_sample_shading@samplemask 4@sample partition,Fail spec@arb_shader_image_load_store@early-z,Fail spec@arb_shader_image_load_store@early-z@occlusion query test/early-z pass,Fail spec@arb_shader_image_load_store@layer,Fail diff --git a/.gitlab-ci/expectations/virt/piglit-virgl-gles-fails.txt b/.gitlab-ci/expectations/virt/piglit-virgl-gles-fails.txt index 2fd5fc8..7f2315a 100644 --- a/.gitlab-ci/expectations/virt/piglit-virgl-gles-fails.txt +++ b/.gitlab-ci/expectations/virt/piglit-virgl-gles-fails.txt @@ -235,45 +235,31 @@ spec@arb_program_interface_query@arb_program_interface_query-getprogramresourcei spec@arb_provoking_vertex@arb-provoking-vertex-render,Fail spec@arb_provoking_vertex@clipped-strip-first,Fail spec@arb_sample_shading@samplemask 2@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2@0.500000 partition,Fail spec@arb_sample_shading@samplemask 2@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2@1.000000 partition,Fail spec@arb_sample_shading@samplemask 2 all@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2 all@0.500000 partition,Fail spec@arb_sample_shading@samplemask 2 all@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 2 all@1.000000 partition,Fail spec@arb_sample_shading@samplemask 2 all,Fail spec@arb_sample_shading@samplemask 2 all@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 2 all@noms partition,Fail spec@arb_sample_shading@samplemask 2 all@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 2 all@sample partition,Fail spec@arb_sample_shading@samplemask 2,Fail spec@arb_sample_shading@samplemask 2@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 2@noms partition,Fail spec@arb_sample_shading@samplemask 2@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 2@sample partition,Fail spec@arb_sample_shading@samplemask 4@0.250000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@0.250000 partition,Fail spec@arb_sample_shading@samplemask 4@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@0.500000 partition,Fail spec@arb_sample_shading@samplemask 4@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@1.000000 partition,Fail spec@arb_sample_shading@samplemask 4 all@0.250000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@0.250000 partition,Fail spec@arb_sample_shading@samplemask 4 all@0.500000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@0.500000 partition,Fail spec@arb_sample_shading@samplemask 4 all@1.000000 mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@1.000000 partition,Fail spec@arb_sample_shading@samplemask 4 all,Fail spec@arb_sample_shading@samplemask 4 all@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 4 all@noms partition,Fail spec@arb_sample_shading@samplemask 4 all@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 4 all@sample partition,Fail spec@arb_sample_shading@samplemask 4,Fail spec@arb_sample_shading@samplemask 4@noms mask_in_one,Fail spec@arb_sample_shading@samplemask 4@noms partition,Fail spec@arb_sample_shading@samplemask 4@sample mask_in_one,Fail -spec@arb_sample_shading@samplemask 4@sample partition,Fail spec@arb_seamless_cube_map@arb_seamless_cubemap,Fail spec@arb_shader_atomic_counter_ops@execution@add,Fail spec@arb_shader_atomic_counter_ops@execution@all_touch_test,Fail diff --git a/src/vrend_shader.c b/src/vrend_shader.c index c09a437..f96da80 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -4532,12 +4532,15 @@ get_source_info(struct dump_ctx *ctx, sinfo->override_no_cast[i] = true; } else if (ctx->system_values[j].name == TGSI_SEMANTIC_SAMPLEMASK) { const char *vec_type = "ivec4"; - if (ctx->cfg->use_gles && - (inst->Instruction.Opcode == TGSI_OPCODE_AND) && - (stype == TGSI_TYPE_UNSIGNED)) + enum vrend_type_qualifier srcstypeprefix = TYPE_CONVERSION_NONE; + if (stypeprefix == TYPE_CONVERSION_NONE) + srcstypeprefix = INT_BITS_TO_FLOAT; + else if (stype == TGSI_TYPE_UNSIGNED) vec_type = "uvec4"; + ctx->shader_req_bits |= SHADER_REQ_SAMPLE_SHADING | SHADER_REQ_INTS; - strbuf_fmt(src_buf, "%s(%s, %s, %s, %s)", + strbuf_fmt(src_buf, "%s(%s(%s, %s, %s, %s))", + get_string(srcstypeprefix), vec_type, src->Register.SwizzleX == TGSI_SWIZZLE_X ? ctx->system_values[j].glsl_name : "0", src->Register.SwizzleY == TGSI_SWIZZLE_X ? ctx->system_values[j].glsl_name : "0",