nir/tex_instr: Rename sampler to texture

We're about to separate the two concepts.  When we do, the sampler will
become optional.  Doing a rename first makes the separation a bit more
safe because drivers that depend on GLSL or TGSI behaviour will be fine to
just use the texture index all the time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Jason Ekstrand
2016-02-06 09:05:10 -08:00
parent 3f42184994
commit ee85014b90
18 changed files with 95 additions and 95 deletions

View File

@@ -965,7 +965,7 @@ typedef enum {
nir_tex_src_ms_index, /* MSAA sample index */
nir_tex_src_ddx,
nir_tex_src_ddy,
nir_tex_src_sampler_offset, /* < dynamically uniform indirect offset */
nir_tex_src_texture_offset, /* < dynamically uniform indirect offset */
nir_num_tex_src_types
} nir_tex_src_type;
@@ -1015,17 +1015,17 @@ typedef struct {
/* gather component selector */
unsigned component : 2;
/** The sampler index
/** The texture index
*
* If this texture instruction has a nir_tex_src_sampler_offset source,
* then the sampler index is given by sampler_index + sampler_offset.
* If this texture instruction has a nir_tex_src_texture_offset source,
* then the texture index is given by texture_index + texture_offset.
*/
unsigned sampler_index;
unsigned texture_index;
/** The size of the sampler array or 0 if it's not an array */
unsigned sampler_array_size;
/** The size of the texture array or 0 if it's not an array */
unsigned texture_array_size;
nir_deref_var *sampler; /* if this is NULL, use sampler_index instead */
nir_deref_var *texture; /* if this is NULL, use texture_index instead */
} nir_tex_instr;
static inline unsigned
@@ -2091,15 +2091,15 @@ typedef struct nir_lower_tex_options {
unsigned saturate_t;
unsigned saturate_r;
/* Bitmask of samplers that need swizzling.
/* Bitmask of textures that need swizzling.
*
* If (swizzle_result & (1 << sampler_index)), then the swizzle in
* swizzles[sampler_index] is applied to the result of the texturing
* If (swizzle_result & (1 << texture_index)), then the swizzle in
* swizzles[texture_index] is applied to the result of the texturing
* operation.
*/
unsigned swizzle_result;
/* A swizzle for each sampler. Values 0-3 represent x, y, z, or w swizzles
/* A swizzle for each texture. Values 0-3 represent x, y, z, or w swizzles
* while 4 and 5 represent 0 and 1 respectively.
*/
uint8_t swizzles[32][4];