all repos — mgba @ 6c780a39e114fc62ecf5d8671a949d8b4ad938d7

mGBA Game Boy Advance Emulator

src/platform/3ds/uishader.vsh (view raw)

 1; Copyright (c) 2015 Yuri Kunde Schlesner
 2;
 3; This Source Code Form is subject to the terms of the Mozilla Public
 4; License, v. 2.0. If a copy of the MPL was not distributed with this
 5; file, You can obtain one at http://mozilla.org/MPL/2.0/.
 6
 7; uishader.vsh - Simply multiplies input position and texcoords with
 8;                corresponding matrices before outputting
 9
10; Uniforms
11.fvec projectionMtx[4]
12.fvec textureMtx[2]
13
14; Constants
15.constf consts1(0.0, 1.0, 0.0039215686, 0.0)
16
17; Outputs : here only position and color
18.out out_pos position
19.out out_tc0 texcoord0
20.out out_col color
21
22; Inputs : here we have only vertices
23.alias in_pos v0
24.alias in_tc0 v1
25.alias in_col v2
26
27.proc main
28	dp4 out_pos.x, projectionMtx[0], in_pos
29	dp4 out_pos.y, projectionMtx[1], in_pos
30	dp4 out_pos.z, projectionMtx[2], in_pos
31	dp4 out_pos.w, projectionMtx[3], in_pos
32
33	dp4 out_tc0.x, textureMtx[0], in_tc0
34	dp4 out_tc0.y, textureMtx[1], in_tc0
35	mov out_tc0.zw, consts1.xxxy
36
37	; Normalize color by multiplying by 1 / 255
38	mul out_col, consts1.z, in_col
39
40	end
41.end