turnip: Set has_gs in ir3_shader_key

The ir3 compiler only lowers the VS and GS for geometry shading if
the corresponding has_gs key is set in the shader key. Without it,
GS-specific intrinsics like load_per_vertex_input won't get lowered
and the GS header will be initialized with invalid values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4436>
This commit is contained in:
Brian Ho 2020-04-01 09:01:52 -07:00 committed by Marge Bot
parent db2ee3686d
commit 1af71bee73
1 changed files with 12 additions and 2 deletions

View File

@ -573,9 +573,19 @@ tu_shader_compile_options_init(
struct tu_shader_compile_options *options,
const VkGraphicsPipelineCreateInfo *pipeline_info)
{
*options = (struct tu_shader_compile_options) {
/* TODO ir3_key */
bool has_gs = false;
for (uint32_t i = 0; i < pipeline_info->stageCount; i++) {
if (pipeline_info->pStages[i].stage == VK_SHADER_STAGE_GEOMETRY_BIT) {
has_gs = true;
break;
}
}
*options = (struct tu_shader_compile_options) {
/* TODO: Populate the remaining fields of ir3_shader_key. */
.key = {
.has_gs = has_gs,
},
/* TODO: VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT
* some optimizations need to happen otherwise shader might not compile
*/