[Mesa-dev] [PROPOSAL] gallium: move state enable bits from clip_state to rasterizer_state

Marek Olšák maraeo at gmail.com
Sat Dec 17 06:45:19 PST 2011


---

This was suggested by Keith Whitwell in this email addressed to me on 8/6/2010:
http://lists.freedesktop.org/archives/mesa-dev/2010-August/001810.html


 src/gallium/include/pipe/p_defines.h |    2 +-
 src/gallium/include/pipe/p_state.h   |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 800a04c..c441a1f 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -453,7 +453,7 @@ enum pipe_cap {
    PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT = 38,
    PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER = 39,
    PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER = 40,
-   PIPE_CAP_DEPTH_CLAMP = 41,
+   PIPE_CAP_DEPTH_CLIP_DISABLE = 41,
    PIPE_CAP_SHADER_STENCIL_EXPORT = 42,
    PIPE_CAP_TGSI_INSTANCEID = 43,
    PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR = 44,
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index f943ca5..3aedada 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -127,6 +127,18 @@ struct pipe_rasterizer_state
     */
    unsigned rasterizer_discard:1;
 
+   /**
+    * When false, depth clipping is disabled and the depth value will be
+    * clamped later at the per-pixel level before depth testing.
+    * This depends on PIPE_CAP_DEPTH_CLIP_DISABLE.
+    */
+   unsigned depth_clip:1;
+
+   /**
+    * Enable bits for user clip planes.
+    */
+   unsigned user_clip_plane_enable:PIPE_MAX_CLIP_PLANES;
+
    unsigned line_stipple_factor:8;  /**< [1..256] actually */
    unsigned line_stipple_pattern:16;
 
@@ -165,8 +177,6 @@ struct pipe_scissor_state
 struct pipe_clip_state
 {
    float ucp[PIPE_MAX_CLIP_PLANES][4];
-   unsigned nr;
-   unsigned depth_clamp:1;
 };
 
 
-- 
1.7.5.4



More information about the mesa-dev mailing list