From 3a658172f8985af2425a0b549a7e71221917c89d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 5 Mar 2016 12:35:34 +0100 Subject: [PATCH] (tools/cg2glsl.py) Write uniform declarations for fragment shaders. Formerly, the fragment shader conversion pass did not write required uniform declarations. This resulted in use of undefined symbols in some cases. In turn conversion of some shaders to GLSL were broken. This fixes conversion of some shaders, most prominently the hq shaders. --- tools/cg2glsl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/cg2glsl.py b/tools/cg2glsl.py index 63bea006fb..7536c6d8aa 100755 --- a/tools/cg2glsl.py +++ b/tools/cg2glsl.py @@ -405,6 +405,8 @@ def fix_samplers(log_prefix, ref_index, source): source.insert(ref_index, sampler) if struct_texunit0: source.insert(ref_index, 'uniform sampler2D Texture;') + for uniform in uniforms: + source.insert(ref_index, 'uniform COMPAT_PRECISION vec2 ' + uniform + ';') for index, line in enumerate(source): for orig, new in translations: log(log_prefix, 'Translation:', orig, '->', new)