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>
diff --git a/generator/templates/dawn_native/ProcTable.cpp b/generator/templates/dawn_native/ProcTable.cpp
index 21c2926..6ef8416 100644
--- a/generator/templates/dawn_native/ProcTable.cpp
+++ b/generator/templates/dawn_native/ProcTable.cpp
@@ -159,7 +159,11 @@
                         {%- 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 %}