Commit 22d7db6e by Brandon Schade Committed by Commit Bot

Vulkan: Change sampleCoverage calculation

When emulating the sample coverage to a mask, truncate the value. Test: dEQP-GLES3.functional.multisample.fbo*sample_coverage* Bug: angleproject:4568 Change-Id: Ie0f9fee7dc7cf08e2289ff24f0fa69f9929c4ae3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2433069 Commit-Queue: Brandon Schade <b.schade@samsung.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent 6136cbcb
...@@ -165,8 +165,18 @@ uint32_t GetCoverageSampleCount(const gl::State &glState, FramebufferVk *drawFra ...@@ -165,8 +165,18 @@ uint32_t GetCoverageSampleCount(const gl::State &glState, FramebufferVk *drawFra
} }
// Get a fraction of the samples based on the coverage parameters. // Get a fraction of the samples based on the coverage parameters.
return static_cast<uint32_t>( // There are multiple ways to obtain an integer value from a float -
std::round(glState.getSampleCoverageValue() * drawFramebuffer->getSamples())); // truncation, ceil and round
//
// round() provides a more even distribution of values but doesn't seem to play well
// with all vendors (AMD). A way to work around this is to increase the comparison threshold
// of deqp tests. Though this takes care of deqp tests other apps would still have issues.
//
// Truncation provides an uneven distribution near the edges of the interval but seems to
// play well with all vendors.
//
// We are going with truncation for expediency.
return static_cast<uint32_t>(glState.getSampleCoverageValue() * drawFramebuffer->getSamples());
} }
void ApplySampleCoverage(const gl::State &glState, void ApplySampleCoverage(const gl::State &glState,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment