[virglrenderer-devel] [PATCH] Enable texture_multisample for GLES
Tomeu Vizoso
tomeu.vizoso at collabora.com
Tue May 15 12:44:58 UTC 2018
Just set the cap if we have GLES 3.0 and call the
glTexStorage*DMultisample functions as appropriate.
Causes a bunch of the tests in
dEQP-GLES3.functional.fbo.msaa.*_samples to pass.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---
src/vrend_renderer.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index f60cf415fbf7..da9e1af18a78 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -4678,15 +4678,25 @@ int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *a
if (args->nr_samples > 1) {
if (vrend_state.use_gles) {
- report_gles_missing_func(NULL, "glTexImage[2,3]DMultisample");
- } else if (gr->target == GL_TEXTURE_2D_MULTISAMPLE) {
- glTexImage2DMultisample(gr->target, args->nr_samples,
- internalformat, args->width, args->height,
- GL_TRUE);
+ if (gr->target == GL_TEXTURE_2D_MULTISAMPLE) {
+ glTexStorage2DMultisample(gr->target, args->nr_samples,
+ internalformat, args->width, args->height,
+ GL_TRUE);
+ } else {
+ glTexStorage3DMultisample(gr->target, args->nr_samples,
+ internalformat, args->width, args->height, args->array_size,
+ GL_TRUE);
+ }
} else {
- glTexImage3DMultisample(gr->target, args->nr_samples,
- internalformat, args->width, args->height, args->array_size,
- GL_TRUE);
+ if (gr->target == GL_TEXTURE_2D_MULTISAMPLE) {
+ glTexImage2DMultisample(gr->target, args->nr_samples,
+ internalformat, args->width, args->height,
+ GL_TRUE);
+ } else {
+ glTexImage3DMultisample(gr->target, args->nr_samples,
+ internalformat, args->width, args->height, args->array_size,
+ GL_TRUE);
+ }
}
} else if (gr->target == GL_TEXTURE_CUBE_MAP) {
@@ -6722,8 +6732,6 @@ void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t version,
caps->v1.bset.seamless_cube_map_per_texture = 0;
- caps->v1.bset.texture_multisample = 0;
-
caps->v1.bset.mirror_clamp = 0;
caps->v1.bset.indep_blend_func = 0;
caps->v1.bset.cube_map_array = 0;
@@ -6768,6 +6776,10 @@ void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t version,
}
}
+ if (gles_ver >= 30) {
+ caps->v1.bset.texture_multisample = 1;
+ }
+
if (!fill_capset2) {
return;
}
--
2.17.0
More information about the virglrenderer-devel
mailing list