2016-04-16 19:26:05 +00:00
|
|
|
.gsh
|
2016-04-16 21:38:13 +00:00
|
|
|
.entry main_gsh
|
2016-04-16 19:26:05 +00:00
|
|
|
|
2016-04-16 21:38:13 +00:00
|
|
|
; Constants
|
|
|
|
.constf _01N1 (0.0, 1.0, -1.0, 1.0)
|
|
|
|
.alias _0000 _01N1.xxxx
|
|
|
|
.alias _1111 _01N1.yyyy
|
|
|
|
.alias _0101 _01N1.xyxy
|
|
|
|
.alias _N1N1 _01N1.zwzw
|
2016-04-16 19:26:05 +00:00
|
|
|
|
|
|
|
; Inputs
|
|
|
|
.alias sprite_coords v0
|
|
|
|
.alias tex_size v1
|
2016-04-16 21:38:13 +00:00
|
|
|
.alias top_left sprite_coords.xyxy
|
|
|
|
.alias bottom_right sprite_coords.zwzw
|
2016-04-16 19:26:05 +00:00
|
|
|
|
2016-04-16 21:38:13 +00:00
|
|
|
; Outputs
|
|
|
|
.out pos position
|
|
|
|
.out texcoord texcoord0
|
2016-04-16 19:26:05 +00:00
|
|
|
|
|
|
|
.proc main_gsh
|
|
|
|
setemit 0
|
2016-04-16 21:38:13 +00:00
|
|
|
mov pos.xy, top_left.xy
|
|
|
|
mov pos.zw, _N1N1
|
|
|
|
mov texcoord.xy, tex_size.xy
|
2016-04-16 19:26:05 +00:00
|
|
|
emit
|
|
|
|
|
|
|
|
setemit 1
|
2016-04-16 21:38:13 +00:00
|
|
|
mov pos.x, top_left.x
|
|
|
|
mov pos.y, bottom_right.y
|
|
|
|
mov pos.zw, _N1N1
|
|
|
|
mov texcoord.x, tex_size.z
|
|
|
|
mov texcoord.y, tex_size.y
|
2016-04-16 19:26:05 +00:00
|
|
|
emit
|
|
|
|
|
|
|
|
setemit 2, prim inv
|
2016-04-16 21:38:13 +00:00
|
|
|
mov pos.xy, bottom_right.xy
|
|
|
|
mov pos.zw, _N1N1
|
|
|
|
mov texcoord.xy, tex_size.zw
|
2016-04-16 19:26:05 +00:00
|
|
|
emit
|
|
|
|
|
|
|
|
setemit 1, prim
|
2016-04-16 21:38:13 +00:00
|
|
|
mov pos.x, bottom_right.x
|
|
|
|
mov pos.y, top_left.y
|
|
|
|
mov pos.zw, _N1N1
|
|
|
|
mov texcoord.x, tex_size.x
|
|
|
|
mov texcoord.y, tex_size.w
|
2016-04-16 19:26:05 +00:00
|
|
|
emit
|
|
|
|
|
|
|
|
end
|
|
|
|
.end
|