From 712a980adde0b14eee8b4accd02af9b9740091a2 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 9 May 2016 17:48:24 -0700 Subject: i965/fs: Rework the persample shading key/prog_data bits This commit reworks and simplifies the way we handle persample shading in the shader key and prog_data. The previous approach had three different key bits that had slightly different and hard-to-decern meanings while the new bits are far more clear. This commit changes it to two easily understood bits that communicate everything we need: 1) key->persample_interp: means that the user has requested persample interpolation through the API. This is equivalent to having SAMPLE_SHADING enabled and having MIN_SAMPLE_SHADING_VALUE set high enough that you actually get multiple per-sample invocations. 2) key->multisample_fbo: means that the shader will be running on an actual multi-sampled framebuffer. This commit also adds a new "persample_dispatch" bit to prog_data which indicates that the shader should be run in persample mode. This way the state setup code doesn't have to look at the fragment program or GL state and can just pull that data out of the prog_data. In theory, this shuffle could mean more recompiles. However, in practice, we were shoving enough state into the key before that we were probably hitting a recompile on every per-sample shader anyway. Reviewed-by: Kenneth Graunke --- src/intel/vulkan/anv_pipeline.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/intel/vulkan/anv_pipeline.c') diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 5800e683d39..f55069ee747 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -286,8 +286,9 @@ populate_wm_prog_key(const struct brw_device_info *devinfo, /* We should probably pull this out of the shader, but it's fairly * harmless to compute it and then let dead-code take care of it. */ - key->persample_shading = info->pMultisampleState->sampleShadingEnable; - key->compute_pos_offset = info->pMultisampleState->sampleShadingEnable; + key->persample_interp = + (info->pMultisampleState->minSampleShading * + info->pMultisampleState->rasterizationSamples) > 1; key->multisample_fbo = true; } } -- cgit v1.2.3