[Mesa-dev] [PATCH 11/12] intel: Change signature of intel_context.vtbl.set_draw_region

chad at chad-versace.us chad at chad-versace.us
Fri Apr 29 18:05:01 PDT 2011


From: Chad Versace <chad.versace at intel.com>

Add additional parameter 'struct intel_region *stencil_region'.
A subsequent patch uses the new parameter to update
brw_context.state.stencil_region.

Signed-off-by: Chad Versace <chad.versace at intel.com>
---
 src/mesa/drivers/dri/i915/i915_vtbl.c      |    3 +++
 src/mesa/drivers/dri/i965/brw_vtbl.c       |    3 +++
 src/mesa/drivers/dri/intel/intel_buffers.c |    2 +-
 src/mesa/drivers/dri/intel/intel_context.h |    1 +
 4 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index 89650b6..e643dc2 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -555,6 +555,7 @@ static void
 i915_set_draw_region(struct intel_context *intel,
                      struct intel_region *color_regions[],
                      struct intel_region *depth_region,
+                     struct intel_region *stencil_region,
 		     GLuint num_regions)
 {
    struct i915_context *i915 = i915_context(&intel->ctx);
@@ -565,6 +566,8 @@ i915_set_draw_region(struct intel_context *intel,
    struct i915_hw_state *state = &i915->state;
    uint32_t draw_x, draw_y, draw_offset;
 
+   assert(!stencil_region);
+
    if (state->draw_region != color_regions[0]) {
       intel_region_release(&state->draw_region);
       intel_region_reference(&state->draw_region, color_regions[0]);
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index b933e27..a35ea99 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -96,10 +96,13 @@ static void brw_destroy_context( struct intel_context *intel )
 static void brw_set_draw_region( struct intel_context *intel, 
                                  struct intel_region *color_regions[],
                                  struct intel_region *depth_region,
+                                 struct intel_region *stencil_region,
                                  GLuint num_color_regions)
 {
    struct brw_context *brw = brw_context(&intel->ctx);
 
+   assert(!stencil_region);
+
    if (brw->state.depth_region != depth_region) {
       brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER;
       intel_region_release(&brw->state.depth_region);
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index becc848..83f63b4 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -230,7 +230,7 @@ intel_draw_buffer(struct gl_context * ctx, struct gl_framebuffer *fb)
       intel->NewGLState |= (_NEW_DEPTH | _NEW_STENCIL);
    }
 
-   intel->vtbl.set_draw_region(intel, colorRegions, depthRegion, 
+   intel->vtbl.set_draw_region(intel, colorRegions, depthRegion, NULL,
                                fb->_NumColorDrawBuffers);
    intel->NewGLState |= _NEW_BUFFERS;
 
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index 3362241..f1df7be 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -135,6 +135,7 @@ struct intel_context
       void (*set_draw_region) (struct intel_context * intel,
                                struct intel_region * draw_regions[],
                                struct intel_region * depth_region,
+                               struct intel_region * stencil_region,
 			       GLuint num_regions);
 
       void (*reduced_primitive_state) (struct intel_context * intel,
-- 
1.7.4.2



More information about the mesa-dev mailing list