i965: Add context flag to disable the viewport transform
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 7 Jul 2014 22:00:46 +0000 (15:00 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 15 Aug 2014 17:33:41 +0000 (10:33 -0700)
This lets us disable the viewport transform, which will be useful for
emitting 3DPRIM_RECTLIST.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/gen7_sf_state.c
src/mesa/drivers/dri/i965/gen8_sf_state.c

index 6f621e0db42aec22f21dfc3efae64e4ebbec5f5f..97790a2aa4b3377b419149c621a7d77da515d7ad 100644 (file)
@@ -757,6 +757,7 @@ brwCreateContext(gl_api api,
    brw->prim_restart.in_progress = false;
    brw->prim_restart.enable_cut_index = false;
    brw->gs.enabled = false;
+   brw->sf.viewport_transform_enable = true;
 
    ctx->VertexProgram._MaintainTnlProgram = true;
    ctx->FragmentProgram._MaintainTexEnvProgram = true;
index f84ced9f9d0897e1f6ffc7ba38e7fd461915e65f..484940828310c4e5b52d5e450bef9c2e0bddc9a0 100644 (file)
@@ -1238,6 +1238,7 @@ struct brw_context
       uint32_t prog_offset;
       uint32_t state_offset;
       uint32_t vp_offset;
+      bool viewport_transform_enable;
    } sf;
 
    struct {
index 20c00a610575dd80b23d765596ac27b4d7bd495f..843507eb32e2b8ebc4f025b0997071d0deecac6c 100644 (file)
@@ -241,9 +241,10 @@ upload_sf_state(struct brw_context *brw)
    uint32_t point_sprite_origin;
 
    dw1 = GEN6_SF_SWIZZLE_ENABLE | num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT;
+   dw2 = GEN6_SF_STATISTICS_ENABLE;
 
-   dw2 = GEN6_SF_STATISTICS_ENABLE |
-         GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
+   if (brw->sf.viewport_transform_enable)
+       dw2 |= GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
 
    dw3 = 0;
    dw4 = 0;
index 6135b2754254096c79479ceb2ed200f9a129143f..4badc82b9be662fbd17c46f7a0eb526236da7968 100644 (file)
@@ -109,8 +109,10 @@ upload_sf_state(struct brw_context *brw)
    bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
    bool multisampled_fbo = ctx->DrawBuffer->Visual.samples > 1;
 
-   dw1 = GEN6_SF_STATISTICS_ENABLE |
-         GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
+   dw1 = GEN6_SF_STATISTICS_ENABLE;
+
+   if (brw->sf.viewport_transform_enable)
+       dw1 |= GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
 
    /* _NEW_BUFFERS */
    dw1 |= (brw_depthbuffer_format(brw) << GEN7_SF_DEPTH_BUFFER_SURFACE_FORMAT_SHIFT);
index 8d8b00dd3ea300224ce9a475add617ccff8ccbf3..4263eaf829a0b3945c43a9662729b455541e7c0c 100644 (file)
@@ -117,7 +117,10 @@ upload_sf(struct brw_context *brw)
    uint32_t dw1 = 0, dw2 = 0, dw3 = 0;
    float point_size;
 
-   dw1 = GEN6_SF_STATISTICS_ENABLE | GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
+   dw1 = GEN6_SF_STATISTICS_ENABLE;
+
+   if (brw->sf.viewport_transform_enable)
+       dw1 |= GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
 
    /* _NEW_LINE */
    uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7);