aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/vk/GrVkBackendContext.cpp3
-rw-r--r--src/gpu/vk/GrVkExtensions.cpp6
-rw-r--r--src/gpu/vk/GrVkGpu.cpp7
-rw-r--r--src/gpu/vk/GrVkPipelineState.cpp3
-rw-r--r--src/gpu/vk/GrVkPipelineStateBuilder.cpp1
5 files changed, 18 insertions, 2 deletions
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp
index 0358618cd2..9506da5546 100644
--- a/src/gpu/vk/GrVkBackendContext.cpp
+++ b/src/gpu/vk/GrVkBackendContext.cpp
@@ -116,6 +116,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() {
err = vkEnumeratePhysicalDevices(inst, &gpuCount, nullptr);
if (err) {
SkDebugf("vkEnumeratePhysicalDevices failed: %d\n", err);
+ vkDestroyInstance(inst, nullptr);
SkFAIL("failing");
}
SkASSERT(gpuCount > 0);
@@ -125,6 +126,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() {
err = vkEnumeratePhysicalDevices(inst, &gpuCount, &physDev);
if (err) {
SkDebugf("vkEnumeratePhysicalDevices failed: %d\n", err);
+ vkDestroyInstance(inst, nullptr);
SkFAIL("failing");
}
@@ -214,6 +216,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() {
err = vkCreateDevice(physDev, &deviceInfo, nullptr, &device);
if (err) {
SkDebugf("CreateDevice failed: %d\n", err);
+ vkDestroyInstance(inst, nullptr);
return nullptr;
}
diff --git a/src/gpu/vk/GrVkExtensions.cpp b/src/gpu/vk/GrVkExtensions.cpp
index 2bec2354f6..c1ca2dd3a2 100644
--- a/src/gpu/vk/GrVkExtensions.cpp
+++ b/src/gpu/vk/GrVkExtensions.cpp
@@ -53,6 +53,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) {
VkLayerProperties* layers = new VkLayerProperties[layerCount];
res = EnumerateInstanceLayerProperties(&layerCount, layers);
if (VK_SUCCESS != res) {
+ delete[] layers;
return false;
}
for (uint32_t i = 0; i < layerCount; ++i) {
@@ -75,6 +76,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) {
VkExtensionProperties* extensions = new VkExtensionProperties[extensionCount];
res = EnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions);
if (VK_SUCCESS != res) {
+ delete[] extensions;
return false;
}
for (uint32_t i = 0; i < extensionCount; ++i) {
@@ -100,6 +102,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) {
res = EnumerateInstanceExtensionProperties((*fInstanceLayerStrings)[layerIndex].c_str(),
&extensionCount, extensions);
if (VK_SUCCESS != res) {
+ delete[] extensions;
return false;
}
for (uint32_t i = 0; i < extensionCount; ++i) {
@@ -138,6 +141,7 @@ bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysica
VkLayerProperties* layers = new VkLayerProperties[layerCount];
res = EnumerateDeviceLayerProperties(physDev, &layerCount, layers);
if (VK_SUCCESS != res) {
+ delete[] layers;
return false;
}
for (uint32_t i = 0; i < layerCount; ++i) {
@@ -161,6 +165,7 @@ bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysica
VkExtensionProperties* extensions = new VkExtensionProperties[extensionCount];
res = EnumerateDeviceExtensionProperties(physDev, nullptr, &extensionCount, extensions);
if (VK_SUCCESS != res) {
+ delete[] extensions;
return false;
}
for (uint32_t i = 0; i < extensionCount; ++i) {
@@ -188,6 +193,7 @@ bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysica
(*fDeviceLayerStrings)[layerIndex].c_str(),
&extensionCount, extensions);
if (VK_SUCCESS != res) {
+ delete[] extensions;
return false;
}
for (uint32_t i = 0; i < extensionCount; ++i) {
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index e1e99ed020..e2ec3781a3 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1209,15 +1209,18 @@ void GrVkGpu::copySurfaceAsBlit(GrSurface* dst,
// Flip rect if necessary
SkIRect srcVkRect;
+ srcVkRect.fLeft = srcRect.fLeft;
+ srcVkRect.fRight = srcRect.fRight;
SkIRect dstRect;
dstRect.fLeft = dstPoint.fX;
- dstRect.fRight = dstPoint.fX + srcVkRect.width();
+ dstRect.fRight = dstPoint.fX + srcRect.width();
if (kBottomLeft_GrSurfaceOrigin == src->origin()) {
srcVkRect.fTop = src->height() - srcRect.fBottom;
srcVkRect.fBottom = src->height() - srcRect.fTop;
} else {
- srcVkRect = srcRect;
+ srcVkRect.fTop = srcRect.fTop;
+ srcVkRect.fBottom = srcRect.fBottom;
}
if (kBottomLeft_GrSurfaceOrigin == dst->origin()) {
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 90a27e35a7..5e3acf818a 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -80,6 +80,9 @@ GrVkPipelineState::~GrVkPipelineState() {
SkASSERT(!fSamplers.count());
SkASSERT(!fTextureViews.count());
SkASSERT(!fTextures.count());
+ for (int i = 0; i < fFragmentProcessors.count(); ++i) {
+ delete fFragmentProcessors[i];
+ }
}
void GrVkPipelineState::freeTempResources(const GrVkGpu* gpu) {
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
index 3ea9e1b5d2..2bd80033dd 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
@@ -284,6 +284,7 @@ GrVkPipelineState* GrVkPipelineStateBuilder::finalize(GrPrimitiveType primitiveT
nullptr));
GR_VK_CALL(fGpu->vkInterface(), DestroyDescriptorSetLayout(fGpu->device(), dsLayout[1],
nullptr));
+ this->cleanupFragmentProcessors();
return nullptr;
}