diff options
author | Dave Airlie <[email protected]> | 2016-06-09 06:38:57 +1000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | 8ce53d4a2f3f44b8fa00a6a04ec0816f38d788db (patch) | |
tree | f3a9e5801ddaad1c85a304f90a282d2e93ab41ab /src/mesa/program/ir_to_mesa.cpp | |
parent | e90830bb8eb6b143551152916ad9eafbee7731b5 (diff) |
glsl: Add basic ARB_gpu_shader_int64 types
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 <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index f7797e28fa3..85e6e92a2d5 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -532,6 +532,12 @@ type_size(const struct glsl_type *type) return 1; } break; + case GLSL_TYPE_UINT64: + case GLSL_TYPE_INT64: + if (type->vector_elements > 2) + return 2; + else + return 1; case GLSL_TYPE_ARRAY: assert(type->length > 0); return type_size(type->fields.array) * type->length; @@ -2522,11 +2528,19 @@ _mesa_associate_uniform_storage(struct gl_context *ctx, unsigned columns = 0; int dmul = 4 * sizeof(float); switch (storage->type->base_type) { + case GLSL_TYPE_UINT64: + if (storage->type->vector_elements > 2) + dmul *= 2; + /* fallthrough */ case GLSL_TYPE_UINT: assert(ctx->Const.NativeIntegers); format = uniform_native; columns = 1; break; + case GLSL_TYPE_INT64: + if (storage->type->vector_elements > 2) + dmul *= 2; + /* fallthrough */ case GLSL_TYPE_INT: format = (ctx->Const.NativeIntegers) ? uniform_native : uniform_int_float; |