mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
radv: fix creating unlinked shaders with ESO when nextStage is 0
When nextStage is 0, the driver needs to assume that a stage might be used with any valid next stages. Fixes new dEQP-VK.shader_object.binding.*_no_next_stage. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29567>
This commit is contained in:
parent
cc82f7f8ac
commit
d4ccae739b
1 changed files with 31 additions and 2 deletions
|
|
@ -150,7 +150,36 @@ radv_shader_object_init_graphics(struct radv_shader_object *shader_obj, struct r
|
|||
struct radv_shader *shader = NULL;
|
||||
struct radv_shader_binary *binary = NULL;
|
||||
|
||||
if (!pCreateInfo->nextStage) {
|
||||
VkShaderStageFlags next_stages = pCreateInfo->nextStage;
|
||||
if (!next_stages) {
|
||||
/* When next stage is 0, gather all valid next stages. */
|
||||
switch (pCreateInfo->stage) {
|
||||
case VK_SHADER_STAGE_VERTEX_BIT:
|
||||
next_stages |=
|
||||
VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
break;
|
||||
case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT:
|
||||
next_stages |= VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;
|
||||
break;
|
||||
case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT:
|
||||
next_stages |= VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
break;
|
||||
case VK_SHADER_STAGE_GEOMETRY_BIT:
|
||||
case VK_SHADER_STAGE_MESH_BIT_EXT:
|
||||
next_stages |= VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
break;
|
||||
case VK_SHADER_STAGE_TASK_BIT_EXT:
|
||||
next_stages |= VK_SHADER_STAGE_MESH_BIT_EXT;
|
||||
break;
|
||||
case VK_SHADER_STAGE_FRAGMENT_BIT:
|
||||
case VK_SHADER_STAGE_COMPUTE_BIT:
|
||||
break;
|
||||
default:
|
||||
unreachable("Invalid shader stage");
|
||||
}
|
||||
}
|
||||
|
||||
if (!next_stages) {
|
||||
struct radv_shader *shaders[MESA_VULKAN_SHADER_STAGES] = {NULL};
|
||||
struct radv_shader_binary *binaries[MESA_VULKAN_SHADER_STAGES] = {NULL};
|
||||
|
||||
|
|
@ -165,7 +194,7 @@ radv_shader_object_init_graphics(struct radv_shader_object *shader_obj, struct r
|
|||
shader_obj->shader = shader;
|
||||
shader_obj->binary = binary;
|
||||
} else {
|
||||
radv_foreach_stage(next_stage, pCreateInfo->nextStage)
|
||||
radv_foreach_stage(next_stage, next_stages)
|
||||
{
|
||||
struct radv_shader *shaders[MESA_VULKAN_SHADER_STAGES] = {NULL};
|
||||
struct radv_shader_binary *binaries[MESA_VULKAN_SHADER_STAGES] = {NULL};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue