summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2014-02-25 14:42:04 +1000
committerIlia Mirkin <[email protected]>2014-04-07 01:06:18 -0400
commit4dc13e3c71f7d2898ce10e8fd9e72b06e64cd825 (patch)
treed0172e8657e401afe74bc43060e08719faed7ff2
parentbe5276ae7d24563301ae627b994f612069c32461 (diff)
st/mesa: add support for ARB_texture_query_lod
Add support for the LODQ texture instruction. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_extensions.c3
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index a83a7088624..3e1e45d1bad 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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 */
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index f019a55c216..c3e36eceab4 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -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);