-
Notifications
You must be signed in to change notification settings - Fork 977
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[naga wgsl-in] Allow abstract literals to be used as return values
- Loading branch information
1 parent
a8cc83e
commit 8b6fa54
Showing
6 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
fn return_i32_ai() -> i32 { | ||
return 1; | ||
} | ||
|
||
fn return_u32_ai() -> u32 { | ||
return 1; | ||
} | ||
|
||
fn return_f32_ai() -> f32 { | ||
return 1; | ||
} | ||
|
||
fn return_f32_af() -> f32 { | ||
return 1.0; | ||
} | ||
|
||
fn return_vec2f32_ai() -> vec2<f32> { | ||
return vec2(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// language: metal1.0 | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using metal::uint; | ||
|
||
|
||
int return_i32_ai( | ||
) { | ||
return 1; | ||
} | ||
|
||
uint return_u32_ai( | ||
) { | ||
return 1u; | ||
} | ||
|
||
float return_f32_ai( | ||
) { | ||
return 1.0; | ||
} | ||
|
||
float return_f32_af( | ||
) { | ||
return 1.0; | ||
} | ||
|
||
metal::float2 return_vec2f32_ai( | ||
) { | ||
return metal::float2(1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
; SPIR-V | ||
; Version: 1.1 | ||
; Generator: rspirv | ||
; Bound: 30 | ||
OpCapability Shader | ||
OpCapability Linkage | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
%2 = OpTypeVoid | ||
%3 = OpTypeInt 32 1 | ||
%4 = OpTypeInt 32 0 | ||
%5 = OpTypeFloat 32 | ||
%6 = OpTypeVector %5 2 | ||
%9 = OpTypeFunction %3 | ||
%10 = OpConstant %3 1 | ||
%14 = OpTypeFunction %4 | ||
%15 = OpConstant %4 1 | ||
%19 = OpTypeFunction %5 | ||
%20 = OpConstant %5 1.0 | ||
%27 = OpTypeFunction %6 | ||
%28 = OpConstantComposite %6 %20 %20 | ||
%8 = OpFunction %3 None %9 | ||
%7 = OpLabel | ||
OpBranch %11 | ||
%11 = OpLabel | ||
OpReturnValue %10 | ||
OpFunctionEnd | ||
%13 = OpFunction %4 None %14 | ||
%12 = OpLabel | ||
OpBranch %16 | ||
%16 = OpLabel | ||
OpReturnValue %15 | ||
OpFunctionEnd | ||
%18 = OpFunction %5 None %19 | ||
%17 = OpLabel | ||
OpBranch %21 | ||
%21 = OpLabel | ||
OpReturnValue %20 | ||
OpFunctionEnd | ||
%23 = OpFunction %5 None %19 | ||
%22 = OpLabel | ||
OpBranch %24 | ||
%24 = OpLabel | ||
OpReturnValue %20 | ||
OpFunctionEnd | ||
%26 = OpFunction %6 None %27 | ||
%25 = OpLabel | ||
OpBranch %29 | ||
%29 = OpLabel | ||
OpReturnValue %28 | ||
OpFunctionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
fn return_i32_ai() -> i32 { | ||
return 1i; | ||
} | ||
|
||
fn return_u32_ai() -> u32 { | ||
return 1u; | ||
} | ||
|
||
fn return_f32_ai() -> f32 { | ||
return 1f; | ||
} | ||
|
||
fn return_f32_af() -> f32 { | ||
return 1f; | ||
} | ||
|
||
fn return_vec2f32_ai() -> vec2<f32> { | ||
return vec2(1f); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters