mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Invalidate sampler with maxAnisotropy = 0
Bug: dawn:568 Change-Id: Ic0eee693a91153e2447c8f9830919f74c08fde48 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36320 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
9a38e5b60d
commit
86980018b3
@@ -20,12 +20,6 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace {
|
||||
uint16_t GetClampedMaxAnisotropy(uint16_t value) {
|
||||
return value >= 1u ? value : 1u;
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
namespace dawn_native {
|
||||
|
||||
MaybeError ValidateSamplerDescriptor(DeviceBase*, const SamplerDescriptor* descriptor) {
|
||||
@@ -54,6 +48,8 @@ namespace dawn_native {
|
||||
"min, mag, and mipmap filter should be linear when using anisotropic "
|
||||
"filtering");
|
||||
}
|
||||
} else if (descriptor->maxAnisotropy == 0u) {
|
||||
return DAWN_VALIDATION_ERROR("max anisotropy cannot be set to 0");
|
||||
}
|
||||
|
||||
DAWN_TRY(ValidateFilterMode(descriptor->minFilter));
|
||||
@@ -79,7 +75,7 @@ namespace dawn_native {
|
||||
mLodMinClamp(descriptor->lodMinClamp),
|
||||
mLodMaxClamp(descriptor->lodMaxClamp),
|
||||
mCompareFunction(descriptor->compare),
|
||||
mMaxAnisotropy(GetClampedMaxAnisotropy(descriptor->maxAnisotropy)) {
|
||||
mMaxAnisotropy(descriptor->maxAnisotropy) {
|
||||
}
|
||||
|
||||
SamplerBase::SamplerBase(DeviceBase* device, ObjectBase::ErrorTag tag)
|
||||
|
||||
Reference in New Issue
Block a user