mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Make Dawn error macro more explicit and have an "error type"
The error type will help distinguish between validation errors, context losts and others which should be handled differently. Take advantage of advantage of this to change DAWN_RETURN_ERROR to "return DAWN_FOO_ERROR" to have the return be more explicit. Also removes usage of DAWN_TRY_ASSERT for more explicit checks. Change-Id: Icbce16b0c8d8eb084b0af2fc132acee776909a36
This commit is contained in:
committed by
Corentin Wallez
parent
cca9c698a0
commit
6fee61ca9c
@@ -20,7 +20,9 @@
|
||||
namespace dawn_native {
|
||||
|
||||
MaybeError ValidateSamplerDescriptor(DeviceBase*, const SamplerDescriptor* descriptor) {
|
||||
DAWN_TRY_ASSERT(descriptor->nextInChain == nullptr, "nextInChain must be nullptr");
|
||||
if (descriptor->nextInChain != nullptr) {
|
||||
return DAWN_VALIDATION_ERROR("nextInChain must be nullptr");
|
||||
}
|
||||
DAWN_TRY(ValidateFilterMode(descriptor->minFilter));
|
||||
DAWN_TRY(ValidateFilterMode(descriptor->magFilter));
|
||||
DAWN_TRY(ValidateFilterMode(descriptor->mipmapFilter));
|
||||
|
||||
Reference in New Issue
Block a user