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

Unified Diff: src/gpu/vk/GrVkCommandBuffer.h

Issue 1813913002: Use dynamic state from vulkan pipelines (Closed) Base URL: https://skia.googlesource.com/skia.git@drawInterface
Patch Set: cache dynamic state updates Created 4 years, 9 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 | « no previous file | src/gpu/vk/GrVkCommandBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkCommandBuffer.h
diff --git a/src/gpu/vk/GrVkCommandBuffer.h b/src/gpu/vk/GrVkCommandBuffer.h
index 5cdb2c0b2f7cd6b4173c56416d0fd6b9632f1ba6..de60a449434fd1ffafcb59b158bdbf44218a902d 100644
--- a/src/gpu/vk/GrVkCommandBuffer.h
+++ b/src/gpu/vk/GrVkCommandBuffer.h
@@ -9,11 +9,11 @@
#define GrVkCommandBuffer_DEFINED
#include "GrVkGpu.h"
-#include "GrVkPipeline.h"
#include "GrVkResource.h"
#include "GrVkUtil.h"
#include "vulkan/vulkan.h"
+class GrVkPipeline;
class GrVkRenderPass;
class GrVkRenderTarget;
class GrVkTransferBuffer;
@@ -39,15 +39,6 @@ public:
bool finished(const GrVkGpu* gpu) const;
////////////////////////////////////////////////////////////////////////////
- // CommandBuffer State/Object bindings
- ////////////////////////////////////////////////////////////////////////////
-#if 0
- void bindPipeline(const GrVkGpu* gpu) const;
- void bindDynamicState(const GrVkGpu* gpu) const;
- void bindDescriptorSet(const GrVkGpu* gpu) const;
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
// CommandBuffer commands
////////////////////////////////////////////////////////////////////////////
enum BarrierType {
@@ -91,13 +82,6 @@ public:
}
}
- void bindPipeline(const GrVkGpu* gpu, const GrVkPipeline* pipeline) {
- GR_VK_CALL(gpu->vkInterface(), CmdBindPipeline(fCmdBuffer,
- VK_PIPELINE_BIND_POINT_GRAPHICS,
- pipeline->pipeline()));
- addResource(pipeline);
- }
-
void bindDescriptorSets(const GrVkGpu* gpu,
GrVkProgram*,
VkPipelineLayout layout,
@@ -106,6 +90,18 @@ public:
const VkDescriptorSet* descriptorSets,
uint32_t dynamicOffsetCount,
const uint32_t* dynamicOffsets);
+
+ void setViewport(const GrVkGpu* gpu,
+ uint32_t firstViewport,
+ uint32_t viewportCount,
+ const VkViewport* viewports);
+
+ void setScissor(const GrVkGpu* gpu,
+ uint32_t firstScissor,
+ uint32_t scissorCount,
+ const VkRect2D* scissors);
+
+ void setBlendConstants(const GrVkGpu* gpu, const float blendConstants[4]);
// Commands that only work outside of a render pass
void clearColorImage(const GrVkGpu* gpu,
@@ -149,6 +145,9 @@ public:
int numRects,
const VkClearRect* clearRects) const;
+ void bindPipeline(const GrVkGpu* gpu, const GrVkPipeline* pipeline);
+
+
void drawIndexed(const GrVkGpu* gpu,
uint32_t indexCount,
uint32_t instanceCount,
@@ -205,6 +204,11 @@ private:
// A nullptr means there is no active render pass. The GrVKCommandBuffer does not own the render
// pass.
const GrVkRenderPass* fActiveRenderPass;
+
+ // Cached values used for dynamic state updates
+ VkViewport fCachedViewport;
+ VkRect2D fCachedScissor;
+ float fCachedBlendConstant[4];
};
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCommandBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698