diff --git a/tests/in/math-functions.wgsl b/tests/in/math-functions.wgsl index a298a5e2b9..38e9acee94 100644 --- a/tests/in/math-functions.wgsl +++ b/tests/in/math-functions.wgsl @@ -6,4 +6,5 @@ fn main() { let b = radians(f); let c = degrees(v); let d = radians(v); + let const_dot = dot(vec2(), vec2()); } diff --git a/tests/out/glsl/math-functions.main.Vertex.glsl b/tests/out/glsl/math-functions.main.Vertex.glsl index b69069b382..02a94ea69d 100644 --- a/tests/out/glsl/math-functions.main.Vertex.glsl +++ b/tests/out/glsl/math-functions.main.Vertex.glsl @@ -10,5 +10,6 @@ void main() { float b = radians(1.0); vec4 c = degrees(v); vec4 d = radians(v); + int const_dot = ( + ivec2(0, 0).x * ivec2(0, 0).x + ivec2(0, 0).y * ivec2(0, 0).y); } diff --git a/tests/out/hlsl/math-functions.hlsl b/tests/out/hlsl/math-functions.hlsl index 584c4c4ffd..b17a32cf41 100644 --- a/tests/out/hlsl/math-functions.hlsl +++ b/tests/out/hlsl/math-functions.hlsl @@ -6,4 +6,5 @@ void main() float b = radians(1.0); float4 c = degrees(v); float4 d = radians(v); + int const_dot = dot(int2(0, 0), int2(0, 0)); } diff --git a/tests/out/msl/math-functions.msl b/tests/out/msl/math-functions.msl index fe1fd5573f..e08894037e 100644 --- a/tests/out/msl/math-functions.msl +++ b/tests/out/msl/math-functions.msl @@ -4,6 +4,7 @@ using metal::uint; +constant metal::int2 const_type = {0, 0}; vertex void main_( ) { @@ -12,4 +13,5 @@ vertex void main_( float b = ((1.0) * 0.017453292519943295474); metal::float4 c = ((v) * 57.295779513082322865); metal::float4 d = ((v) * 0.017453292519943295474); + int const_dot = ( + const_type.x * const_type.x + const_type.y * const_type.y); } diff --git a/tests/out/spv/math-functions.spvasm b/tests/out/spv/math-functions.spvasm index 738ac6a728..03b4a04234 100644 --- a/tests/out/spv/math-functions.spvasm +++ b/tests/out/spv/math-functions.spvasm @@ -1,25 +1,38 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 16 +; Bound: 29 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %7 "main" +OpEntryPoint Vertex %11 "main" %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpConstant %4 1.0 %5 = OpConstant %4 0.0 -%8 = OpTypeFunction %2 -%10 = OpTypeVector %4 4 -%7 = OpFunction %2 None %8 -%6 = OpLabel -OpBranch %9 -%9 = OpLabel -%11 = OpCompositeConstruct %10 %5 %5 %5 %5 -%12 = OpExtInst %4 %1 Degrees %3 -%13 = OpExtInst %4 %1 Radians %3 -%14 = OpExtInst %10 %1 Degrees %11 -%15 = OpExtInst %10 %1 Radians %11 +%7 = OpTypeInt 32 1 +%6 = OpConstant %7 0 +%8 = OpTypeVector %7 2 +%9 = OpConstantComposite %8 %6 %6 +%12 = OpTypeFunction %2 +%14 = OpTypeVector %4 4 +%21 = OpConstantNull %7 +%11 = OpFunction %2 None %12 +%10 = OpLabel +OpBranch %13 +%13 = OpLabel +%15 = OpCompositeConstruct %14 %5 %5 %5 %5 +%16 = OpExtInst %4 %1 Degrees %3 +%17 = OpExtInst %4 %1 Radians %3 +%18 = OpExtInst %14 %1 Degrees %15 +%19 = OpExtInst %14 %1 Radians %15 +%22 = OpCompositeExtract %7 %9 0 +%23 = OpCompositeExtract %7 %9 0 +%24 = OpIMul %7 %22 %23 +%25 = OpIAdd %7 %21 %24 +%26 = OpCompositeExtract %7 %9 1 +%27 = OpCompositeExtract %7 %9 1 +%28 = OpIMul %7 %26 %27 +%20 = OpIAdd %7 %25 %28 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/wgsl/math-functions.wgsl b/tests/out/wgsl/math-functions.wgsl index c87270742c..2be33d5647 100644 --- a/tests/out/wgsl/math-functions.wgsl +++ b/tests/out/wgsl/math-functions.wgsl @@ -5,4 +5,5 @@ fn main() { let b = radians(1.0); let c = degrees(v); let d = radians(v); + let const_dot = dot(vec2(0, 0), vec2(0, 0)); }