mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Fix compatibility with desktop GL in cg2xml.
This commit is contained in:
parent
73e98ca78a
commit
3888b31c79
@ -139,9 +139,16 @@ def hack_source_vertex(source):
|
||||
for index, line in enumerate(source):
|
||||
if 'void main()' in line:
|
||||
source.insert(index + 2, ' mat4 rubyMVPMatrix_ = transpose_(rubyMVPMatrix);') # transpose() is GLSL 1.20+, doesn't exist in GLSL ES 1.0
|
||||
source.insert(index, '#endif')
|
||||
source.insert(index, 'uniform vec2 rubyInputSize;')
|
||||
source.insert(index, 'uniform vec2 rubyTextureSize;')
|
||||
source.insert(index, 'uniform vec2 rubyOutputSize;')
|
||||
source.insert(index, '#else')
|
||||
source.insert(index, 'uniform mediump vec2 rubyInputSize;')
|
||||
source.insert(index, 'uniform mediump vec2 rubyTextureSize;')
|
||||
source.insert(index, 'uniform mediump vec2 rubyOutputSize;')
|
||||
source.insert(index, '#ifdef GL_ES')
|
||||
|
||||
source.insert(index, """
|
||||
mat4 transpose_(mat4 matrix)
|
||||
{
|
||||
@ -175,9 +182,15 @@ def replace_global_fragment(source):
|
||||
def hack_source_fragment(source):
|
||||
for index, line in enumerate(source):
|
||||
if 'void main()' in line:
|
||||
source.insert(index, '#endif')
|
||||
source.insert(index, 'uniform vec2 rubyInputSize;')
|
||||
source.insert(index, 'uniform vec2 rubyTextureSize;')
|
||||
source.insert(index, 'uniform vec2 rubyOutputSize;')
|
||||
source.insert(index, '#else')
|
||||
source.insert(index, 'uniform mediump vec2 rubyInputSize;')
|
||||
source.insert(index, 'uniform mediump vec2 rubyTextureSize;')
|
||||
source.insert(index, 'uniform mediump vec2 rubyOutputSize;')
|
||||
source.insert(index, '#ifdef GL_ES')
|
||||
break
|
||||
|
||||
for line in source:
|
||||
|
Loading…
x
Reference in New Issue
Block a user