mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
tint: Add builtin type aliases (vec3f, etc)
Fixed: tint:1772 Change-Id: I4bed36ded91ca5288875ed6ea819ff4bbb432186 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112340 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
5798f2d021
commit
d5d207ba9f
10
test/tint/shadowing/alias/builtin/const.wgsl
Normal file
10
test/tint/shadowing/alias/builtin/const.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
type a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
const vec3f = 1;
|
||||
const b = vec3f;
|
||||
}
|
||||
const c = a();
|
||||
const d = vec3f();
|
||||
}
|
||||
10
test/tint/shadowing/alias/builtin/const.wgsl.expected.wgsl
Normal file
10
test/tint/shadowing/alias/builtin/const.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
type a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
const vec3f = 1;
|
||||
const b = vec3f;
|
||||
}
|
||||
const c = a();
|
||||
const d = vec3f();
|
||||
}
|
||||
10
test/tint/shadowing/alias/builtin/let.wgsl
Normal file
10
test/tint/shadowing/alias/builtin/let.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
type a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
let vec3f = 1;
|
||||
let b = vec3f;
|
||||
}
|
||||
let c = a();
|
||||
let d = vec3f();
|
||||
}
|
||||
13
test/tint/shadowing/alias/builtin/let.wgsl.expected.dxc.hlsl
Normal file
13
test/tint/shadowing/alias/builtin/let.wgsl.expected.dxc.hlsl
Normal file
@@ -0,0 +1,13 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
const int vec3f = 1;
|
||||
const int b = vec3f;
|
||||
}
|
||||
const float3 c = (0.0f).xxx;
|
||||
const float3 d = (0.0f).xxx;
|
||||
}
|
||||
13
test/tint/shadowing/alias/builtin/let.wgsl.expected.fxc.hlsl
Normal file
13
test/tint/shadowing/alias/builtin/let.wgsl.expected.fxc.hlsl
Normal file
@@ -0,0 +1,13 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
const int vec3f = 1;
|
||||
const int b = vec3f;
|
||||
}
|
||||
const float3 c = (0.0f).xxx;
|
||||
const float3 d = (0.0f).xxx;
|
||||
}
|
||||
15
test/tint/shadowing/alias/builtin/let.wgsl.expected.glsl
Normal file
15
test/tint/shadowing/alias/builtin/let.wgsl.expected.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
void f() {
|
||||
{
|
||||
int vec3f = 1;
|
||||
int b = vec3f;
|
||||
}
|
||||
vec3 c = vec3(0.0f);
|
||||
vec3 d = vec3(0.0f);
|
||||
}
|
||||
|
||||
12
test/tint/shadowing/alias/builtin/let.wgsl.expected.msl
Normal file
12
test/tint/shadowing/alias/builtin/let.wgsl.expected.msl
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
{
|
||||
int const vec3f = 1;
|
||||
int const b = vec3f;
|
||||
}
|
||||
float3 const c = float3(0.0f);
|
||||
float3 const d = float3(0.0f);
|
||||
}
|
||||
|
||||
26
test/tint/shadowing/alias/builtin/let.wgsl.expected.spvasm
Normal file
26
test/tint/shadowing/alias/builtin/let.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,26 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %f "f"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%11 = OpConstantNull %v3float
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
10
test/tint/shadowing/alias/builtin/let.wgsl.expected.wgsl
Normal file
10
test/tint/shadowing/alias/builtin/let.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
type a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
let vec3f = 1;
|
||||
let b = vec3f;
|
||||
}
|
||||
let c = a();
|
||||
let d = vec3f();
|
||||
}
|
||||
3
test/tint/shadowing/alias/builtin/param.wgsl
Normal file
3
test/tint/shadowing/alias/builtin/param.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f(vec3f : vec3f) {
|
||||
let b = vec3f;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f(float3 vec3f) {
|
||||
const float3 b = vec3f;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f(float3 vec3f) {
|
||||
const float3 b = vec3f;
|
||||
}
|
||||
10
test/tint/shadowing/alias/builtin/param.wgsl.expected.glsl
Normal file
10
test/tint/shadowing/alias/builtin/param.wgsl.expected.glsl
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 310 es
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
void f(vec3 vec3f) {
|
||||
vec3 b = vec3f;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f(float3 vec3f) {
|
||||
float3 const b = vec3f;
|
||||
}
|
||||
|
||||
26
test/tint/shadowing/alias/builtin/param.wgsl.expected.spvasm
Normal file
26
test/tint/shadowing/alias/builtin/param.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,26 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 11
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %f "f"
|
||||
OpName %vec3f "vec3f"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%5 = OpTypeFunction %void %v3float
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %5
|
||||
%vec3f = OpFunctionParameter %v3float
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,3 @@
|
||||
fn f(vec3f : vec3f) {
|
||||
let b = vec3f;
|
||||
}
|
||||
10
test/tint/shadowing/alias/builtin/var.wgsl
Normal file
10
test/tint/shadowing/alias/builtin/var.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
type a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
var vec3f = 1;
|
||||
var b = vec3f;
|
||||
}
|
||||
var c = a();
|
||||
var d = vec3f();
|
||||
}
|
||||
13
test/tint/shadowing/alias/builtin/var.wgsl.expected.dxc.hlsl
Normal file
13
test/tint/shadowing/alias/builtin/var.wgsl.expected.dxc.hlsl
Normal file
@@ -0,0 +1,13 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
int vec3f = 1;
|
||||
int b = vec3f;
|
||||
}
|
||||
float3 c = (0.0f).xxx;
|
||||
float3 d = (0.0f).xxx;
|
||||
}
|
||||
13
test/tint/shadowing/alias/builtin/var.wgsl.expected.fxc.hlsl
Normal file
13
test/tint/shadowing/alias/builtin/var.wgsl.expected.fxc.hlsl
Normal file
@@ -0,0 +1,13 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
int vec3f = 1;
|
||||
int b = vec3f;
|
||||
}
|
||||
float3 c = (0.0f).xxx;
|
||||
float3 d = (0.0f).xxx;
|
||||
}
|
||||
15
test/tint/shadowing/alias/builtin/var.wgsl.expected.glsl
Normal file
15
test/tint/shadowing/alias/builtin/var.wgsl.expected.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
void f() {
|
||||
{
|
||||
int vec3f = 1;
|
||||
int b = vec3f;
|
||||
}
|
||||
vec3 c = vec3(0.0f);
|
||||
vec3 d = vec3(0.0f);
|
||||
}
|
||||
|
||||
12
test/tint/shadowing/alias/builtin/var.wgsl.expected.msl
Normal file
12
test/tint/shadowing/alias/builtin/var.wgsl.expected.msl
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
{
|
||||
int vec3f = 1;
|
||||
int b = vec3f;
|
||||
}
|
||||
float3 c = float3(0.0f);
|
||||
float3 d = float3(0.0f);
|
||||
}
|
||||
|
||||
42
test/tint/shadowing/alias/builtin/var.wgsl.expected.spvasm
Normal file
42
test/tint/shadowing/alias/builtin/var.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,42 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 20
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %f "f"
|
||||
OpName %vec3f "vec3f"
|
||||
OpName %b "b"
|
||||
OpName %c "c"
|
||||
OpName %d "d"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%11 = OpConstantNull %int
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%16 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
%vec3f = OpVariable %_ptr_Function_int Function %11
|
||||
%b = OpVariable %_ptr_Function_int Function %11
|
||||
%c = OpVariable %_ptr_Function_v3float Function %16
|
||||
%d = OpVariable %_ptr_Function_v3float Function %16
|
||||
OpStore %vec3f %int_1
|
||||
%12 = OpLoad %int %vec3f
|
||||
OpStore %b %12
|
||||
OpStore %c %16
|
||||
OpStore %d %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
10
test/tint/shadowing/alias/builtin/var.wgsl.expected.wgsl
Normal file
10
test/tint/shadowing/alias/builtin/var.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
type a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
var vec3f = 1;
|
||||
var b = vec3f;
|
||||
}
|
||||
var c = a();
|
||||
var d = vec3f();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
}
|
||||
}
|
||||
11
test/tint/shadowing/alias/user/const.wgsl.expected.glsl
Normal file
11
test/tint/shadowing/alias/user/const.wgsl.expected.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
void f() {
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
8
test/tint/shadowing/alias/user/const.wgsl.expected.msl
Normal file
8
test/tint/shadowing/alias/user/const.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
21
test/tint/shadowing/alias/user/const.wgsl.expected.spvasm
Normal file
21
test/tint/shadowing/alias/user/const.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,21 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 7
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %f "f"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
Reference in New Issue
Block a user