diff options
author | Daniel Vetter <[email protected]> | 2011-02-26 15:53:01 +0100 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2011-02-27 15:58:13 +0100 |
commit | f58c11af72303a7b8ec480b4f216e4a17882e0f4 (patch) | |
tree | ab53c36e3af533f9bb324365b5a7c9929283626b /src/gallium/drivers/i915/i915_state_emit.c | |
parent | beaf039f972490bc62ec87401441d4b754ae86b0 (diff) |
i915g: cleanup static state calculation, part 2
Now also for the DRAW_RECT command
Signed-off-by: Daniel Vetter <[email protected]>
Diffstat (limited to 'src/gallium/drivers/i915/i915_state_emit.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_state_emit.c | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 1b2cffc91ee..f7c8ed10183 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -37,29 +37,6 @@ #include "util/u_math.h" -/** - * Examine framebuffer state to determine width, height. - */ -static boolean -framebuffer_size(const struct pipe_framebuffer_state *fb, - uint *width, uint *height) -{ - if (fb->cbufs[0]) { - *width = fb->cbufs[0]->width; - *height = fb->cbufs[0]->height; - return TRUE; - } - else if (fb->zsbuf) { - *width = fb->zsbuf->width; - *height = fb->zsbuf->height; - return TRUE; - } - else { - *width = *height = 0; - return FALSE; - } -} - /* Push the state into the sarea and/or texture memory. */ @@ -330,35 +307,13 @@ i915_emit_hardware_state(struct i915_context *i915 ) /* 6 dwords, 0 relocs */ if (i915->hardware_dirty & I915_HW_STATIC) { - uint w, h; - struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0]; - unsigned x, y; - int layer; - uint32_t draw_offset; - boolean ret; - - ret = framebuffer_size(&i915->framebuffer, &w, &h); - assert(ret); - - if (cbuf_surface) { - struct i915_texture *tex = i915_texture(cbuf_surface->texture); - layer = cbuf_surface->u.tex.first_layer; - - x = tex->image_offset[cbuf_surface->u.tex.level][layer].nblocksx; - y = tex->image_offset[cbuf_surface->u.tex.level][layer].nblocksy; - - } else - x = y = 0; - - draw_offset = x | (y << 16); - /* XXX flush only required when the draw_offset changes! */ OUT_BATCH(MI_FLUSH | INHIBIT_FLUSH_RENDER_CACHE); OUT_BATCH(_3DSTATE_DRAW_RECT_CMD); OUT_BATCH(DRAW_RECT_DIS_DEPTH_OFS); - OUT_BATCH(draw_offset); - OUT_BATCH((w - 1 + x) | ((h - 1 + y) << 16)); - OUT_BATCH(draw_offset); + OUT_BATCH(i915->current.draw_offset); + OUT_BATCH(i915->current.draw_size); + OUT_BATCH(i915->current.draw_offset); } #endif |