Module: Mesa
Branch: master
Commit: 05b008c961faf4de322bbf08a452893f01fb143d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=05b008c961faf4de322bbf08a452893f01fb143d

Author: Dave Airlie <airl...@redhat.com>
Date:   Wed Oct  9 13:12:31 2019 +1000

llvmpipe: add support for tg4 component selection.

This is needed as part of GLES3.1 and helps for ARB_gpu_shader5.

Fixes: KHR-GLES31.core.texture_gather.* cases
Reviewed-by: Roland Scheidegger <srol...@vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 4 ++++
 src/gallium/drivers/llvmpipe/lp_screen.c        | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 1f42c4ef549..9bfe41b9062 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -2237,6 +2237,10 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
       lod_property = lp_build_lod_property(&bld->bld_base, inst, 0);
    }
 
+   if (sampler_op == LP_SAMPLER_OP_GATHER) {
+      uint32_t comp_val = inst->Src[sampler_reg].Register.SwizzleX;
+      sample_key |= (comp_val << LP_SAMPLER_GATHER_COMP_SHIFT);
+   }
    if (modifier == LP_BLD_TEX_MODIFIER_PROJECTED) {
       oow = lp_build_emit_fetch(&bld->bld_base, inst, 0, 3);
       oow = lp_build_rcp(&bld->bld_base.base, oow);
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 96c7623c461..63c1793620d 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -388,6 +388,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
    case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
       return LP_MAX_TGSI_SHADER_BUFFER_SIZE;
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
+   case PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE:
       return 1;
    default:
       return u_pipe_screen_get_param_defaults(screen, param);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to