<div class="gmail_quote">On Mon, Mar 21, 2011 at 4:50 PM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 03/21/2011 09:10 AM, Keith Whitwell wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Mon, 2011-03-21 at 02:12 +0100, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
diff --git a/src/gallium/include/pipe/p_state.h<br>
b/src/gallium/include/pipe/p_state.h<br>
index cf6c5b5..f6ad456 100644<br>
--- a/src/gallium/include/pipe/p_state.h<br>
+++ b/src/gallium/include/pipe/p_state.h<br>
@@ -81,6 +81,8 @@ struct pipe_rasterizer_state<br>
{<br>
unsigned flatshade:1;<br>
unsigned light_twoside:1;<br>
+ unsigned clamp_vertex_color:1;<br>
+ unsigned clamp_fragment_color:1;<br>
unsigned front_ccw:1;<br>
unsigned cull_face:2; /**< PIPE_FACE_x */<br>
unsigned fill_front:2; /**< PIPE_POLYGON_MODE_x */<br>
</blockquote>
<br>
Don't know if this affects the overall packing of the struct. Have you<br>
been able to check?<br>
<br>
Otherwise the interface changes look good to me.<br>
</blockquote>
<br>
<br></div></div>
How do most GPUs handle this clamping? Is it done with extra shader code or is it a discrete operation? If most hardware does it with shader code, maybe we should just do it that way too in Gallium and avoid the new cap bits, etc.<br>
</blockquote><div><br>There is a bit in the CB_COLOR[0-7]_INFO register on R600 which controls color clamping before blending. I am not sure whether it can be used for ARB_color_buffer_float or whether it's strictly dependent on the colorbuffer format.<br>
<br>Christopher, do you happen to know whether NV50/NVC0 has a hardware state for it too?<br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
OpenGL 3.0 deprecates the per-vertex and per-fragment clamp controls so people will have to do it in their shaders eventually.<br>
<br>
<br>
Re: your comment in rasterizer.rst:<div class="im"><br>
<br>
XXX: this happens _before_ the geometry shader and thus might not belong here.<br>
<br></div>
So is there some question about where the per-vertex clamp is to be done? It seems to me that it should be done after the geometry shader.<br></blockquote><div><br></div></div>You're right. I will remove that comment.<br>
<br>Marek<br>