mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
More refactoring of cg2glsl.py.
This commit is contained in:
parent
f272431b5d
commit
867b83e352
@ -329,22 +329,19 @@ def replace_varyings(source):
|
|||||||
attribs = []
|
attribs = []
|
||||||
uniforms = []
|
uniforms = []
|
||||||
for index, line in enumerate(source):
|
for index, line in enumerate(source):
|
||||||
if (('//var' in line) or ('#var' in line)) and ('$vin.' in line):
|
if ('//var' in line) or ('#var' in line):
|
||||||
|
func = translate_texture_size
|
||||||
|
collection = uniforms
|
||||||
|
if '$vin.' in line:
|
||||||
|
func = translate_varying
|
||||||
|
collection = attribs
|
||||||
orig = line.split()[2]
|
orig = line.split()[2]
|
||||||
translated = translate_varying(orig)
|
translated = func(orig)
|
||||||
if translated != orig and translated not in attribs:
|
if translated != orig and translated not in collection:
|
||||||
cg_attrib = line.split(':')[2].split(' ')[1]
|
cg_var = line.split(':')[2].split(' ')[1]
|
||||||
if cg_attrib:
|
if cg_var:
|
||||||
translations.append((cg_attrib, translated))
|
translations.append((cg_var, translated))
|
||||||
attribs.append(translated)
|
collection.append(translated)
|
||||||
elif ('//var' in line) or ('#var' in line):
|
|
||||||
orig = line.split()[2]
|
|
||||||
translated = translate_texture_size(orig)
|
|
||||||
if translated != orig and translated not in uniforms:
|
|
||||||
cg_uniform = line.split(':')[2].split(' ')[1]
|
|
||||||
if cg_uniform:
|
|
||||||
translations.append((cg_uniform, translated))
|
|
||||||
uniforms.append(translated)
|
|
||||||
|
|
||||||
for index, line in enumerate(source):
|
for index, line in enumerate(source):
|
||||||
if 'void main()' in line:
|
if 'void main()' in line:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user