diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-08-23 13:27:18 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-08-23 13:27:18 -0600 |
commit | d3eb25c575464bed7dbfc8be4717d85cb2928ec1 (patch) | |
tree | 9d0a18cc6c7c7e5c3939066dc6868a867d651fa0 /src/mesa/pipe/i915simple/i915_state_emit.c | |
parent | 690a9de40b20092ae9027dc52d7b26a48995bbff (diff) |
Checkpoint commit: i915 texture works, use new vertex_info struct
Basic i915 2D texturing seems to work now.
The vertex format is determined from the current fragment shader.
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_state_emit.c')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_state_emit.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/src/mesa/pipe/i915simple/i915_state_emit.c b/src/mesa/pipe/i915simple/i915_state_emit.c index ceb96289b5..48eb86091d 100644 --- a/src/mesa/pipe/i915simple/i915_state_emit.c +++ b/src/mesa/pipe/i915simple/i915_state_emit.c @@ -190,37 +190,39 @@ i915_emit_hardware_state(struct i915_context *i915 ) } -#if 0 +#if 01 /* texture images */ if (i915->hardware_dirty & I915_HW_MAP) { const uint nr = i915->current.sampler_enable_nr; - const uint enabled = i915->current.sampler_enable_flags; - uint unit; - uint count = 0; - OUT_BATCH(_3DSTATE_MAP_STATE | (3 * nr)); - OUT_BATCH(enabled); - for (unit = 0; unit < I915_TEX_UNITS; unit++) { - if (enabled & (1 << unit)) { - struct pipe_buffer_handle *buf = - i915->texture[unit]->region->buffer; - uint offset = 0; - assert(buf); - - count++; - - OUT_RELOC(buf, - I915_BUFFER_ACCESS_READ, - offset); - OUT_BATCH(i915->current.texbuffer[unit][0]); /* MS3 */ - OUT_BATCH(i915->current.texbuffer[unit][1]); /* MS4 */ + if (nr) { + const uint enabled = i915->current.sampler_enable_flags; + uint unit; + uint count = 0; + OUT_BATCH(_3DSTATE_MAP_STATE | (3 * nr)); + OUT_BATCH(enabled); + for (unit = 0; unit < I915_TEX_UNITS; unit++) { + if (enabled & (1 << unit)) { + struct pipe_buffer_handle *buf = + i915->texture[unit]->region->buffer; + uint offset = 0; + assert(buf); + + count++; + + OUT_RELOC(buf, + I915_BUFFER_ACCESS_READ, + offset); + OUT_BATCH(i915->current.texbuffer[unit][0]); /* MS3 */ + OUT_BATCH(i915->current.texbuffer[unit][1]); /* MS4 */ + } } + assert(count == nr); } - assert(count == nr); } #endif -#if 0 +#if 01 /* samplers */ if (i915->hardware_dirty & I915_HW_SAMPLER) { |