diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-03-25 14:02:50 -0700 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-04-04 15:56:39 -0700 |
commit | 80c72a8ea7b1018661da0e6509a7f88ca1f5086f (patch) | |
tree | 09375f0c2b89ca271c5c1d68998ea3c090117e17 /src/mesa/drivers/dri/i965/brw_fs_nir.cpp | |
parent | 3babb7b0a4037c4ae98078611a827af6dd3e121e (diff) | |
download | external_mesa3d-80c72a8ea7b1018661da0e6509a7f88ca1f5086f.zip external_mesa3d-80c72a8ea7b1018661da0e6509a7f88ca1f5086f.tar.gz external_mesa3d-80c72a8ea7b1018661da0e6509a7f88ca1f5086f.tar.bz2 |
i965/nir: Provide a default LOD for buffer textures
Our hardware requires an LOD for all texelFetch commands even if they are
on buffer textures. GLSL IR gives us an LOD of 0 in that case, but the LOD
is really rather meaningless. This commit allows other NIR producers to be
more lazy and not provide one at all.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_nir.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 5cca91e..b804f3c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -3022,6 +3022,10 @@ fs_visitor::nir_emit_texture(const fs_builder &bld, nir_tex_instr *instr) fs_reg coordinate, shadow_comparitor, lod, lod2, sample_index, mcs, tex_offset; + /* The hardware requires a LOD for buffer textures */ + if (instr->sampler_dim == GLSL_SAMPLER_DIM_BUF) + lod = brw_imm_d(0); + for (unsigned i = 0; i < instr->num_srcs; i++) { fs_reg src = get_nir_src(instr->src[i].src); switch (instr->src[i].src_type) { |