diff options
author | marha <marha@users.sourceforge.net> | 2014-08-11 21:22:25 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-08-11 21:22:25 +0200 |
commit | 8e27619ab489dece35cc4bec86950ee7729cd309 (patch) | |
tree | ab59dbc661e00c12ed4777cf9d0d37393c4163aa /mesalib/src/glsl/link_uniform_block_active_visitor.cpp | |
parent | ffc99ce2402fe5c9a6eb8fcf193e8e9472fd993b (diff) | |
parent | fdbedba4d50e1b28b0249c83ba11c029f096e400 (diff) | |
download | vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.gz vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.bz2 vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
libxcb/src/c_client.py
mesalib/include/GL/glext.h
mesalib/include/GL/glxext.h
mesalib/src/glsl/.gitignore
mesalib/src/mesa/drivers/dri/common/xmlconfig.h
mesalib/src/mesa/main/.gitignore
xorg-server/Xext/xvmain.c
xorg-server/dix/dispatch.c
xorg-server/hw/xfree86/common/compiler.h
Diffstat (limited to 'mesalib/src/glsl/link_uniform_block_active_visitor.cpp')
-rw-r--r-- | mesalib/src/glsl/link_uniform_block_active_visitor.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mesalib/src/glsl/link_uniform_block_active_visitor.cpp b/mesalib/src/glsl/link_uniform_block_active_visitor.cpp index 854309f9b..9da6a4bba 100644 --- a/mesalib/src/glsl/link_uniform_block_active_visitor.cpp +++ b/mesalib/src/glsl/link_uniform_block_active_visitor.cpp @@ -73,6 +73,45 @@ process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var) } ir_visitor_status +link_uniform_block_active_visitor::visit(ir_variable *var) +{ + if (!var->is_in_uniform_block()) + return visit_continue; + + const glsl_type *const block_type = var->is_interface_instance() + ? var->type : var->get_interface_type(); + + /* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec says: + * + * "All members of a named uniform block declared with a shared or + * std140 layout qualifier are considered active, even if they are not + * referenced in any shader in the program. The uniform block itself is + * also considered active, even if no member of the block is + * referenced." + */ + if (block_type->interface_packing == GLSL_INTERFACE_PACKING_PACKED) + return visit_continue; + + /* Process the block. Bail if there was an error. + */ + link_uniform_block_active *const b = + process_block(this->mem_ctx, this->ht, var); + if (b == NULL) { + linker_error(this->prog, + "uniform block `%s' has mismatching definitions", + var->get_interface_type()->name); + this->success = false; + return visit_stop; + } + + assert(b->num_array_elements == 0); + assert(b->array_elements == NULL); + assert(b->type != NULL); + + return visit_continue; +} + +ir_visitor_status link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir) { ir_dereference_variable *const d = ir->array->as_dereference_variable(); |