anv/meta: Rename anv_cmd_buffer_save/restore
authorChad Versace <chad.versace@intel.com>
Tue, 3 Nov 2015 22:31:19 +0000 (14:31 -0800)
committerChad Versace <chad.versace@intel.com>
Wed, 4 Nov 2015 23:15:19 +0000 (15:15 -0800)
As the functions are now exposed in anv_meta.h, let's rename them
to clarify that they are meta functions.

    anv_cmd_buffer_save -> anv_meta_save
    anv_cmd_buffer_restore -> anv_meta_restore

src/vulkan/anv_meta.c
src/vulkan/anv_meta.h
src/vulkan/anv_meta_clear.c

index 880af14208dc744f4738b67bae7e642530601202..976d028127e7ab0eb759591c210667fa3e2a3c98 100644 (file)
@@ -120,9 +120,9 @@ build_nir_copy_fragment_shader(enum glsl_sampler_dim tex_dim)
 }
 
 void
-anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer,
-                    struct anv_meta_saved_state *state,
-                    uint32_t dynamic_state)
+anv_meta_save(struct anv_meta_saved_state *state,
+              const struct anv_cmd_buffer *cmd_buffer,
+              uint32_t dynamic_state)
 {
    state->old_pipeline = cmd_buffer->state.pipeline;
    state->old_descriptor_set0 = cmd_buffer->state.descriptors[0];
@@ -134,8 +134,8 @@ anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer,
 }
 
 void
-anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer,
-                       const struct anv_meta_saved_state *state)
+anv_meta_restore(const struct anv_meta_saved_state *state,
+                 struct anv_cmd_buffer *cmd_buffer)
 {
    cmd_buffer->state.pipeline = state->old_pipeline;
    cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
@@ -434,8 +434,8 @@ static void
 meta_prepare_blit(struct anv_cmd_buffer *cmd_buffer,
                   struct anv_meta_saved_state *saved_state)
 {
-   anv_cmd_buffer_save(cmd_buffer, saved_state,
-                       (1 << VK_DYNAMIC_STATE_VIEWPORT));
+   anv_meta_save(saved_state, cmd_buffer,
+                 (1 << VK_DYNAMIC_STATE_VIEWPORT));
 }
 
 struct blit_region {
@@ -625,7 +625,7 @@ static void
 meta_finish_blit(struct anv_cmd_buffer *cmd_buffer,
                  const struct anv_meta_saved_state *saved_state)
 {
-   anv_cmd_buffer_restore(cmd_buffer, saved_state);
+   anv_meta_restore(saved_state, cmd_buffer);
 }
 
 static VkFormat
index ac28d897f0b582928237540df175aceda37c68ca..2f26d94451627a46413eb247afe1f4fe3ed38ef1 100644 (file)
@@ -40,13 +40,13 @@ struct anv_meta_saved_state {
 };
 
 void
-anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer,
-                    struct anv_meta_saved_state *state,
-                    uint32_t dynamic_state);
+anv_meta_save(struct anv_meta_saved_state *state,
+              const struct anv_cmd_buffer *cmd_buffer,
+              uint32_t dynamic_state);
 
 void
-anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer,
-                       const struct anv_meta_saved_state *state);
+anv_meta_restore(const struct anv_meta_saved_state *state,
+                 struct anv_cmd_buffer *cmd_buffer);
 
 #ifdef __cplusplus
 }
index 3a6a369bfc11bd8068b17636a6f8130e763be069..8f217105b4ff9aeacdc771530d972159c8af40b7 100644 (file)
@@ -140,8 +140,8 @@ anv_cmd_buffer_clear_attachments(struct anv_cmd_buffer *cmd_buffer,
       }
    }
 
-   anv_cmd_buffer_save(cmd_buffer, &saved_state,
-                       (1 << VK_DYNAMIC_STATE_VIEWPORT));
+   anv_meta_save(&saved_state, cmd_buffer,
+                 (1 << VK_DYNAMIC_STATE_VIEWPORT));
    cmd_buffer->state.dynamic.viewport.count = 0;
 
    struct anv_subpass subpass = {
@@ -156,8 +156,7 @@ anv_cmd_buffer_clear_attachments(struct anv_cmd_buffer *cmd_buffer,
    meta_emit_clear(cmd_buffer, pass->num_color_clear_attachments,
                    instance_data, ds_clear_value);
 
-   /* Restore API state */
-   anv_cmd_buffer_restore(cmd_buffer, &saved_state);
+   anv_meta_restore(&saved_state, cmd_buffer);
 }
 
 static nir_shader *
@@ -401,8 +400,8 @@ void anv_CmdClearColorImage(
    ANV_FROM_HANDLE(anv_image, image, _image);
    struct anv_meta_saved_state saved_state;
 
-   anv_cmd_buffer_save(cmd_buffer, &saved_state,
-                       (1 << VK_DYNAMIC_STATE_VIEWPORT));
+   anv_meta_save(&saved_state, cmd_buffer,
+                 (1 << VK_DYNAMIC_STATE_VIEWPORT));
    cmd_buffer->state.dynamic.viewport.count = 0;
 
    for (uint32_t r = 0; r < rangeCount; r++) {
@@ -514,8 +513,7 @@ void anv_CmdClearColorImage(
       }
    }
 
-   /* Restore API state */
-   anv_cmd_buffer_restore(cmd_buffer, &saved_state);
+   anv_meta_restore(&saved_state, cmd_buffer);
 }
 
 void anv_CmdClearDepthStencilImage(