[virglrenderer-devel] [PATCH 2/2] shader: fix texture gather offsets in input registers.

Gurchetan Singh gurchetansingh at chromium.org
Fri Jun 15 23:49:34 UTC 2018


Patches 1 and 2 are:

Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>



On Thu, Jun 14, 2018 at 6:52 PM Dave Airlie <airlied at gmail.com> wrote:

> From: Dave Airlie <airlied at redhat.com>
>
> ---
>  src/vrend_shader.c | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
>
> diff --git a/src/vrend_shader.c b/src/vrend_shader.c
> index 2987d07..c269d0e 100644
> --- a/src/vrend_shader.c
> +++ b/src/vrend_shader.c
> @@ -1873,6 +1873,46 @@ static bool fill_offset_buffer(struct dump_ctx *ctx,
>           return false;
>           break;
>        }
> +   } else if (inst->TexOffsets[0].File == TGSI_FILE_INPUT) {
> +      for (uint32_t j = 0; j < ctx->num_inputs; j++) {
> +         if (ctx->inputs[j].first != inst->TexOffsets[0].Index)
> +            continue;
> +         switch (inst->Texture.Texture) {
> +         case TGSI_TEXTURE_1D:
> +         case TGSI_TEXTURE_1D_ARRAY:
> +         case TGSI_TEXTURE_SHADOW1D:
> +         case TGSI_TEXTURE_SHADOW1D_ARRAY:
> +            snprintf(offbuf, 120, ", int(floatBitsToInt(%s.%c))",
> +                     ctx->inputs[j].glsl_name,
> +                     get_swiz_char(inst->TexOffsets[0].SwizzleX));
> +            break;
> +         case TGSI_TEXTURE_RECT:
> +         case TGSI_TEXTURE_SHADOWRECT:
> +         case TGSI_TEXTURE_2D:
> +         case TGSI_TEXTURE_2D_ARRAY:
> +         case TGSI_TEXTURE_SHADOW2D:
> +         case TGSI_TEXTURE_SHADOW2D_ARRAY:
> +            snprintf(offbuf, 120, ", ivec2(floatBitsToInt(%s.%c),
> floatBitsToInt(%s.%c))",
> +                     ctx->inputs[j].glsl_name,
> +                     get_swiz_char(inst->TexOffsets[0].SwizzleX),
> +                     ctx->inputs[j].glsl_name,
> +                     get_swiz_char(inst->TexOffsets[0].SwizzleY));
> +            break;
> +         case TGSI_TEXTURE_3D:
> +            snprintf(offbuf, 120, ", ivec3(floatBitsToInt(%s.%c),
> floatBitsToInt(%s.%c), floatBitsToInt(%s.%c)",
> +                     ctx->inputs[j].glsl_name,
> +                     get_swiz_char(inst->TexOffsets[0].SwizzleX),
> +                     ctx->inputs[j].glsl_name,
> +                     get_swiz_char(inst->TexOffsets[0].SwizzleY),
> +                     ctx->inputs[j].glsl_name,
> +                     get_swiz_char(inst->TexOffsets[0].SwizzleZ));
> +            break;
> +         default:
> +            fprintf(stderr, "unhandled texture: %x\n",
> inst->Texture.Texture);
> +            return false;
> +            break;
> +         }
> +      }
>     }
>     return true;
>  }
> --
> 2.14.3
>
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/virglrenderer-devel/attachments/20180615/7a05fd96/attachment.html>


More information about the virglrenderer-devel mailing list