-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See: gpuweb/gpuweb#1901 Bug: tint:950 Change-Id: I6f00ab753a2ddf2374352ddf636e1abfebe86ba7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56777 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
- Loading branch information
1 parent
892aaf3
commit b045521
Showing
23 changed files
with
1,833 additions
and
1,240 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -88,6 +88,7 @@ enum class IntrinsicType { | |
kPack4x8unorm, | ||
kPow, | ||
kReflect, | ||
kRefract, | ||
kReverseBits, | ||
kRound, | ||
kSelect, | ||
|
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
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,45 @@ | ||
// Copyright 2021 The Tint Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// File generated by tools/intrinsic-gen | ||
// using the template: | ||
// test/intrinsics/intrinsics.wgsl.tmpl | ||
// and the intrinsic defintion file: | ||
// src/intrinsics.def | ||
// | ||
// Do not modify this file directly | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
// fn refract(vec<4, f32>, vec<4, f32>, f32) -> vec<4, f32> | ||
fn refract_7e02e6() { | ||
var res: vec4<f32> = refract(vec4<f32>(), vec4<f32>(), 1.0); | ||
} | ||
|
||
[[stage(vertex)]] | ||
fn vertex_main() -> [[builtin(position)]] vec4<f32> { | ||
refract_7e02e6(); | ||
return vec4<f32>(); | ||
} | ||
|
||
[[stage(fragment)]] | ||
fn fragment_main() { | ||
refract_7e02e6(); | ||
} | ||
|
||
[[stage(compute), workgroup_size(1)]] | ||
fn compute_main() { | ||
refract_7e02e6(); | ||
} |
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,24 @@ | ||
void refract_7e02e6() { | ||
float4 res = refract(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), 1.0f); | ||
} | ||
|
||
struct tint_symbol { | ||
float4 value : SV_Position; | ||
}; | ||
|
||
tint_symbol vertex_main() { | ||
refract_7e02e6(); | ||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; | ||
return tint_symbol_1; | ||
} | ||
|
||
void fragment_main() { | ||
refract_7e02e6(); | ||
return; | ||
} | ||
|
||
[numthreads(1, 1, 1)] | ||
void compute_main() { | ||
refract_7e02e6(); | ||
return; | ||
} |
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,27 @@ | ||
#include <metal_stdlib> | ||
|
||
using namespace metal; | ||
struct tint_symbol { | ||
float4 value [[position]]; | ||
}; | ||
|
||
void refract_7e02e6() { | ||
float4 res = refract(float4(), float4(), 1.0f); | ||
} | ||
|
||
vertex tint_symbol vertex_main() { | ||
refract_7e02e6(); | ||
tint_symbol const tint_symbol_1 = {.value=float4()}; | ||
return tint_symbol_1; | ||
} | ||
|
||
fragment void fragment_main() { | ||
refract_7e02e6(); | ||
return; | ||
} | ||
|
||
kernel void compute_main() { | ||
refract_7e02e6(); | ||
return; | ||
} | ||
|
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,67 @@ | ||
; SPIR-V | ||
; Version: 1.3 | ||
; Generator: Google Tint Compiler; 0 | ||
; Bound: 32 | ||
; Schema: 0 | ||
OpCapability Shader | ||
%14 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 | ||
OpEntryPoint Fragment %fragment_main "fragment_main" | ||
OpEntryPoint GLCompute %compute_main "compute_main" | ||
OpExecutionMode %fragment_main OriginUpperLeft | ||
OpExecutionMode %compute_main LocalSize 1 1 1 | ||
OpName %tint_pointsize "tint_pointsize" | ||
OpName %tint_symbol_1 "tint_symbol_1" | ||
OpName %refract_7e02e6 "refract_7e02e6" | ||
OpName %res "res" | ||
OpName %tint_symbol_2 "tint_symbol_2" | ||
OpName %tint_symbol "tint_symbol" | ||
OpName %vertex_main "vertex_main" | ||
OpName %fragment_main "fragment_main" | ||
OpName %compute_main "compute_main" | ||
OpDecorate %tint_pointsize BuiltIn PointSize | ||
OpDecorate %tint_symbol_1 BuiltIn Position | ||
%float = OpTypeFloat 32 | ||
%_ptr_Output_float = OpTypePointer Output %float | ||
%4 = OpConstantNull %float | ||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4 | ||
%v4float = OpTypeVector %float 4 | ||
%_ptr_Output_v4float = OpTypePointer Output %v4float | ||
%8 = OpConstantNull %v4float | ||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 | ||
%void = OpTypeVoid | ||
%9 = OpTypeFunction %void | ||
%float_1 = OpConstant %float 1 | ||
%_ptr_Function_v4float = OpTypePointer Function %v4float | ||
%18 = OpTypeFunction %void %v4float | ||
%refract_7e02e6 = OpFunction %void None %9 | ||
%12 = OpLabel | ||
%res = OpVariable %_ptr_Function_v4float Function %8 | ||
%13 = OpExtInst %v4float %14 Refract %8 %8 %float_1 | ||
OpStore %res %13 | ||
OpReturn | ||
OpFunctionEnd | ||
%tint_symbol_2 = OpFunction %void None %18 | ||
%tint_symbol = OpFunctionParameter %v4float | ||
%21 = OpLabel | ||
OpStore %tint_symbol_1 %tint_symbol | ||
OpReturn | ||
OpFunctionEnd | ||
%vertex_main = OpFunction %void None %9 | ||
%23 = OpLabel | ||
OpStore %tint_pointsize %float_1 | ||
%24 = OpFunctionCall %void %refract_7e02e6 | ||
%25 = OpFunctionCall %void %tint_symbol_2 %8 | ||
OpReturn | ||
OpFunctionEnd | ||
%fragment_main = OpFunction %void None %9 | ||
%27 = OpLabel | ||
%28 = OpFunctionCall %void %refract_7e02e6 | ||
OpReturn | ||
OpFunctionEnd | ||
%compute_main = OpFunction %void None %9 | ||
%30 = OpLabel | ||
%31 = OpFunctionCall %void %refract_7e02e6 | ||
OpReturn | ||
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,19 @@ | ||
fn refract_7e02e6() { | ||
var res : vec4<f32> = refract(vec4<f32>(), vec4<f32>(), 1.0); | ||
} | ||
|
||
[[stage(vertex)]] | ||
fn vertex_main() -> [[builtin(position)]] vec4<f32> { | ||
refract_7e02e6(); | ||
return vec4<f32>(); | ||
} | ||
|
||
[[stage(fragment)]] | ||
fn fragment_main() { | ||
refract_7e02e6(); | ||
} | ||
|
||
[[stage(compute), workgroup_size(1)]] | ||
fn compute_main() { | ||
refract_7e02e6(); | ||
} |
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,45 @@ | ||
// Copyright 2021 The Tint Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// File generated by tools/intrinsic-gen | ||
// using the template: | ||
// test/intrinsics/intrinsics.wgsl.tmpl | ||
// and the intrinsic defintion file: | ||
// src/intrinsics.def | ||
// | ||
// Do not modify this file directly | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
// fn refract(vec<3, f32>, vec<3, f32>, f32) -> vec<3, f32> | ||
fn refract_cbc1d2() { | ||
var res: vec3<f32> = refract(vec3<f32>(), vec3<f32>(), 1.0); | ||
} | ||
|
||
[[stage(vertex)]] | ||
fn vertex_main() -> [[builtin(position)]] vec4<f32> { | ||
refract_cbc1d2(); | ||
return vec4<f32>(); | ||
} | ||
|
||
[[stage(fragment)]] | ||
fn fragment_main() { | ||
refract_cbc1d2(); | ||
} | ||
|
||
[[stage(compute), workgroup_size(1)]] | ||
fn compute_main() { | ||
refract_cbc1d2(); | ||
} |
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,24 @@ | ||
void refract_cbc1d2() { | ||
float3 res = refract(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), 1.0f); | ||
} | ||
|
||
struct tint_symbol { | ||
float4 value : SV_Position; | ||
}; | ||
|
||
tint_symbol vertex_main() { | ||
refract_cbc1d2(); | ||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; | ||
return tint_symbol_1; | ||
} | ||
|
||
void fragment_main() { | ||
refract_cbc1d2(); | ||
return; | ||
} | ||
|
||
[numthreads(1, 1, 1)] | ||
void compute_main() { | ||
refract_cbc1d2(); | ||
return; | ||
} |
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,27 @@ | ||
#include <metal_stdlib> | ||
|
||
using namespace metal; | ||
struct tint_symbol { | ||
float4 value [[position]]; | ||
}; | ||
|
||
void refract_cbc1d2() { | ||
float3 res = refract(float3(), float3(), 1.0f); | ||
} | ||
|
||
vertex tint_symbol vertex_main() { | ||
refract_cbc1d2(); | ||
tint_symbol const tint_symbol_1 = {.value=float4()}; | ||
return tint_symbol_1; | ||
} | ||
|
||
fragment void fragment_main() { | ||
refract_cbc1d2(); | ||
return; | ||
} | ||
|
||
kernel void compute_main() { | ||
refract_cbc1d2(); | ||
return; | ||
} | ||
|
Oops, something went wrong.