[Mesa-dev] [PATCH 2/6] glsl: move builtin types to glsl_types.cpp

Rob Clark robdclark at gmail.com
Mon Oct 12 12:18:58 PDT 2015


On Mon, Oct 12, 2015 at 12:50 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> Can we tweak the commit message a bit:
>
> glsl: move builtin vector types to glsl_types.cpp
>
> builtin_types.CPP contains a lot more than just vec4_type and friends and
> you're not moving all of them.

ok, updated the commit msg[1] (but I assume no point to resend to list
just for that)

[1] https://github.com/freedreno/mesa/commits/wip-nir-no-glsl

BR,
-R

> On Oct 10, 2015 11:48 AM, "Rob Clark" <robdclark at gmail.com> wrote:
>>
>> From: Rob Clark <robclark at freedesktop.org>
>>
>> First step at untangling NIR's dependency on glsl_types without bringing
>> in the dependency on glsl_symbol_table.  The builtin types are now in
>> glsl_types (which will end up in NIR), but adding them to the symbol-
>> table stays in builtin_types.cpp (which will not be part of NIR).
>>
>> Signed-off-by: Rob Clark <robclark at freedesktop.org>
>> ---
>>  src/glsl/builtin_types.cpp |  4 +---
>>  src/glsl/glsl_types.cpp    | 14 ++++++++++++++
>>  2 files changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/glsl/builtin_types.cpp b/src/glsl/builtin_types.cpp
>> index 0aedbb3..bbdcd19 100644
>> --- a/src/glsl/builtin_types.cpp
>> +++ b/src/glsl/builtin_types.cpp
>> @@ -43,9 +43,7 @@
>>   * convenience pointers (glsl_type::foo_type).
>>   * @{
>>   */
>> -#define DECL_TYPE(NAME, ...)                                    \
>> -   const glsl_type glsl_type::_##NAME##_type = glsl_type(__VA_ARGS__,
>> #NAME); \
>> -   const glsl_type *const glsl_type::NAME##_type =
>> &glsl_type::_##NAME##_type;
>> +#define DECL_TYPE(NAME, ...)
>>
>>  #define STRUCT_TYPE(NAME)                                       \
>>     const glsl_type glsl_type::_struct_##NAME##_type =           \
>> diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
>> index b9cb97c..b0bb2ff 100644
>> --- a/src/glsl/glsl_types.cpp
>> +++ b/src/glsl/glsl_types.cpp
>> @@ -1713,3 +1713,17 @@ glsl_type::coordinate_components() const
>>
>>     return size;
>>  }
>> +
>> +/**
>> + * Declarations of type flyweights (glsl_type::_foo_type) and
>> + * convenience pointers (glsl_type::foo_type).
>> + * @{
>> + */
>> +#define DECL_TYPE(NAME, ...)                                    \
>> +   const glsl_type glsl_type::_##NAME##_type = glsl_type(__VA_ARGS__,
>> #NAME); \
>> +   const glsl_type *const glsl_type::NAME##_type =
>> &glsl_type::_##NAME##_type;
>> +
>> +#define STRUCT_TYPE(NAME)
>> +
>> +#include "builtin_type_macros.h"
>> +/** @} */
>> --
>> 2.4.3
>>


More information about the mesa-dev mailing list