X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fnir%2Fnir.h;h=1da9874060bf46a47f66e84a261bc3fba8640d52;hb=d8a0658d8ba80d56c5c7f487b24f0ecaa85c1e34;hp=b25842834ae0434efa0edf511a47f70a587ce0c7;hpb=c8d42c8cf689fcaac1e0fd8477a8ddf269c4fe4d;p=mesa.git diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index b25842834ae..1da9874060b 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -59,6 +59,7 @@ extern "C" { #define NIR_FALSE 0u #define NIR_TRUE (~0u) #define NIR_MAX_VEC_COMPONENTS 4 +#define NIR_MAX_MATRIX_COLUMNS 4 typedef uint8_t nir_component_mask_t; /** Defines a cast function @@ -141,7 +142,7 @@ typedef struct nir_constant { * by the type associated with the \c nir_variable. Constants may be * scalars, vectors, or matrices. */ - nir_const_value values[NIR_MAX_VEC_COMPONENTS]; + nir_const_value values[NIR_MAX_MATRIX_COLUMNS]; /* we could get this from the var->type but makes clone *much* easier to * not have to care about the type. @@ -1481,6 +1482,9 @@ typedef struct { /* gather component selector */ unsigned component : 2; + /* gather offsets */ + int8_t tg4_offsets[4][2]; + /** The texture index * * If this texture instruction has a nir_tex_src_texture_offset source, @@ -1698,6 +1702,8 @@ void nir_tex_instr_add_src(nir_tex_instr *tex, void nir_tex_instr_remove_src(nir_tex_instr *tex, unsigned src_idx); +bool nir_tex_instr_has_explicit_tg4_offsets(nir_tex_instr *tex); + typedef struct { nir_instr instr; @@ -2973,6 +2979,16 @@ void nir_fixup_deref_modes(nir_shader *shader); bool nir_lower_global_vars_to_local(nir_shader *shader); +typedef enum { + nir_lower_direct_array_deref_of_vec_load = (1 << 0), + nir_lower_indirect_array_deref_of_vec_load = (1 << 1), + nir_lower_direct_array_deref_of_vec_store = (1 << 2), + nir_lower_indirect_array_deref_of_vec_store = (1 << 3), +} nir_lower_array_deref_of_vec_options; + +bool nir_lower_array_deref_of_vec(nir_shader *shader, nir_variable_mode modes, + nir_lower_array_deref_of_vec_options options); + bool nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes); bool nir_lower_locals_to_regs(nir_shader *shader); @@ -3220,6 +3236,11 @@ typedef struct nir_lower_tex_options { */ bool lower_tg4_broadcom_swizzle; + /** + * If true, lowers tg4 with 4 constant offsets to 4 tg4 calls + */ + bool lower_tg4_offsets; + enum nir_lower_tex_packing lower_tex_packing[32]; } nir_lower_tex_options;