summary refs log tree commit diff
path: root/misc/3ds/coloured.v.pica
blob: 7954ed9cd11c3fab3f26c5b9eaa21b786f7d1af7 (plain)
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
32
33
; Vertex shader for rendering coloured vertices for PICA200 GPU on the Nintendo 3DS
; ==================================================================================

; Uniforms
.fvec MVP[4];

; Constants
.constf ONE_DIV_255(0.003921568627, 0.003921568627, 0.003921568627, 0.003921568627)

; Outputs
.out out_pos position
.out out_col color

; Inputs (defined as aliases for convenience)
.alias in_pos v0
.alias in_col v1

.proc main
	; r0 = in_pos
	mov r0, in_pos

	; out_pos = MVP * r0
	dp4 out_pos.x, MVP[0], r0
	dp4 out_pos.y, MVP[1], r0
	dp4 out_pos.z, MVP[2], r0
	dp4 out_pos.w, MVP[3], r0

	; out_col = in_col * ONE_DIV_255
	mul out_col, ONE_DIV_255, in_col
	
	end
.end