diff options
author | Chad Versace <[email protected]> | 2012-07-11 15:10:49 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2012-08-07 09:30:33 -0700 |
commit | e2f2376e884225705e2369caee4a8c4e90e938f3 (patch) | |
tree | 13ae981e62a863ce9fa443a2a0aa0987b93ebecd | |
parent | 53fa28f7b1f21251a3807abf1f234f52beff0256 (diff) |
intel: Set num samples for winsys renderbuffers
Add a new param, num_samples, to intel_create_renderbuffer and
intel_create_private_renderbuffer.
No multisample GL config is yet advertised, so the value of num_samples is
currently 0. For server-owned winsys buffers, gl_renderbuffer::NumSamples
is not yet used.
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Paul Berry <[email protected]> (v1)
Signed-off-by: Chad Versace <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 17 |
3 files changed, 21 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 80af192d3ef..cea57e6d31d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -397,9 +397,11 @@ intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb, /** * Create a new intel_renderbuffer which corresponds to an on-screen window, * not a user-created renderbuffer. + * + * \param num_samples must be quantized. */ struct intel_renderbuffer * -intel_create_renderbuffer(gl_format format) +intel_create_renderbuffer(gl_format format, unsigned num_samples) { struct intel_renderbuffer *irb; struct gl_renderbuffer *rb; @@ -419,6 +421,7 @@ intel_create_renderbuffer(gl_format format) rb->_BaseFormat = _mesa_get_format_base_format(format); rb->Format = format; rb->InternalFormat = rb->_BaseFormat; + rb->NumSamples = num_samples; /* intel-specific methods */ rb->Delete = intel_delete_renderbuffer; @@ -432,13 +435,15 @@ intel_create_renderbuffer(gl_format format) * server created with intel_create_renderbuffer()) are most similar in their * handling to user-created renderbuffers, but they have a resize handler that * may be called at intel_update_renderbuffers() time. + * + * \param num_samples must be quantized. */ struct intel_renderbuffer * -intel_create_private_renderbuffer(gl_format format) +intel_create_private_renderbuffer(gl_format format, unsigned num_samples) { struct intel_renderbuffer *irb; - irb = intel_create_renderbuffer(format); + irb = intel_create_renderbuffer(format, num_samples); irb->Base.Base.AllocStorage = intel_alloc_renderbuffer_storage; return irb; diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index b922dca8403..72ed04d1212 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -130,10 +130,10 @@ intel_rb_format(const struct intel_renderbuffer *rb) } extern struct intel_renderbuffer * -intel_create_renderbuffer(gl_format format); +intel_create_renderbuffer(gl_format format, unsigned num_samples); struct intel_renderbuffer * -intel_create_private_renderbuffer(gl_format format); +intel_create_private_renderbuffer(gl_format format, unsigned num_samples); struct gl_renderbuffer* intel_create_wrapped_renderbuffer(struct gl_context * ctx, diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 90f177834f7..9aca4639d25 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -550,6 +550,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, struct intel_renderbuffer *rb; struct intel_screen *screen = (struct intel_screen*) driScrnPriv->driverPrivate; gl_format rgbFormat; + unsigned num_samples = intel_quantize_num_samples(screen, mesaVis->samples); struct gl_framebuffer *fb; if (isPixmap) @@ -569,11 +570,11 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, rgbFormat = MESA_FORMAT_ARGB8888; /* setup the hardware-based renderbuffers */ - rb = intel_create_renderbuffer(rgbFormat); + rb = intel_create_renderbuffer(rgbFormat, num_samples); _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); if (mesaVis->doubleBufferMode) { - rb = intel_create_renderbuffer(rgbFormat); + rb = intel_create_renderbuffer(rgbFormat, num_samples); _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &rb->Base.Base); } @@ -586,23 +587,27 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, assert(mesaVis->stencilBits == 8); if (screen->hw_has_separate_stencil) { - rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24); + rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24, + num_samples); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); - rb = intel_create_private_renderbuffer(MESA_FORMAT_S8); + rb = intel_create_private_renderbuffer(MESA_FORMAT_S8, + num_samples); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); } else { /* * Use combined depth/stencil. Note that the renderbuffer is * attached to two attachment points. */ - rb = intel_create_private_renderbuffer(MESA_FORMAT_S8_Z24); + rb = intel_create_private_renderbuffer(MESA_FORMAT_S8_Z24, + num_samples); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); } } else if (mesaVis->depthBits == 16) { assert(mesaVis->stencilBits == 0); - rb = intel_create_private_renderbuffer(MESA_FORMAT_Z16); + rb = intel_create_private_renderbuffer(MESA_FORMAT_Z16, + num_samples); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); } else { |