[virglrenderer-devel] [PATCH v3 5/7] vrend, caps: evaluate GLSL version before everything else
Gert Wollny
gert.wollny at collabora.com
Mon Jul 30 13:01:09 UTC 2018
Also move the function code up in the file to let the code reflect the
call logic.
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/vrend_renderer.c | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 7e7dd2d..2d7b658 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -7388,6 +7388,29 @@ static void vrender_get_glsl_version(int *glsl_version)
*glsl_version = version;
}
+static void vrend_fill_caps_glsl_version(int gl_ver, int gles_ver,
+ union virgl_caps *caps)
+{
+ if (gles_ver >= 30) {
+ caps->v1.glsl_level = 130;
+ } else {
+ caps->v1.glsl_level = 120;
+ }
+
+ if (gl_ver == 31)
+ caps->v1.glsl_level = 140;
+ else if (gl_ver == 32)
+ caps->v1.glsl_level = 150;
+ else if (gl_ver == 33)
+ caps->v1.glsl_level = 330;
+ else if (gl_ver == 40)
+ caps->v1.glsl_level = 400;
+ else if (gl_ver >= 41)
+ caps->v1.glsl_level = 410;
+ else
+ caps->v1.glsl_level = 130;
+}
+
/*
* Does all of the common caps setting,
* if it dedects a early out returns true.
@@ -7460,29 +7483,6 @@ static void vrend_renderer_fill_caps_v2_common(union virgl_caps *caps)
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, (GLint*)&caps->v2.uniform_buffer_offset_alignment);
}
-static void vrend_fill_caps_glsl_version(int gl_ver, int gles_ver,
- union virgl_caps *caps)
-{
- if (gles_ver >= 30) {
- caps->v1.glsl_level = 130;
- } else {
- caps->v1.glsl_level = 120;
- }
-
- if (gl_ver == 31)
- caps->v1.glsl_level = 140;
- else if (gl_ver == 32)
- caps->v1.glsl_level = 150;
- else if (gl_ver == 33)
- caps->v1.glsl_level = 330;
- else if (gl_ver == 40)
- caps->v1.glsl_level = 400;
- else if (gl_ver >= 41)
- caps->v1.glsl_level = 410;
- else
- caps->v1.glsl_level = 130;
-}
-
static void vrend_renderer_fill_caps_gl(bool fill_capset2, union virgl_caps *caps)
{
GLfloat range[2];
@@ -7539,8 +7539,8 @@ void vrend_renderer_fill_caps(uint32_t set, UNUSED uint32_t version,
gl_ver = epoxy_gl_version();
}
- vrend_renderer_fill_caps_common(caps);
vrend_fill_caps_glsl_version(gl_ver, gles_ver, caps);
+ vrend_renderer_fill_caps_common(caps);
if (!vrend_state.use_gles)
vrend_renderer_fill_caps_gl(fill_capset2, caps);
--
2.16.4
More information about the virglrenderer-devel
mailing list