Mesa (master): compiler: move glsl_interface_packing enum to shader_enums.h

Timothy Arceri tarceri at kemper.freedesktop.org
Wed Jul 26 00:40:09 UTC 2017


Module: Mesa
Branch: master
Commit: b0333e55b77ff16bff3ca4a744043f85d06b4633
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0333e55b77ff16bff3ca4a744043f85d06b4633

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Fri Jul 21 10:23:47 2017 +1000

compiler: move glsl_interface_packing enum to shader_enums.h

This allows us to drop the duplicate gl_uniform_block_packing enum.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/compiler/glsl/link_uniform_blocks.cpp | 11 +----------
 src/compiler/glsl_types.h                 |  9 ++-------
 src/compiler/shader_enums.h               |  7 +++++++
 src/mesa/main/mtypes.h                    | 11 +----------
 4 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/src/compiler/glsl/link_uniform_blocks.cpp b/src/compiler/glsl/link_uniform_blocks.cpp
index 249a767636..ef2f29dd7a 100644
--- a/src/compiler/glsl/link_uniform_blocks.cpp
+++ b/src/compiler/glsl/link_uniform_blocks.cpp
@@ -280,7 +280,7 @@ process_block_array_leaf(const char *name,
    blocks[i].Binding = (b->has_binding) ? b->binding + *binding_offset : 0;
 
    blocks[i].UniformBufferSize = 0;
-   blocks[i]._Packing = gl_uniform_block_packing(type->interface_packing);
+   blocks[i]._Packing = glsl_interface_packing(type->interface_packing);
    blocks[i]._RowMajor = type->get_interface_row_major();
    blocks[i].linearized_array_index = linearized_index;
 
@@ -354,15 +354,6 @@ create_buffer_blocks(void *mem_ctx, struct gl_context *ctx,
     */
    ubo_visitor parcel(blocks, variables, num_variables, prog);
 
-   STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_STD140)
-                 == unsigned(ubo_packing_std140));
-   STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_SHARED)
-                 == unsigned(ubo_packing_shared));
-   STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_PACKED)
-                 == unsigned(ubo_packing_packed));
-   STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_STD430)
-                 == unsigned(ubo_packing_std430));
-
    unsigned i = 0;
    struct hash_entry *entry;
    hash_table_foreach (block_hash, entry) {
diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h
index 2857dc9ad9..f67465e6c8 100644
--- a/src/compiler/glsl_types.h
+++ b/src/compiler/glsl_types.h
@@ -28,6 +28,8 @@
 #include <string.h>
 #include <assert.h>
 
+#include "shader_enums.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -101,13 +103,6 @@ enum glsl_sampler_dim {
    GLSL_SAMPLER_DIM_SUBPASS_MS, /* for multisampled vulkan input attachments */
 };
 
-enum glsl_interface_packing {
-   GLSL_INTERFACE_PACKING_STD140,
-   GLSL_INTERFACE_PACKING_SHARED,
-   GLSL_INTERFACE_PACKING_PACKED,
-   GLSL_INTERFACE_PACKING_STD430
-};
-
 enum glsl_matrix_layout {
    /**
     * The layout of the matrix is inherited from the object containing the
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index 352f27040c..2f20e68c5d 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -567,6 +567,13 @@ enum glsl_interp_mode
    INTERP_MODE_COUNT /**< Number of interpolation qualifiers */
 };
 
+enum glsl_interface_packing {
+   GLSL_INTERFACE_PACKING_STD140,
+   GLSL_INTERFACE_PACKING_SHARED,
+   GLSL_INTERFACE_PACKING_PACKED,
+   GLSL_INTERFACE_PACKING_STD430
+};
+
 const char *glsl_interp_mode_name(enum glsl_interp_mode qual);
 
 /**
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0cb002469b..0d0536c775 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2645,15 +2645,6 @@ struct gl_uniform_buffer_variable
 };
 
 
-enum gl_uniform_block_packing
-{
-   ubo_packing_std140,
-   ubo_packing_shared,
-   ubo_packing_packed,
-   ubo_packing_std430
-};
-
-
 struct gl_uniform_block
 {
    /** Declared name of the uniform block */
@@ -2699,7 +2690,7 @@ struct gl_uniform_block
     * This isn't accessible through the API, but it is used while
     * cross-validating uniform blocks.
     */
-   enum gl_uniform_block_packing _Packing;
+   enum glsl_interface_packing _Packing;
    GLboolean _RowMajor;
 };
 




More information about the mesa-commit mailing list