mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
Implement the device error callback.
This adds support for "natively defined" API types like callbacks that will have to be implemented manually for each target language. Also this splits the concept of "native method" into a set of native methods per language. Removes the "Synchronous error" concept that was used to make builders work in the maybe Monad, this will have to be reinroduced with builder callbacks.
This commit is contained in:
committed by
Corentin Wallez
parent
682a8250b3
commit
4b410a33ca
@@ -64,7 +64,7 @@ namespace nxt {
|
||||
{{as_varName(arg.name)}}.Get()
|
||||
{%- elif arg.type.category == "enum" or arg.type.category == "bitmask" -%}
|
||||
static_cast<{{as_cType(arg.type.name)}}>({{as_varName(arg.name)}})
|
||||
{%- elif arg.type.category == "native" -%}
|
||||
{%- elif arg.type.category in ["native", "natively defined"] -%}
|
||||
{{as_varName(arg.name)}}
|
||||
{%- else -%}
|
||||
UNHANDLED
|
||||
@@ -76,7 +76,7 @@ namespace nxt {
|
||||
)
|
||||
{%- endmacro %}
|
||||
|
||||
{% for method in type.methods %}
|
||||
{% for method in native_methods(type) %}
|
||||
{{render_cpp_method_declaration(type, method)}} {
|
||||
{% if method.return_type.name.concatcase() == "void" %}
|
||||
{{render_cpp_to_c_method_call(type, method)}};
|
||||
|
||||
Reference in New Issue
Block a user