tu: Implement extendedDynamicState3AlphaToOneEnable
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 30 Sep 2022 09:53:25 +0000 (11:53 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Nov 2022 21:59:42 +0000 (21:59 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>

src/freedreno/vulkan/tu_cmd_buffer.c
src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_pipeline.c

index b7071158e8250492c5a318635d998435069afa01..878e6e5d44236fc4bd2f4bffc5a7f70188d269ff 100644 (file)
@@ -3215,6 +3215,19 @@ tu_CmdSetAlphaToCoverageEnableEXT(VkCommandBuffer commandBuffer,
    cmd->state.dirty |= TU_CMD_DIRTY_BLEND;
 }
 
+VKAPI_ATTR void VKAPI_CALL
+tu_CmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer,
+                             VkBool32 alphaToOneEnable)
+{
+   TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer);
+
+   cmd->state.rb_blend_cntl =
+      (cmd->state.rb_blend_cntl & ~A6XX_RB_BLEND_CNTL_ALPHA_TO_ONE) |
+      COND(alphaToOneEnable, A6XX_RB_BLEND_CNTL_ALPHA_TO_ONE);
+
+   cmd->state.dirty |= TU_CMD_DIRTY_BLEND;
+}
+
 static void
 tu_flush_for_access(struct tu_cache_state *cache,
                     enum tu_cmd_access_mask src_mask,
index 2add8d05b5ae0b2e85ae2272ec10e18f65d5bcbb..92c6f73a4c5d88fe957fa2cb1d54497a75f52d83 100644 (file)
@@ -769,7 +769,7 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
          features->extendedDynamicState3SampleMask = true;
          features->extendedDynamicState3RasterizationSamples = true;
          features->extendedDynamicState3AlphaToCoverageEnable = true;
-         features->extendedDynamicState3AlphaToOneEnable = false;
+         features->extendedDynamicState3AlphaToOneEnable = true;
          features->extendedDynamicState3DepthClipNegativeOneToOne = false;
          features->extendedDynamicState3RasterizationStream = false;
          features->extendedDynamicState3ConservativeRasterizationMode = false;
index 020c0d4b379129b995ed4d008678c0e89a865554..706258de49b8a9c09165528f03b8216010fc8cb1 100644 (file)
@@ -3754,6 +3754,11 @@ tu_pipeline_builder_parse_dynamic(struct tu_pipeline_builder *builder,
          pipeline->blend.sp_blend_cntl_mask &=
             ~A6XX_SP_BLEND_CNTL_ALPHA_TO_COVERAGE;
          break;
+      case VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT:
+         pipeline->dynamic_state_mask |= BIT(TU_DYNAMIC_STATE_BLEND);
+         pipeline->blend.rb_blend_cntl_mask &=
+            ~A6XX_RB_BLEND_CNTL_ALPHA_TO_ONE;
+         break;
       default:
          assert(!"unsupported dynamic state");
          break;