mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 22:20:27 +01: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>
(cherry picked from commit d4ccae739b)
This commit is contained in:
parent
6faf208ce8
commit
8fe207e751
2 changed files with 32 additions and 3 deletions
|
|
@ -504,7 +504,7 @@
|
|||
"description": "radv: fix creating unlinked shaders with ESO when nextStage is 0",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -147,7 +147,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};
|
||||
|
||||
|
|
@ -162,7 +191,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