bug-14365: add dynamic state to PSO
This commit covers phase 2 of the removal of dynamic
state objects. Now, an application can include an array
of VK_DYNAMIC_STATE_* values that tell the driver
which PSO dynamic state elements to use.
I.e. if VK_DYNAMIC_STATE_LINE_WIDTH was specified in the
pDynamicState array then the ICD should use the lineWidth
defined at PSO create time and ignore any set using
vkCmdSetLineWidth.
To accomplish that the driver will make a copy of the
dynamic state specified in the PSO as well as a bitmask
of the affected state. When vkCmdSet* is called, the
driver will check if a PSO override is current and ignore
the call if so.
At PSO bind time the command buffer's dynamic state
will be updated and the PSO override bitmask set so that
any future vkCmdSet*'s will be appropriately ignored.
TODO: Validation layer should probably indicate a warning
if app tries to do vkCmdSet on state defined by the PSO.
diff --git a/icd/intel/pipeline.h b/icd/intel/pipeline.h
index 3241434..22ec7eb 100644
--- a/icd/intel/pipeline.h
+++ b/icd/intel/pipeline.h
@@ -33,6 +33,7 @@
#include "obj.h"
#include "desc.h"
#include "dev.h"
+#include "state.h"
enum intel_pipeline_shader_use {
INTEL_SHADER_USE_VID = (1 << 0),
@@ -230,6 +231,18 @@
*/
// VkPipelineDsStateCreateInfo ds_state
bool stencilTestEnable;
+
+ /* Dynamic state specified at PSO create time */
+ struct {
+ VkFlags use_pipeline_dynamic_state;
+ struct intel_dynamic_viewport viewport;
+ struct intel_dynamic_line_width line_width;
+ struct intel_dynamic_depth_bias depth_bias;
+ struct intel_dynamic_blend blend;
+ struct intel_dynamic_depth_bounds depth_bounds;
+ struct intel_dynamic_stencil stencil;
+ } state;
+
uint32_t cmd_depth_stencil;
uint32_t cmd_depth_test;