summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-02-26 16:19:26 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-02-26 22:23:29 +0100
commit23cf7f443013ad29acd294a3cefa4da6b798036e (patch)
treeb5f15242cc8db9e2ef02ed4fd8211693146be048
parente76123cfaf1982ebd2cce97968cfa47316d82c34 (diff)
i915g: switch sampler state to hw_atom
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--src/gallium/drivers/i915/i915_state_emit.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c
index 1e465cdcd0..9cd7fec9d4 100644
--- a/src/gallium/drivers/i915/i915_state_emit.c
+++ b/src/gallium/drivers/i915/i915_state_emit.c
@@ -237,6 +237,27 @@ emit_map(struct i915_context *i915)
}
}
+static void
+emit_sampler(struct i915_context *i915)
+{
+ if (i915->current.sampler_enable_nr) {
+ int i;
+
+ OUT_BATCH( _3DSTATE_SAMPLER_STATE |
+ (3 * i915->current.sampler_enable_nr) );
+
+ OUT_BATCH( i915->current.sampler_enable_flags );
+
+ for (i = 0; i < I915_TEX_UNITS; i++) {
+ if (i915->current.sampler_enable_flags & (1<<i)) {
+ OUT_BATCH( i915->current.sampler[i][0] );
+ OUT_BATCH( i915->current.sampler[i][1] );
+ OUT_BATCH( i915->current.sampler[i][2] );
+ }
+ }
+ }
+}
+
const static struct i915_tracked_hw_state hw_atoms[] = {
{ "flush", NULL, emit_flush, I915_HW_FLUSH, 1 },
{ "invariant", NULL, emit_invariant,
@@ -245,7 +266,8 @@ const static struct i915_tracked_hw_state hw_atoms[] = {
I915_HW_IMMEDIATE, I915_MAX_IMMEDIATE },
{ "dynamic", NULL, emit_dynamic, I915_HW_DYNAMIC, I915_MAX_DYNAMIC },
{ "static", update_static, emit_static, I915_HW_STATIC, 3 + 3 + 2 },
- { "map", update_map, emit_map, I915_HW_MAP, 2 + 3 * I915_TEX_UNITS }
+ { "map", update_map, emit_map, I915_HW_MAP, 2 + 3 * I915_TEX_UNITS },
+ { "sampler", NULL, emit_sampler, I915_HW_SAMPLER, 2 + 3 * I915_TEX_UNITS }
};
static boolean
@@ -330,30 +352,6 @@ i915_emit_hardware_state(struct i915_context *i915 )
emit_state(i915);
#if 01
- /* samplers */
- /* 2 + I915_TEX_UNITS*3 dwords, 0 relocs */
- if (i915->hardware_dirty & I915_HW_SAMPLER)
- {
- if (i915->current.sampler_enable_nr) {
- int i;
-
- OUT_BATCH( _3DSTATE_SAMPLER_STATE |
- (3 * i915->current.sampler_enable_nr) );
-
- OUT_BATCH( i915->current.sampler_enable_flags );
-
- for (i = 0; i < I915_TEX_UNITS; i++) {
- if (i915->current.sampler_enable_flags & (1<<i)) {
- OUT_BATCH( i915->current.sampler[i][0] );
- OUT_BATCH( i915->current.sampler[i][1] );
- OUT_BATCH( i915->current.sampler[i][2] );
- }
- }
- }
- }
-#endif
-
-#if 01
/* constants */
/* 2 + I915_MAX_CONSTANT*4 dwords, 0 relocs */
if (i915->hardware_dirty & I915_HW_CONSTANTS)