st/mesa: add support for ARB_texture_query_lod
authorDave Airlie <airlied@redhat.com>
Tue, 25 Feb 2014 04:42:04 +0000 (14:42 +1000)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 7 Apr 2014 05:06:18 +0000 (01:06 -0400)
Add support for the LODQ texture instruction.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index a83a70886245de54e18368378c6056492e749820..3e1e45d1badc42cbadc166f82f3361fcced041e5 100644 (file)
@@ -421,7 +421,8 @@ void st_init_extensions(struct st_context *st)
 
       { o(OES_standard_derivatives),         PIPE_CAP_SM3                              },
       { o(ARB_texture_cube_map_array),       PIPE_CAP_CUBE_MAP_ARRAY                   },
-      { o(ARB_texture_multisample),          PIPE_CAP_TEXTURE_MULTISAMPLE              }
+      { o(ARB_texture_multisample),          PIPE_CAP_TEXTURE_MULTISAMPLE              },
+      { o(ARB_texture_query_lod),            PIPE_CAP_TEXTURE_QUERY_LOD                }
    };
 
    /* Required: render target and sampler support */
index f019a55c216b6b66daa4cf791fc85db15e8194c0..c3e36eceab40f881b779f788d05187d1854c9b75 100644 (file)
@@ -2793,7 +2793,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
       }
       break;
    case ir_lod:
-      assert(!"Unexpected ir_lod opcode");
+      opcode = TGSI_OPCODE_LODQ;
       break;
    case ir_query_levels:
       assert(!"Unexpected ir_query_levels opcode");
@@ -4513,6 +4513,7 @@ compile_tgsi_instruction(struct st_translate *t,
    case TGSI_OPCODE_TXB2:
    case TGSI_OPCODE_TXL2:
    case TGSI_OPCODE_TG4:
+   case TGSI_OPCODE_LODQ:
       src[num_src++] = t->samplers[inst->sampler];
       for (i = 0; i < inst->tex_offset_num_offset; i++) {
          texoffsets[i] = translate_tex_offset(t, &inst->tex_offsets[i], i);