It is already done in NIR.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
}
}
- /* TXS and TXL require a LOD but not everything we implement using those
- * two opcodes provides one. Provide a default LOD of 0.
- */
- if ((instr->op == nir_texop_txs ||
- instr->op == nir_texop_txl) &&
- lod.file == BAD_FILE) {
- lod = brw_imm_ud(0u);
- }
-
if (instr->op == nir_texop_txf_ms ||
instr->op == nir_texop_samples_identical) {
assert(coord_type != NULL);
src_reg surface_reg,
src_reg sampler_reg)
{
- /* The sampler can only meaningfully compute LOD for fragment shader
- * messages. For all other stages, we change the opcode to TXL and hardcode
- * the LOD to 0.
- *
- * textureQueryLevels() is implemented in terms of TXS so we need to pass a
- * valid LOD argument.
- */
- if (op == ir_tex || op == ir_query_levels) {
- assert(lod.file == BAD_FILE);
- lod = brw_imm_f(0.0f);
- }
-
enum opcode opcode;
switch (op) {
case ir_tex: opcode = SHADER_OPCODE_TXL; break;