ProcTable: only cast the return value if needed.

Fence::GetCompletedValue introduced the first return value that's not an
object which reinterpret_cast to its own type. MSVC complains about it,
so instead we reinterpret_cast only if the value is an object.

BUG=

Change-Id: I35225cd1ff47a91868572a45a67ebe979e4b064f
Reviewed-on: https://dawn-review.googlesource.com/c/2942
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-12-06 10:43:33 +00:00 committed by Commit Bot service account
parent bdd887fce7
commit 5aacd29d5e
1 changed files with 5 additions and 1 deletions

View File

@ -159,7 +159,11 @@ namespace dawn_native {
{%- endfor -%}
);
{% if method.return_type.name.canonical_case() != "void" %}
return reinterpret_cast<{{as_cType(method.return_type.name)}}>(result);
{% if method.return_type.category == "object" %}
return reinterpret_cast<{{as_cType(method.return_type.name)}}>(result);
{% else %}
return result;
{% endif %}
{% endif %}
}
{% endfor %}