anv/cmd_buffer: Add an alloc_surface_state helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Oct 2015 20:45:07 +0000 (13:45 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Oct 2015 20:45:07 +0000 (13:45 -0700)
src/vulkan/anv_batch_chain.c
src/vulkan/anv_private.h
src/vulkan/gen7_state.c
src/vulkan/gen8_state.c

index c621c0745b701289e11cde9a2e3276c0153e7853..77fbd6635c010d8bc5f39b369be52cd244a53768 100644 (file)
@@ -483,6 +483,12 @@ anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer,
    return state;
 }
 
+struct anv_state
+anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer)
+{
+   return anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64);
+}
+
 struct anv_state
 anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer,
                                    uint32_t size, uint32_t alignment)
index 757a149289f577b0eea0a8aaffc8cfaeee57c7f5..bcfb6fada50b064edf92f1b96b8c1ac6f9a23951 100644 (file)
@@ -992,6 +992,8 @@ struct anv_state
 anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer,
                                    uint32_t entries, uint32_t *state_offset);
 struct anv_state
+anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer);
+struct anv_state
 anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer,
                                    uint32_t size, uint32_t alignment);
 
index d317fa4ec165fe3a801d821b83fdc8b6f700af7d..aef97838e17e0723938e09fbc3171d861f757fc7 100644 (file)
@@ -118,8 +118,7 @@ gen7_alloc_surface_state(struct anv_device *device,
                          struct anv_cmd_buffer *cmd_buffer)
 {
       if (cmd_buffer) {
-         return anv_state_stream_alloc(&cmd_buffer->surface_state_stream,
-                                      64, 64);
+         return anv_cmd_buffer_alloc_surface_state(cmd_buffer);
       } else {
          return anv_state_pool_alloc(&device->surface_state_pool, 64, 64);
       }
index 9be3bf4602144136ca28380676cec0d4abb7b117..d9438127f2a845b95c600d61cc7f92e44dc55855 100644 (file)
@@ -104,8 +104,7 @@ gen8_alloc_surface_state(struct anv_device *device,
                          struct anv_cmd_buffer *cmd_buffer)
 {
       if (cmd_buffer) {
-         return anv_state_stream_alloc(&cmd_buffer->surface_state_stream,
-                                      64, 64);
+         return anv_cmd_buffer_alloc_surface_state(cmd_buffer);
       } else {
          return anv_state_pool_alloc(&device->surface_state_pool, 64, 64);
       }