Update cube example

This Cl updates the cube example to use unique names for the entry
points and fixes the duplicate name used for fragColor between the
vertex and fragment shaders.

Change-Id: Icb77897bac88f7641cab2702b37573bfd771a586
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24781
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-07-14 19:43:02 +00:00 committed by dan sinclair
parent 919011af0a
commit 8604eb4495
1 changed files with 4 additions and 4 deletions

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
entry_point vertex as "main" = vtx_main;
entry_point fragment as "main" = frag_main;
entry_point vertex = vtx_main;
entry_point fragment = frag_main;
# Vertex shader
type Uniforms = struct {
@ -24,12 +24,12 @@ type Uniforms = struct {
[[location 0]] var<in> cur_position : vec4<f32>;
[[location 1]] var<in> color : vec4<f32>;
[[location 0]] var<out> fragColor : vec4<f32>;
[[location 0]] var<out> vtxFragColor : vec4<f32>;
[[builtin position]] var<out> Position : vec4<f32>;
fn vtx_main() -> void {
Position = uniforms.modelViewProjectionMatrix * cur_position;
fragColor = color;
vtxFragColor = color;
return;
}