[virglrenderer-devel] [PATCH v2] make sure both shift-operands are the same size

Erik Faye-Lund erik.faye-lund at collabora.com
Thu Jul 5 07:10:28 UTC 2018


On 05. juli 2018 02:25, Dave Airlie wrote:
> On 4 July 2018 at 22:00, Erik Faye-Lund <erik.faye-lund at collabora.com> wrote:
>> On 04. juli 2018 11:37, Erik Faye-Lund wrote:
>>> Changes since last round:
>>>
>>> Fixed the piglit regression in fs-op-assign-lshift-ivec3-int.shader_test
>>> (and probably the rest,
>>> will run a full set of tests soon).
>>>
>> Yep, confirmed. Regressions are gone.
> Actually this is the wrong answer to this problem.
>
> But we have the same bug in a few ways,
>
> The problem is TGSI gives us a system value like
>
> SV[0].xxxx
>
> then we translate the to
> gl_SampleMask[0] instead of
> uvec4(gl_SampleMask[0], gl_SampleMask[0], gl_SampleMask[0], gl_SampleMask[0])
>
> I've fixed this previously for some of the other system values and I
> think the same
> fix is required here.
>
Ah, thanks for the pointer. Yeah, the following seems to also work, and 
be a much more contained fix:
---8<---
diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index a203622..fa53d6b 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -3096,7 +3096,8 @@ get_source_info(struct dump_ctx *ctx,
                     ctx->system_values[j].name == TGSI_SEMANTIC_PRIMID ||
                     ctx->system_values[j].name == 
TGSI_SEMANTIC_VERTICESIN ||
                     ctx->system_values[j].name == 
TGSI_SEMANTIC_INVOCATIONID ||
-                   ctx->system_values[j].name == TGSI_SEMANTIC_SAMPLEID) {
+                   ctx->system_values[j].name == TGSI_SEMANTIC_SAMPLEID ||
+                   ctx->system_values[j].name == 
TGSI_SEMANTIC_SAMPLEMASK) {
                    if (inst->Instruction.Opcode == 
TGSI_OPCODE_INTERP_SAMPLE && i == 1)
                       snprintf(srcs[i], 255, "ivec4(%s)", 
ctx->system_values[j].glsl_name);
                    else
---8<---

I'll send a new patch with this fix instead.


More information about the virglrenderer-devel mailing list