Replace some nullptrs with VK_NULL_HANDLE

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
This commit is contained in:
jvanverth 2016-03-02 12:08:22 -08:00 committed by Commit bot
parent 73c4e64f4b
commit 9846ef2633
4 changed files with 10 additions and 10 deletions

View 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) {}

View 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) {

View 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();

View 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
#endif