1 /**********************************************************
2 * Copyright 2008-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 **********************************************************/
29 #include "pipe/p_compiler.h"
30 #include "svga3d_reg.h"
33 #define MAX_VGPU10_ADDR_REGS 2
35 struct svga_compile_key
;
38 struct svga_shader_variant
;
41 /* TGSI doesn't provide use with VS input semantics (they're actually
42 * pretty meaningless), so we just generate some plausible ones here.
43 * This is called both from within the TGSI translator and when
44 * building vdecls to ensure they match up.
46 * The real use of this information is matching vertex elements to
47 * fragment shader inputs in the case where vertex shader is disabled.
49 static inline void svga_generate_vdecl_semantics( unsigned idx
,
51 unsigned *usage_index
)
54 *usage
= SVGA3D_DECLUSAGE_POSITION
;
58 *usage
= SVGA3D_DECLUSAGE_TEXCOORD
;
59 *usage_index
= idx
- 1;
65 struct svga_shader_variant
*
66 svga_tgsi_vgpu9_translate(struct svga_context
*svga
,
67 const struct svga_shader
*shader
,
68 const struct svga_compile_key
*key
, unsigned unit
);
70 struct svga_shader_variant
*
71 svga_tgsi_vgpu10_translate(struct svga_context
*svga
,
72 const struct svga_shader
*shader
,
73 const struct svga_compile_key
*key
,
76 boolean
svga_shader_verify(const uint32_t *tokens
, unsigned nr_tokens
);