diff options
author | Brian Paul <[email protected]> | 2017-10-04 11:21:18 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-09-10 13:07:30 -0600 |
commit | 4a1976bfcf4b4843369aa9146af48ac8bf9e70d8 (patch) | |
tree | bc37f294c3975274a0180ce4aaf6cbe0dcb602ac | |
parent | 252e97ecdf05ad1050823e14e2119fbe0cc266a0 (diff) |
svga: implement support for GL_ARB_texture_query_lod
Just translate the TGSI LODQ intruction to VGPU10 LOD instruction.
All (4) Piglit GL_ARB_texture_query_lod tests pass.
Reviewed-by: Charmaine Lee <[email protected]>
Reviewed-by: Neha Bhende <[email protected]>
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index a38e062f776..c0f898d9d8f 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -347,6 +347,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_INDEP_BLEND_FUNC: case PIPE_CAP_SAMPLE_SHADING: case PIPE_CAP_FORCE_PERSAMPLE_INTERP: + case PIPE_CAP_TEXTURE_QUERY_LOD: return sws->have_sm4_1; case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS: @@ -367,7 +368,6 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT: case PIPE_CAP_TEXTURE_GATHER_SM5: case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT: - case PIPE_CAP_TEXTURE_QUERY_LOD: case PIPE_CAP_TEXTURE_GATHER_OFFSETS: case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION: case PIPE_CAP_DRAW_INDIRECT: diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index b87ac906584..2dc870ffef0 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -4254,6 +4254,30 @@ emit_lit(struct svga_shader_emitter_v10 *emit, /** + * Emit Level Of Detail Query (LODQ) instruction. + */ +static boolean +emit_lodq(struct svga_shader_emitter_v10 *emit, + const struct tgsi_full_instruction *inst) +{ + const uint unit = inst->Src[1].Register.Index; + + assert(emit->version >= 41); + + /* LOD dst, coord, resource, sampler */ + begin_emit_instruction(emit); + emit_opcode(emit, VGPU10_OPCODE_LOD, FALSE); + emit_dst_register(emit, &inst->Dst[0]); + emit_src_register(emit, &inst->Src[0]); /* coord */ + emit_resource_register(emit, unit); + emit_sampler_register(emit, unit); + end_emit_instruction(emit); + + return TRUE; +} + + +/** * Emit code for TGSI_OPCODE_LOG instruction. */ static boolean @@ -5862,6 +5886,8 @@ emit_vgpu10_instruction(struct svga_shader_emitter_v10 *emit, return emit_lg2(emit, inst); case TGSI_OPCODE_LIT: return emit_lit(emit, inst); + case TGSI_OPCODE_LODQ: + return emit_lodq(emit, inst); case TGSI_OPCODE_LOG: return emit_log(emit, inst); case TGSI_OPCODE_LRP: |