2 * Mesa 3-D graphics library
4 * Copyright (C) 2015 LunarG, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
25 * Chia-I Wu <olv@lunarg.com>
28 #ifndef ILO_STATE_SBE_H
29 #define ILO_STATE_SBE_H
31 #include "genhw/genhw.h"
37 * From the Sandy Bridge PRM, volume 2 part 1, page 264:
39 * "Number of SF Output Attributes sets the number of attributes that will
40 * be output from the SF stage, not including position. This can be used
41 * to specify up to 32, and may differ from the number of input
44 * "The first or last set of 16 attributes can be swizzled according to
45 * certain state fields."
47 #define ILO_STATE_SBE_MAX_ATTR_COUNT 32
48 #define ILO_STATE_SBE_MAX_SWIZZLE_COUNT 16
50 struct ilo_state_sbe_swizzle_info
{
51 /* select an attribute from read ones */
52 enum gen_inputattr_select attr_select
;
58 struct ilo_state_sbe_info
{
61 /* which VUE attributes to read */
62 uint8_t cv_vue_attr_count
;
63 uint8_t vue_read_base
;
64 uint8_t vue_read_count
;
65 bool has_min_read_count
;
68 bool point_sprite_origin_lower_left
;
69 /* force sprite coordinates to the four corner vertices of the point */
70 uint32_t point_sprite_enables
;
72 /* force attr at the provoking vertex to a0 and zero to a1/a2 */
73 uint32_t const_interp_enables
;
76 /* swizzle attribute 16 to 31 instead; Gen7+ only */
78 uint8_t swizzle_count
;
79 const struct ilo_state_sbe_swizzle_info
*swizzles
;
82 struct ilo_state_sbe
{
88 ilo_state_sbe_init(struct ilo_state_sbe
*sbe
,
89 const struct ilo_dev
*dev
,
90 const struct ilo_state_sbe_info
*info
);
93 ilo_state_sbe_init_for_rectlist(struct ilo_state_sbe
*sbe
,
94 const struct ilo_dev
*dev
,
99 ilo_state_sbe_set_info(struct ilo_state_sbe
*sbe
,
100 const struct ilo_dev
*dev
,
101 const struct ilo_state_sbe_info
*info
);
103 #endif /* ILO_STATE_SBE_H */