diff options
author | Brian Paul <brianp@vmware.com> | 2017-11-06 12:44:06 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2017-11-16 20:35:17 -0700 |
commit | 92c1290dc57b493690ffe754b1b7724e93d41900 (patch) | |
tree | 8555c880a5e9be0a3235263cf7b29dc806c05b58 /src/compiler/glsl_types.cpp | |
parent | 940fba68c903d9b4da2d99a68f1c06c53d4fe82a (diff) |
glsl: s/unsigned/glsl_base_type/ in glsl type code (v2)
Declare glsl_type::sampled_type as glsl_base_type as we do for the
base_type field. And make base_type a bitfield to save a few bytes.
Update glsl_type constructor to take glsl_base_type instead of unsigned
and pass GLSL_TYPE_VOID instead of zero.
No Piglit regressions with llvmpipe.
v2:
- Declare both base_type and sampled_type as 8-bit fields
- Use the new ASSERT_BITFIELD_SIZE() macro.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/compiler/glsl_types.cpp')
-rw-r--r-- | src/compiler/glsl_types.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index 704b63c5cf2..107a81f5e79 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -50,9 +50,9 @@ glsl_type::glsl_type(GLenum gl_type, glsl_base_type base_type, unsigned vector_elements, unsigned matrix_columns, const char *name) : gl_type(gl_type), - base_type(base_type), + base_type(base_type), sampled_type(GLSL_TYPE_VOID), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampled_type(0), interface_packing(0), interface_row_major(0), + interface_packing(0), interface_row_major(0), vector_elements(vector_elements), matrix_columns(matrix_columns), length(0) { @@ -79,11 +79,11 @@ glsl_type::glsl_type(GLenum gl_type, glsl_type::glsl_type(GLenum gl_type, glsl_base_type base_type, enum glsl_sampler_dim dim, bool shadow, bool array, - unsigned type, const char *name) : + glsl_base_type type, const char *name) : gl_type(gl_type), - base_type(base_type), + base_type(base_type), sampled_type(type), sampler_dimensionality(dim), sampler_shadow(shadow), - sampler_array(array), sampled_type(type), interface_packing(0), + sampler_array(array), interface_packing(0), interface_row_major(0), length(0) { mtx_lock(&glsl_type::mem_mutex); @@ -102,9 +102,9 @@ glsl_type::glsl_type(GLenum gl_type, glsl_base_type base_type, glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, const char *name) : gl_type(0), - base_type(GLSL_TYPE_STRUCT), + base_type(GLSL_TYPE_STRUCT), sampled_type(GLSL_TYPE_VOID), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampled_type(0), interface_packing(0), interface_row_major(0), + interface_packing(0), interface_row_major(0), vector_elements(0), matrix_columns(0), length(num_fields) { @@ -131,9 +131,9 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, enum glsl_interface_packing packing, bool row_major, const char *name) : gl_type(0), - base_type(GLSL_TYPE_INTERFACE), + base_type(GLSL_TYPE_INTERFACE), sampled_type(GLSL_TYPE_VOID), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampled_type(0), interface_packing((unsigned) packing), + interface_packing((unsigned) packing), interface_row_major((unsigned) row_major), vector_elements(0), matrix_columns(0), length(num_fields) @@ -159,9 +159,9 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, glsl_type::glsl_type(const glsl_type *return_type, const glsl_function_param *params, unsigned num_params) : gl_type(0), - base_type(GLSL_TYPE_FUNCTION), + base_type(GLSL_TYPE_FUNCTION), sampled_type(GLSL_TYPE_VOID), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampled_type(0), interface_packing(0), interface_row_major(0), + interface_packing(0), interface_row_major(0), vector_elements(0), matrix_columns(0), length(num_params) { @@ -191,9 +191,9 @@ glsl_type::glsl_type(const glsl_type *return_type, glsl_type::glsl_type(const char *subroutine_name) : gl_type(0), - base_type(GLSL_TYPE_SUBROUTINE), + base_type(GLSL_TYPE_SUBROUTINE), sampled_type(GLSL_TYPE_VOID), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampled_type(0), interface_packing(0), interface_row_major(0), + interface_packing(0), interface_row_major(0), vector_elements(1), matrix_columns(1), length(0) { @@ -442,9 +442,9 @@ _mesa_glsl_release_types(void) glsl_type::glsl_type(const glsl_type *array, unsigned length) : - base_type(GLSL_TYPE_ARRAY), + base_type(GLSL_TYPE_ARRAY), sampled_type(GLSL_TYPE_VOID), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampled_type(0), interface_packing(0), interface_row_major(0), + interface_packing(0), interface_row_major(0), vector_elements(0), matrix_columns(0), length(length), name(NULL) { |