mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 11:43:00 +00:00
Allow multiple samplers in cg2glsl.
This commit is contained in:
parent
88e2ac3c9c
commit
e4089af307
@ -217,15 +217,24 @@ def hack_source_fragment(source):
|
|||||||
source.insert(index, 'uniform int FrameDirection;')
|
source.insert(index, 'uniform int FrameDirection;')
|
||||||
break
|
break
|
||||||
|
|
||||||
|
samplers = []
|
||||||
for line in source:
|
for line in source:
|
||||||
if ('TEXUNIT0' in line) and ('semantic' not in line):
|
if ('TEXUNIT0' in line) and ('semantic' not in line):
|
||||||
sampler = line.split(':')[2].split(' ')[1]
|
main_sampler = (line.split(':')[2].split(' ')[1], 'Texture')
|
||||||
log('Fragment: Sampler:', sampler)
|
samplers.append(main_sampler)
|
||||||
|
log('Fragment: Sampler:', main_sampler[0], '->', main_sampler[1])
|
||||||
break
|
break
|
||||||
|
elif '//var sampler2D' in line:
|
||||||
|
orig_name = line.split(' ')[2]
|
||||||
|
new_name = line.split(':')[2].split(' ')[1]
|
||||||
|
samplers.append((new_name, orig_name))
|
||||||
|
log('Fragment: Sampler:', new_name, '->', orig_name)
|
||||||
|
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
for line in source:
|
for line in source:
|
||||||
ret.append(line.replace(sampler, 'Texture'))
|
for sampler in samplers:
|
||||||
|
ret.append(line.replace(sampler[0], sampler[1]))
|
||||||
|
|
||||||
ret = destructify_varyings(ret)
|
ret = destructify_varyings(ret)
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user