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:
parent
73c4e64f4b
commit
9846ef2633
@ -29,7 +29,7 @@ public:
|
|||||||
VkDeviceMemory fAlloc;
|
VkDeviceMemory fAlloc;
|
||||||
Flags fFlags;
|
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)
|
Resource(VkImage image, VkDeviceMemory alloc, Flags flags)
|
||||||
: fImage(image), fAlloc(alloc), fFlags(flags) {}
|
: fImage(image), fAlloc(alloc), fFlags(flags) {}
|
||||||
|
@ -495,7 +495,7 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
|
|||||||
|
|
||||||
VkPipeline vkPipeline;
|
VkPipeline vkPipeline;
|
||||||
VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->device(),
|
VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->device(),
|
||||||
nullptr, 1,
|
VK_NULL_HANDLE, 1,
|
||||||
&pipelineCreateInfo,
|
&pipelineCreateInfo,
|
||||||
nullptr, &vkPipeline));
|
nullptr, &vkPipeline));
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -100,18 +100,18 @@ void GrVkProgram::freeGPUResources(const GrVkGpu* gpu) {
|
|||||||
GR_VK_CALL(gpu->vkInterface(), DestroyPipelineLayout(gpu->device(),
|
GR_VK_CALL(gpu->vkInterface(), DestroyPipelineLayout(gpu->device(),
|
||||||
fPipelineLayout,
|
fPipelineLayout,
|
||||||
nullptr));
|
nullptr));
|
||||||
fPipelineLayout = nullptr;
|
fPipelineLayout = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fDSLayout[0]) {
|
if (fDSLayout[0]) {
|
||||||
GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorSetLayout(gpu->device(), fDSLayout[0],
|
GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorSetLayout(gpu->device(), fDSLayout[0],
|
||||||
nullptr));
|
nullptr));
|
||||||
fDSLayout[0] = nullptr;
|
fDSLayout[0] = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
if (fDSLayout[1]) {
|
if (fDSLayout[1]) {
|
||||||
GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorSetLayout(gpu->device(), fDSLayout[1],
|
GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorSetLayout(gpu->device(), fDSLayout[1],
|
||||||
nullptr));
|
nullptr));
|
||||||
fDSLayout[1] = nullptr;
|
fDSLayout[1] = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fVertexUniformBuffer) {
|
if (fVertexUniformBuffer) {
|
||||||
@ -129,9 +129,9 @@ void GrVkProgram::abandonGPUResources() {
|
|||||||
fPipeline = nullptr;
|
fPipeline = nullptr;
|
||||||
fDescriptorPool->unrefAndAbandon();
|
fDescriptorPool->unrefAndAbandon();
|
||||||
fDescriptorPool = nullptr;
|
fDescriptorPool = nullptr;
|
||||||
fPipelineLayout = nullptr;
|
fPipelineLayout = VK_NULL_HANDLE;
|
||||||
fDSLayout[0] = nullptr;
|
fDSLayout[0] = VK_NULL_HANDLE;
|
||||||
fDSLayout[1] = nullptr;
|
fDSLayout[1] = VK_NULL_HANDLE;
|
||||||
|
|
||||||
fVertexUniformBuffer->abandon();
|
fVertexUniformBuffer->abandon();
|
||||||
fFragmentUniformBuffer->abandon();
|
fFragmentUniformBuffer->abandon();
|
||||||
|
@ -19,7 +19,7 @@ class GrVkRenderTarget;
|
|||||||
|
|
||||||
class GrVkRenderPass : public GrVkResource {
|
class GrVkRenderPass : public GrVkResource {
|
||||||
public:
|
public:
|
||||||
GrVkRenderPass() : INHERITED(), fRenderPass(nullptr) {}
|
GrVkRenderPass() : INHERITED(), fRenderPass(VK_NULL_HANDLE) {}
|
||||||
void initSimple(const GrVkGpu* gpu, const GrVkRenderTarget& target);
|
void initSimple(const GrVkGpu* gpu, const GrVkRenderTarget& target);
|
||||||
|
|
||||||
struct AttachmentsDescriptor {
|
struct AttachmentsDescriptor {
|
||||||
|
Loading…
Reference in New Issue
Block a user