intel: Refactor quantize_num_samples
authorChad Versace <chad.versace@linux.intel.com>
Wed, 11 Jul 2012 21:52:53 +0000 (14:52 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 7 Aug 2012 16:30:33 +0000 (09:30 -0700)
Rename quantize_num_samples to intel_quantize_num_samples and change the
first param from struct intel_context* to struct intel_screen*. The
function will later be used by intelCreateBuffer, which is not bound to
any context but is bound to a screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_fbo.h

index 613287f6d3d17101bf4b5eb515b47f043a881cde..80af192d3ef6359378f000b8cd9a57d54e04c964 100644 (file)
@@ -182,8 +182,8 @@ intel_unmap_renderbuffer(struct gl_context *ctx,
 /**
  * Round up the requested multisample count to the next supported sample size.
  */
-static unsigned
-quantize_num_samples(struct intel_context *intel, unsigned num_samples)
+unsigned
+intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples)
 {
    switch (intel->gen) {
    case 6:
@@ -226,8 +226,9 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
                                  GLuint width, GLuint height)
 {
    struct intel_context *intel = intel_context(ctx);
+   struct intel_screen *screen = intel->intelScreen;
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);
-   rb->NumSamples = quantize_num_samples(intel, rb->NumSamples);
+   rb->NumSamples = intel_quantize_num_samples(screen, rb->NumSamples);
 
    switch (internalFormat) {
    default:
index 02bda1efc8b6af7dec4d24f6152da45f5faaf0fe..b922dca8403c252513ffabe980b2fcedd18e35f9 100644 (file)
@@ -200,6 +200,9 @@ bool
 intel_renderbuffer_resolve_depth(struct intel_context *intel,
                                 struct intel_renderbuffer *irb);
 
+unsigned
+intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples);
+
 #ifdef __cplusplus
 }
 #endif