diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 56cb8df..b28eaa7 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -757,7 +757,7 @@ static void vrend_destroy_query_object(void *obj_ptr); static void vrend_finish_context_switch(struct vrend_context *ctx); static void vrend_patch_blend_state(struct vrend_sub_context *sub_ctx); static void vrend_update_frontface_state(struct vrend_sub_context *ctx); -static void vrender_get_glsl_version(int *glsl_version); +static int vrender_get_glsl_version(void); static void vrend_destroy_program(struct vrend_linked_shader_program *ent); static void vrend_apply_sampler_state(struct vrend_sub_context *sub_ctx, struct vrend_resource *res, @@ -6430,7 +6430,7 @@ struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *de vrend_renderer_create_sub_ctx(grctx, 0); vrend_renderer_set_sub_ctx(grctx, 0); - vrender_get_glsl_version(&grctx->shader_cfg.glsl_version); + grctx->shader_cfg.glsl_version = vrender_get_glsl_version(); if (!grctx->ctx_id) grctx->fence_retire = vrend_clicbs->ctx0_fence_retire; @@ -9883,12 +9883,11 @@ int vrend_create_so_target(struct vrend_context *ctx, return 0; } -static void vrender_get_glsl_version(int *glsl_version) +static int vrender_get_glsl_version(void) { - int major_local, minor_local; + int major_local = 0, minor_local = 0; const GLubyte *version_str; MAYBE_UNUSED int c; - int version; version_str = glGetString(GL_SHADING_LANGUAGE_VERSION); if (vrend_state.use_gles) { @@ -9902,9 +9901,7 @@ static void vrender_get_glsl_version(int *glsl_version) assert(c == 2); } - version = (major_local * 100) + minor_local; - if (glsl_version) - *glsl_version = version; + return (major_local * 100) + minor_local; } static void vrend_fill_caps_glsl_version(int gl_ver, int gles_ver,