intel: add layered parameter to update_renderbuffer_surface
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 19 Apr 2013 08:00:20 +0000 (01:00 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 3 Jun 2013 03:38:37 +0000 (20:38 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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

index f73ea20442ee63e7f781cd16af422b595c497b9a..4d4d30031ffff0b42797327998314b12b2bcc9df 100644 (file)
@@ -1315,6 +1315,7 @@ 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,
+                               bool layered,
                                unsigned int unit)
 {
    struct intel_context *intel = &brw->intel;
@@ -1328,6 +1329,8 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
    /* _NEW_BUFFERS */
    gl_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
 
+   assert(!layered);
+
    if (rb->TexImage && !brw->has_surface_tile_offset) {
       intel_renderbuffer_get_tile_offsets(irb, &tile_x, &tile_y);
 
@@ -1424,7 +1427,8 @@ 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->_ColorDrawBuffers[i],
+                                                   ctx->DrawBuffer->Layered, i);
         } else {
            intel->vtbl.update_null_renderbuffer_surface(brw, i);
         }
index 03767050385d2b4a71254b0c39a4f3a260c6b575..0768438df16566f2db14ccf6b09dd2f91063b426 100644 (file)
@@ -523,6 +523,7 @@ 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,
+                                bool layered,
                                 unsigned int unit)
 {
    struct intel_context *intel = &brw->intel;
@@ -534,6 +535,8 @@ gen7_update_renderbuffer_surface(struct brw_context *brw,
    /* _NEW_BUFFERS */
    gl_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
 
+   assert(!layered);
+
    uint32_t *surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE,
                                     8 * 4, 32, &brw->wm.surf_offset[unit]);
    memset(surf, 0, 8 * 4);
index c0f07ff1f3c87e559f48f749389e4975e6961363..5420e76b70943c7b63b19543b3d06305985c5297 100644 (file)
@@ -196,6 +196,7 @@ struct intel_context
                                      unsigned surf_index);
       void (*update_renderbuffer_surface)(struct brw_context *brw,
                                          struct gl_renderbuffer *rb,
+                                         bool layered,
                                          unsigned unit);
       void (*update_null_renderbuffer_surface)(struct brw_context *brw,
                                               unsigned unit);