summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_manager.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-12 12:22:45 +0200
committerNicolai Hähnle <[email protected]>2017-06-13 09:35:36 +0200
commit77ea2ada5ae4b72c43598f3faa518526cb36b822 (patch)
tree8cbd9adb01421c2fa5bd1d77db740a5d276c9035 /src/mesa/state_tracker/st_manager.c
parent597b2486b8d1bce7b373bcace37866a83faa3e7a (diff)
glsl: give all unnamed structs the same name
As a result, unnamed structs defined in different places of the program are considered the same types if they have the same fields in the same order. This will simplify matching of global variables whose type is an unnamed struct. It also fixes a memory leak when the same shader containing unnamed structs is compiled over and over again: instead of creating a new type each time, the existing type is re-used. Finally, this does have the effect that some previously rejected programs are now accepted, such as: struct { float a; } s1; struct { float a; } s2; s2 = s1; C/C++ do not allow that, but GLSL does seem to want to treat unnamed structs with the same fields as the same type at least during linking (and apparently, some applications require it), so it seems odd to treat them as different types elsewhere. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_manager.c')
0 files changed, 0 insertions, 0 deletions