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

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: Remove resource tracking changes 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
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index e5d24fc5806ff8044a55da6416b311f9c9bcb8f3..ca1bb10636e91d4c552c7d93ab697f543bccc067 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() ||
@@ -661,6 +661,20 @@ 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);
+
+ // Submit the current command buffer to the Queue
+ // TODO: batch these?
+ this->submitCommandBuffer(kSkip_SyncQueue);
egdaniel 2016/06/30 13:51:19 why then need to submit the command buffer here?
jvanverth1 2016/06/30 14:56:38 Done.
+
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin) {
// By default, all textures in Vk use TopLeft
if (kDefault_GrSurfaceOrigin == origin) {
« src/gpu/vk/GrVkBuffer.cpp ('K') | « 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