Ensure line numbers reported by the GLSL compiler are correct
This commit is contained in:
parent
db40445572
commit
a44e3a3a50
@ -36,6 +36,7 @@ class BordersProgram(ShaderProgram):
|
||||
def __init__(self):
|
||||
ShaderProgram.__init__(
|
||||
self, '''\
|
||||
#version GLSL_VERSION
|
||||
uniform vec3 colors[3];
|
||||
in vec3 rect;
|
||||
out vec3 color;
|
||||
@ -45,6 +46,7 @@ void main() {
|
||||
color = colors[uint(rect[2])];
|
||||
}
|
||||
''', '''\
|
||||
#version GLSL_VERSION
|
||||
in vec3 color;
|
||||
out vec4 final_color;
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#version GLSL_VERSION
|
||||
uniform sampler2DArray sprites;
|
||||
in vec3 sprite_pos;
|
||||
in vec3 underline_pos;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#version GLSL_VERSION
|
||||
uniform uvec2 dimensions; // xnum, ynum
|
||||
uniform vec4 steps; // xstart, ystart, dx, dy
|
||||
uniform vec2 sprite_layout; // dx, dy
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#version GLSL_VERSION
|
||||
uniform vec4 color;
|
||||
out vec4 final_color;
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#version GLSL_VERSION
|
||||
uniform vec2 xpos;
|
||||
uniform vec2 ypos;
|
||||
|
||||
|
||||
@ -310,7 +310,7 @@ class ShaderProgram: # {{{
|
||||
def add_shader(self, source: str, shader_type: int) -> int:
|
||||
' Compile a shader and return its id, or raise an exception if compilation fails '
|
||||
shader_id = glCreateShader(shader_type)
|
||||
source = '#version {}\n{}'.format(VERSION, source)
|
||||
source = source.replace('GLSL_VERSION', str(VERSION), 1)
|
||||
try:
|
||||
glShaderSource(shader_id, source)
|
||||
glCompileShader(shader_id)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user