[Mesa-dev] [PATCH V4 02/13] glsl: add texture gather changes

Ian Romanick idr at freedesktop.org
Mon Sep 30 17:02:44 PDT 2013


On 09/30/2013 12:08 PM, Kenneth Graunke wrote:
> On 09/30/2013 11:03 AM, Ian Romanick wrote:
>> On 09/30/2013 03:08 AM, Chris Forbes wrote:
>>> From: Maxence Le Dore <maxence.ledore at gmail.com>
>>>
>>> V2 [Chris Forbes]:
>>>    - Add new pattern, fixup parameter reading.
>>>
>>> V3: Rebase onto new builtins machinery
>>>
>>> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
>>> ---
>>>  src/glsl/builtin_functions.cpp      | 35 +++++++++++++++++++++++++++++++++++
>>>  src/glsl/glcpp/glcpp-parse.y        |  3 +++
>>>  src/glsl/glsl_parser_extras.cpp     |  1 +
>>>  src/glsl/glsl_parser_extras.h       |  2 ++
>>>  src/glsl/ir.cpp                     |  2 +-
>>>  src/glsl/ir.h                       |  4 +++-
>>>  src/glsl/ir_clone.cpp               |  1 +
>>>  src/glsl/ir_hv_accept.cpp           |  1 +
>>>  src/glsl/ir_print_visitor.cpp       |  3 ++-
>>>  src/glsl/ir_reader.cpp              |  6 +++++-
>>>  src/glsl/ir_rvalue_visitor.cpp      |  1 +
>>>  src/glsl/opt_tree_grafting.cpp      |  1 +
>>>  src/glsl/standalone_scaffolding.cpp |  1 +
>>>  src/mesa/program/ir_to_mesa.cpp     |  5 +++++
>>>  14 files changed, 62 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
>>> index 72054e0..df735ef 100644
>>> --- a/src/glsl/builtin_functions.cpp
>>> +++ b/src/glsl/builtin_functions.cpp
>>> @@ -262,6 +262,13 @@ texture_query_lod(const _mesa_glsl_parse_state *state)
>>>            state->ARB_texture_query_lod_enable;
>>>  }
>>>  
>>> +static bool
>>> +texture_gather(const _mesa_glsl_parse_state *state)
>>> +{
>>> +   return state->is_version(400, 0) ||
>>> +          state->ARB_texture_gather_enable;
>>> +}
>>> +
>>
>> This should be glsl_parser_state::has_texture_gather, like in Ken's
>> f91475d... though it looks like some of the rest of this file could be
>> modified to use that pattern.  Hrm...
> 
> Ian,
> 
> These are accessed via function pointers (in ir_function_signature):
> 
> /**
>  * A function that returns whether a built-in function is available in the
>  * current shading language (based on version, ES or desktop, and extensions).
>  */
> typedef bool (*builtin_available_predicate)(const _mesa_glsl_parse_state *);
> 
> I don't believe that you can mix pointers to ordinary functions and pointers
> to class methods.  We could move /all/ of these predicates to be members of
> _mesa_glsl_parse_state, and change the typedef, but...I don't think we get to
> mix both styles.
> 
> I would prefer to leave Chris's patch as is, and resolve this as a follow-up
> series.

Yeah, I can get behind that.

> --Ken



More information about the mesa-dev mailing list