diff options
Diffstat (limited to 'src/gpu/vk')
40 files changed, 68 insertions, 90 deletions
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp index 6aae6a21f8..1ca56e8647 100644 --- a/src/gpu/vk/GrVkBackendContext.cpp +++ b/src/gpu/vk/GrVkBackendContext.cpp @@ -167,7 +167,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { // query to get the physical device properties VkPhysicalDeviceFeatures deviceFeatures; vkGetPhysicalDeviceFeatures(physDev, &deviceFeatures); - // this looks like it would slow things down, + // this looks like it would slow things down, // and we can't depend on it on all platforms deviceFeatures.robustBufferAccess = VK_FALSE; @@ -225,7 +225,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { ctx->fExtensions = extensionFlags; ctx->fFeatures = featureFlags; ctx->fInterface.reset(GrVkCreateInterface(inst, device, extensionFlags)); - + return ctx; } diff --git a/src/gpu/vk/GrVkBuffer.cpp b/src/gpu/vk/GrVkBuffer.cpp index 24a593a9a7..679132873b 100644 --- a/src/gpu/vk/GrVkBuffer.cpp +++ b/src/gpu/vk/GrVkBuffer.cpp @@ -195,4 +195,3 @@ void GrVkBuffer::validate() const { || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType || kUniform_Type == fDesc.fType); } - diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp index 41bf1ad9e4..8f46408706 100644 --- a/src/gpu/vk/GrVkCaps.cpp +++ b/src/gpu/vk/GrVkCaps.cpp @@ -280,4 +280,3 @@ void GrVkCaps::initStencilFormats(const GrVkInterface* interface, VkPhysicalDevi SET_CONFIG_CAN_STENCIL(gS8); SET_CONFIG_CAN_STENCIL(gD24S8); } - diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h index 2137251d29..5834b151fd 100644 --- a/src/gpu/vk/GrVkCaps.h +++ b/src/gpu/vk/GrVkCaps.h @@ -19,7 +19,7 @@ class GrGLSLCaps; * Stores some capabilities of a Vk backend. */ class GrVkCaps : public GrCaps { -public: +public: typedef GrVkStencilAttachment::Format StencilFormat; /** diff --git a/src/gpu/vk/GrVkCommandBuffer.cpp b/src/gpu/vk/GrVkCommandBuffer.cpp index ea2b1bee0b..cd97337956 100644 --- a/src/gpu/vk/GrVkCommandBuffer.cpp +++ b/src/gpu/vk/GrVkCommandBuffer.cpp @@ -63,7 +63,7 @@ void GrVkCommandBuffer::freeGPUData(const GrVkGpu* gpu) const { for (int i = 0; i < fTrackedResources.count(); ++i) { fTrackedResources[i]->unref(gpu); } - + // Destroy the fence, if any if (VK_NULL_HANDLE != fSubmitFence) { GR_VK_CALL(gpu->vkInterface(), DestroyFence(gpu->device(), fSubmitFence, nullptr)); @@ -126,7 +126,7 @@ void GrVkCommandBuffer::endRenderPass(const GrVkGpu* gpu) { void GrVkCommandBuffer::submitToQueue(const GrVkGpu* gpu, VkQueue queue, GrVkGpu::SyncQueue sync) { SkASSERT(!fIsActive); - + VkResult err; VkFenceCreateInfo fenceInfo; memset(&fenceInfo, 0, sizeof(VkFenceCreateInfo)); @@ -148,7 +148,7 @@ void GrVkCommandBuffer::submitToQueue(const GrVkGpu* gpu, VkQueue queue, GrVkGpu GR_VK_CALL_ERRCHECK(gpu->vkInterface(), QueueSubmit(queue, 1, &submitInfo, fSubmitFence)); if (GrVkGpu::kForce_SyncQueue == sync) { - err = GR_VK_CALL(gpu->vkInterface(), + err = GR_VK_CALL(gpu->vkInterface(), WaitForFences(gpu->device(), 1, &fSubmitFence, true, UINT64_MAX)); if (VK_TIMEOUT == err) { SkDebugf("Fence failed to signal: %d\n", err); diff --git a/src/gpu/vk/GrVkCommandBuffer.h b/src/gpu/vk/GrVkCommandBuffer.h index c3d2978d36..99a3563e8b 100644 --- a/src/gpu/vk/GrVkCommandBuffer.h +++ b/src/gpu/vk/GrVkCommandBuffer.h @@ -160,7 +160,7 @@ public: uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const; - + // Add ref-counted resource that will be tracked and released when this // command buffer finishes execution void addResource(const GrVkResource* resource) { @@ -213,4 +213,3 @@ private: #endif - diff --git a/src/gpu/vk/GrVkDescriptorPool.cpp b/src/gpu/vk/GrVkDescriptorPool.cpp index 43ffe951e2..b89145a731 100644 --- a/src/gpu/vk/GrVkDescriptorPool.cpp +++ b/src/gpu/vk/GrVkDescriptorPool.cpp @@ -13,7 +13,7 @@ GrVkDescriptorPool::GrVkDescriptorPool(const GrVkGpu* gpu, VkDescriptorType type, uint32_t count) : INHERITED() - , fType (type) + , fType (type) , fCount(count) { VkDescriptorPoolSize poolSize; memset(&poolSize, 0, sizeof(VkDescriptorPoolSize)); diff --git a/src/gpu/vk/GrVkDescriptorPool.h b/src/gpu/vk/GrVkDescriptorPool.h index 19f778c03e..bb5697c26f 100644 --- a/src/gpu/vk/GrVkDescriptorPool.h +++ b/src/gpu/vk/GrVkDescriptorPool.h @@ -15,7 +15,7 @@ class GrVkGpu; /** - * We require that all descriptor sets are of a single descriptor type. We also use a pool to only + * We require that all descriptor sets are of a single descriptor type. We also use a pool to only * make one type of descriptor set. Thus a single VkDescriptorPool will only allocated space for * for one type of descriptor. */ diff --git a/src/gpu/vk/GrVkExtensions.cpp b/src/gpu/vk/GrVkExtensions.cpp index 73cd8091a8..2bec2354f6 100644 --- a/src/gpu/vk/GrVkExtensions.cpp +++ b/src/gpu/vk/GrVkExtensions.cpp @@ -91,7 +91,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { layerCount = fInstanceLayerStrings->count(); for (uint32_t layerIndex = 0; layerIndex < layerCount; ++layerIndex) { uint32_t extensionCount = 0; - res = EnumerateInstanceExtensionProperties((*fInstanceLayerStrings)[layerIndex].c_str(), + res = EnumerateInstanceExtensionProperties((*fInstanceLayerStrings)[layerIndex].c_str(), &extensionCount, nullptr); if (VK_SUCCESS != res) { return false; @@ -107,7 +107,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { if (specVersion >= extensions[i].specVersion && find_string(*fInstanceExtensionStrings, extensions[i].extensionName) < 0) { fInstanceExtensionStrings->push_back() = extensions[i].extensionName; - SkTQSort(&fInstanceExtensionStrings->front(), &fInstanceExtensionStrings->back(), + SkTQSort(&fInstanceExtensionStrings->front(), &fInstanceExtensionStrings->back(), cmp); } } diff --git a/src/gpu/vk/GrVkExtensions.h b/src/gpu/vk/GrVkExtensions.h index 93b258e73a..6c395fdddd 100644 --- a/src/gpu/vk/GrVkExtensions.h +++ b/src/gpu/vk/GrVkExtensions.h @@ -13,7 +13,7 @@ #include "vk/GrVkDefines.h" /** - * This helper queries the Vulkan driver for available extensions and layers, remembers them, + * This helper queries the Vulkan driver for available extensions and layers, remembers them, * and can be queried. It supports queries for both instance and device extensions and layers. */ class SK_API GrVkExtensions { @@ -22,7 +22,7 @@ public: , fDeviceExtensionStrings(new SkTArray<SkString>) , fInstanceLayerStrings(new SkTArray<SkString>) , fDeviceLayerStrings(new SkTArray<SkString>) {} - + bool initInstance(uint32_t specVersion); bool initDevice(uint32_t specVersion, VkInstance, VkPhysicalDevice); diff --git a/src/gpu/vk/GrVkFramebuffer.cpp b/src/gpu/vk/GrVkFramebuffer.cpp index d79895ce8e..49c6e414fc 100644 --- a/src/gpu/vk/GrVkFramebuffer.cpp +++ b/src/gpu/vk/GrVkFramebuffer.cpp @@ -20,7 +20,7 @@ GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, // At the very least we need a renderPass and a colorAttachment SkASSERT(renderPass); SkASSERT(colorAttachment); - + VkImageView attachments[3]; attachments[0] = colorAttachment->imageView(); int numAttachments = 1; @@ -30,7 +30,7 @@ GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, if (stencilAttachment) { attachments[numAttachments++] = stencilAttachment->imageView(); } - + VkFramebufferCreateInfo createInfo; memset(&createInfo, 0, sizeof(VkFramebufferCreateInfo)); createInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; @@ -42,7 +42,7 @@ GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, createInfo.width = width; createInfo.height = height; createInfo.layers = 1; - + VkFramebuffer framebuffer; VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateFramebuffer(gpu->device(), &createInfo, @@ -59,5 +59,3 @@ void GrVkFramebuffer::freeGPUData(const GrVkGpu* gpu) const { SkASSERT(fFramebuffer); GR_VK_CALL(gpu->vkInterface(), DestroyFramebuffer(gpu->device(), fFramebuffer, nullptr)); } - - diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 496f38c3df..de1e9052fa 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -79,7 +79,7 @@ GrGpu* GrVkGpu::Create(GrBackendContext backendContext, const GrContextOptions& //////////////////////////////////////////////////////////////////////////////// -GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, +GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, const GrVkBackendContext* backendCtx) : INHERITED(context) , fVkInstance(backendCtx->fInstance) @@ -122,7 +122,7 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // CmdPoolCreateFlags backendCtx->fQueueFamilyIndex, // queueFamilyIndex }; - GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateCommandPool(fDevice, &cmdPoolInfo, nullptr, + GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateCommandPool(fDevice, &cmdPoolInfo, nullptr, &fCmdPool)); // must call this after creating the CommandPool @@ -141,7 +141,7 @@ GrVkGpu::~GrVkGpu() { SkDEBUGCODE(VkResult res =) VK_CALL(QueueWaitIdle(fQueue)); // VK_ERROR_DEVICE_LOST is acceptable when tearing down (see 4.2.4 in spec) SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res); - + // must call this just before we destroy the VkDevice fResourceProvider.destroyResources(); @@ -208,7 +208,7 @@ bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, } if (dstSurface->config() != srcConfig) { - // TODO: This should fall back to drawing or copying to change config of dstSurface to + // TODO: This should fall back to drawing or copying to change config of dstSurface to // match that of srcConfig. return false; } @@ -319,7 +319,7 @@ bool GrVkGpu::uploadTexData(GrVkTexture* tex, VkDeviceSize offset = texTop*layout.rowPitch + left*bpp; VkDeviceSize size = height*layout.rowPitch; void* mapPtr; - err = GR_VK_CALL(interface, MapMemory(fDevice, tex->textureMemory(), offset, size, 0, + err = GR_VK_CALL(interface, MapMemory(fDevice, tex->textureMemory(), offset, size, 0, &mapPtr)); if (err) { return false; @@ -556,11 +556,11 @@ GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, GrVkTexture* texture = nullptr; if (renderTarget) { - texture = GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(this, surfDesc, + texture = GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(this, surfDesc, lifeCycle, format, info); } else { - texture = GrVkTexture::CreateWrappedTexture(this, surfDesc, lifeCycle, format, + texture = GrVkTexture::CreateWrappedTexture(this, surfDesc, lifeCycle, format, info); } if (!texture) { @@ -572,7 +572,7 @@ GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc, GrWrapOwnership ownership) { - + const GrVkTextureInfo* info = reinterpret_cast<const GrVkTextureInfo*>(wrapDesc.fRenderTargetHandle); if (VK_NULL_HANDLE == info->fImage || @@ -594,7 +594,7 @@ GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe desc.fOrigin = resolve_origin(wrapDesc.fOrigin); GrVkRenderTarget* tgt = GrVkRenderTarget::CreateWrappedRenderTarget(this, desc, - lifeCycle, + lifeCycle, info); if (tgt && wrapDesc.fStencilBits) { if (!createStencilAttachmentForRenderTarget(tgt, desc.fWidth, desc.fHeight)) { @@ -975,7 +975,7 @@ void GrVkGpu::onClear(GrRenderTarget* target, const SkIRect& rect, GrColor color VkClearColorValue vkColor; GrColorToRGBAFloat(color, vkColor.float32); - + GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target); VkImageLayout origDstLayout = vkRT->currentLayout(); @@ -1045,7 +1045,7 @@ void GrVkGpu::onClear(GrRenderTarget* target, const SkIRect& rect, GrColor color subRange.baseArrayLayer = 0; subRange.layerCount = 1; - // In the future we may not actually be doing this type of clear at all. If we are inside a + // In the future we may not actually be doing this type of clear at all. If we are inside a // render pass or doing a non full clear then we will use CmdClearColorAttachment. The more // common use case will be clearing an attachment at the start of a render pass, in which case // we will use the clear load ops. @@ -1091,7 +1091,7 @@ void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, // the cache is flushed since it is only being written to. VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(origDstLayout);; VkAccessFlags dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; - + dstTex->setImageLayout(this, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, srcAccessMask, @@ -1099,7 +1099,7 @@ void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, srcStageMask, dstStageMask, false); - + srcStageMask = GrVkMemory::LayoutToPipelineStageFlags(origSrcLayout); dstStageMask = VK_PIPELINE_STAGE_TRANSFER_BIT; @@ -1225,7 +1225,7 @@ bool GrVkGpu::onReadPixels(GrSurface* surface, dstStageMask, false); - GrVkTransferBuffer* transferBuffer = + GrVkTransferBuffer* transferBuffer = static_cast<GrVkTransferBuffer*>(this->createBuffer(kXferGpuToCpu_GrBufferType, rowBytes * height, kStream_GrAccessPattern)); @@ -1441,4 +1441,3 @@ void GrVkGpu::onDraw(const GrPipeline& pipeline, #endif #endif } - diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 91a67b6deb..99c03bd4e8 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -106,7 +106,7 @@ public: VkPipelineStageFlags dstStageMask, bool byRegion, VkImageMemoryBarrier* barrier) const; - + shaderc_compiler_t shadercCompiler() const { return fCompiler; } @@ -169,7 +169,7 @@ private: void bindGeometry(const GrPrimitiveProcessor&, const GrNonInstancedMesh&); // Ends and submits the current command buffer to the queue and then creates a new command - // buffer and begins it. If sync is set to kForce_SyncQueue, the function will wait for all + // buffer and begins it. If sync is set to kForce_SyncQueue, the function will wait for all // work in the queue to finish before returning. void submitCommandBuffer(SyncQueue sync); diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp index 729c62794d..f91c6a9ee6 100644 --- a/src/gpu/vk/GrVkImage.cpp +++ b/src/gpu/vk/GrVkImage.cpp @@ -24,7 +24,7 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout, if (newLayout == fCurrentLayout) { return; } - + VkImageMemoryBarrier imageMemoryBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType NULL, // pNext @@ -44,7 +44,7 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout, fCurrentLayout = newLayout; } -const GrVkImage::Resource* GrVkImage::CreateResource(const GrVkGpu* gpu, +const GrVkImage::Resource* GrVkImage::CreateResource(const GrVkGpu* gpu, const ImageDesc& imageDesc) { VkImage image = 0; VkDeviceMemory alloc; diff --git a/src/gpu/vk/GrVkImageView.cpp b/src/gpu/vk/GrVkImageView.cpp index 70e6106879..1ab2475f1c 100644 --- a/src/gpu/vk/GrVkImageView.cpp +++ b/src/gpu/vk/GrVkImageView.cpp @@ -12,7 +12,7 @@ const GrVkImageView* GrVkImageView::Create(GrVkGpu* gpu, VkImage image, VkFormat format, Type viewType) { VkImageView imageView; - + // Create the VkImageView VkImageViewCreateInfo viewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, // sType @@ -32,18 +32,16 @@ const GrVkImageView* GrVkImageView::Create(GrVkGpu* gpu, VkImage image, VkFormat viewInfo.components.a = VK_COMPONENT_SWIZZLE_ZERO; viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT; } - + VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateImageView(gpu->device(), &viewInfo, nullptr, &imageView)); if (err) { return nullptr; } - + return new GrVkImageView(imageView); } void GrVkImageView::freeGPUData(const GrVkGpu* gpu) const { GR_VK_CALL(gpu->vkInterface(), DestroyImageView(gpu->device(), fImageView, nullptr)); } - - diff --git a/src/gpu/vk/GrVkImageView.h b/src/gpu/vk/GrVkImageView.h index ab988c065a..f70080852d 100644 --- a/src/gpu/vk/GrVkImageView.h +++ b/src/gpu/vk/GrVkImageView.h @@ -20,7 +20,7 @@ public: kColor_Type, kStencil_Type }; - + static const GrVkImageView* Create(GrVkGpu* gpu, VkImage image, VkFormat format, Type viewType); VkImageView imageView() const { return fImageView; } diff --git a/src/gpu/vk/GrVkIndexBuffer.cpp b/src/gpu/vk/GrVkIndexBuffer.cpp index 6cec856cd4..7342e939e1 100644 --- a/src/gpu/vk/GrVkIndexBuffer.cpp +++ b/src/gpu/vk/GrVkIndexBuffer.cpp @@ -72,4 +72,3 @@ GrVkGpu* GrVkIndexBuffer::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast<GrVkGpu*>(this->getGpu()); } - diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp index bc6b87edb8..37e3570e48 100644 --- a/src/gpu/vk/GrVkInterface.cpp +++ b/src/gpu/vk/GrVkInterface.cpp @@ -16,7 +16,7 @@ GrVkInterface::GrVkInterface() { #define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcAddr(inst, "vk" #F) #define GET_DEV_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetDeviceProcAddr(device, "vk" #F) -const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, +const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, uint32_t extensionFlags) { GrVkInterface* interface = new GrVkInterface(); @@ -373,4 +373,3 @@ bool GrVkInterface::validate() const { } return true; } - diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp index 7e8c57733a..30a38066c2 100644 --- a/src/gpu/vk/GrVkMemory.cpp +++ b/src/gpu/vk/GrVkMemory.cpp @@ -154,4 +154,3 @@ VkAccessFlags GrVkMemory::LayoutToSrcAccessMask(const VkImageLayout layout) { } return flags; } - diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp index 794acb077c..53e9dba08f 100644 --- a/src/gpu/vk/GrVkPipeline.cpp +++ b/src/gpu/vk/GrVkPipeline.cpp @@ -203,7 +203,7 @@ void setup_viewport_scissor_state(const GrVkGpu* gpu, SkASSERT(viewportInfo->viewportCount == viewportInfo->scissorCount); } -void setup_multisample_state(const GrPipeline& pipeline, +void setup_multisample_state(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, const GrCaps* caps, VkPipelineMultisampleStateCreateInfo* multisampleInfo) { @@ -469,8 +469,8 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline, VkPipeline vkPipeline; VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->device(), - cache, 1, - &pipelineCreateInfo, + cache, 1, + &pipelineCreateInfo, nullptr, &vkPipeline)); if (err) { return nullptr; @@ -493,7 +493,7 @@ void set_dynamic_scissor_state(GrVkGpu* gpu, if (scissorState.enabled() && !scissorState.rect().contains(0, 0, target.width(), target.height())) { // This all assumes the scissorState has previously been clipped to the device space render - // target. + // target. scissor.offset.x = scissorState.rect().fLeft; scissor.extent.width = scissorState.rect().width(); if (kTopLeft_GrSurfaceOrigin == target.origin()) { diff --git a/src/gpu/vk/GrVkPipeline.h b/src/gpu/vk/GrVkPipeline.h index be422e1f3d..0e818edadc 100644 --- a/src/gpu/vk/GrVkPipeline.h +++ b/src/gpu/vk/GrVkPipeline.h @@ -23,7 +23,7 @@ class GrVkRenderPass; class GrVkPipeline : public GrVkResource { public: - static GrVkPipeline* Create(GrVkGpu* gpu, + static GrVkPipeline* Create(GrVkGpu* gpu, const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, VkPipelineShaderStageCreateInfo* shaderStageInfo, diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp index 996ce4a13c..dacd66b0e7 100644 --- a/src/gpu/vk/GrVkPipelineState.cpp +++ b/src/gpu/vk/GrVkPipelineState.cpp @@ -489,7 +489,7 @@ void GrVkPipelineState::BuildStateKey(const GrPipeline& pipeline, GrPrimitiveTyp b.add32(primitiveType); - // Set key length + // Set key length int keyLength = key->count(); SkASSERT(0 == (keyLength % 4)); *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp index f4bb566de1..871e94e1d3 100644 --- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp +++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp @@ -36,9 +36,9 @@ GrVkPipelineStateBuilder::GrVkPipelineStateBuilder(GrVkGpu* gpu, const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, const GrVkProgramDesc& desc) - : INHERITED(pipeline, primProc, desc) + : INHERITED(pipeline, primProc, desc) , fGpu(gpu) - , fVaryingHandler(this) + , fVaryingHandler(this) , fUniformHandler(this) { } diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.cpp b/src/gpu/vk/GrVkPipelineStateDataManager.cpp index 76ad483405..86066abe0b 100644 --- a/src/gpu/vk/GrVkPipelineStateDataManager.cpp +++ b/src/gpu/vk/GrVkPipelineStateDataManager.cpp @@ -15,7 +15,7 @@ GrVkPipelineStateDataManager::GrVkPipelineStateDataManager(const UniformInfoArra uint32_t fragmentUniformSize) : fVertexUniformSize(vertexUniformSize) , fFragmentUniformSize(fragmentUniformSize) - , fVertexUniformsDirty(false) + , fVertexUniformsDirty(false) , fFragmentUniformsDirty(false) { fVertexUniformData.reset(vertexUniformSize); fFragmentUniformData.reset(fragmentUniformSize); @@ -279,4 +279,3 @@ void GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu, fFragmentUniformsDirty = false; } } - diff --git a/src/gpu/vk/GrVkRenderPass.cpp b/src/gpu/vk/GrVkRenderPass.cpp index 35387761d3..1aedab4cfa 100644 --- a/src/gpu/vk/GrVkRenderPass.cpp +++ b/src/gpu/vk/GrVkRenderPass.cpp @@ -187,7 +187,7 @@ void GrVkRenderPass::getBeginInfo(const GrVkRenderTarget& target, beginInfo->clearValueCount = 0; beginInfo->pClearValues = nullptr; - // Currently just assuming no secondary cmd buffers. This value will need to be update if we + // Currently just assuming no secondary cmd buffers. This value will need to be update if we // have them. *contents = VK_SUBPASS_CONTENTS_INLINE; } @@ -235,4 +235,3 @@ void GrVkRenderPass::genKey(GrProcessorKeyBuilder* b) const { b->add32(fAttachmentsDescriptor.fStencil.fSamples); } } - diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp index c04cca3d69..486f2f52b9 100644 --- a/src/gpu/vk/GrVkRenderTarget.cpp +++ b/src/gpu/vk/GrVkRenderTarget.cpp @@ -120,7 +120,7 @@ GrVkRenderTarget::Create(GrVkGpu* gpu, const GrVkImage::Resource* imageResource) { VkFormat pixelFormat; GrPixelConfigToVkFormat(desc.fConfig, &pixelFormat); - + VkImage colorImage; // create msaa surface if necessary @@ -211,7 +211,7 @@ GrVkRenderTarget::CreateWrappedRenderTarget(GrVkGpu* gpu, SkASSERT(VK_NULL_HANDLE != info->fImage); SkASSERT(VK_NULL_HANDLE != info->fAlloc || kAdopted_LifeCycle != lifeCycle); - GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTiling) + GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTiling) ? Resource::kLinearTiling_Flag : Resource::kNo_Flags; const GrVkImage::Resource* imageResource; @@ -410,4 +410,3 @@ GrVkGpu* GrVkRenderTarget::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast<GrVkGpu*>(this->getGpu()); } - diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h index 21c5788aa1..f8c08e6b98 100644 --- a/src/gpu/vk/GrVkRenderTarget.h +++ b/src/gpu/vk/GrVkRenderTarget.h @@ -63,7 +63,7 @@ public: // Returns the total number of attachments void getAttachmentsDescriptor(GrVkRenderPass::AttachmentsDescriptor* desc, GrVkRenderPass::AttachmentFlags* flags) const; - + void addResources(GrVkCommandBuffer& commandBuffer) const; protected: @@ -130,7 +130,7 @@ private: const GrVkImage::Resource* fMSAAImageResource; const GrVkImageView* fResolveAttachmentView; int fColorValuesPerPixel; - + // This is a cached pointer to a simple render pass. The render target should unref it // once it is done with it. const GrVkRenderPass* fCachedSimpleRenderPass; diff --git a/src/gpu/vk/GrVkResource.h b/src/gpu/vk/GrVkResource.h index 8387c4ef96..6c08f4ee55 100644 --- a/src/gpu/vk/GrVkResource.h +++ b/src/gpu/vk/GrVkResource.h @@ -80,7 +80,7 @@ public: return false; } - /** Increment the reference count. + /** Increment the reference count. Must be balanced by a call to unref() or unrefAndFreeResources(). */ void ref() const { @@ -122,13 +122,13 @@ public: #endif private: - /** Must be implemented by any subclasses. - * Deletes any Vk data associated with this resource + /** Must be implemented by any subclasses. + * Deletes any Vk data associated with this resource */ virtual void freeGPUData(const GrVkGpu* gpu) const = 0; - /** Must be overridden by subclasses that themselves store GrVkResources. - * Will unrefAndAbandon those resources without deleting the underlying Vk data + /** Must be overridden by subclasses that themselves store GrVkResources. + * Will unrefAndAbandon those resources without deleting the underlying Vk data */ virtual void abandonSubResources() const {} diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp index 8bb3911c76..7def55d555 100644 --- a/src/gpu/vk/GrVkResourceProvider.cpp +++ b/src/gpu/vk/GrVkResourceProvider.cpp @@ -61,9 +61,9 @@ GrVkPipeline* GrVkResourceProvider::createPipeline(const GrPipeline& pipeline, // To create framebuffers, we first need to create a simple RenderPass that is -// only used for framebuffer creation. When we actually render we will create +// only used for framebuffer creation. When we actually render we will create // RenderPasses as needed that are compatible with the framebuffer. -const GrVkRenderPass* +const GrVkRenderPass* GrVkResourceProvider::findOrCreateCompatibleRenderPass(const GrVkRenderTarget& target) { for (int i = 0; i < fSimpleRenderPasses.count(); ++i) { GrVkRenderPass* renderPass = fSimpleRenderPasses[i]; diff --git a/src/gpu/vk/GrVkSampler.cpp b/src/gpu/vk/GrVkSampler.cpp index 9938340a84..fb8dacae87 100644 --- a/src/gpu/vk/GrVkSampler.cpp +++ b/src/gpu/vk/GrVkSampler.cpp @@ -74,7 +74,7 @@ void GrVkSampler::freeGPUData(const GrVkGpu* gpu) const { uint8_t GrVkSampler::GenerateKey(const GrTextureParams& params) { uint8_t key = params.filterMode(); - + SkASSERT(params.filterMode() <= 3); key |= (params.getTileModeX() << 2); @@ -83,4 +83,3 @@ uint8_t GrVkSampler::GenerateKey(const GrTextureParams& params) { return key; } - diff --git a/src/gpu/vk/GrVkSampler.h b/src/gpu/vk/GrVkSampler.h index 3e08745779..ec97751cbb 100644 --- a/src/gpu/vk/GrVkSampler.h +++ b/src/gpu/vk/GrVkSampler.h @@ -40,4 +40,3 @@ private: }; #endif - diff --git a/src/gpu/vk/GrVkStencilAttachment.cpp b/src/gpu/vk/GrVkStencilAttachment.cpp index a632700d02..97597fc511 100644 --- a/src/gpu/vk/GrVkStencilAttachment.cpp +++ b/src/gpu/vk/GrVkStencilAttachment.cpp @@ -62,7 +62,7 @@ GrVkStencilAttachment* GrVkStencilAttachment::Create(GrVkGpu* gpu, imageResource, imageView); imageResource->unref(gpu); imageView->unref(gpu); - + return stencil; } diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp index 058dfbdc0a..b297b60c11 100644 --- a/src/gpu/vk/GrVkTexture.cpp +++ b/src/gpu/vk/GrVkTexture.cpp @@ -76,7 +76,7 @@ GrVkTexture* GrVkTexture::CreateNewTexture(GrVkGpu* gpu, const GrSurfaceDesc& de GrVkTexture* GrVkTexture::CreateWrappedTexture(GrVkGpu* gpu, const GrSurfaceDesc& desc, GrGpuResource::LifeCycle lifeCycle, - VkFormat format, + VkFormat format, const GrVkTextureInfo* info) { SkASSERT(info); // Wrapped textures require both image and allocation (because they can be mapped) @@ -145,4 +145,3 @@ GrVkGpu* GrVkTexture::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast<GrVkGpu*>(this->getGpu()); } - diff --git a/src/gpu/vk/GrVkTexture.h b/src/gpu/vk/GrVkTexture.h index 48ec7305e4..7c476ca542 100644 --- a/src/gpu/vk/GrVkTexture.h +++ b/src/gpu/vk/GrVkTexture.h @@ -21,7 +21,7 @@ public: static GrVkTexture* CreateNewTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, const GrVkImage::ImageDesc&); - + static GrVkTexture* CreateWrappedTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, VkFormat, const GrVkTextureInfo*); @@ -47,7 +47,7 @@ protected: GrGpuResource::LifeCycle, VkFormat, const GrVkImage::Resource* texImpl); - GrVkGpu* getVkGpu() const; + GrVkGpu* getVkGpu() const; void onAbandon() override; void onRelease() override; diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp index 43e213fc50..bd028d2536 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.cpp +++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp @@ -129,7 +129,7 @@ GrVkTextureRenderTarget::CreateNewTextureRenderTarget(GrVkGpu* gpu, return nullptr; } - GrVkTextureRenderTarget* trt = GrVkTextureRenderTarget::Create(gpu, desc, lifeCycle, + GrVkTextureRenderTarget* trt = GrVkTextureRenderTarget::Create(gpu, desc, lifeCycle, imageDesc.fFormat, imageRsrc); // Create() will increment the refCount of the image resource if it succeeds imageRsrc->unref(gpu); @@ -141,7 +141,7 @@ GrVkTextureRenderTarget* GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu, const GrSurfaceDesc& desc, GrGpuResource::LifeCycle lifeCycle, - VkFormat format, + VkFormat format, const GrVkTextureInfo* info) { SkASSERT(info); // Wrapped textures require both image and allocation (because they can be mapped) @@ -170,4 +170,3 @@ GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu, return trt; } - diff --git a/src/gpu/vk/GrVkTextureRenderTarget.h b/src/gpu/vk/GrVkTextureRenderTarget.h index a7aff009d3..f2580ebf51 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.h +++ b/src/gpu/vk/GrVkTextureRenderTarget.h @@ -28,7 +28,7 @@ public: GrGpuResource::LifeCycle, const GrVkImage::ImageDesc&); - static GrVkTextureRenderTarget* CreateWrappedTextureRenderTarget(GrVkGpu*, + static GrVkTextureRenderTarget* CreateWrappedTextureRenderTarget(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, VkFormat, diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp index ac6da190d7..fac955d874 100644 --- a/src/gpu/vk/GrVkUniformHandler.cpp +++ b/src/gpu/vk/GrVkUniformHandler.cpp @@ -201,4 +201,3 @@ void GrVkUniformHandler::appendUniformDecls(GrShaderFlags visibility, SkString* out->appendf("%s\n};\n", uniformsString.c_str()); } } - diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp index ec3ec234d4..5ab7966d1a 100644 --- a/src/gpu/vk/GrVkUtil.cpp +++ b/src/gpu/vk/GrVkUtil.cpp @@ -91,4 +91,3 @@ bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSam return false; } } - diff --git a/src/gpu/vk/GrVkUtil.h b/src/gpu/vk/GrVkUtil.h index a3064c8329..4e03c751a8 100644 --- a/src/gpu/vk/GrVkUtil.h +++ b/src/gpu/vk/GrVkUtil.h @@ -33,4 +33,3 @@ bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format); bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSamples); #endif - diff --git a/src/gpu/vk/GrVkVertexBuffer.cpp b/src/gpu/vk/GrVkVertexBuffer.cpp index 1d3eadb42c..c2c2df0d8f 100644 --- a/src/gpu/vk/GrVkVertexBuffer.cpp +++ b/src/gpu/vk/GrVkVertexBuffer.cpp @@ -71,4 +71,3 @@ GrVkGpu* GrVkVertexBuffer::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast<GrVkGpu*>(this->getGpu()); } - |