With OES_viewport_array available the depth ranges can also be set on GLES. Fixes on GLES when run individually: KHR-GL41.viewport_array.* Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
@ -2302,16 +2302,11 @@ void vrend_set_viewport_states(struct vrend_context *ctx,
ctx->sub->vps[idx].near_val = near_val;
ctx->sub->vps[idx].far_val = far_val;
if (vrend_state.use_gles) {
if (near_val < 0.0f || far_val < 0.0f ||
near_val > 1.0f || far_val > 1.0f || idx) {
report_gles_warn(ctx, GLES_WARN_DEPTH_RANGE);
}
/* Best effort despite the warning, gles will clamp. */
glDepthRangef(ctx->sub->vps[idx].near_val, ctx->sub->vps[idx].far_val);
} else if (idx && has_feature(feat_viewport_array))
glDepthRangeIndexed(idx, ctx->sub->vps[idx].near_val, ctx->sub->vps[idx].far_val);
if (idx && has_feature(feat_viewport_array))
glDepthRangeIndexedfOES(idx, ctx->sub->vps[idx].near_val, ctx->sub->vps[idx].far_val);
} else
else
glDepthRange(ctx->sub->vps[idx].near_val, ctx->sub->vps[idx].far_val);