intel: Pass the gl_renderbuffer to render_target_supported() vtable method.
authorEric Anholt <eric@anholt.net>
Fri, 20 Jan 2012 01:23:25 +0000 (17:23 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 27 Jan 2012 19:46:10 +0000 (11:46 -0800)
I'm going to want to go looking at it for an integer texture fix.

NOTE: This is a candidate for the 8.0 branch.

src/mesa/drivers/dri/i915/i830_vtbl.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_fbo.c

index 082372e2c5d4817c2165c2f07ed1b40c16e20226..8b255966904102f926abd558452b234ec1973afb 100644 (file)
@@ -592,8 +592,11 @@ static uint32_t i830_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
 };
 
 static bool
-i830_render_target_supported(struct intel_context *intel, gl_format format)
+i830_render_target_supported(struct intel_context *intel,
+                            struct gl_renderbuffer *rb)
 {
+   gl_format format = rb->Format;
+
    if (format == MESA_FORMAT_S8_Z24 ||
        format == MESA_FORMAT_X8_Z24 ||
        format == MESA_FORMAT_Z16) {
index 62bfa0abf49687d7e7f3671a9409043d0e2dd5c0..11e8a35d34c04d949b609d439bd3c6b251c59a07 100644 (file)
@@ -557,8 +557,11 @@ static uint32_t i915_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
 };
 
 static bool
-i915_render_target_supported(struct intel_context *intel, gl_format format)
+i915_render_target_supported(struct intel_context *intel,
+                            struct gl_renderbuffer *rb)
 {
+   gl_format format = rb->Format;
+
    if (format == MESA_FORMAT_S8_Z24 ||
        format == MESA_FORMAT_X8_Z24 ||
        format == MESA_FORMAT_Z16) {
index 3bce1f3dd8f0409aeb41f9702cc50984212d8808..8f1cb8c9d8b3131ff12df365851d58927ea3dbe0 100644 (file)
@@ -472,7 +472,8 @@ struct gl_shader *brw_new_shader(struct gl_context *ctx, GLuint name, GLuint typ
 struct gl_shader_program *brw_new_shader_program(struct gl_context *ctx, GLuint name);
 
 bool brw_color_buffer_write_enabled(struct brw_context *brw);
-bool brw_render_target_supported(struct intel_context *intel, gl_format format);
+bool brw_render_target_supported(struct intel_context *intel,
+                                struct gl_renderbuffer *rb);
 void brw_wm_payload_setup(struct brw_context *brw,
                          struct brw_wm_compile *c);
 bool do_wm_prog(struct brw_context *brw,
index c77d83a9509bc1a8db727ab6801a8fae45fc2aab..bdce057366e4d34506284e136d22a0c471afe204 100644 (file)
@@ -557,12 +557,12 @@ brw_init_surface_formats(struct brw_context *brw)
 }
 
 bool
-brw_render_target_supported(struct intel_context *intel, gl_format format)
+brw_render_target_supported(struct intel_context *intel,
+                           struct gl_renderbuffer *rb)
 {
    struct brw_context *brw = brw_context(&intel->ctx);
-   /* Not exactly true, as some of those formats are not renderable.
-    * But at least we know how to translate them.
-    */
+   gl_format format = rb->Format;
+
    return brw->format_supported_as_render_target[format];
 }
 
index d429adcfd60a5238f43d833d179ac433ddc6fc34..1efb82f345892d4bed7b18f02dc860eb2f7760f3 100644 (file)
@@ -221,7 +221,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw,
         surf->ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
       break;
    default:
-      assert(brw_render_target_supported(intel, rb_format));
+      assert(brw_render_target_supported(intel, rb));
       surf->ss0.surface_format = brw->render_target_format[rb_format];
       if (unlikely(!brw->format_supported_as_render_target[rb_format])) {
         _mesa_problem(ctx, "%s: renderbuffer format %s unsupported\n",
index e673a4e88cf5feaa530e0dbc65bac56977e839fe..4d4e03085e341f94b28b004751af3a5c1e5c8674 100644 (file)
@@ -153,7 +153,7 @@ struct intel_context
 
       void (*debug_batch)(struct intel_context *intel);
       bool (*render_target_supported)(struct intel_context *intel,
-                                     gl_format format);
+                                     struct gl_renderbuffer *rb);
 
       /** Can HiZ be enabled on a depthbuffer of the given format? */
       bool (*is_hiz_depth_format)(struct intel_context *intel,
index f4a25a182f315accb08aac541b004974400a91f1..2ba43ac8623934de95b92915a10a5d73e7f6db33 100644 (file)
@@ -769,7 +769,7 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
         continue;
       }
 
-      if (!intel->vtbl.render_target_supported(intel, intel_rb_format(irb))) {
+      if (!intel->vtbl.render_target_supported(intel, rb)) {
         DBG("Unsupported HW texture/renderbuffer format attached: %s\n",
             _mesa_get_format_name(intel_rb_format(irb)));
         fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;