summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_lower_bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir/nir_lower_bitmap.c')
-rw-r--r--src/compiler/nir/nir_lower_bitmap.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/compiler/nir/nir_lower_bitmap.c b/src/compiler/nir/nir_lower_bitmap.c
index 713048714cb..51e3f98f47b 100644
--- a/src/compiler/nir/nir_lower_bitmap.c
+++ b/src/compiler/nir/nir_lower_bitmap.c
@@ -52,24 +52,6 @@
* Run before nir_lower_io.
*/
-static nir_variable *
-get_texcoord(nir_shader *shader)
-{
- nir_variable *texcoord =
- nir_find_variable_with_location(shader, nir_var_shader_in,
- VARYING_SLOT_TEX0);
- /* otherwise create it: */
- if (texcoord == NULL) {
- texcoord = nir_variable_create(shader,
- nir_var_shader_in,
- glsl_vec4_type(),
- "gl_TexCoord");
- texcoord->data.location = VARYING_SLOT_TEX0;
- }
-
- return texcoord;
-}
-
static void
lower_bitmap(nir_shader *shader, nir_builder *b,
const nir_lower_bitmap_options *options)
@@ -78,7 +60,8 @@ lower_bitmap(nir_shader *shader, nir_builder *b,
nir_tex_instr *tex;
nir_ssa_def *cond;
- texcoord = nir_load_var(b, get_texcoord(shader));
+ texcoord = nir_load_var(b, nir_get_variable_with_location(shader, nir_var_shader_in,
+ VARYING_SLOT_TEX0, glsl_vec4_type()));
const struct glsl_type *sampler2D =
glsl_sampler_type(GLSL_SAMPLER_DIM_2D, false, false, GLSL_TYPE_FLOAT);