nv50,nvc0: use clip_halfz setting when creating rasterizer state
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 23 Oct 2014 04:43:45 +0000 (00:43 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 15 Nov 2014 19:14:51 +0000 (14:14 -0500)
This enables the ARB_clip_control extension.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
docs/GL3.txt
docs/relnotes/10.4.html
src/gallium/drivers/nouveau/nv50/nv50_3d.xml.h
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nv50/nv50_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_state.c

index 285443129450a98cce90f4e7afbc605fe8ee183f..cfbce92bd929f639c4b41ace530ece5d6665998a 100644 (file)
@@ -187,7 +187,7 @@ GL 4.4, GLSL 4.40:
 GL 4.5, GLSL 4.50:
 
   GL_ARB_ES3_1_compatibility                           not started
-  GL_ARB_clip_control                                  DONE (llvmpipe, softpipe, r300, r600, radeonsi)
+  GL_ARB_clip_control                                  DONE (nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
   GL_ARB_conditional_render_inverted                   DONE (i965, nv50, nvc0, llvmpipe, softpipe)
   GL_ARB_cull_distance                                 not started
   GL_ARB_derivative_control                            DONE (i965, nv50, nvc0, r600)
index d0fbd3bd1aceb19424bcfe6fe2275b9ae220b1b6..8682d71961834574a817b3e32c6173b63e7fa3a6 100644 (file)
@@ -47,7 +47,7 @@ Note: some of the new features are only available with certain drivers.
 <li>GL_ARB_conditional_render_inverted on nv50</li>
 <li>GL_ARB_sample_shading on r600</li>
 <li>GL_ARB_texture_view on nv50, nvc0</li>
-<li>GL_ARB_clip_control on llvmpipe, softpipe, r300, r600, radeonsi</li>
+<li>GL_ARB_clip_control on nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe</li>
 <li>GL_KHR_context_flush_control on all drivers</li>
 </ul>
 
index 7523fdc4580da001c5a03503d1cd685c8d888c0e..a2c22c5eaa5089a96982584978558b318cd11144 100644 (file)
@@ -415,7 +415,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define NV50_3D_VERTEX_BUFFER_COUNT                            0x00000d78
 
-#define NV50_3D_UNK0D7C                                                0x00000d7c
+#define NV50_3D_DEPTH_CLIP_NEGATIVE_Z                          0x00000d7c
 
 #define NV50_3D_CLEAR_COLOR(i0)                                       (0x00000d80 + 0x4*(i0))
 #define NV50_3D_CLEAR_COLOR__ESIZE                             0x00000004
index 825e0ba49978704e19d753a75a9c2f0a04635613..fcf00982cb83eefcfe67f177a00174729ae77941 100644 (file)
@@ -173,6 +173,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
+   case PIPE_CAP_CLIP_HALFZ:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
       return 1; /* class_3d >= NVA0_3D_CLASS; */
@@ -204,7 +205,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
    case PIPE_CAP_COMPUTE:
    case PIPE_CAP_DRAW_INDIRECT:
-   case PIPE_CAP_CLIP_HALFZ:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index cf84f88666221be636f5e22b49472d1b9fc5bf41..155cdddf8450ceec3645449be1b81077ed8f294a 100644 (file)
@@ -333,6 +333,9 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
    SB_BEGIN_3D(so, VIEW_VOLUME_CLIP_CTRL, 1);
    SB_DATA    (so, reg);
 
+   SB_BEGIN_3D(so, DEPTH_CLIP_NEGATIVE_Z, 1);
+   SB_DATA    (so, cso->clip_halfz);
+
    assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
    return (void *)so;
 }
index 94b447b088fe748b300473332619706a780d689d..5bd5e95370fc5b3977f0565a32d0a81c649f41b6 100644 (file)
@@ -318,6 +318,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define NVC0_3D_VERTEX_BUFFER_COUNT                            0x00000d78
 
+#define NVC0_3D_DEPTH_CLIP_NEGATIVE_Z                          0x00000d7c
+
 #define NVC0_3D_CLEAR_COLOR(i0)                                       (0x00000d80 + 0x4*(i0))
 #define NVC0_3D_CLEAR_COLOR__ESIZE                             0x00000004
 #define NVC0_3D_CLEAR_COLOR__LEN                               0x00000004
index 4d4d5eb340a8acf9ad3b7c986223325d15601aa4..2a759311bf761cefd40a444aee33b89c3ba05170 100644 (file)
@@ -171,6 +171,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
+   case PIPE_CAP_CLIP_HALFZ:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
@@ -188,7 +189,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
    case PIPE_CAP_FAKE_SW_MSAA:
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
-   case PIPE_CAP_CLIP_HALFZ:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d1a7cf515595eae3cf6c6cbf32e730d463088ad3..54deb20cb0ccc0bfdb2ff81859ae6ed7aacf96cb 100644 (file)
@@ -313,6 +313,8 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
     SB_BEGIN_3D(so, VIEW_VOLUME_CLIP_CTRL, 1);
     SB_DATA    (so, reg);
 
+    SB_IMMED_3D(so, DEPTH_CLIP_NEGATIVE_Z, cso->clip_halfz);
+
     assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
     return (void *)so;
 }