[Mesa-dev] [PATCH 2/3] i965: Pass the framebuffer to update_renderbuffer_surface().
Eric Anholt
eric at anholt.net
Tue Jul 31 18:04:37 PDT 2012
We're going to want to look at the framebuffer for window system sRGB
handling.
---
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 5 +++--
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 3 ++-
src/mesa/drivers/dri/intel/intel_context.h | 4 ++--
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 099668e..0744cc0 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1051,9 +1051,10 @@ brw_update_null_renderbuffer_surface(struct brw_context *brw, unsigned int unit)
*/
static void
brw_update_renderbuffer_surface(struct brw_context *brw,
- struct gl_renderbuffer *rb,
+ struct gl_framebuffer *fb,
unsigned int unit)
{
+ struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[unit];
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
@@ -1196,7 +1197,7 @@ brw_update_renderbuffer_surfaces(struct brw_context *brw)
if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) {
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
if (intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[i])) {
- intel->vtbl.update_renderbuffer_surface(brw, ctx->DrawBuffer->_ColorDrawBuffers[i], i);
+ intel->vtbl.update_renderbuffer_surface(brw, ctx->DrawBuffer, i);
} else {
intel->vtbl.update_null_renderbuffer_surface(brw, i);
}
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
index 62d2be8..4c127ab 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -457,9 +457,10 @@ gen7_update_null_renderbuffer_surface(struct brw_context *brw, unsigned unit)
*/
static void
gen7_update_renderbuffer_surface(struct brw_context *brw,
- struct gl_renderbuffer *rb,
+ struct gl_framebuffer *fb,
unsigned int unit)
{
+ struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[unit];
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index 29ab187..d85f1be 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -191,8 +191,8 @@ struct intel_context
*/
void (*update_texture_surface)(struct gl_context *ctx, unsigned unit);
void (*update_renderbuffer_surface)(struct brw_context *brw,
- struct gl_renderbuffer *rb,
- unsigned unit);
+ struct gl_framebuffer *fb,
+ unsigned index);
void (*update_null_renderbuffer_surface)(struct brw_context *brw,
unsigned unit);
void (*create_constant_surface)(struct brw_context *brw,
--
1.7.10.4
More information about the mesa-dev
mailing list