Remove EntryPoint.

This CL removes the EntryPoint node and transitions everything to the
stage decoration.

Change-Id: Ib2840155905c8fa60ff35870f0c4b6705efb73ff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28705
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
dan sinclair
2020-09-22 14:53:03 +00:00
committed by Commit Bot service account
parent de2a019a7f
commit 5f8126271d
55 changed files with 86 additions and 4856 deletions

View File

@@ -21,7 +21,8 @@ import "GLSL.std.450" as std;
[[location(2)]] var<in> a_pos : vec2<f32>;
[[builtin(position)]] var<out> gl_Position : vec4<f32>;
fn vtx_main() -> void {
[[stage(vertex)]]
fn vert_main() -> void {
var angle : f32 = -std::atan2(a_particleVel.x, a_particleVel.y);
var pos : vec2<f32> = vec2<f32>(
(a_pos.x * std::cos(angle)) - (a_pos.y * std::sin(angle)),
@@ -29,16 +30,15 @@ fn vtx_main() -> void {
gl_Position = vec4<f32>(pos + a_particlePos, 0.0, 1.0);
return;
}
entry_point vertex as "vert_main" = vtx_main;
# fragment shader
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]]
fn frag_main() -> void {
fragColor = vec4<f32>(1.0, 1.0, 1.0, 1.0);
return;
}
entry_point fragment as "frag_main" = frag_main;
# compute shader
type Particle = [[block]] struct {
@@ -67,7 +67,8 @@ type Particles = [[block]] struct {
[[builtin(global_invocation_id)]] var<in> gl_GlobalInvocationID : vec3<u32>;
# https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp
fn compute_main() -> void {
[[stage(compute)]]
fn comp_main() -> void {
var index : u32 = gl_GlobalInvocationID.x;
if (index >= 5) {
return;
@@ -149,5 +150,3 @@ fn compute_main() -> void {
return;
}
entry_point compute as "comp_main" = compute_main;

View File

@@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
entry_point vertex = vtx_main;
entry_point fragment = frag_main;
# Vertex shader
type Uniforms = [[block]] struct {
[[offset(0)]] modelViewProjectionMatrix : mat4x4<f32>;
@@ -27,6 +24,7 @@ type Uniforms = [[block]] struct {
[[location(0)]] var<out> vtxFragColor : vec4<f32>;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]]
fn vtx_main() -> void {
Position = uniforms.modelViewProjectionMatrix * cur_position;
vtxFragColor = color;
@@ -37,6 +35,7 @@ fn vtx_main() -> void {
[[location(0)]] var<in> fragColor : vec4<f32>;
[[location(0)]] var<out> outColor : vec4<f32>;
[[stage(fragment)]]
fn frag_main() -> void {
outColor = fragColor;
return;

View File

@@ -18,10 +18,10 @@ fn bar() -> void {
return;
}
[[stage(fragment)]]
fn main() -> void {
var a : vec2<f32> = vec2<f32>();
gl_FragColor = vec4<f32>(0.4, 0.4, 0.8, 1.0);
bar();
return;
}
entry_point fragment = main;

View File

@@ -1,6 +1,6 @@
# v-switch03: line 7: the case selector values must have the same type as the selector expression
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: i32 = -2;
switch (a) {

View File

@@ -1,6 +1,6 @@
# v-switch03: line 7: the case selector values must have the same type as the selector expression
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: u32 = 2;
switch (a) {

View File

@@ -1,7 +1,7 @@
# v-switch04: line 9: a literal value must not appear more than once in the case selectors for a
# switch statement: '0'
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: u32 = 2;
switch (a) {

View File

@@ -1,7 +1,7 @@
# v-switch05: line 9: a fallthrough statement must not appear as the last statement in last clause
# of a switch
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: i32 = -2;
switch (a) {

View File

@@ -1,6 +1,6 @@
# v-0008: line 6: switch statement must have exactly one default clause
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: i32 = 2;
switch (a) {

View File

@@ -1,6 +1,6 @@
# v-0008: line 6: switch statement must have exactly one default clause
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: i32 = 2;
switch (a) {

View File

@@ -1,6 +1,6 @@
# v-switch01: line 6: switch statement selector expression must be of a scalar integer type
entry_point vertex = main;
[[stage(vertex)]]
fn main() -> void {
var a: f32 = 3.14;
switch (a) {

View File

@@ -21,16 +21,17 @@ const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[builtin(vertex_idx)]] var<in> VertexIndex : i32;
[[stage(vertex)]]
fn vtx_main() -> void {
Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
return;
}
entry_point vertex as "main" = vtx_main;
# Fragment shader
[[location(0)]] var<out> outColor : vec4<f32>;
[[stage(fragment)]]
fn frag_main() -> void {
outColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);
return;
}
entry_point fragment = frag_main;

View File

@@ -15,9 +15,9 @@
# Vertex shader
var<private> a : i32;
[[stage(vertex)]]
fn main() -> void {
a = 2;
return;
}
entry_point vertex as "main" = main;

View File

@@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
[[stage(fragment)]]
fn main() -> void {
var a : f32 = 2.0;
{ a = 3.14;}
return;
}
entry_point fragment = main;