From 9dcf465ad64dfb60473c149c1e79a3a8cda0c23b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 27 May 2019 20:51:05 +1000 Subject: [PATCH] Force glsl attributes to explicit locations, fixes web client on safari (mac/ios) --- src/Graphics.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Graphics.c b/src/Graphics.c index d5981fe8c..d2a5e6b19 100644 --- a/src/Graphics.c +++ b/src/Graphics.c @@ -1498,6 +1498,14 @@ static void Gfx_CompileProgram(struct GLShader* shader) { glAttachShader(program, vertex); glAttachShader(program, fragment); + + /* Force in_pos/in_col/in_uv attributes to be bound to 0,1,2 locations */ + /* Although most browsers assign the attributes in this order anyways, */ + /* the specification does not require this. (e.g. Safari doesn't) */ + glBindAttribLocation(program, 0, "in_pos"); + glBindAttribLocation(program, 1, "in_col"); + glBindAttribLocation(program, 2, "in_uv"); + glLinkProgram(program); glGetProgramiv(program, GL_LINK_STATUS, &temp);