[Mesa-dev] [RFC PATCH] i965/snb: add textureSamples support

Ilia Mirkin imirkin at alum.mit.edu
Sun Sep 13 19:45:17 PDT 2015


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---

This patch doesn't work. I'm not sure what the correct way to fix it
is. I have no idea what the base mrf is supposed to get set to, I
tried to understand the logic in lower_sampler_logical_send_gen5, but
apparently with only limited success. However this seems to work
reliably for vs/gs.

[Oh, and leaving it as -1 doesn't work either, the
fs_generator::generate_tex() logic checks for it not being -1.]

 src/mesa/drivers/dri/i965/brw_fs_nir.cpp     | 6 +++++-
 src/mesa/drivers/dri/i965/intel_extensions.c | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index e4ddadc..c075a35 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -1881,7 +1881,11 @@ fs_visitor::nir_emit_texture(const fs_builder &bld, nir_tex_instr *instr)
                                sampler_reg);
       inst->mlen = 1;
       inst->header_size = 1;
-      inst->base_mrf = -1;
+      if (devinfo->gen < 7) {
+         inst->base_mrf = 2;
+      } else {
+         inst->base_mrf = -1;
+      }
       return;
    }
    default:
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
index e6d39e0..05573d8 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -286,6 +286,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.ARB_draw_buffers_blend = true;
       ctx->Extensions.ARB_ES3_compatibility = true;
       ctx->Extensions.ARB_sample_shading = true;
+      ctx->Extensions.ARB_shader_texture_image_samples = true;
       ctx->Extensions.ARB_shading_language_420pack = true;
       ctx->Extensions.ARB_shading_language_packing = true;
       ctx->Extensions.ARB_texture_buffer_object = true;
@@ -325,7 +326,6 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.ARB_shader_atomic_counters = true;
       ctx->Extensions.ARB_shader_image_load_store = true;
       ctx->Extensions.ARB_shader_image_size = true;
-      ctx->Extensions.ARB_shader_texture_image_samples = true;
       ctx->Extensions.ARB_texture_compression_bptc = true;
       ctx->Extensions.ARB_texture_view = true;
 
-- 
2.0.5



More information about the mesa-dev mailing list