mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
v3dv: don't try to access pColorBlendState if rasterization is disabled
Fixes: dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics Reviewed-by: Juan A. Suarez <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12337>
This commit is contained in:
parent
777de86eb1
commit
ede320fa90
1 changed files with 7 additions and 5 deletions
|
|
@ -1140,7 +1140,8 @@ pipeline_populate_v3d_fs_key(struct v3d_fs_key *key,
|
||||||
key->has_gs = has_geometry_shader;
|
key->has_gs = has_geometry_shader;
|
||||||
|
|
||||||
const VkPipelineColorBlendStateCreateInfo *cb_info =
|
const VkPipelineColorBlendStateCreateInfo *cb_info =
|
||||||
pCreateInfo->pColorBlendState;
|
!pCreateInfo->pRasterizationState->rasterizerDiscardEnable ?
|
||||||
|
pCreateInfo->pColorBlendState : NULL;
|
||||||
|
|
||||||
key->logicop_func = cb_info && cb_info->logicOpEnable == VK_TRUE ?
|
key->logicop_func = cb_info && cb_info->logicOpEnable == VK_TRUE ?
|
||||||
vk_to_pipe_logicop[cb_info->logicOp] :
|
vk_to_pipe_logicop[cb_info->logicOp] :
|
||||||
|
|
@ -1955,19 +1956,20 @@ pipeline_populate_graphics_key(struct v3dv_pipeline *pipeline,
|
||||||
key->robust_buffer_access =
|
key->robust_buffer_access =
|
||||||
pipeline->device->features.robustBufferAccess;
|
pipeline->device->features.robustBufferAccess;
|
||||||
|
|
||||||
|
const bool raster_enabled =
|
||||||
|
!pCreateInfo->pRasterizationState->rasterizerDiscardEnable;
|
||||||
|
|
||||||
const VkPipelineInputAssemblyStateCreateInfo *ia_info =
|
const VkPipelineInputAssemblyStateCreateInfo *ia_info =
|
||||||
pCreateInfo->pInputAssemblyState;
|
pCreateInfo->pInputAssemblyState;
|
||||||
key->topology = vk_to_pipe_prim_type[ia_info->topology];
|
key->topology = vk_to_pipe_prim_type[ia_info->topology];
|
||||||
|
|
||||||
const VkPipelineColorBlendStateCreateInfo *cb_info =
|
const VkPipelineColorBlendStateCreateInfo *cb_info =
|
||||||
pCreateInfo->pColorBlendState;
|
raster_enabled ? pCreateInfo->pColorBlendState : NULL;
|
||||||
|
|
||||||
key->logicop_func = cb_info && cb_info->logicOpEnable == VK_TRUE ?
|
key->logicop_func = cb_info && cb_info->logicOpEnable == VK_TRUE ?
|
||||||
vk_to_pipe_logicop[cb_info->logicOp] :
|
vk_to_pipe_logicop[cb_info->logicOp] :
|
||||||
PIPE_LOGICOP_COPY;
|
PIPE_LOGICOP_COPY;
|
||||||
|
|
||||||
const bool raster_enabled =
|
|
||||||
!pCreateInfo->pRasterizationState->rasterizerDiscardEnable;
|
|
||||||
|
|
||||||
/* Multisample rasterization state must be ignored if rasterization
|
/* Multisample rasterization state must be ignored if rasterization
|
||||||
* is disabled.
|
* is disabled.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue