[Mesa-dev] [PATCH 08/20] radeonsi: assume that a VS without POSITION is LS

Marek Olšák maraeo at gmail.com
Wed Nov 16 18:38:31 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_state_shaders.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 9e95fea..d0869e3 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1117,20 +1117,27 @@ static void si_parse_next_shader_property(const struct tgsi_shader_info *info,
 	switch (info->processor) {
 	case PIPE_SHADER_VERTEX:
 		switch (next_shader) {
 		case PIPE_SHADER_GEOMETRY:
 			key->vs.as_es = 1;
 			break;
 		case PIPE_SHADER_TESS_CTRL:
 		case PIPE_SHADER_TESS_EVAL:
 			key->vs.as_ls = 1;
 			break;
+		default:
+			/* If POSITION isn't written, it can't be a HW VS.
+			 * Assume that it's a HW LS. (the next shader is TCS)
+			 * This heuristic is needed for separate shader objects.
+			 */
+			if (!info->writes_position)
+				key->as_ls = 1;
 		}
 		break;
 
 	case PIPE_SHADER_TESS_EVAL:
 		if (next_shader == PIPE_SHADER_GEOMETRY)
 			key->tes.as_es = 1;
 		break;
 	}
 }
 
-- 
2.7.4



More information about the mesa-dev mailing list