Edit

kc3-lang/SDL/src/render/direct3d11/SDL_D3D11_VertexShader_Default.hlsl

Branch :

  • Show log

    Commit

  • Author : David Ludwig
    Date : 2013-08-12 22:29:55
    Hash : f7049b93
    Message : WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d4ce48ff30d1)

  • src/render/direct3d11/SDL_D3D11_VertexShader_Default.hlsl
  • #pragma pack_matrix( row_major )
    
    cbuffer SDL_VertexShaderConstants : register(b0)
    {
        matrix model;
        matrix view;
        matrix projection;
    };
    
    struct VertexShaderInput
    {
        float3 pos : POSITION;
        float2 tex : TEXCOORD0;
        float4 color : COLOR0;
    };
    
    struct VertexShaderOutput
    {
        float4 pos : SV_POSITION;
        float2 tex : TEXCOORD0;
        float4 color : COLOR0;
    };
    
    VertexShaderOutput main(VertexShaderInput input)
    {
        VertexShaderOutput output;
        float4 pos = float4(input.pos, 1.0f);
    
        // Transform the vertex position into projected space.
        pos = mul(pos, model);
        pos = mul(pos, view);
        pos = mul(pos, projection);
        output.pos = pos;
    
        // Pass through texture coordinates and color values without transformation
        output.tex = input.tex;
        output.color = input.color;
    
        return output;
    }