diff options
author | Roland Scheidegger <[email protected]> | 2017-09-28 03:45:04 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2017-09-30 02:58:09 +0200 |
commit | 740a1618c34c095f85d4929e11ef107d560f7450 (patch) | |
tree | eb956477a8c8d7dbc3a2d04282620f10e17ef703 /src/gallium/auxiliary/gallivm | |
parent | d5e7ce28b5f6e0a7e4857d1e56143c00eba0c265 (diff) |
gallium: add new LOD opcode
The operation performed is all the same as LODQ, but with the usual
differences between dx10 and GL texture opcodes, that is separate resource
and sampler indices (plus result swizzling, and setting z/w channels
to zero).
Reviewed-by: Jose Fonseca <[email protected]>
Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index e5d0293b8f9..de18f629cd0 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -3284,6 +3284,18 @@ sviewinfo_emit( emit_size_query(bld, emit_data->inst, emit_data->output, TRUE); } +static void +lod_emit( + const struct lp_build_tgsi_action * action, + struct lp_build_tgsi_context * bld_base, + struct lp_build_emit_data * emit_data) +{ + struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base); + + emit_sample(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_NONE, + FALSE, LP_SAMPLER_OP_LODQ, emit_data->output); +} + static LLVMValueRef mask_vec(struct lp_build_tgsi_context *bld_base) { @@ -3898,6 +3910,8 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, bld.bld_base.op_actions[TGSI_OPCODE_SAMPLE_L].emit = sample_l_emit; bld.bld_base.op_actions[TGSI_OPCODE_GATHER4].emit = gather4_emit; bld.bld_base.op_actions[TGSI_OPCODE_SVIEWINFO].emit = sviewinfo_emit; + bld.bld_base.op_actions[TGSI_OPCODE_LOD].emit = lod_emit; + if (gs_iface) { /* There's no specific value for this because it should always |