1 /**********************************************************
2 * Copyright 2007-2009 VMware, Inc. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 **********************************************************/
28 * SVGA Shader Token Definitions
30 * @author Michal Krol <michal@vmware.com>
33 #ifndef ST_SHADER_SVGA_H
34 #define ST_SHADER_SVGA_H
36 #include "pipe/p_compiler.h"
43 unsigned predicated
:1;
59 static INLINE
unsigned
60 sh_reg_type( struct sh_reg reg
)
62 return reg
.type_lo
| (reg
.type_hi
<< 3);
74 struct sh_cdata cdata
;
93 struct sh_idata idata
;
96 #define PS_TEXTURETYPE_UNKNOWN SVGA3DSAMP_UNKNOWN
97 #define PS_TEXTURETYPE_2D SVGA3DSAMP_2D
98 #define PS_TEXTURETYPE_CUBE SVGA3DSAMP_CUBE
99 #define PS_TEXTURETYPE_VOLUME SVGA3DSAMP_VOLUME
104 unsigned texture_type
:4;
112 unsigned usage_index
:4;
117 #define SH_WRITEMASK_0 0x1
118 #define SH_WRITEMASK_1 0x2
119 #define SH_WRITEMASK_2 0x4
120 #define SH_WRITEMASK_3 0x8
121 #define SH_WRITEMASK_ALL 0xf
123 #define SH_DSTMOD_NONE 0x0
124 #define SH_DSTMOD_SATURATE 0x1
125 #define SH_DSTMOD_PARTIALPRECISION 0x2
126 #define SH_DSTMOD_MSAMPCENTROID 0x4
134 unsigned write_mask
:4;
136 unsigned shift_scale
:4;
141 static INLINE
unsigned
142 sh_dstreg_type( struct sh_dstreg reg
)
144 return reg
.type_lo
| (reg
.type_hi
<< 3);
151 struct sh_sampleinfo sampleinfo
;
152 struct sh_semantic semantic
;
154 struct sh_dstreg reg
;
163 unsigned swizzle_x
:2;
164 unsigned swizzle_y
:2;
165 unsigned swizzle_z
:2;
166 unsigned swizzle_w
:2;
172 static INLINE
unsigned
173 sh_srcreg_type( struct sh_srcreg reg
)
175 return reg
.type_lo
| (reg
.type_hi
<< 3);
181 struct sh_dstreg dst
;
187 struct sh_srcreg src
;
193 struct sh_srcreg src0
;
194 struct sh_srcreg src1
;
200 struct sh_dstreg dst
;
201 struct sh_srcreg src
;
207 struct sh_dstreg dst
;
208 struct sh_srcreg src0
;
209 struct sh_srcreg src1
;
215 struct sh_dstreg dst
;
216 struct sh_srcreg src0
;
217 struct sh_srcreg src1
;
218 struct sh_srcreg src2
;
227 #endif /* ST_SHADER_SVGA_H */