mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 17:05:31 +00:00
Limit Clear Color Values to 2^24 For Integer Formats
Adds validation to ensure clear colors do not exceed 2^24 and a corresponding unit test. Also removes intermediate float conversions that are no longer necessary. Bug: dawn:525 Change-Id: I020b98de85384c20da51158de79eab87f60dcf6d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29040 Commit-Queue: Brandon Jones <brandon1.jones@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
da5828c06b
commit
16ebcf601d
@@ -935,11 +935,11 @@ namespace dawn_native { namespace opengl {
|
||||
gl.ClearBufferfv(GL_COLOR, i, appliedClearColor.data());
|
||||
} else if (attachmentFormat.HasComponentType(Format::Type::Uint)) {
|
||||
const std::array<uint32_t, 4> appliedClearColor =
|
||||
ConvertToFloatToUnsignedIntegerColor(attachmentInfo->clearColor);
|
||||
ConvertToUnsignedIntegerColor(attachmentInfo->clearColor);
|
||||
gl.ClearBufferuiv(GL_COLOR, i, appliedClearColor.data());
|
||||
} else if (attachmentFormat.HasComponentType(Format::Type::Sint)) {
|
||||
const std::array<int32_t, 4> appliedClearColor =
|
||||
ConvertToFloatToSignedIntegerColor(attachmentInfo->clearColor);
|
||||
ConvertToSignedIntegerColor(attachmentInfo->clearColor);
|
||||
gl.ClearBufferiv(GL_COLOR, i, appliedClearColor.data());
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
|
||||
Reference in New Issue
Block a user