From 07e45addf4151844f3f43b989024c69f8082b492 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 31 Oct 2024 21:41:12 -0700 Subject: [PATCH] Add `lerp` for wgsl. (#5472) --- source/slang/hlsl.meta.slang | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 747446bbdb..525b666ab0 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -9616,12 +9616,12 @@ T length(T x) /// @category math __generic [__readNone] -[require(cpp_cuda_glsl_hlsl_metal_spirv, sm_4_0_version)] T lerp(T x, T y, T s) { __target_switch { case glsl: __intrinsic_asm "mix"; + case wgsl: __intrinsic_asm "mix"; case metal: __intrinsic_asm "mix"; case hlsl: __intrinsic_asm "lerp"; case spirv: return spirv_asm { @@ -9634,12 +9634,12 @@ T lerp(T x, T y, T s) __generic [__readNone] -[require(cpp_cuda_glsl_hlsl_metal_spirv, sm_4_0_version)] vector lerp(vector x, vector y, vector s) { __target_switch { case glsl: __intrinsic_asm "mix"; + case wgsl: __intrinsic_asm "mix"; case metal: __intrinsic_asm "mix"; case hlsl: __intrinsic_asm "lerp"; case spirv: return spirv_asm { @@ -9652,7 +9652,6 @@ vector lerp(vector x, vector y, vector s) __generic [__readNone] -[require(cpp_cuda_glsl_hlsl_metal_spirv, sm_4_0_version)] matrix lerp(matrix x, matrix y, matrix s) { __target_switch