Skip to content

error uniform.type == GL_SAMPLER_2D or GL_SAMPLER_CUBE after shader compile #2250

Closed Answered by rh101
10100010010001001010 asked this question in Q&A
Discussion options

You must be logged in to vote

Here are the fixed shaders based on your project and the original fragment shader you posted, where I accidentally removed v_position:

vertext_shader.vsh:

#version 310 es

layout(std140) uniform vs_ub {
    mat4 u_MVPMatrix;
};

layout(location = POSITION) in vec4 a_position;
layout(location = 0) out vec4 v_position;

void main()
{
    gl_Position = u_MVPMatrix * a_position;
    v_position = a_position;
}

and fragment_shader.fsh (with v_position re-added):

#version 310 es
precision mediump float;

layout(location = COLOR0) in vec4 v_color;
layout(location = POSITION) in vec4 v_position;
layout(location = SV_Target0) out vec4 FragColor;

layout(binding = 0) uniform sampler2D u_tex0;

layo…

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
12 replies
@10100010010001001010
Comment options

@halx99
Comment options

@rh101
Comment options

rh101 Nov 27, 2024
Collaborator

@rh101
Comment options

rh101 Nov 27, 2024
Collaborator

Answer selected by 10100010010001001010
@10100010010001001010
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants