diff options
author | Kenneth Graunke <[email protected]> | 2018-08-24 01:34:30 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-10-14 23:35:35 -0700 |
commit | ed169c9ad2121429aaf0cb99cdf9e298b284a753 (patch) | |
tree | 3ac67b5d832d6be131a9928e585e4665adaa2b09 /src/compiler/nir/nir_lower_bitmap.c | |
parent | b7397b09d5474e783b3d0e404cdee82b9dc31345 (diff) |
nir: Create sampler2D variables in nir_lower_{bitmap,drawpixels}.
This is needed for nir_gather_info to actually count the new textures,
since it operates solely on variables.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_bitmap.c')
-rw-r--r-- | src/compiler/nir/nir_lower_bitmap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_bitmap.c b/src/compiler/nir/nir_lower_bitmap.c index a4d9498576c..03eb6273129 100644 --- a/src/compiler/nir/nir_lower_bitmap.c +++ b/src/compiler/nir/nir_lower_bitmap.c @@ -88,6 +88,13 @@ lower_bitmap(nir_shader *shader, nir_builder *b, texcoord = nir_load_var(b, get_texcoord(shader)); + const struct glsl_type *sampler2D = + glsl_sampler_type(GLSL_SAMPLER_DIM_2D, false, false, GLSL_TYPE_FLOAT); + + nir_variable *tex_var = + nir_variable_create(shader, nir_var_uniform, sampler2D, "bitmap_tex"); + tex_var->data.binding = options->sampler; + tex = nir_tex_instr_create(shader, 1); tex->op = nir_texop_tex; tex->sampler_dim = GLSL_SAMPLER_DIM_2D; |