aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_shader.c
diff options
context:
space:
mode:
authorBrian Ho <[email protected]>2020-04-01 09:01:52 -0700
committerMarge Bot <[email protected]>2020-04-07 14:13:20 +0000
commit1af71bee734da7d87e0ef1b71a64e12fa81ed92e (patch)
tree67727b00a29cdba485893d67ca5c0a7a188298a4 /src/freedreno/vulkan/tu_shader.c
parentdb2ee3686d396eabd9233e80e368da0e9ae521be (diff)
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>
Diffstat (limited to 'src/freedreno/vulkan/tu_shader.c')
-rw-r--r--src/freedreno/vulkan/tu_shader.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 1deb19d45ee..51e1c65177c 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -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
*/