aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_samplers.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-06 09:05:10 -0800
committerJason Ekstrand <[email protected]>2016-02-09 15:00:17 -0800
commitee85014b90af1d94d637ec763a803479e9bac5dc (patch)
tree91a7aea9be51e8c18b18f40f237175e9471e0d41 /src/compiler/nir/nir_lower_samplers.c
parent3f421849945d763b3e477ceb1c726c2dbed3bafd (diff)
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 <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_samplers.c')
-rw-r--r--src/compiler/nir/nir_lower_samplers.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/nir/nir_lower_samplers.c b/src/compiler/nir/nir_lower_samplers.c
index 96e82914014..bccb544dc91 100644
--- a/src/compiler/nir/nir_lower_samplers.c
+++ b/src/compiler/nir/nir_lower_samplers.c
@@ -52,7 +52,7 @@ calc_sampler_offsets(nir_deref *tail, nir_tex_instr *instr,
calc_sampler_offsets(tail->child, instr, array_elements,
indirect, b, location);
- instr->sampler_index += deref_array->base_offset * *array_elements;
+ instr->texture_index += deref_array->base_offset * *array_elements;
if (deref_array->deref_array_type == nir_deref_array_type_indirect) {
nir_ssa_def *mul =
@@ -91,16 +91,16 @@ static void
lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_program,
gl_shader_stage stage, nir_builder *builder)
{
- if (instr->sampler == NULL)
+ if (instr->texture == NULL)
return;
- instr->sampler_index = 0;
- unsigned location = instr->sampler->var->data.location;
+ instr->texture_index = 0;
+ unsigned location = instr->texture->var->data.location;
unsigned array_elements = 1;
nir_ssa_def *indirect = NULL;
builder->cursor = nir_before_instr(&instr->instr);
- calc_sampler_offsets(&instr->sampler->deref, instr, &array_elements,
+ calc_sampler_offsets(&instr->texture->deref, instr, &array_elements,
&indirect, builder, &location);
if (indirect) {
@@ -120,13 +120,13 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr
/* Now we can go ahead and move the source over to being a
* first-class texture source.
*/
- instr->src[instr->num_srcs].src_type = nir_tex_src_sampler_offset;
+ instr->src[instr->num_srcs].src_type = nir_tex_src_texture_offset;
instr->num_srcs++;
nir_instr_rewrite_src(&instr->instr,
&instr->src[instr->num_srcs - 1].src,
nir_src_for_ssa(indirect));
- instr->sampler_array_size = array_elements;
+ instr->texture_array_size = array_elements;
}
if (location > shader_program->NumUniformStorage - 1 ||
@@ -135,10 +135,10 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr
return;
}
- instr->sampler_index +=
+ instr->texture_index +=
shader_program->UniformStorage[location].opaque[stage].index;
- instr->sampler = NULL;
+ instr->texture = NULL;
}
typedef struct {