[Mesa-dev] [PATCH 2/2] gallium/ttn: add texture-type support

Rob Clark robdclark at gmail.com
Thu Jun 4 08:50:23 PDT 2015


From: Rob Clark <robclark at freedesktop.org>

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index 515171c..d370b57 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -1082,6 +1082,20 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
 
    setup_texture_info(instr, tgsi_inst->Texture.Texture);
 
+   switch (tgsi_inst->Texture.TextureType) {
+   case TGSI_TEXTURE_TYPE_FLOAT:
+      instr->dest_type = nir_type_float;
+      break;
+   case TGSI_TEXTURE_TYPE_INT:
+      instr->dest_type = nir_type_int;
+      break;
+   case TGSI_TEXTURE_TYPE_UNSIGNED:
+      instr->dest_type = nir_type_unsigned;
+      break;
+   default:
+      unreachable("not reached");
+   }
+
    switch (instr->sampler_dim) {
    case GLSL_SAMPLER_DIM_1D:
    case GLSL_SAMPLER_DIM_BUF:
-- 
2.4.2



More information about the mesa-dev mailing list