From 66ec61c49f0e57ebe237de3ee5610c7fda972e9c Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 30 Jul 2014 09:08:48 +0200 Subject: [PATCH] i965/gen6/gs: Enable texture units and upload sampler state. Acked-by: Kenneth Graunke Reviewed-by: Jordan Justen --- 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 619f2d56a57..5e2f175bdde 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -325,7 +325,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 c0b3c8b284b..49034a374b9 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 981e98fc8bb..9c6c508fb73 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(); } -- 2.30.2