File: cube.hlsl

package info (click to toggle)
libsdl3 3.2.28%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 42,080 kB
  • sloc: ansic: 391,330; objc: 12,361; xml: 9,084; cpp: 5,729; perl: 4,589; python: 3,373; sh: 1,032; makefile: 265; cs: 56
file content (31 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define REG(reg, space) register(reg, space)

cbuffer UBO : REG(b0, space1)
{
    float4x4 ModelViewProj;
};

struct VSInput
{
    float3 Position : TEXCOORD0;
    float3 Color : TEXCOORD1;
};

struct VSOutput
{
    float4 Color : TEXCOORD0;
    float4 Position : SV_Position;
};

VSOutput VSMain(VSInput input)
{
    VSOutput output;
    output.Color = float4(input.Color, 1.0f);
    output.Position = mul(ModelViewProj, float4(input.Position, 1.0f));
    return output;
}

float4 PSMain(VSOutput input) : SV_Target0
{
    return input.Color;
}