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

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

Issue 1765923002: Add DescriptorPool and set manager to GrVkProgram (Closed) Base URL: https://skia.googlesource.com/skia.git@samplerDesc
Patch Set: rebase 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/GrVkDescriptorPool.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkDescriptorPool.h
diff --git a/src/gpu/vk/GrVkDescriptorPool.h b/src/gpu/vk/GrVkDescriptorPool.h
index b20b01827ca8aac38b553bb6f7566fad5bdc7ae2..ad24453ef6af52be545c57370c98a1ffdbacb618 100644
--- a/src/gpu/vk/GrVkDescriptorPool.h
+++ b/src/gpu/vk/GrVkDescriptorPool.h
@@ -14,39 +14,28 @@
class GrVkGpu;
+/**
+ * We require that all descriptor sets are of a single descriptor type. We also use a pool to only
+ * make one type of descriptor set. Thus a single VkDescriptorPool will only allocated space for
+ * for one type of descriptor.
+ */
class GrVkDescriptorPool : public GrVkResource {
public:
- class DescriptorTypeCounts {
- public:
- DescriptorTypeCounts() {
- memset(fDescriptorTypeCount, 0, sizeof(fDescriptorTypeCount));
- }
-
- void setTypeCount(VkDescriptorType type, uint8_t count);
- int numPoolSizes() const;
-
- // Determines if for each i, that.fDescriptorTypeCount[i] <= fDescriptorTypeCount[i];
- bool isSuperSet(const DescriptorTypeCounts& that) const;
- private:
- uint8_t fDescriptorTypeCount[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
-
- friend class GrVkDescriptorPool;
- };
-
- explicit GrVkDescriptorPool(const GrVkGpu* gpu, const DescriptorTypeCounts& typeCounts);
+ explicit GrVkDescriptorPool(const GrVkGpu* gpu, VkDescriptorType type, uint32_t count);
VkDescriptorPool descPool() const { return fDescPool; }
void reset(const GrVkGpu* gpu);
// Returns whether or not this descriptor pool could be used, assuming it gets fully reset and
- // not in use by another draw, to support the requested typeCounts.
- bool isCompatible(const DescriptorTypeCounts& typeCounts) const;
+ // not in use by another draw, to support the requested type and count.
+ bool isCompatible(VkDescriptorType type, uint32_t count) const;
private:
void freeGPUData(const GrVkGpu* gpu) const override;
- DescriptorTypeCounts fTypeCounts;
+ VkDescriptorType fType;
+ uint32_t fCount;
VkDescriptorPool fDescPool;
typedef GrVkResource INHERITED;
« no previous file with comments | « no previous file | src/gpu/vk/GrVkDescriptorPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698