[Mesa-dev] [PATCH] main: Fix deprecation of glLineWidth()
Paul Berry
stereotype441 at gmail.com
Wed Aug 7 13:19:44 PDT 2013
On 7 August 2013 12:34, Ian Romanick <idr at freedesktop.org> wrote:
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>
> I believe we have someone writing a piglit test for this?
Yes, I believe Nick is writing a test for it.
>
>
> On 08/07/2013 10:28 AM, Paul Berry wrote:
>
>> From section E.1 (Profiles and Deprecated Features of OpenGL 3.0)
>>>
>> of the OpenGL 3.0 spec:
>>
>> "LineWidth is not deprecated, but values greater than 1.0
>> will generate an INVALID VALUE error"
>>
>> From context it is clear that values greater than 1.0 should only
>>>
>> generate an INVALID VALUE error in a forward-compatible context.
>>
>> The code was correctly quoting this spec text, but it was disallowing
>> all line widths in forward-compatible contexts, instead of just widths
>> greater than 1.0.
>>
>> This patch introduces the correct check, so that setting a line width
>> of 1.0 or less is permitted.
>> ---
>> src/mesa/main/lines.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
>> index 0df9d66..3c08ed2 100644
>> --- a/src/mesa/main/lines.c
>> +++ b/src/mesa/main/lines.c
>> @@ -56,19 +56,20 @@ _mesa_LineWidth( GLfloat width )
>> * "Wide lines and line stipple - LineWidth is not deprecated,
>> but
>> * values greater than 1.0 will generate an INVALID_VALUE error;"
>> *
>> * This is one of the very few cases where functionality was
>> deprecated but
>> * *NOT* removed in a later spec. Therefore, we only disallow this
>> in a
>> * forward compatible context.
>> */
>> if (ctx->API == API_OPENGL_CORE
>> && ((ctx->Const.ContextFlags & GL_CONTEXT_FLAG_FORWARD_**
>> COMPATIBLE_BIT)
>> - != 0)) {
>> + != 0)
>> + && width > 1.0) {
>> _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
>> return;
>> }
>>
>> if (ctx->Line.Width == width)
>> return;
>>
>> FLUSH_VERTICES(ctx, _NEW_LINE);
>> ctx->Line.Width = width;
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130807/d80cfcff/attachment-0001.html>
More information about the mesa-dev
mailing list