diff options
author | egdaniel <egdaniel@google.com> | 2016-06-08 14:02:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-08 14:02:27 -0700 |
commit | 066df7ca911b65d416783f3bec6f4f1662948ad5 (patch) | |
tree | 3ab14fe44d84871e83831d5686b3ab1067dae665 /src/gpu/GrGpuCommandBuffer.h | |
parent | 28215d44b3f9d100ba4420df43adb72cdff7d2b3 (diff) |
Add GpuCommandBuffer support.
Currently this is not actually hooked into the system.
To give some context, in a follow up CL I'll add this to GrDrawTarget.
For this I will move the gpu onDraw command to the GpuCommandBuffer as well.
For GL this will end up just being a pass through to a non virtual draw(...)
on GrGLGpu, and for vulkan it will mostly do what it currently does but
adding commands to the secondary command buffer instead.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2038583002
Review-Url: https://codereview.chromium.org/2038583002
Diffstat (limited to 'src/gpu/GrGpuCommandBuffer.h')
-rw-r--r-- | src/gpu/GrGpuCommandBuffer.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.h b/src/gpu/GrGpuCommandBuffer.h new file mode 100644 index 0000000000..3c6e6116fb --- /dev/null +++ b/src/gpu/GrGpuCommandBuffer.h @@ -0,0 +1,37 @@ +/* +* Copyright 2016 Google Inc. +* +* Use of this source code is governed by a BSD-style license that can be +* found in the LICENSE file. +*/ + +#ifndef GrGpuCommandBuffer_DEFINED +#define GrGpuCommandBuffer_DEFINED + +#include "GrColor.h" + +class GrRenderTarget; + +class GrGpuCommandBuffer { +public: + enum LoadAndStoreOp { + kLoadAndStore_LoadAndStoreOp, + kLoadAndDiscard_LoadAndStoreOp, + kClearAndStore_LoadAndStoreOp, + kClearAndDiscard_LoadAndStoreOp, + kDiscardAndStore_LoadAndStoreOp, + kDiscardAndDiscard_LoadAndStoreOp, + }; + + GrGpuCommandBuffer() {} + virtual ~GrGpuCommandBuffer() {} + + // Signals the end of recording to the command buffer and that it can now be submitted. + virtual void end() = 0; + + // Sends the command buffer off to the GPU object to execute the commands built up in the + // buffer. The gpu object is allowed to defer execution of the commands until it is flushed. + virtual void submit() = 0; +}; + +#endif |