summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2007-06-25 23:12:23 -0700
committerCarl Worth <cworth@cworth.org>2007-06-25 23:12:23 -0700
commit0a8a4afd3c59011d6b1f5b39aedfb9bce0e55c48 (patch)
tree22f9f5e0e67725a5c2ece2916ca773817229b39f
parent499166a60fcbf16021bd9ec233790ba55803aa44 (diff)
Use local structure for src_sampler_state and mask_sampler_state
-rw-r--r--src/i965_render.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index 08822711..d79edd1c 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -264,8 +264,8 @@ static int urb_cs_start, urb_cs_size;
static struct brw_surface_state *dest_surf_state, dest_surf_state_local;
static struct brw_surface_state *src_surf_state, src_surf_state_local;
static struct brw_surface_state *mask_surf_state, mask_surf_state_local;
-static struct brw_sampler_state *src_sampler_state;
-static struct brw_sampler_state *mask_sampler_state;
+static struct brw_sampler_state *src_sampler_state, src_sampler_state_local;
+static struct brw_sampler_state *mask_sampler_state, mask_sampler_state_local;
static struct brw_sampler_default_color *default_color_state;
static struct brw_vs_unit_state *vs_state;
@@ -539,10 +539,6 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
cc_viewport = (void *)(state_base + cc_viewport_offset);
- src_sampler_state = (void *)(state_base + src_sampler_offset);
- if (pMask)
- mask_sampler_state = (void *)(state_base + mask_sampler_offset);
-
binding_table = (void *)(state_base + binding_table_offset);
vb = (void *)(state_base + vb_offset);
@@ -712,6 +708,7 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
binding_table[2] = state_base_offset + mask_surf_offset;
/* PS kernel use this sampler */
+ src_sampler_state = &src_sampler_state_local;
memset(src_sampler_state, 0, sizeof(*src_sampler_state));
src_sampler_state->ss0.lod_preclamp = 1; /* GL mode */
switch(pSrcPicture->filter) {
@@ -748,7 +745,11 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
}
src_sampler_state->ss3.chroma_key_enable = 0; /* disable chromakey */
+ src_sampler_state = (void *)(state_base + src_sampler_offset);
+ memcpy (src_sampler_state, &src_sampler_state_local, sizeof (src_sampler_state_local));
+
if (pMask) {
+ mask_sampler_state = &mask_sampler_state_local;
memset(mask_sampler_state, 0, sizeof(*mask_sampler_state));
mask_sampler_state->ss0.lod_preclamp = 1; /* GL mode */
switch(pMaskPicture->filter) {
@@ -779,6 +780,9 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
mask_sampler_state->ss1.t_wrap_mode = BRW_TEXCOORDMODE_WRAP;
}
mask_sampler_state->ss3.chroma_key_enable = 0; /* disable chromakey */
+
+ mask_sampler_state = (void *)(state_base + mask_sampler_offset);
+ memcpy (mask_sampler_state, &mask_sampler_state_local, sizeof (mask_sampler_state_local));
}
/* Set up the vertex shader to be disabled (passthrough) */