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:
Corentin Wallez
2018-09-10 16:17:24 +02:00
committed by Corentin Wallez
parent cca9c698a0
commit 6fee61ca9c
16 changed files with 132 additions and 86 deletions

View File

@@ -117,19 +117,19 @@ namespace dawn_native {
ASSERT(aspects.any());
if (aspects[VALIDATION_ASPECT_INDEX_BUFFER]) {
DAWN_RETURN_ERROR("Missing index buffer");
return DAWN_VALIDATION_ERROR("Missing index buffer");
}
if (aspects[VALIDATION_ASPECT_VERTEX_BUFFERS]) {
DAWN_RETURN_ERROR("Missing vertex buffer");
return DAWN_VALIDATION_ERROR("Missing vertex buffer");
}
if (aspects[VALIDATION_ASPECT_BIND_GROUPS]) {
DAWN_RETURN_ERROR("Missing bind group");
return DAWN_VALIDATION_ERROR("Missing bind group");
}
if (aspects[VALIDATION_ASPECT_PIPELINE]) {
DAWN_RETURN_ERROR("Missing pipeline");
return DAWN_VALIDATION_ERROR("Missing pipeline");
}
UNREACHABLE();