Commit Graph

13 Commits

Author SHA1 Message Date
Jason Ekstrand a5952c362e vulkan: Don't assert VkGraphicsPipelineLibraryCreateInfoEXT::Flags == 0
There are VUs that imply that this is a requirement but the CTS seems to
ignore it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand 0415d66c97 vulkan: Input assembly and depth/stencil can also be fully dynamic
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand ceccbc01f5 vulkan: Fix pipeline libraries with dynamic-only VI or FSR state
When we initialize the graphics pipeline state, we skip VI and FSR state
if they're 100% dynamic.  We need to do this if the current set of
dynamic things contains VI/FSR or if the set of dynamic state already in
the vk_graphics_pipeline_state has them dynamic.  Look state->dynamic
after we've merged instead of just looking at the dynamic set from the
VkGraphicsPipelineCreateInfo we were passed.

Also, when we validate, we need to assume that VI and FSR exist or else
we'll assert if dynamic VI or FSR are set.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand e5e828e91d vulkan: Add a fully_dynamic_state_groups() helper
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand 00269c09d6 vulkan: Depth/stencil isn't fragment output state but multisample is
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand cc84d4ca66 vulkan: Multisample state isn't always included in fragment shader state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand 50411bd786 vulkan: Record shader stages in vk_graphics_pipeline_state
Some of our asserts and other checks depend on the total set of stages,
not just the stages set in the current pCreateInfo.  Recording the stage
mask lets us combine them in vk_graphics_pipeline_state_merge().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jason Ekstrand 07f5f15963 vulkan/graphics_state: Improve the depth/stencil optimization code
We now disable stencil writes when the stencil test is disabled or when
both stencil write masks are zero.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17564>
2022-07-19 23:16:45 +00:00
Jason Ekstrand 9066cc86bb vulkan: Copy the depth/stencil state optimization code from ANV
Instead of having stencil writes as an out parameter of the optimization
function, we add a new write_enable field for stencil that's equivalent
to the similarly named field for depth.  This doesn't mean drivers must
actually support disabling stencil writes independently but the
information may be helpful on some hardware.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
2022-07-19 19:19:34 +00:00
Jason Ekstrand 4ad149a8fc vulkan: Add a common implementation of vkCmdSet*
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
2022-07-19 19:19:34 +00:00
Jason Ekstrand fcedb1250b vulkan: Add a common data structure for dynamic states
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
2022-07-19 19:19:34 +00:00
Jason Ekstrand 7ca8dcb05f vulkan: Add data structures to store all graphics state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
2022-07-19 19:19:33 +00:00
Jason Ekstrand fb3f9c0aac vulkan: Add an enum for all dynamic graphics states
Also, add a helper function to turn VkPipelineDynamicStateCreateInfo
into a bitset.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
2022-07-19 19:19:33 +00:00