intel/fs: Make per-sample and coarse dispatch tri-state

Whenever one of them is BRW_SOMETIMES, we depend on dynamic flag pushed
in as a push constant.  In this case, we have to often have to do the
calculation both ways and SEL the result.  It's a bit more code but
decouples MSAA from the shader key.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
This commit is contained in:
Jason Ekstrand
2021-11-19 16:32:24 -06:00
committed by Marge Bot
parent 43ca7f4178
commit d8dfd153c5
12 changed files with 349 additions and 80 deletions
+7 -4
View File
@@ -43,7 +43,8 @@ static inline void
intel_set_ps_dispatch_state(struct GENX(3DSTATE_PS) *ps,
const struct intel_device_info *devinfo,
const struct brw_wm_prog_data *prog_data,
unsigned rasterization_samples)
unsigned rasterization_samples,
enum brw_wm_msaa_flags msaa_flags)
{
assert(rasterization_samples != 0);
@@ -72,7 +73,10 @@ intel_set_ps_dispatch_state(struct GENX(3DSTATE_PS) *ps,
enable_8 = false;
#endif
if (prog_data->persample_dispatch) {
const bool is_persample_dispatch =
brw_wm_prog_data_is_persample(prog_data, msaa_flags);
if (is_persample_dispatch) {
/* TGL PRMs, Volume 2d: Command Reference: Structures:
* 3DSTATE_PS_BODY::32 Pixel Dispatch Enable:
*
@@ -108,8 +112,7 @@ intel_set_ps_dispatch_state(struct GENX(3DSTATE_PS) *ps,
*
* 16x MSAA only exists on Gfx9+, so we can skip this on Gfx8.
*/
if (GFX_VER >= 9 && rasterization_samples == 16 &&
!prog_data->persample_dispatch) {
if (GFX_VER >= 9 && rasterization_samples == 16 && !is_persample_dispatch) {
assert(enable_8 || enable_16);
enable_32 = false;
}