2006-08-09 19:14:05 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) Intel Corp. 2006. All Rights Reserved.
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
Intel funded Tungsten Graphics to
|
2006-08-09 19:14:05 +00:00
|
|
|
develop this 3D driver.
|
2012-11-19 14:59:14 -08:00
|
|
|
|
2006-08-09 19:14:05 +00:00
|
|
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
a copy of this software and associated documentation files (the
|
|
|
|
"Software"), to deal in the Software without restriction, including
|
|
|
|
without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
the following conditions:
|
2012-11-19 14:59:14 -08:00
|
|
|
|
2006-08-09 19:14:05 +00:00
|
|
|
The above copyright notice and this permission notice (including the
|
|
|
|
next paragraph) shall be included in all copies or substantial
|
|
|
|
portions of the Software.
|
2012-11-19 14:59:14 -08:00
|
|
|
|
2006-08-09 19:14:05 +00:00
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
|
|
|
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2012-11-19 14:59:14 -08:00
|
|
|
|
2006-08-09 19:14:05 +00:00
|
|
|
**********************************************************************/
|
|
|
|
/*
|
|
|
|
* Authors:
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
* Keith Whitwell <keithw@vmware.com>
|
2006-08-09 19:14:05 +00:00
|
|
|
*/
|
2012-11-19 14:59:14 -08:00
|
|
|
|
2006-08-09 19:14:05 +00:00
|
|
|
|
2012-11-19 14:59:14 -08:00
|
|
|
#include "brw_fs.h"
|
2006-08-09 19:14:05 +00:00
|
|
|
|
|
|
|
|
2012-11-19 14:59:14 -08:00
|
|
|
#undef P /* prompted depth */
|
|
|
|
#undef C /* computed */
|
|
|
|
#undef N /* non-promoted? */
|
2006-08-09 19:14:05 +00:00
|
|
|
|
|
|
|
#define P 0
|
|
|
|
#define C 1
|
|
|
|
#define N 2
|
|
|
|
|
2012-11-19 14:59:14 -08:00
|
|
|
static const struct {
|
2006-08-09 19:14:05 +00:00
|
|
|
GLuint mode:2;
|
|
|
|
GLuint sd_present:1;
|
|
|
|
GLuint sd_to_rt:1;
|
|
|
|
GLuint dd_present:1;
|
|
|
|
GLuint ds_present:1;
|
2017-02-28 16:33:49 -08:00
|
|
|
} wm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 0, 0, 0 },
|
|
|
|
{ N, 1, 1, 0, 1 },
|
|
|
|
{ N, 0, 1, 0, 1 },
|
|
|
|
{ N, 0, 1, 0, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ N, 1, 1, 0, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ C, 0, 0, 0, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ C, 0, 1, 0, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ C, 1, 1, 0, 1 },
|
|
|
|
{ C, 0, 1, 0, 1 },
|
|
|
|
{ C, 0, 1, 0, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ C, 1, 1, 1, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ P, 0, 0, 0, 0 },
|
|
|
|
{ C, 1, 1, 1, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 },
|
|
|
|
{ C, 0, 1, 1, 1 }
|
2006-08-09 19:14:05 +00:00
|
|
|
};
|
|
|
|
|
2009-05-12 09:16:27 -06:00
|
|
|
/**
|
2017-02-28 16:33:49 -08:00
|
|
|
* \param line_aa BRW_WM_AA_NEVER, BRW_WM_AA_ALWAYS or BRW_WM_AA_SOMETIMES
|
|
|
|
* \param lookup bitmask of BRW_WM_IZ_* flags
|
2009-05-12 09:16:27 -06:00
|
|
|
*/
|
2021-03-29 15:40:04 -07:00
|
|
|
void fs_visitor::setup_fs_payload_gfx4()
|
2006-08-09 19:14:05 +00:00
|
|
|
{
|
2014-08-29 12:50:46 -07:00
|
|
|
assert(stage == MESA_SHADER_FRAGMENT);
|
2017-01-13 15:36:51 -08:00
|
|
|
assert(dispatch_width <= 16);
|
2016-09-08 23:48:51 -07:00
|
|
|
struct brw_wm_prog_data *prog_data = brw_wm_prog_data(this->prog_data);
|
2014-08-29 12:50:46 -07:00
|
|
|
brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
|
2017-01-13 15:36:51 -08:00
|
|
|
GLuint reg = 1;
|
2011-10-07 12:26:50 -07:00
|
|
|
bool kill_stats_promoted_workaround = false;
|
2014-05-13 21:06:00 -07:00
|
|
|
int lookup = key->iz_lookup;
|
2006-08-09 19:14:05 +00:00
|
|
|
|
2017-02-28 16:33:49 -08:00
|
|
|
assert(lookup < BRW_WM_IZ_BIT_MAX);
|
2010-09-21 12:05:37 -07:00
|
|
|
|
|
|
|
/* Crazy workaround in the windowizer, which we need to track in
|
|
|
|
* our register allocation and render target writes. See the "If
|
|
|
|
* statistics are enabled..." paragraph of 11.5.3.2: Early Depth
|
|
|
|
* Test Cases [Pre-DevGT] of the 3D Pipeline - Windower B-Spec.
|
|
|
|
*/
|
2014-05-13 21:06:00 -07:00
|
|
|
if (key->stats_wm &&
|
2017-02-28 16:33:49 -08:00
|
|
|
(lookup & BRW_WM_IZ_PS_KILL_ALPHATEST_BIT) &&
|
2010-09-21 12:05:37 -07:00
|
|
|
wm_iz_table[lookup].mode == P) {
|
2011-10-07 12:26:50 -07:00
|
|
|
kill_stats_promoted_workaround = true;
|
2010-09-21 12:05:37 -07:00
|
|
|
}
|
|
|
|
|
2017-01-13 15:36:51 -08:00
|
|
|
payload.subspan_coord_reg[0] = reg++;
|
|
|
|
|
2016-02-10 21:27:57 -08:00
|
|
|
if (wm_iz_table[lookup].sd_present || prog_data->uses_src_depth ||
|
2010-09-21 12:05:37 -07:00
|
|
|
kill_stats_promoted_workaround) {
|
2017-01-13 15:36:51 -08:00
|
|
|
payload.source_depth_reg[0] = reg;
|
2006-08-09 19:14:05 +00:00
|
|
|
reg += 2;
|
|
|
|
}
|
|
|
|
|
2010-09-21 12:05:37 -07:00
|
|
|
if (wm_iz_table[lookup].sd_to_rt || kill_stats_promoted_workaround)
|
2014-05-14 00:08:58 -07:00
|
|
|
source_depth_to_render_target = true;
|
2006-08-09 19:14:05 +00:00
|
|
|
|
2017-02-28 16:33:49 -08:00
|
|
|
if (wm_iz_table[lookup].ds_present || key->line_aa != BRW_WM_AA_NEVER) {
|
2017-01-13 15:36:51 -08:00
|
|
|
payload.aa_dest_stencil_reg[0] = reg;
|
2014-05-14 00:08:58 -07:00
|
|
|
runtime_check_aads_emit =
|
2017-02-28 16:33:49 -08:00
|
|
|
!wm_iz_table[lookup].ds_present && key->line_aa == BRW_WM_AA_SOMETIMES;
|
2006-08-09 19:14:05 +00:00
|
|
|
reg++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wm_iz_table[lookup].dd_present) {
|
2017-01-13 15:36:51 -08:00
|
|
|
payload.dest_depth_reg[0] = reg;
|
2006-08-09 19:14:05 +00:00
|
|
|
reg+=2;
|
|
|
|
}
|
|
|
|
|
2014-05-13 21:52:51 -07:00
|
|
|
payload.num_regs = reg;
|
2006-08-09 19:14:05 +00:00
|
|
|
}
|