diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-08-26 18:18:25 +0200 |
---|---|---|
committer | Luca Barbieri <luca@luca-barbieri.com> | 2010-09-05 18:11:22 +0200 |
commit | 76bdfcfe3ff4145a1818e6cb6e227b730a5f12d8 (patch) | |
tree | d73181bee02d53a9a2926138e23d08c7dc57d921 | |
parent | 11d72248257c07a9aab84d6c5a4dbc288bad4d90 (diff) |
gallium: add color clamping to the interface
-rw-r--r-- | src/gallium/docs/source/cso/rasterizer.rst | 28 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 4 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 2 |
3 files changed, 33 insertions, 1 deletions
diff --git a/src/gallium/docs/source/cso/rasterizer.rst b/src/gallium/docs/source/cso/rasterizer.rst index ee3419ccfc..622798a9a7 100644 --- a/src/gallium/docs/source/cso/rasterizer.rst +++ b/src/gallium/docs/source/cso/rasterizer.rst @@ -7,6 +7,34 @@ The rasterizer state controls the rendering of points, lines and triangles. Attributes include polygon culling state, line width, line stipple, multisample state, scissoring and flat/smooth shading. +Linkage +------- + +clamp_vertex_color +^^^^^^^^^^^^^^^^^^ + +If set, TGSI_SEMANTIC_COLOR registers are clamped to the [0, 1] range after +the execution of the vertex shader, before being passed to the geometry +shader or fragment shader. + +OpenGL: glClampColor(GL_CLAMP_VERTEX_COLOR) in GL 3.0 or GL_ARB_color_buffer_float + +D3D11: seems always disabled + +XXX: this happens _before_ the geometry shader and thus might not belong here. + +clamp_fragment_color +^^^^^^^^^^^^^^^^^^^^ + +Controls whether TGSI_SEMANTIC_COLOR outputs of the fragment shader +are clamped to [0, 1]. + +OpenGL: glClampColor(GL_CLAMP_FRAGMENT_COLOR) in GL 3.0 or ARB_color_buffer_float + +D3D11: seems always disabled + +XXX: this happens _after_ the fragment shader and thus might not belong here. + Shading ------- diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 627b5ae538..8d45649717 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -494,7 +494,9 @@ enum pipe_cap { PIPE_CAP_MAX_VS_PREDS, PIPE_CAP_GEOMETRY_SHADER4, - PIPE_CAP_DEPTH_CLAMP + PIPE_CAP_DEPTH_CLAMP, + PIPE_CAP_UNCLAMPED_VERTEX_COLOR, + PIPE_CAP_UNCLAMPED_FRAGMENT_COLOR, }; diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 9a2b31da50..bd4c5b7158 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -80,6 +80,8 @@ struct pipe_rasterizer_state { unsigned flatshade:1; unsigned light_twoside:1; + unsigned clamp_vertex_color:1; /* probably shouldn't be there... */ + unsigned clamp_fragment_color:1; /* probably shouldn't be there... */ unsigned front_ccw:1; unsigned cull_face:2; /**< PIPE_FACE_x */ unsigned fill_front:2; /**< PIPE_POLYGON_MODE_x */ |