2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keithw@vmware.com>
33 #include "main/mtypes.h"
37 #undef P /* prompted depth */
38 #undef C /* computed */
39 #undef N /* non-promoted? */
51 } wm_iz_table
[IZ_BIT_MAX
] =
120 * \param line_aa AA_NEVER, AA_ALWAYS or AA_SOMETIMES
121 * \param lookup bitmask of IZ_* flags
123 void fs_visitor::setup_payload_gen4()
125 assert(stage
== MESA_SHADER_FRAGMENT
);
126 brw_wm_prog_key
*key
= (brw_wm_prog_key
*) this->key
;
128 bool kill_stats_promoted_workaround
= false;
129 int lookup
= key
->iz_lookup
;
131 (nir
->info
.inputs_read
& (1 << VARYING_SLOT_POS
)) != 0;
133 assert(lookup
< IZ_BIT_MAX
);
135 /* Crazy workaround in the windowizer, which we need to track in
136 * our register allocation and render target writes. See the "If
137 * statistics are enabled..." paragraph of 11.5.3.2: Early Depth
138 * Test Cases [Pre-DevGT] of the 3D Pipeline - Windower B-Spec.
141 (lookup
& IZ_PS_KILL_ALPHATEST_BIT
) &&
142 wm_iz_table
[lookup
].mode
== P
) {
143 kill_stats_promoted_workaround
= true;
146 if (wm_iz_table
[lookup
].sd_present
|| uses_depth
||
147 kill_stats_promoted_workaround
) {
148 payload
.source_depth_reg
= reg
;
152 if (wm_iz_table
[lookup
].sd_to_rt
|| kill_stats_promoted_workaround
)
153 source_depth_to_render_target
= true;
155 if (wm_iz_table
[lookup
].ds_present
|| key
->line_aa
!= AA_NEVER
) {
156 payload
.aa_dest_stencil_reg
= reg
;
157 runtime_check_aads_emit
=
158 !wm_iz_table
[lookup
].ds_present
&& key
->line_aa
== AA_SOMETIMES
;
162 if (wm_iz_table
[lookup
].dd_present
) {
163 payload
.dest_depth_reg
= reg
;
167 payload
.num_regs
= reg
;