r300g: fix microtiling on RS6xx
[mesa.git] / src / gallium / drivers / r300 / r300_shader_semantics.h
1 /*
2 * Copyright 2009 Marek Olšák <maraeo@gmail.com>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
22
23 #ifndef R300_SHADER_SEMANTICS_H
24 #define R300_SHADER_SEMANTICS_H
25
26 #define ATTR_UNUSED (-1)
27 #define ATTR_COLOR_COUNT 2
28 #define ATTR_GENERIC_COUNT 32
29
30 /* This structure contains information about what attributes are written by VS
31 * or read by FS. (but not both) It's much easier to work with than
32 * tgsi_shader_info.
33 *
34 * The variables contain indices to tgsi_shader_info semantics and those
35 * indices are nothing else than input/output register numbers. */
36 struct r300_shader_semantics {
37 int pos;
38 int psize;
39 int color[ATTR_COLOR_COUNT];
40 int bcolor[ATTR_COLOR_COUNT];
41 int generic[ATTR_GENERIC_COUNT];
42 int fog;
43 int wpos;
44 };
45
46 static INLINE void r300_shader_semantics_reset(
47 struct r300_shader_semantics* info)
48 {
49 int i;
50
51 info->pos = ATTR_UNUSED;
52 info->psize = ATTR_UNUSED;
53 info->fog = ATTR_UNUSED;
54 info->wpos = ATTR_UNUSED;
55
56 for (i = 0; i < ATTR_COLOR_COUNT; i++) {
57 info->color[i] = ATTR_UNUSED;
58 info->bcolor[i] = ATTR_UNUSED;
59 }
60
61 for (i = 0; i < ATTR_GENERIC_COUNT; i++) {
62 info->generic[i] = ATTR_UNUSED;
63 }
64 }
65
66 #endif