parent
49d713c2ee
commit
e8d89eb2b2
|
@ -125,6 +125,11 @@ def destructify_varyings(source):
|
||||||
log('Found elements in struct', struct + ':', names)
|
log('Found elements in struct', struct + ':', names)
|
||||||
last_struct_decl_line = j
|
last_struct_decl_line = j
|
||||||
|
|
||||||
|
# Must have explicit uniform sampler2D in struct.
|
||||||
|
for index in range(i, j + 1):
|
||||||
|
if 'sampler2D' in source[index]:
|
||||||
|
source[index] = ''
|
||||||
|
|
||||||
varyings_tmp = varyings
|
varyings_tmp = varyings
|
||||||
varyings = []
|
varyings = []
|
||||||
variables = []
|
variables = []
|
||||||
|
@ -170,6 +175,12 @@ def destructify_varyings(source):
|
||||||
if varying_name in varyings_dict:
|
if varying_name in varyings_dict:
|
||||||
source[index] = source[index].replace(varying_name, varyings_dict[varying_name])
|
source[index] = source[index].replace(varying_name, varyings_dict[varying_name])
|
||||||
|
|
||||||
|
# Replace union <struct>. Sometimes we get collision in vertex and fragment.
|
||||||
|
for index, line in enumerate(source):
|
||||||
|
for struct_type in struct_types:
|
||||||
|
line = line.replace('uniform ' + struct_type, struct_type)
|
||||||
|
source[index] = line
|
||||||
|
|
||||||
return source
|
return source
|
||||||
|
|
||||||
def translate_varying(cg):
|
def translate_varying(cg):
|
||||||
|
|
Loading…
Reference in New Issue