Mesa (master): turnip: Add support for alphaToOne.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 5 18:29:14 UTC 2020


Module: Mesa
Branch: master
Commit: ac1ab9294abd2eb24af8e810cd93b491ac22a8a1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac1ab9294abd2eb24af8e810cd93b491ac22a8a1

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jun  4 17:00:59 2020 -0700

turnip: Add support for alphaToOne.

Comparing a blob trace using the feature to one not, the difference was
pretty obvious and in the spot you'd expect compared to alphaToCoverage.
The SP_ reg didn't have a corresponding bit set, though it also has an
alphaToCoverage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5343>

---

 src/freedreno/registers/a6xx.xml   | 1 +
 src/freedreno/vulkan/tu_device.c   | 2 +-
 src/freedreno/vulkan/tu_pipeline.c | 5 ++---
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/freedreno/registers/a6xx.xml b/src/freedreno/registers/a6xx.xml
index 0a0eec3ea07..515b1043aae 100644
--- a/src/freedreno/registers/a6xx.xml
+++ b/src/freedreno/registers/a6xx.xml
@@ -2294,6 +2294,7 @@ to upconvert to 32b float internally?
 		<bitfield name="INDEPENDENT_BLEND" pos="8" type="boolean"/>
 		<bitfield name="DUAL_COLOR_IN_ENABLE" pos="9" type="boolean"/>
 		<bitfield name="ALPHA_TO_COVERAGE" pos="10" type="boolean"/>
+		<bitfield name="ALPHA_TO_ONE" pos="11" type="boolean"/>
 		<bitfield name="SAMPLE_MASK" low="16" high="31"/>
 	</reg32>
 	<reg32 offset="0x8870" name="RB_DEPTH_PLANE_CNTL">
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index dfadb66d5e2..6e0b787beba 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -598,7 +598,7 @@ tu_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
       .depthBounds = false,
       .wideLines = false,
       .largePoints = false,
-      .alphaToOne = false,
+      .alphaToOne = true,
       .multiViewport = false,
       .samplerAnisotropy = true,
       .textureCompressionETC2 = true,
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 6a6fd2728aa..158297d9d17 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -2058,8 +2058,6 @@ tu6_emit_blend_control(struct tu_cs *cs,
                        bool dual_src_blend,
                        const VkPipelineMultisampleStateCreateInfo *msaa_info)
 {
-   assert(!msaa_info->alphaToOneEnable);
-
    const uint32_t sample_mask =
       msaa_info->pSampleMask ? (*msaa_info->pSampleMask & 0xffff)
                              : ((1 << msaa_info->rasterizationSamples) - 1);
@@ -2076,7 +2074,8 @@ tu6_emit_blend_control(struct tu_cs *cs,
                                       .independent_blend = true,
                                       .sample_mask = sample_mask,
                                       .dual_color_in_enable = dual_src_blend,
-                                      .alpha_to_coverage = msaa_info->alphaToCoverageEnable));
+                                      .alpha_to_coverage = msaa_info->alphaToCoverageEnable,
+                                      .alpha_to_one = msaa_info->alphaToOneEnable));
 }
 
 void



More information about the mesa-commit mailing list