[Mesa-dev] [PATCH 23/37] i965/gen6/gs: Enable texture units and upload sampler state.

Iago Toral Quiroga itoral at igalia.com
Thu Aug 14 04:11:55 PDT 2014


---
 src/mesa/drivers/dri/i965/brw_context.c        | 2 +-
 src/mesa/drivers/dri/i965/brw_state_upload.c   | 1 +
 src/mesa/drivers/dri/i965/gen6_sampler_state.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index bf2aedb..bc0e1dd 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -300,7 +300,7 @@ brw_initialize_context_constants(struct brw_context *brw)
       MIN2(ctx->Const.MaxTextureCoordUnits,
            ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits);
    ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = max_samplers;
-   if (brw->gen >= 7)
+   if (brw->gen >= 6)
       ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = max_samplers;
    else
       ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 0;
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index a52a8f4..b0d78ab 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -147,6 +147,7 @@ static const struct brw_tracked_state *gen6_atoms[] =
 
    &brw_fs_samplers,
    &brw_vs_samplers,
+   &brw_gs_samplers,
    &gen6_sampler_state,
    &gen6_multisample_state,
 
diff --git a/src/mesa/drivers/dri/i965/gen6_sampler_state.c b/src/mesa/drivers/dri/i965/gen6_sampler_state.c
index 981e98f..9c6c508 100644
--- a/src/mesa/drivers/dri/i965/gen6_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sampler_state.c
@@ -40,7 +40,7 @@ upload_sampler_state_pointers(struct brw_context *brw)
 	     PS_SAMPLER_STATE_CHANGE |
 	     (4 - 2));
    OUT_BATCH(brw->vs.base.sampler_offset); /* VS */
-   OUT_BATCH(0); /* GS */
+   OUT_BATCH(brw->gs.base.sampler_offset); /* GS */
    OUT_BATCH(brw->wm.base.sampler_offset);
    ADVANCE_BATCH();
 }
-- 
1.9.1



More information about the mesa-dev mailing list