mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present.
Fixes bugzilla #32214.
(cherry picked from commit ce9171f9d8)
This commit is contained in:
parent
9a9bd548b0
commit
6b7b2af43a
1 changed files with 14 additions and 0 deletions
|
|
@ -1655,6 +1655,20 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||
demote_shader_inputs_and_outputs(sh, ir_var_in);
|
||||
}
|
||||
|
||||
/* OpenGL ES requires that a vertex shader and a fragment shader both be
|
||||
* present in a linked program. By checking for use of shading language
|
||||
* version 1.00, we also catch the GL_ARB_ES2_compatibility case.
|
||||
*/
|
||||
if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
|
||||
if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
|
||||
linker_error_printf(prog, "program lacks a vertex shader\n");
|
||||
prog->LinkStatus = false;
|
||||
} else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
|
||||
linker_error_printf(prog, "program lacks a fragment shader\n");
|
||||
prog->LinkStatus = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* FINISHME: Assign fragment shader output locations. */
|
||||
|
||||
done:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue