mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 17:05:31 +00:00
Add support for depthBias, depthBiasSlope, and depthBiasClamp
Bug: dawn:524 Change-Id: I2586aadbc326f58889314a2d10794bcc0572aaba Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28300 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
326e14f34b
commit
db2c2dd9b9
@@ -264,6 +264,19 @@ namespace dawn_native { namespace opengl {
|
||||
gl.Disable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
}
|
||||
|
||||
if (IsDepthBiasEnabled()) {
|
||||
gl.Enable(GL_POLYGON_OFFSET_FILL);
|
||||
float depthBias = GetDepthBias();
|
||||
float slopeScale = GetDepthBiasSlopeScale();
|
||||
if (gl.PolygonOffsetClamp != nullptr) {
|
||||
gl.PolygonOffsetClamp(slopeScale, depthBias, GetDepthBiasClamp());
|
||||
} else {
|
||||
gl.PolygonOffset(slopeScale, depthBias);
|
||||
}
|
||||
} else {
|
||||
gl.Disable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
|
||||
for (ColorAttachmentIndex attachmentSlot : IterateBitSet(GetColorAttachmentsMask())) {
|
||||
ApplyColorState(gl, attachmentSlot, GetColorStateDescriptor(attachmentSlot));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user