[Mesa-dev] [PATCH] st/mesa: respect higher GLSL levels.
Brian Paul
brianp at vmware.com
Mon Oct 21 00:12:11 CEST 2013
On 10/20/2013 04:03 PM, Dave Airlie wrote:
> On Sun, Oct 20, 2013 at 11:00 PM, Brian Paul <brianp at vmware.com> wrote:
>> On 10/20/2013 01:07 PM, Dave Airlie wrote:
>>>
>>> From: Dave Airlie <airlied at redhat.com>
>>>
>>> If a driver wants to expose higher glsl levels have the state tracker
>>> respect them.
>>>
>>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>>> ---
>>> src/mesa/state_tracker/st_extensions.c | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/mesa/state_tracker/st_extensions.c
>>> b/src/mesa/state_tracker/st_extensions.c
>>> index 97dd732..ceb6f31 100644
>>> --- a/src/mesa/state_tracker/st_extensions.c
>>> +++ b/src/mesa/state_tracker/st_extensions.c
>>> @@ -591,7 +591,11 @@ void st_init_extensions(struct st_context *st)
>>> /* Figure out GLSL support. */
>>> glsl_feature_level = screen->get_param(screen,
>>> PIPE_CAP_GLSL_FEATURE_LEVEL);
>>>
>>> - if (glsl_feature_level >= 140) {
>>> + if (glsl_feature_level >= 330) {
>>> + ctx->Const.GLSLVersion = 330;
>>> + } else if (glsl_feature_level >= 150) {
>>> + ctx->Const.GLSLVersion = 150;
>>> + } else if (glsl_feature_level >= 140) {
>>> ctx->Const.GLSLVersion = 140;
>>> } else if (glsl_feature_level >= 130) {
>>> ctx->Const.GLSLVersion = 130;
>>>
>>
>> Can't this code be simplified to read
>>
>> ctx->Const.GLSLVersion = screen->get_param(screen,
>> PIPE_CAP_GLSL_FEATURE_LEVEL);
>
> Well for a while nouveau reported 150 when the mesa side could only handle 140,
>
> So I'm not sure how that would work out all the time if drivers when
> ahead of mesa.
How about clamping the value returned by the the driver to whatever's
supported by Mesa and the state tracker?
-Brian
More information about the mesa-dev
mailing list