Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: src/gpu/vk/GrVkGpu.cpp

Issue 2112653002: Add static buffer support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkMemory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index e5d24fc5806ff8044a55da6416b311f9c9bcb8f3..ab6761cc32b5ccda141ca310bdd8215ed9065ed8 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -425,9 +425,9 @@ bool GrVkGpu::uploadTexDataLinear(GrVkTexture* tex,
}
bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
- int left, int top, int width, int height,
- GrPixelConfig dataConfig,
- const SkTArray<GrMipLevel>& texels) {
+ int left, int top, int width, int height,
+ GrPixelConfig dataConfig,
+ const SkTArray<GrMipLevel>& texels) {
SkASSERT(!tex->isLinearTiled());
// The assumption is either that we have no mipmaps, or that our rect is the entire texture
SkASSERT(1 == texels.count() ||
@@ -555,10 +555,6 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
regions.count(),
regions.begin());
-
- // Submit the current command buffer to the Queue
- this->submitCommandBuffer(kSkip_SyncQueue);
-
transferBuffer->unref();
return true;
@@ -661,6 +657,16 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budget
////////////////////////////////////////////////////////////////////////////////
+bool GrVkGpu::updateBuffer(GrVkBuffer* buffer, const void* src, size_t srcSizeInBytes) {
+
+ // Update the buffer
+ fCurrentCmdBuffer->updateBuffer(this, buffer, 0, srcSizeInBytes, src);
+
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin) {
// By default, all textures in Vk use TopLeft
if (kDefault_GrSurfaceOrigin == origin) {
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkMemory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698