Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
; Outputs | ||
.out outpos position | ||
.out outtc0 texcoord0 | ||
.out outclr color | ||
|
||
; Inputs | ||
.alias inpos v0 | ||
.alias inarg v1 | ||
|
||
; Uniforms | ||
.fvec projection[4] | ||
.fvec transform | ||
.bool useTransform | ||
|
||
; Constants | ||
.constf RGBA8_TO_FLOAT4(0.00392156862, 0, 0, 0) | ||
|
||
.proc main | ||
ifu useTransform | ||
; outpos = projection * transform * in.pos | ||
dp4 r15.x, transform[0], inpos | ||
dp4 r15.y, transform[1], inpos | ||
dp4 r15.z, transform[2], inpos | ||
dp4 r15.w, transform[3], inpos | ||
dp4 outpos.x, projection[0], r15 | ||
dp4 outpos.y, projection[1], r15 | ||
dp4 outpos.z, projection[2], r15 | ||
dp4 outpos.w, projection[3], r15 | ||
.else | ||
; outpos = projection * in.pos | ||
dp4 outpos.x, projection[0], inpos | ||
dp4 outpos.y, projection[1], inpos | ||
dp4 outpos.z, projection[2], inpos | ||
dp4 outpos.w, projection[3], inpos | ||
.end | ||
|
||
; outtc0 = in.texcoord | ||
mov outtc0, inarg | ||
|
||
; outclr = RGBA8_TO_FLOAT4(in.color) | ||
mul outclr, RGBA8_TO_FLOAT4.xxxx, inarg | ||
|
||
end | ||
.end |