1 /**************************************************************************
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 **************************************************************************/
31 static const char pass_through_depth_asm
[] =
33 "DCL IN[0], POSITION, LINEAR\n"
34 "DCL OUT[0].z, POSITION, CONSTANT\n"
35 "0: MOV OUT[0].z, IN[0].zzzz\n"
41 static const char set_mask_asm
[] =
43 "DCL IN[0], GENERIC[0], PERSPECTIVE\n"
44 "DCL SAMP[0], CONSTANT\n"
45 "DCL OUT[0], COLOR, CONSTANT\n"
46 "0: TEX OUT[0], IN[0], SAMP[0], 2D\n"/*umask*/
49 /* μnew = 1 – (1 – μmask)*(1 – μprev) */
50 static const char union_mask_asm
[] =
52 "DCL IN[0], GENERIC[0], PERSPECTIVE\n"
53 "DCL IN[1], POSITION, LINEAR\n"
54 "DCL CONST[0], CONSTANT\n"
55 "DCL SAMP[0..1], CONSTANT\n"
56 "DCL TEMP[0..3], CONSTANT\n"
57 "DCL OUT[0], COLOR, CONSTANT\n"
58 "0: TEX TEMP[1], IN[0], SAMP[0], 2D\n"/*umask*/
59 "1: TEX TEMP[0], IN[1], SAMP[1], 2D\n"/*uprev*/
60 "2: SUB TEMP[2], CONST[0], TEMP[0]\n"
61 "3: SUB TEMP[3], CONST[0], TEMP[1]\n"
62 "4: MUL TEMP[0].w, TEMP[2].wwww, TEMP[3].wwww\n"
63 "5: SUB OUT[0], CONST[0], TEMP[0]\n"
66 /* μnew = μmask *μprev */
67 static const char intersect_mask_asm
[] =
69 "DCL IN[0], GENERIC[0], PERSPECTIVE\n"
70 "DCL IN[1], POSITION, LINEAR\n"
71 "DCL CONST[0], CONSTANT\n"
72 "DCL SAMP[0..1], CONSTANT\n"
73 "DCL TEMP[0..1], CONSTANT\n"
74 "DCL OUT[0], COLOR, CONSTANT\n"
75 "0: TEX TEMP[0], IN[1], SAMP[1], 2D\n"/*uprev*/
76 "1: TEX TEMP[1], IN[0], SAMP[0], 2D\n"/*umask*/
77 "2: MUL OUT[0], TEMP[0].wwww, TEMP[1].wwww\n"
80 /* μnew = μprev*(1 – μmask) */
81 static const char subtract_mask_asm
[] =
83 "DCL IN[0], GENERIC[0], PERSPECTIVE\n"
84 "DCL IN[1], POSITION, LINEAR\n"
85 "DCL CONST[0], CONSTANT\n"
86 "DCL SAMP[0..1], CONSTANT\n"
87 "DCL TEMP[0..2], CONSTANT\n"
88 "DCL OUT[0], COLOR, CONSTANT\n"
89 "0: TEX TEMP[1], IN[0], SAMP[0], 2D\n"/*umask*/
90 "1: TEX TEMP[0], IN[1], SAMP[1], 2D\n"/*uprev*/
91 "2: SUB TEMP[2], CONST[0], TEMP[1]\n"
92 "3: MUL OUT[0], TEMP[2].wwww, TEMP[0].wwww\n"
96 static const char vs_plain_asm
[] =
99 "DCL OUT[0], POSITION\n"
102 "0: MUL TEMP[0], IN[0], CONST[0]\n"
103 "1: ADD TEMP[0], TEMP[0], CONST[1]\n"
104 "2: MOV OUT[0], TEMP[0]\n"
107 static const char vs_clear_asm
[] =
111 "DCL OUT[0], POSITION\n"
112 "DCL OUT[1], COLOR\n"
115 "0: MUL TEMP[0], IN[0], CONST[0]\n"
116 "1: ADD TEMP[0], TEMP[0], CONST[1]\n"
117 "2: MOV OUT[0], TEMP[0]\n"
118 "3: MOV OUT[1], IN[1]\n"
122 static const char vs_texture_asm
[] =
126 "DCL OUT[0], POSITION\n"
127 "DCL OUT[1], GENERIC\n"
130 "0: MUL TEMP[0], IN[0], CONST[0]\n"
131 "1: ADD TEMP[0], TEMP[0], CONST[1]\n"
132 "2: MOV OUT[0], TEMP[0]\n"
133 "3: MOV OUT[1], IN[1]\n"