summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965/brw_wm_sampler_state.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-11-05 22:43:36 +0000
committerKeith Whitwell <keithw@vmware.com>2009-11-05 22:43:36 +0000
commit4c196ed7a8e06933d11b96ac520afa39252fc5c7 (patch)
treed32fea2784830e7695c071104a461eb853da638f /src/gallium/drivers/i965/brw_wm_sampler_state.c
parent3763457892c2d0c654c0eca7585e4d3a863f7714 (diff)
i965g: pass relocation information in an array with bo_subdata
Makes it easier to dump as we get all of the information about the upload in a single hit. Opens the window to simplification in the driver if these relocation arrays can be maintained statically rather than being recreated whenever we check for a new upload. Still needs some cleanup to avoid uglyness introduced with the delta values.
Diffstat (limited to 'src/gallium/drivers/i965/brw_wm_sampler_state.c')
-rw-r--r--src/gallium/drivers/i965/brw_wm_sampler_state.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/gallium/drivers/i965/brw_wm_sampler_state.c b/src/gallium/drivers/i965/brw_wm_sampler_state.c
index 174836b39d..4e99ac703a 100644
--- a/src/gallium/drivers/i965/brw_wm_sampler_state.c
+++ b/src/gallium/drivers/i965/brw_wm_sampler_state.c
@@ -165,6 +165,7 @@ brw_wm_sampler_update_default_colors(struct brw_context *brw)
static int upload_wm_samplers( struct brw_context *brw )
{
struct wm_sampler_key key;
+ struct brw_winsys_reloc reloc[BRW_MAX_TEX_UNIT];
enum pipe_error ret;
int i;
@@ -181,9 +182,20 @@ static int upload_wm_samplers( struct brw_context *brw )
return PIPE_OK;
}
+ /* Emit SDC relocations */
+ for (i = 0; i < key.sampler_count; i++) {
+ make_reloc( &reloc[i],
+ BRW_USAGE_SAMPLER,
+ 0,
+ i * sizeof(struct brw_sampler_state) +
+ offsetof(struct brw_sampler_state, ss2),
+ brw->wm.sdc_bo[i]);
+ }
+
+
if (brw_search_cache(&brw->cache, BRW_SAMPLER,
&key, sizeof(key),
- brw->wm.sdc_bo, key.sampler_count,
+ reloc, key.sampler_count,
NULL,
&brw->wm.sampler_bo))
return PIPE_OK;
@@ -193,24 +205,13 @@ static int upload_wm_samplers( struct brw_context *brw )
*/
ret = brw_upload_cache(&brw->cache, BRW_SAMPLER,
&key, sizeof(key),
- brw->wm.sdc_bo, key.sampler_count,
+ reloc, key.sampler_count,
&key.sampler, sizeof(key.sampler),
NULL, NULL,
&brw->wm.sampler_bo);
if (ret)
return ret;
- /* Emit SDC relocations */
- for (i = 0; i < key.sampler_count; i++) {
- ret = brw->sws->bo_emit_reloc(brw->wm.sampler_bo,
- BRW_USAGE_SAMPLER,
- 0,
- i * sizeof(struct brw_sampler_state) +
- offsetof(struct brw_sampler_state, ss2),
- brw->wm.sdc_bo[i]);
- if (ret)
- return ret;
- }
return 0;
}