GrVkPipeline.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2016 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef GrVkPipeline_DEFINED
  8. #define GrVkPipeline_DEFINED
  9. #include "include/gpu/vk/GrVkTypes.h"
  10. #include "include/private/GrTypesPriv.h"
  11. #include "src/gpu/vk/GrVkResource.h"
  12. class GrPipeline;
  13. class GrPrimitiveProcessor;
  14. class GrRenderTarget;
  15. class GrXferProcessor;
  16. class GrStencilSettings;
  17. class GrVkCommandBuffer;
  18. class GrVkGpu;
  19. class GrVkRenderPass;
  20. struct SkIRect;
  21. class GrVkPipeline : public GrVkResource {
  22. public:
  23. static GrVkPipeline* Create(GrVkGpu*,
  24. int numColorSamples,
  25. const GrPrimitiveProcessor&,
  26. const GrPipeline& pipeline,
  27. const GrStencilSettings&,
  28. GrSurfaceOrigin,
  29. VkPipelineShaderStageCreateInfo* shaderStageInfo,
  30. int shaderStageCount,
  31. GrPrimitiveType primitiveType,
  32. VkRenderPass compatibleRenderPass,
  33. VkPipelineLayout layout,
  34. VkPipelineCache cache);
  35. VkPipeline pipeline() const { return fPipeline; }
  36. static void SetDynamicScissorRectState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*,
  37. GrSurfaceOrigin, SkIRect);
  38. static void SetDynamicViewportState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*);
  39. static void SetDynamicBlendConstantState(GrVkGpu*, GrVkCommandBuffer*,
  40. const GrSwizzle& outputSwizzle,
  41. const GrXferProcessor&);
  42. #ifdef SK_TRACE_VK_RESOURCES
  43. void dumpInfo() const override {
  44. SkDebugf("GrVkPipeline: %d (%d refs)\n", fPipeline, this->getRefCnt());
  45. }
  46. #endif
  47. protected:
  48. GrVkPipeline(VkPipeline pipeline) : INHERITED(), fPipeline(pipeline) {}
  49. VkPipeline fPipeline;
  50. private:
  51. void freeGPUData(GrVkGpu* gpu) const override;
  52. typedef GrVkResource INHERITED;
  53. };
  54. #endif