aboutsummaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_private.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-10-07 09:31:53 -0700
committerJason Ekstrand <[email protected]>2015-10-07 09:36:27 -0700
commit55fcca306b349a959feecae8f84a6b62f532114f (patch)
treebf0403fd5b17a321d6d8e0d21e498dc8693dee38 /src/vulkan/anv_private.h
parent941a1059541197dfb356b45f1e003745533c4b0e (diff)
anv: Add a dynamic state data structure and basic helpers
Diffstat (limited to 'src/vulkan/anv_private.h')
-rw-r--r--src/vulkan/anv_private.h56
1 files changed, 53 insertions, 3 deletions
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index ac9422f6b90..047c1cf4355 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -763,9 +763,11 @@ void
anv_descriptor_set_destroy(struct anv_device *device,
struct anv_descriptor_set *set);
-#define MAX_VBS 32
-#define MAX_SETS 8
-#define MAX_RTS 8
+#define MAX_VBS 32
+#define MAX_SETS 8
+#define MAX_RTS 8
+#define MAX_VIEWPORTS 16
+#define MAX_SCISSORS 16
#define MAX_PUSH_CONSTANTS_SIZE 128
#define MAX_DYNAMIC_BUFFERS 16
#define MAX_IMAGES 8
@@ -839,6 +841,54 @@ struct anv_push_constants {
struct brw_image_param images[MAX_IMAGES];
};
+struct anv_dynamic_state {
+ struct {
+ uint32_t count;
+ VkViewport viewports[MAX_VIEWPORTS];
+ } viewport;
+
+ struct {
+ uint32_t count;
+ VkRect2D scissors[MAX_SCISSORS];
+ } scissor;
+
+ float line_width;
+
+ struct {
+ float bias;
+ float clamp;
+ float slope_scaled;
+ } depth_bias;
+
+ float blend_constants[4];
+
+ struct {
+ float min;
+ float max;
+ } depth_bounds;
+
+ struct {
+ uint32_t front;
+ uint32_t back;
+ } stencil_compare_mask;
+
+ struct {
+ uint32_t front;
+ uint32_t back;
+ } stencil_write_mask;
+
+ struct {
+ uint32_t front;
+ uint32_t back;
+ } stencil_reference;
+};
+
+extern const struct anv_dynamic_state default_dynamic_state;
+
+void anv_dynamic_state_copy(struct anv_dynamic_state *dest,
+ const struct anv_dynamic_state *src,
+ uint32_t copy_mask);
+
/** State required while building cmd buffer */
struct anv_cmd_state {
uint32_t current_pipeline;