vrend, tex: Support fake multisample correctly

A texture is non-multisample when the nr_samples == 0, for the value 1
fake multisampling is assumed and a GL_TEXTURE_2D_MULTISAMPLE should be
created.

Closes: #44

Fixes dEQP tests that pass on the host when run with softpipe:
  dEQP-GLES31.functional.shaders.builtin_functions.texture_size.
    samples_1_texture_2d
    samples_1_texture_2d_array Pass -> Fail
    samples_1_texture_int_2d Pass -> Fail
    samples_1_texture_int_2d_array Pass -> Fail
    samples_1_texture_uint_2d Pass -> Fail
    samples_1_texture_uint_2d_array Pass -> Fail
  dEQP-GLES31.functional.texture.multisample.samples_1.
    sample_position
    use_texture_color_2d
    use_texture_color_2d_array
    use_texture_depth_2d
    use_texture_depth_2d_array
    use_texture_int_2d
    use_texture_int_2d_array
    use_texture_uint_2d
    use_texture_uint_2d_array

Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 6 years ago committed by Jakob Bornecrantz
parent c5930371b8
commit 584a1e20fb
  1. 6
      src/vrend_renderer.c

@ -4974,7 +4974,7 @@ static GLenum tgsitargettogltarget(const enum pipe_texture_target target, int nr
case PIPE_TEXTURE_1D:
return GL_TEXTURE_1D;
case PIPE_TEXTURE_2D:
return (nr_samples > 1) ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
return (nr_samples > 0) ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
case PIPE_TEXTURE_3D:
return GL_TEXTURE_3D;
case PIPE_TEXTURE_RECT:
@ -4985,7 +4985,7 @@ static GLenum tgsitargettogltarget(const enum pipe_texture_target target, int nr
case PIPE_TEXTURE_1D_ARRAY:
return GL_TEXTURE_1D_ARRAY;
case PIPE_TEXTURE_2D_ARRAY:
return (nr_samples > 1) ? GL_TEXTURE_2D_MULTISAMPLE_ARRAY : GL_TEXTURE_2D_ARRAY;
return (nr_samples > 0) ? GL_TEXTURE_2D_MULTISAMPLE_ARRAY : GL_TEXTURE_2D_ARRAY;
case PIPE_TEXTURE_CUBE_ARRAY:
return GL_TEXTURE_CUBE_MAP_ARRAY;
case PIPE_BUFFER:
@ -5635,7 +5635,7 @@ static int vrend_renderer_resource_allocate_texture(struct vrend_resource *gr,
FREE(gr);
return EINVAL;
}
} else if (pr->nr_samples > 1) {
} else if (pr->nr_samples > 0) {
if (vrend_state.use_gles || has_feature(feat_texture_storage)) {
if (gr->target == GL_TEXTURE_2D_MULTISAMPLE) {
glTexStorage2DMultisample(gr->target, pr->nr_samples,

Loading…
Cancel
Save