vrend: Call glDepthRange if we move from default value

Virglrender holds the values in a structure vrend_sub_context that is zeroed
out when it is initialized.
So, when the first state change set the near_val and far_val to zero,
the check assumes it is the old state and doesn't call glDepthRange.

Fixes: dEQP-GLES2.functional.depth_range.write.zero_to_zero

v2: initialize far_val in vrend_renderer_create_sub_ctx (Gurchetan)

Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Elie Tournier 6 years ago committed by Jakob Bornecrantz
parent 4baf9b6a9e
commit 0cca6d6b48
  1. 6
      src/vrend_renderer.c

@ -7302,6 +7302,7 @@ void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
{ {
struct vrend_sub_context *sub; struct vrend_sub_context *sub;
struct virgl_gl_ctx_param ctx_params; struct virgl_gl_ctx_param ctx_params;
GLuint i;
LIST_FOR_EACH_ENTRY(sub, &ctx->sub_ctxs, head) { LIST_FOR_EACH_ENTRY(sub, &ctx->sub_ctxs, head) {
if (sub->sub_ctx_id == sub_ctx_id) { if (sub->sub_ctx_id == sub_ctx_id) {
@ -7328,6 +7329,11 @@ void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
sub->sub_ctx_id = sub_ctx_id; sub->sub_ctx_id = sub_ctx_id;
/* initialize the depth far_val to 1 */
for (i = 0; i < PIPE_MAX_VIEWPORTS; i++) {
sub->vps[i].far_val = 1.0;
}
if (!vrend_state.have_gles31_vertex_attrib_binding) { if (!vrend_state.have_gles31_vertex_attrib_binding) {
glGenVertexArrays(1, &sub->vaoid); glGenVertexArrays(1, &sub->vaoid);
glBindVertexArray(sub->vaoid); glBindVertexArray(sub->vaoid);

Loading…
Cancel
Save