glsl: replace gl ctx direct access

Replaces GL API context access with an abstraction as
to allow for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343

Signed-off-by: Michal Vanis <mik@vanis.sh>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38981>
This commit is contained in:
Michal Vanis 2025-12-16 21:36:54 +01:00 committed by Marge Bot
parent ba4908e61f
commit 75d95cb355

View file

@ -29,6 +29,7 @@
#include "util/set.h"
#include "util/u_range_remap.h"
#include "main/consts_exts.h"
#include "main/context.h"
void
linker_error(gl_shader_program *prog, const char *fmt, ...)
@ -75,7 +76,7 @@ link_shaders_init(struct gl_context *ctx, struct gl_shader_program *prog)
* missing.
*/
if (prog->NumShaders == 0) {
if (ctx->API != API_OPENGL_COMPAT)
if (!_mesa_is_desktop_gl_compat(ctx))
linker_error(prog, "no shaders attached to the program\n");
return;
}