aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vulkan/compute_pipeline.cc10
-rw-r--r--src/vulkan/graphics_pipeline.cc10
-rw-r--r--src/vulkan/pipeline.cc11
-rw-r--r--src/vulkan/pipeline.h5
4 files changed, 5 insertions, 31 deletions
diff --git a/src/vulkan/compute_pipeline.cc b/src/vulkan/compute_pipeline.cc
index 262b822..377b0c9 100644
--- a/src/vulkan/compute_pipeline.cc
+++ b/src/vulkan/compute_pipeline.cc
@@ -69,15 +69,7 @@ Result ComputePipeline::CreateVkComputePipeline(
}
Result ComputePipeline::Compute(uint32_t x, uint32_t y, uint32_t z) {
- Result r = command_->BeginIfNotInRecording();
- if (!r.IsSuccess())
- return r;
-
- r = SendDescriptorDataToDeviceIfNeeded();
- if (!r.IsSuccess())
- return r;
-
- r = command_->SubmitAndReset(GetFenceTimeout());
+ Result r = SendDescriptorDataToDeviceIfNeeded();
if (!r.IsSuccess())
return r;
diff --git a/src/vulkan/graphics_pipeline.cc b/src/vulkan/graphics_pipeline.cc
index 3244f31..08add8a 100644
--- a/src/vulkan/graphics_pipeline.cc
+++ b/src/vulkan/graphics_pipeline.cc
@@ -822,15 +822,7 @@ Result GraphicsPipeline::ClearBuffer(const VkClearValue& clear_value,
Result GraphicsPipeline::Draw(const DrawArraysCommand* command,
VertexBuffer* vertex_buffer) {
- Result r = command_->BeginIfNotInRecording();
- if (!r.IsSuccess())
- return r;
-
- r = SendDescriptorDataToDeviceIfNeeded();
- if (!r.IsSuccess())
- return r;
-
- r = command_->SubmitAndReset(GetFenceTimeout());
+ Result r = SendDescriptorDataToDeviceIfNeeded();
if (!r.IsSuccess())
return r;
diff --git a/src/vulkan/pipeline.cc b/src/vulkan/pipeline.cc
index b01d636..c5cd9c5 100644
--- a/src/vulkan/pipeline.cc
+++ b/src/vulkan/pipeline.cc
@@ -355,6 +355,9 @@ Result Pipeline::SendDescriptorDataToDeviceIfNeeded() {
}
}
+ r = command_->SubmitAndReset(GetFenceTimeout());
+ if (!r.IsSuccess())
+ return r;
return {};
}
@@ -408,13 +411,5 @@ const char* Pipeline::GetEntryPointName(VkShaderStageFlagBits stage) const {
return kDefaultEntryPointName;
}
-Result Pipeline::ProcessCommands() {
- Result r = command_->BeginIfNotInRecording();
- if (!r.IsSuccess())
- return r;
-
- return command_->SubmitAndReset(GetFenceTimeout());
-}
-
} // namespace vulkan
} // namespace amber
diff --git a/src/vulkan/pipeline.h b/src/vulkan/pipeline.h
index 3b71f2a..070b121 100644
--- a/src/vulkan/pipeline.h
+++ b/src/vulkan/pipeline.h
@@ -62,11 +62,6 @@ class Pipeline {
entry_points_[stage] = entry;
}
- // End recording command buffer if it is in recording state. This
- // method also submits commands in the command buffer and reset
- // the command buffer.
- Result ProcessCommands();
-
CommandBuffer* GetCommandBuffer() const { return command_.get(); }
Device* GetDevice() const { return device_; }