nir: Add NV-specific texture opcodes
These are for implementing various texture queries. Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
This commit is contained in:
committed by
Marge Bot
parent
5984265d45
commit
1a2e8290ab
@@ -3087,6 +3087,10 @@ nir_tex_instr_result_size(const nir_tex_instr *instr)
|
||||
case nir_texop_sampler_descriptor_amd:
|
||||
return 4;
|
||||
|
||||
case nir_texop_hdr_dim_nv:
|
||||
case nir_texop_tex_type_nv:
|
||||
return 4;
|
||||
|
||||
default:
|
||||
if (instr->is_shadow && instr->is_new_style_shadow)
|
||||
return 1;
|
||||
|
||||
@@ -2283,6 +2283,8 @@ typedef enum {
|
||||
nir_texop_descriptor_amd, /**< Returns a buffer or image descriptor. */
|
||||
nir_texop_sampler_descriptor_amd, /**< Returns a sampler descriptor. */
|
||||
nir_texop_lod_bias_agx, /**< Returns the sampler's LOD bias */
|
||||
nir_texop_hdr_dim_nv, /**< Maps to TXQ.DIMENSION */
|
||||
nir_texop_tex_type_nv, /**< Maps to TXQ.TEXTURE_TYPE */
|
||||
} nir_texop;
|
||||
|
||||
/** Represents a texture instruction */
|
||||
|
||||
@@ -1709,6 +1709,12 @@ print_tex_instr(nir_tex_instr *instr, print_state *state)
|
||||
case nir_texop_lod_bias_agx:
|
||||
fprintf(fp, "lod_bias_agx ");
|
||||
break;
|
||||
case nir_texop_hdr_dim_nv:
|
||||
fprintf(fp, "hdr_dim_nv ");
|
||||
break;
|
||||
case nir_texop_tex_type_nv:
|
||||
fprintf(fp, "tex_type_nv ");
|
||||
break;
|
||||
default:
|
||||
unreachable("Invalid texture operation");
|
||||
break;
|
||||
|
||||
@@ -3045,6 +3045,10 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
|
||||
case nir_texop_lod_bias_agx:
|
||||
vtn_fail("unexpected nir_texop_lod_bias_agx");
|
||||
break;
|
||||
case nir_texop_hdr_dim_nv:
|
||||
case nir_texop_tex_type_nv:
|
||||
vtn_fail("unexpected nir_texop_*_nv");
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned idx = 4;
|
||||
|
||||
Reference in New Issue
Block a user