[Mesa-dev] Mesa (master): glsl: Add constuctors for the common cases of glsl_struct_field

Michel Dänzer michel at daenzer.net
Tue Aug 4 19:25:35 PDT 2015


Hi Ian,


On 04.08.2015 03:11, Ian Romanick wrote:
> Module: Mesa
> Branch: master
> Commit: 7ac946e546bba440f87ce95ef022745201744f9c
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ac946e546bba440f87ce95ef022745201744f9c
> 
> Author: Ian Romanick <ian.d.romanick at intel.com>
> Date:   Thu Jul 30 06:00:56 2015 -0700
> 
> glsl: Add constuctors for the common cases of glsl_struct_field
> 
> Fixes a giant pile of GCC warnings:
> 
> builtin_types.cpp:60:1: warning: missing initializer for member 'glsl_struct_field::stream' [-Wmissing-field-initializers]
> 
> I had to add a default constructor because a non-default constructor
> was added.  Otherwise the only constructor would be the one with
> parameters, and all the plases like
> 
>     glsl_struct_field foo;
> 
> would fail to compile.
> 
> I wanted to do this in two patches.  All of the initializers of
> glsl_struct_field structures had to be converted to use the
> constructor because C++ apparently forces you to do one or the other:
> 
> builtin_types.cpp:61:1: error: could not convert '{glsl_type::float_type, "near", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0, -1}' from '<brace-enclosed initializer list>' to 'glsl_struct_field'
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>
> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>

This commit caused a few (mostly tessellation related) piglit
regressions for me with radeonsi. Some of them fail with

Failed to link: error: definitions of interface block `gl_PerVertex' do not match

others with

shader_runner: ../../../src/glsl/ir_set_program_inouts.cpp:260: bool {anonymous}::ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable*, ir_rvalue*): Assertion `!"Unexpected indexing in ir_set_program_inouts"' failed.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list