2 * Copyright © 2017 Intel Corporation
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:
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
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.
25 #include "pipe/p_defines.h"
26 #include "pipe/p_state.h"
27 #include "pipe/p_context.h"
28 #include "pipe/p_screen.h"
29 #include "util/u_inlines.h"
30 #include "util/u_transfer.h"
31 #include "intel/compiler/brw_compiler.h"
32 #include "iris_context.h"
34 #define __gen_address_type unsigned
35 #define __gen_user_data void
38 __gen_combine_address(void *user_data
, void *location
,
39 unsigned address
, uint32_t delta
)
44 #define __genxml_cmd_length(cmd) cmd ## _length
45 #define __genxml_cmd_length_bias(cmd) cmd ## _length_bias
46 #define __genxml_cmd_header(cmd) cmd ## _header
47 #define __genxml_cmd_pack(cmd) cmd ## _pack
49 #define iris_pack_command(cmd, dst, name) \
50 for (struct cmd name = { __genxml_cmd_header(cmd) }, \
51 *_dst = (void *)(dst); __builtin_expect(_dst != NULL, 1); \
52 __genxml_cmd_pack(cmd)(NULL, (void *)dst, &name), \
55 #define iris_pack_state(cmd, dst, name) \
56 for (struct cmd name = {}, \
57 *_dst = (void *)(dst); __builtin_expect(_dst != NULL, 1); \
58 __genxml_cmd_pack(cmd)(NULL, (void *)_dst, &name), \
61 #include "genxml/genX_pack.h"
62 #include "genxml/gen_macros.h"
65 iris_draw_vbo(struct pipe_context
*ctx
, const struct pipe_draw_info
*info
)
70 3DSTATE_VIEWPORT_STATE_POINTERS_CC
- CC_VIEWPORT
71 -> from iris_depth_stencil_alpha_state
73 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CL
- SF_CLIP_VIEWPORT
74 -> pipe_viewport_state
for matrix elements
, guardband is calculated
75 from those
. can calculate screen space from matrix apparently
...
77 3DSTATE_SCISSOR_STATE_POINTERS
- SCISSOR_RECT
78 -> from ice
->state
.scissors
80 3DSTATE_PUSH_CONSTANT_ALLOC_
*
85 3DSTATE_BLEND_STATE_POINTERS
- BLEND_STATE
86 -> from
iris_blend_state (most
) + iris_depth_stencil_alpha_state
87 (alpha test function
/enable
) + has writeable RT from
???????
89 3DSTATE_CC_STATE_POINTERS
- COLOR_CALC_STATE
90 -> from ice
->state
.blend_color
+ iris_depth_stencil_alpha_state
93 3DSTATE_CONSTANT_
* - push constants
101 - render targets
- write
and read
102 3DSTATE_BINDING_TABLE_POINTERS_
*
105 3DSTATE_SAMPLER_STATE_POINTERS_
*
123 -> iris_raster_state
+ ??? (Non
-perspective Bary
, ForceZeroRTAIndex
)
130 -> iris_raster_state
+ FS
state (barycentric
, EDSC
)
132 -> iris_raster_state (point sprite texture coordinate origin
)
133 -> bunch of shader state
...
138 3DSTATE_HIER_DEPTH_BUFFER
139 3DSTATE_STENCIL_BUFFER
141 -> iris_framebuffer_state
?
144 -> pipe_draw_info (prim_mode
)
146 -> pipe_draw_info (restart_index
, primitive_restart
)
149 -> pipe_draw_info (index
)
150 3DSTATE_VERTEX_BUFFERS
151 -> pipe_vertex_buffer (set_vertex_buffer hook
)
152 3DSTATE_VERTEX_ELEMENTS
153 -> iris_vertex_element
154 3DSTATE_VF_INSTANCING
155 -> iris_vertex_element
158 3DSTATE_VF_COMPONENT_PACKING
165 3DSTATE_POLY_STIPPLE_OFFSET
166 3DSTATE_POLY_STIPPLE_PATTERN
167 -> ice
->state
.poly_stipple
172 3DSTATE_AA_LINE_PARAMETERS
174 3DSTATE_SAMPLE_PATTERN
175 3DSTATE_DRAWING_RECTANGLE