[Mesa-dev] [PATCH 11/59] glsl: Add basic ARB_gpu_shader_int64 types

Ian Romanick idr at freedesktop.org
Fri Oct 28 02:40:13 UTC 2016


On 10/27/2016 05:52 AM, Nicolai Hähnle wrote:
> On 26.10.2016 02:59, Ian Romanick wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This adds the builtins and the lexer support.
>>
>> To avoid too many warnings, it adds basic support to the type in a few
>> other places in mesa, mostly in the trivial places.
>>
>> It also adds a query to be used later for if a type is an integer 32
>> or 64.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>> ---
>>  src/compiler/builtin_type_macros.h              | 10 ++++++
>>  src/compiler/glsl/ast_to_hir.cpp                |  2 ++
>>  src/compiler/glsl/builtin_types.cpp             | 12 +++++++
>>  src/compiler/glsl/glsl_lexer.ll                 | 10 ++++++
>>  src/compiler/glsl/glsl_parser.yy                |  9 +++++
>>  src/compiler/glsl/ir_clone.cpp                  |  2 ++
>>  src/compiler/glsl/link_uniform_initializers.cpp |  2 ++
>>  src/compiler/glsl_types.cpp                     | 45
>> +++++++++++++++++++++++++
>>  src/compiler/glsl_types.h                       | 19 +++++++++--
>>  src/mesa/program/ir_to_mesa.cpp                 | 14 ++++++++
>>  src/mesa/state_tracker/st_glsl_types.cpp        |  6 ++++
>>  11 files changed, 129 insertions(+), 2 deletions(-)
>>
> [snip]
>> diff --git a/src/mesa/state_tracker/st_glsl_types.cpp
>> b/src/mesa/state_tracker/st_glsl_types.cpp
>> index 857e143..37c3164 100644
>> --- a/src/mesa/state_tracker/st_glsl_types.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_types.cpp
>> @@ -67,6 +67,12 @@ st_glsl_attrib_type_size(const struct glsl_type
>> *type, bool is_vs_input)
>>              return 2;
>>        }
>>        break;
>> +   case GLSL_TYPE_UINT64:
>> +   case GLSL_TYPE_INT64:
>> +      if (type->vector_elements <= 2 || is_vs_input)
>> +         return 1;
>> +      else
>> +         return 2;
>>     case GLSL_TYPE_ARRAY:
>>        assert(type->length > 0);
>>        return st_glsl_attrib_type_size(type->fields.array,
>> is_vs_input) * type->length;
>>
> 
> Do we have a test where a vertex shader input is an array of dvec4 or
> [u]i64vec4? I suspect that that may be broken.

I don't know if there are tests for dvec4 arrays.  You can't use 64-bit
integer vertex shader inputs at all until someone implements
NV_vertex_attrib_integer_64bit. :)

> That said, if it _is_ broken, then it's broken for doubles as well and
> needs to be fixed separately. With that in mind, patches 7-11:
> 
> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> 



More information about the mesa-dev mailing list