File: DefaultVertexShader.hlsl

package info (click to toggle)
kodi-visualization-waveform 20.2.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,044 kB
  • sloc: cpp: 441; xml: 94; makefile: 9
file content (31 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (2)
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
/*
 *  Copyright (C) 2005-2021 Team Kodi (https://kodi.tv)
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSE.md for more information.
 */

struct VS_OUT
{
  float4 pos : SV_POSITION;
  float4 col : COLOR;
};

cbuffer cbViewPort : register(b0)
{
  float g_viewPortWidth;
  float g_viewPortHeigh;
  float align1;
  float align2;
};

VS_OUT main(float4 pos : POSITION, float4 col : COLOR)
{
  VS_OUT r = (VS_OUT)0;
  r.pos.x  =  (pos.x / (g_viewPortWidth / 2.0)) - 1;
  r.pos.y  = -(pos.y / (g_viewPortHeigh / 2.0)) + 1;
  r.pos.z  = pos.z;
  r.pos.w  = 1.0;
  r.col    = col;
  return r;
}