tests/2.vsh
author Ethan Lee <flibitijibibo@flibitijibibo.com>
Tue, 07 Jul 2020 17:44:32 -0400
changeset 1278 be0f548f321f
parent 23 8a6ac66b0761
permissions -rw-r--r--
spirv: Fix bogus detection of PSIZE0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     1
vs.2.0
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     2
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     3
//------------------------------------------------------------------------------
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     4
// Simple Vertex Shader
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     5
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     6
//  Constants Registers:
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     7
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     8
//    c0-c3 = combined model-view-projection matrix
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
     9
//    c4    = constant color (defined by the application)
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    10
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    11
//  Input Registers:
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    12
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    13
//    v0    = per-vertex position
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    14
//    v1    = per-vertex color
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    15
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    16
//  Output Registers:
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    17
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    18
//    oPos  = homogeneous position
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    19
//    oD0   = diffuse color
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    20
//
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    21
//------------------------------------------------------------------------------
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    22
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    23
dcl_position v0
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    24
dcl_color    v1
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    25
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    26
m4x4 oPos, v0, c0   // Transform the per-vertex position into clip-space
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    27
mov oD0, v1         // Use the original per-vertex color specified
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    28
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    29
//mov oD0, c4         // Uncomment this to use the constant color stored at c4
8a6ac66b0761 [svn] Endline fixes for test shader assembly code.
icculus
parents: 3
diff changeset
    30