tests/2.vsh
author Katelyn Gadd <kg@luminance.org>
Tue, 15 Jun 2021 22:11:58 -0400
changeset 1322 f9b8e34cc41f
parent 23 8a6ac66b0761
permissions -rw-r--r--
hlsl: Emit attributes for POSITION1 and above. Also, add an assert for the case where a buggy VS is missing outputs its PS needs (the shader will fail to compile anyway and produce a mystery crash later, so this is an improvement)

vs.2.0

//------------------------------------------------------------------------------
// Simple Vertex Shader
//
//  Constants Registers:
//
//    c0-c3 = combined model-view-projection matrix
//    c4    = constant color (defined by the application)
//
//  Input Registers:
//
//    v0    = per-vertex position
//    v1    = per-vertex color
//
//  Output Registers:
//
//    oPos  = homogeneous position
//    oD0   = diffuse color
//
//------------------------------------------------------------------------------

dcl_position v0
dcl_color    v1

m4x4 oPos, v0, c0   // Transform the per-vertex position into clip-space
mov oD0, v1         // Use the original per-vertex color specified

//mov oD0, c4         // Uncomment this to use the constant color stored at c4