From 6d9ee4254bd3a24298a2e0fd1c494d8a8d333ee1 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Mon, 10 Jan 2022 15:23:21 +0000 Subject: [PATCH] dawn_node: handle literals on typdef'd interface members Bug: dawn:1123 Change-Id: Ie7f388a0322b195937aa76ab30b1513ca642b572 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75901 Reviewed-by: Ben Clayton Commit-Queue: Corentin Wallez --- src/dawn_node/interop/WebGPUCommon.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dawn_node/interop/WebGPUCommon.tmpl b/src/dawn_node/interop/WebGPUCommon.tmpl index 8630773563..c47c097f5e 100644 --- a/src/dawn_node/interop/WebGPUCommon.tmpl +++ b/src/dawn_node/interop/WebGPUCommon.tmpl @@ -84,9 +84,10 @@ See: {{- if IsDefaultDictionaryLiteral $.Value}}{{template "Type" $.Type}}{} {{- else if IsTypeName $.Type }} {{- $ty := Lookup $.Type.Name}} -{{- if IsEnum $ty }}{{$.Type.Name}}::{{EnumEntryName $.Value.Value}} +{{- if IsTypedef $ty }}{{Eval "Literal" "Value" $.Value "Type" $ty.Type}} +{{- else if IsEnum $ty }}{{$.Type.Name}}::{{EnumEntryName $.Value.Value}} {{- else if IsBasicLiteral $.Value }}{{$.Value.Value}} -{{- else }}/* Unhandled Type {{printf "ty: %v $.Type.Name: %T $.Value: %T" $ty $.Type.Name $.Value}} */ +{{- else }}/* Unhandled Type {{printf "ty: %T $.Type.Name: %T $.Value: %T" $ty $.Type.Name $.Value}} */ {{- end }} {{- else if IsSequenceType $.Type }}{{template "Type" $.Type}}{} {{- /* TODO: Assumes the initialiser is empty */}} {{- else if IsBasicLiteral $.Value }}{{$.Value.Value}}