glsl: rework misleading block layout code
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 21 Jul 2017 01:42:33 +0000 (11:42 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 23 Jul 2017 00:06:01 +0000 (10:06 +1000)
From the ARB_uniform_buffer_object spec:

   ""shared" uniform blocks, the default layout, ..."

This doesn't fix anything as the default layout is already applied
at this point but fixes the misleading code/comment.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/compiler/glsl/ast_to_hir.cpp

index 7de164cebbf8b63360f9f179383c70dccff9fe39..4916b1590a09f29559f992fc0fee852845457ac1 100644 (file)
@@ -7678,16 +7678,16 @@ ast_interface_block::hir(exec_list *instructions,
                                this->block_name);
 
    enum glsl_interface_packing packing;
-   if (this->layout.flags.q.shared) {
-      packing = GLSL_INTERFACE_PACKING_SHARED;
+   if (this->layout.flags.q.std140) {
+      packing = GLSL_INTERFACE_PACKING_STD140;
    } else if (this->layout.flags.q.packed) {
       packing = GLSL_INTERFACE_PACKING_PACKED;
    } else if (this->layout.flags.q.std430) {
       packing = GLSL_INTERFACE_PACKING_STD430;
    } else {
-      /* The default layout is std140.
+      /* The default layout is shared.
        */
-      packing = GLSL_INTERFACE_PACKING_STD140;
+      packing = GLSL_INTERFACE_PACKING_SHARED;
    }
 
    ir_variable_mode var_mode;