vrend: always set CLAMP_READ_COLOR to false in do_readpixels

Some paths don't emit rasterizer state or framebuffer state before calling
do_readpixels, and because of that the clamping is not done properly.

Fixes 0d84775435
Fixes several piglit snorm tests.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Italo Nicola 3 years ago committed by Gert Wollny
parent 729c6b9177
commit 5d2202fcb6
  1. 10
      src/vrend_renderer.c

@ -5805,11 +5805,6 @@ static void vrend_hw_emit_rs(struct vrend_context *ctx)
report_core_warn(ctx, CORE_PROFILE_WARN_CLAMP); report_core_warn(ctx, CORE_PROFILE_WARN_CLAMP);
} }
/* read-color-clamping is handled in the mesa frontend */
if (!vrend_state.use_gles) {
glClampColor(GL_CLAMP_READ_COLOR_ARB, GL_FALSE);
}
if (has_feature(feat_multisample)) { if (has_feature(feat_multisample)) {
if (has_feature(feat_sample_mask)) { if (has_feature(feat_sample_mask)) {
if (state->multisample) if (state->multisample)
@ -8073,6 +8068,11 @@ static void do_readpixels(struct vrend_resource *res,
} }
} }
/* read-color clamping is handled in the mesa frontend */
if (!vrend_state.use_gles) {
glClampColor(GL_CLAMP_READ_COLOR_ARB, GL_FALSE);
}
if (has_feature(feat_arb_robustness)) if (has_feature(feat_arb_robustness))
glReadnPixelsARB(x, y, width, height, format, type, bufSize, data); glReadnPixelsARB(x, y, width, height, format, type, bufSize, data);
else if (has_feature(feat_gles_khr_robustness)) else if (has_feature(feat_gles_khr_robustness))

Loading…
Cancel
Save