diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-02-26 16:57:42 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-02-26 22:25:08 +0100 |
commit | 2b62c952f54969e15bea92590a7e5ae14ac4e1bc (patch) | |
tree | b786f97b2b20dda25a3bf444f3d0bb0804a239b1 | |
parent | 5feb1a30440774f0ab30e9c3335c8d4bdb90eda2 (diff) |
i915g: switch fs program emission to hw_atom
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | src/gallium/drivers/i915/i915_state_emit.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 27f50eb2da..40a0deaf3f 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -337,6 +337,23 @@ emit_constants(struct i915_context *i915) } } +static void +update_program(struct i915_context *i915, unsigned *batch_space) +{ + *batch_space = i915->fs->program_len; +} + +static void +emit_program(struct i915_context *i915) +{ + uint i; + /* we should always have, at least, a pass-through program */ + assert(i915->fs->program_len > 0); + for (i = 0; i < i915->fs->program_len; i++) { + OUT_BATCH(i915->fs->program[i]); + } +} + const static struct i915_tracked_hw_state hw_atoms[] = { { "flush", update_flush, emit_flush, I915_HW_FLUSH }, { "invariant", NULL, emit_invariant, @@ -346,7 +363,8 @@ const static struct i915_tracked_hw_state hw_atoms[] = { { "static", update_static, emit_static, I915_HW_STATIC }, { "map", update_map, emit_map, I915_HW_MAP }, { "sampler", update_sampler, emit_sampler, I915_HW_SAMPLER }, - { "constants", update_constants, emit_constants, I915_HW_CONSTANTS } + { "constants", update_constants, emit_constants, I915_HW_CONSTANTS }, + { "program", update_program, emit_program, I915_HW_PROGRAM } }; static boolean @@ -435,20 +453,6 @@ i915_emit_hardware_state(struct i915_context *i915 ) emit_state(i915); #if 01 - /* Fragment program */ - /* i915->current.program_len dwords, 0 relocs */ - if (i915->hardware_dirty & I915_HW_PROGRAM) - { - uint i; - /* we should always have, at least, a pass-through program */ - assert(i915->fs->program_len > 0); - for (i = 0; i < i915->fs->program_len; i++) { - OUT_BATCH(i915->fs->program[i]); - } - } -#endif - -#if 01 /* drawing surface size */ /* 6 dwords, 0 relocs */ if (i915->hardware_dirty & I915_HW_STATIC) |