i965/blorp: Add support for layered rendering
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 27 Mar 2015 14:25:56 +0000 (16:25 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 29 Apr 2015 21:28:49 +0000 (00:28 +0300)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_blorp.cpp
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/gen6_blorp.cpp
src/mesa/drivers/dri/i965/gen7_blorp.cpp

index 8f82851a624a8e5fe8b59d74d3d59932cb0de293..b404869f0c73e81173fab257456fce7c42a23afc 100644 (file)
@@ -156,7 +156,8 @@ brw_blorp_surface_info::compute_tile_offsets(uint32_t *tile_x,
 
 
 brw_blorp_params::brw_blorp_params(unsigned num_varyings,
-                                   unsigned num_draw_buffers)
+                                   unsigned num_draw_buffers,
+                                   unsigned num_layers)
    : x0(0),
      y0(0),
      x1(0),
@@ -165,7 +166,8 @@ brw_blorp_params::brw_blorp_params(unsigned num_varyings,
      hiz_op(GEN6_HIZ_OP_NONE),
      use_wm_prog(false),
      num_varyings(num_varyings),
-     num_draw_buffers(num_draw_buffers)
+     num_draw_buffers(num_draw_buffers),
+     num_layers(num_layers)
 {
 }
 
index c9957a6a8e5c99b7bf0ea790f085f85aa6494061..dd28d810f7f7cf9de53367c6408c5103ba7221c8 100644 (file)
@@ -212,7 +212,8 @@ class brw_blorp_params
 {
 public:
    brw_blorp_params(unsigned num_varyings = 0,
-                    unsigned num_draw_buffers = 1);
+                    unsigned num_draw_buffers = 1,
+                    unsigned num_layers = 1);
 
    virtual uint32_t get_wm_prog(struct brw_context *brw,
                                 brw_blorp_prog_data **prog_data) const = 0;
@@ -230,6 +231,7 @@ public:
    brw_blorp_wm_push_constants wm_push_consts;
    const unsigned num_varyings;
    const unsigned num_draw_buffers;
+   const unsigned num_layers;
 };
 
 
index bfd20016d63d9a3775d3b04b0ba0735f5054e06e..ed08898d957d7a4b48b348058d0688cbddc741a8 100644 (file)
@@ -992,7 +992,7 @@ gen6_blorp_emit_primitive(struct brw_context *brw,
              GEN4_3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL);
    OUT_BATCH(3); /* vertex count per instance */
    OUT_BATCH(0);
-   OUT_BATCH(1); /* instance count */
+   OUT_BATCH(params->num_layers); /* instance count */
    OUT_BATCH(0);
    OUT_BATCH(0);
    ADVANCE_BATCH();
index 3065a4c2f4692ed01b6616c974081f57b63b2e6a..2bdc82bc89503f0c42010c28d5f0b6d940718b2c 100644 (file)
@@ -753,7 +753,7 @@ gen7_blorp_emit_primitive(struct brw_context *brw,
              _3DPRIM_RECTLIST);
    OUT_BATCH(3); /* vertex count per instance */
    OUT_BATCH(0);
-   OUT_BATCH(1); /* instance count */
+   OUT_BATCH(params->num_layers); /* instance count */
    OUT_BATCH(0);
    OUT_BATCH(0);
    ADVANCE_BATCH();