Mesa (master): radv: Allow setting the domain origin in tess.

Bas Nieuwenhuizen bnieuwenhuizen at kemper.freedesktop.org
Thu Oct 5 23:42:34 UTC 2017


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

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Fri Oct  6 01:10:11 2017 +0200

radv: Allow setting the domain origin in tess.

Reviewed-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/vulkan/radv_pipeline.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 5800f29707..95a00cb357 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1542,11 +1542,19 @@ calculate_tess_state(struct radv_pipeline *pipeline,
 		break;
 	}
 
+	bool ccw = tes->info.tes.ccw;
+	const VkPipelineTessellationDomainOriginStateCreateInfoKHR *domain_origin_state =
+	              vk_find_struct_const(pCreateInfo->pTessellationState,
+	                                   PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR);
+
+	if (domain_origin_state && domain_origin_state->domainOrigin != VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR)
+		ccw = !ccw;
+
 	if (tes->info.tes.point_mode)
 		topology = V_028B6C_OUTPUT_POINT;
 	else if (tes->info.tes.primitive_mode == GL_ISOLINES)
 		topology = V_028B6C_OUTPUT_LINE;
-	else if (tes->info.tes.ccw)
+	else if (ccw)
 		topology = V_028B6C_OUTPUT_TRIANGLE_CW;
 	else
 		topology = V_028B6C_OUTPUT_TRIANGLE_CCW;




More information about the mesa-commit mailing list