graphicsdriver/opengl: Bug fix: Rename the attribute variables along with custom shaders

This commit is contained in:
Hajime Hoshi 2020-07-20 04:06:35 +09:00
parent c8fa937a0a
commit 29d53edf1d
2 changed files with 9 additions and 9 deletions

View File

@ -109,15 +109,15 @@ func fragmentShaderStr(useColorM bool, filter driver.Filter, address driver.Addr
const (
shaderStrVertex = `
uniform vec2 viewport_size;
attribute vec2 vertex;
attribute vec2 tex;
attribute vec4 color_scale;
attribute vec2 A0;
attribute vec2 A1;
attribute vec4 A2;
varying vec2 varying_tex;
varying vec4 varying_color_scale;
void main(void) {
varying_tex = tex;
varying_color_scale = color_scale;
varying_tex = A1;
varying_color_scale = A2;
mat4 projection_matrix = mat4(
vec4(2.0 / viewport_size.x, 0, 0, 0),
@ -125,7 +125,7 @@ void main(void) {
vec4(0, 0, 1, 0),
vec4(-1, -1, 0, 1)
);
gl_Position = projection_matrix * vec4(vertex, 0, 1);
gl_Position = projection_matrix * vec4(A0, 0, 1);
}
`
shaderStrFragment = `

View File

@ -90,15 +90,15 @@ var theArrayBufferLayout = arrayBufferLayout{
// Note that GL_MAX_VERTEX_ATTRIBS is at least 16.
parts: []arrayBufferLayoutPart{
{
name: "vertex",
name: "A0",
num: 2,
},
{
name: "tex",
name: "A1",
num: 2,
},
{
name: "color_scale",
name: "A2",
num: 4,
},
},