Replace some nullptrs with VK_NULL_HANDLE
authorjvanverth <jvanverth@google.com>
Wed, 2 Mar 2016 20:08:22 +0000 (12:08 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 2 Mar 2016 20:08:22 +0000 (12:08 -0800)
Also ensures GrVkRenderPass.h ends with a LF.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1758003002

NOTRY=true

Review URL: https://codereview.chromium.org/1758003002

src/gpu/vk/GrVkImage.h
src/gpu/vk/GrVkPipeline.cpp
src/gpu/vk/GrVkProgram.cpp
src/gpu/vk/GrVkRenderPass.h

index 3467a61f2bb735a9ec5ae89dcf53376c8e344490..eb0f7bf4fe99976f1a2bf8cff7639df2c4f5a324 100644 (file)
@@ -29,7 +29,7 @@ public:
         VkDeviceMemory fAlloc;
         Flags          fFlags;
 
-        Resource() : INHERITED(), fImage(nullptr), fAlloc(nullptr), fFlags(kNo_Flags) {}
+        Resource() : INHERITED(), fImage(VK_NULL_HANDLE), fAlloc(VK_NULL_HANDLE), fFlags(kNo_Flags) {}
 
         Resource(VkImage image, VkDeviceMemory alloc, Flags flags)
             : fImage(image), fAlloc(alloc), fFlags(flags) {}
index 8c05de5fdc8404b97e7e8fc2e3a9e7a4ff44b144..becebac269f8d2152a2f446a4ac93c8d8807a686 100644 (file)
@@ -495,7 +495,7 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
 
     VkPipeline vkPipeline;
     VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->device(),
-                                                                          nullptr, 1, 
+                                                                          VK_NULL_HANDLE, 1, 
                                                                           &pipelineCreateInfo, 
                                                                           nullptr, &vkPipeline));
     if (err) {
index 00f01b70c80b2aeeb7612e6e493bf76f72868113..0e1e201c2b5bd6405f61dddbe436f6e0f7df5bde 100644 (file)
@@ -100,18 +100,18 @@ void GrVkProgram::freeGPUResources(const GrVkGpu* gpu) {
         GR_VK_CALL(gpu->vkInterface(), DestroyPipelineLayout(gpu->device(),
                                                              fPipelineLayout,
                                                              nullptr));
-        fPipelineLayout = nullptr;
+        fPipelineLayout = VK_NULL_HANDLE;
     }
 
     if (fDSLayout[0]) {
         GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorSetLayout(gpu->device(), fDSLayout[0],
                                                                   nullptr));
-        fDSLayout[0] = nullptr;
+        fDSLayout[0] = VK_NULL_HANDLE;
     }
     if (fDSLayout[1]) {
         GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorSetLayout(gpu->device(), fDSLayout[1],
                                                                   nullptr));
-        fDSLayout[1] = nullptr;
+        fDSLayout[1] = VK_NULL_HANDLE;
     }
 
     if (fVertexUniformBuffer) {
@@ -129,9 +129,9 @@ void GrVkProgram::abandonGPUResources() {
     fPipeline = nullptr;
     fDescriptorPool->unrefAndAbandon();
     fDescriptorPool = nullptr;
-    fPipelineLayout = nullptr;
-    fDSLayout[0] = nullptr;
-    fDSLayout[1] = nullptr;
+    fPipelineLayout = VK_NULL_HANDLE;
+    fDSLayout[0] = VK_NULL_HANDLE;
+    fDSLayout[1] = VK_NULL_HANDLE;
 
     fVertexUniformBuffer->abandon();
     fFragmentUniformBuffer->abandon();
index d460741d5e5ae916c41c77084e1f62f97d4f9fd2..2f7e2875427ba05edce0ff6f2bb4b631bd0513e0 100644 (file)
@@ -19,7 +19,7 @@ class GrVkRenderTarget;
 
 class GrVkRenderPass : public GrVkResource {
 public:
-    GrVkRenderPass() : INHERITED(), fRenderPass(nullptr) {}
+    GrVkRenderPass() : INHERITED(), fRenderPass(VK_NULL_HANDLE) {}
     void initSimple(const GrVkGpu* gpu, const GrVkRenderTarget& target);
 
     struct AttachmentsDescriptor {
@@ -87,4 +87,4 @@ private:
 
 GR_MAKE_BITFIELD_OPS(GrVkRenderPass::AttachmentFlags);
 
-#endif
\ No newline at end of file
+#endif