aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/vk')
-rw-r--r--src/gpu/vk/GrVkBackendContext.cpp9
-rw-r--r--src/gpu/vk/GrVkCaps.cpp25
-rw-r--r--src/gpu/vk/GrVkCommandBuffer.cpp23
-rw-r--r--src/gpu/vk/GrVkCommandBuffer.h6
-rw-r--r--src/gpu/vk/GrVkGpuCommandBuffer.cpp16
-rw-r--r--src/gpu/vk/GrVkInterface.cpp23
-rw-r--r--src/gpu/vk/GrVkPipeline.cpp113
-rw-r--r--src/gpu/vk/GrVkPipeline.h6
-rw-r--r--src/gpu/vk/GrVkPipelineState.cpp11
-rw-r--r--src/gpu/vk/GrVkPipelineState.h2
-rw-r--r--src/gpu/vk/GrVkPipelineStateCache.cpp2
-rw-r--r--src/gpu/vk/GrVkRenderTarget.cpp17
-rw-r--r--src/gpu/vk/GrVkRenderTarget.h3
13 files changed, 50 insertions, 206 deletions
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp
index a602a50f73..e473178223 100644
--- a/src/gpu/vk/GrVkBackendContext.cpp
+++ b/src/gpu/vk/GrVkBackendContext.cpp
@@ -76,10 +76,6 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex
SkTArray<const char*> instanceLayerNames;
SkTArray<const char*> instanceExtensionNames;
uint32_t extensionFlags = 0;
- if (extensions.hasInstanceExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
- instanceExtensionNames.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
- extensionFlags |= kKHR_get_physical_device_properties2_GrVkExtensionFlag;
- }
#ifdef SK_ENABLE_VK_LAYERS
for (size_t i = 0; i < SK_ARRAY_COUNT(kDebugLayerNames); ++i) {
if (extensions.hasInstanceLayer(kDebugLayerNames[i])) {
@@ -91,6 +87,7 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex
extensionFlags |= kEXT_debug_report_GrVkExtensionFlag;
}
#endif
+
if (extensions.hasInstanceExtension(VK_KHR_SURFACE_EXTENSION_NAME)) {
instanceExtensionNames.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
extensionFlags |= kKHR_surface_GrVkExtensionFlag;
@@ -226,10 +223,6 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex
}
}
#endif
- if (extensions.hasDeviceExtension(VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME)) {
- deviceExtensionNames.push_back(VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME);
- extensionFlags |= kEXT_discard_rectangles_GrVkExtensionFlag;
- }
if (extensions.hasDeviceExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME)) {
deviceExtensionNames.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
extensionFlags |= kKHR_swapchain_GrVkExtensionFlag;
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 9f635e2f20..2b24205af8 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -75,30 +75,9 @@ bool GrVkCaps::initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc*
void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* vkInterface,
VkPhysicalDevice physDev, uint32_t featureFlags, uint32_t extensionFlags) {
- VkPhysicalDeviceProperties2KHR khrProperties;
- if (SkToBool(extensionFlags & kKHR_get_physical_device_properties2_GrVkExtensionFlag)) {
- khrProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
- khrProperties.pNext = nullptr;
-
- VkPhysicalDeviceDiscardRectanglePropertiesEXT discardRectsProperties;
- if (SkToBool(extensionFlags & kEXT_discard_rectangles_GrVkExtensionFlag)) {
- discardRectsProperties.sType =
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT;
- discardRectsProperties.pNext = khrProperties.pNext;
- khrProperties.pNext = &discardRectsProperties;
- }
-
- GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties2KHR(physDev, &khrProperties));
-
- if (SkToBool(extensionFlags & kEXT_discard_rectangles_GrVkExtensionFlag)) {
- fWindowRectsSupport = WindowRectsSupport::kDrawOnly;
- fMaxWindowRectangles = discardRectsProperties.maxDiscardRectangles;
- }
- } else {
- GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &khrProperties.properties));
- }
- const VkPhysicalDeviceProperties& properties = khrProperties.properties;
+ VkPhysicalDeviceProperties properties;
+ GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &properties));
VkPhysicalDeviceMemoryProperties memoryProperties;
GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryProperties));
diff --git a/src/gpu/vk/GrVkCommandBuffer.cpp b/src/gpu/vk/GrVkCommandBuffer.cpp
index ba19168b37..8a17a4f033 100644
--- a/src/gpu/vk/GrVkCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkCommandBuffer.cpp
@@ -34,11 +34,6 @@ void GrVkCommandBuffer::invalidateState() {
memset(&fCachedScissor, 0, sizeof(VkRect2D));
fCachedScissor.offset.x = -1; // Scissor offset must be greater that 0 to be valid
- memset(&fCachedDiscardRectangles, 0, sizeof(fCachedDiscardRectangles));
- for (int i = 0; i < GrWindowRectangles::kMaxWindows; ++i) {
- fCachedDiscardRectangles[i].offset.x = -1; // Negative offsets are invalid.
- }
-
for (int i = 0; i < 4; ++i) {
fCachedBlendConstant[i] = -1.0;
}
@@ -328,24 +323,6 @@ void GrVkCommandBuffer::setScissor(const GrVkGpu* gpu,
}
}
-void GrVkCommandBuffer::setDiscardRectangles(const GrVkGpu* gpu,
- uint32_t firstDiscardRectangle,
- uint32_t discardRectangleCount,
- const VkRect2D* discardRectangles) {
- SkASSERT(fIsActive);
- SkASSERT(firstDiscardRectangle + discardRectangleCount <= gpu->vkCaps().maxWindowRectangles());
- SkASSERT(gpu->vkCaps().maxWindowRectangles() <= GrWindowRectangles::kMaxWindows);
- if (memcmp(discardRectangles, &fCachedDiscardRectangles[firstDiscardRectangle],
- discardRectangleCount * sizeof(VkRect2D))) {
- GR_VK_CALL(gpu->vkInterface(), CmdSetDiscardRectangleEXT(fCmdBuffer,
- firstDiscardRectangle,
- discardRectangleCount,
- discardRectangles));
- memcpy(&fCachedDiscardRectangles[firstDiscardRectangle], discardRectangles,
- discardRectangleCount * sizeof(VkRect2D));
- }
-}
-
void GrVkCommandBuffer::setBlendConstants(const GrVkGpu* gpu,
const float blendConstants[4]) {
SkASSERT(fIsActive);
diff --git a/src/gpu/vk/GrVkCommandBuffer.h b/src/gpu/vk/GrVkCommandBuffer.h
index cf6dc2a750..7d16242e6b 100644
--- a/src/gpu/vk/GrVkCommandBuffer.h
+++ b/src/gpu/vk/GrVkCommandBuffer.h
@@ -80,11 +80,6 @@ public:
uint32_t scissorCount,
const VkRect2D* scissors);
- void setDiscardRectangles(const GrVkGpu* gpu,
- uint32_t firstDiscardRectangle,
- uint32_t discardRectangleCount,
- const VkRect2D* discardRectangles);
-
void setBlendConstants(const GrVkGpu* gpu, const float blendConstants[4]);
// Commands that only work inside of a render pass
@@ -172,7 +167,6 @@ private:
// Cached values used for dynamic state updates
VkViewport fCachedViewport;
VkRect2D fCachedScissor;
- VkRect2D fCachedDiscardRectangles[GrWindowRectangles::kMaxWindows];
float fCachedBlendConstant[4];
};
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index a14ce8c3e2..52dfede267 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -251,11 +251,10 @@ void GrVkGpuRTCommandBuffer::insertEventMarker(const char* msg) {
}
void GrVkGpuRTCommandBuffer::onClearStencilClip(const GrFixedClip& clip, bool insideStencilMask) {
- CommandBufferInfo& cbInfo = fCommandBufferInfos[fCurrentCmdInfo];
-
- // We ignore window rectangles as they are not supported by Vulkan during clear.
SkASSERT(!clip.hasWindowRectangles());
+ CommandBufferInfo& cbInfo = fCommandBufferInfos[fCurrentCmdInfo];
+
GrStencilAttachment* sb = fRenderTarget->renderTargetPriv().getStencilAttachment();
// this should only be called internally when we know we have a
// stencil buffer.
@@ -314,7 +313,7 @@ void GrVkGpuRTCommandBuffer::onClearStencilClip(const GrFixedClip& clip, bool in
void GrVkGpuRTCommandBuffer::onClear(const GrFixedClip& clip, GrColor color) {
GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(fRenderTarget);
- // We ignore window rectangles as they are not supported by Vulkan during clear.
+ // parent class should never let us get here with no RT
SkASSERT(!clip.hasWindowRectangles());
CommandBufferInfo& cbInfo = fCommandBufferInfos[fCurrentCmdInfo];
@@ -528,7 +527,6 @@ GrVkPipelineState* GrVkGpuRTCommandBuffer::prepareDrawState(const GrPipeline& pi
GrRenderTarget* rt = pipeline.renderTarget();
- GrVkPipeline::SetDynamicViewportState(fGpu, cbInfo.currentCmdBuf(), rt);
if (!pipeline.getScissorState().enabled()) {
GrVkPipeline::SetDynamicScissorRectState(fGpu, cbInfo.currentCmdBuf(),
rt, pipeline.proxy()->origin(),
@@ -538,13 +536,7 @@ GrVkPipelineState* GrVkGpuRTCommandBuffer::prepareDrawState(const GrPipeline& pi
rt, pipeline.proxy()->origin(),
pipeline.getScissorState().rect());
}
- if (pipeline.getWindowRectsState().enabled()) {
- // No need to check hasDynamicState -- window rectangles aren't currently included in
- // GrPipeline::DynamicState.
- GrVkPipeline::SetDynamicDiscardRectanglesState(fGpu, cbInfo.currentCmdBuf(),
- rt, pipeline.proxy()->origin(),
- pipeline.getWindowRectsState().windows());
- }
+ GrVkPipeline::SetDynamicViewportState(fGpu, cbInfo.currentCmdBuf(), rt);
GrVkPipeline::SetDynamicBlendConstantState(fGpu, cbInfo.currentCmdBuf(), rt->config(),
pipeline.getXferProcessor());
diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp
index 04589cd51b..dedc264136 100644
--- a/src/gpu/vk/GrVkInterface.cpp
+++ b/src/gpu/vk/GrVkInterface.cpp
@@ -59,11 +59,6 @@ GrVkInterface::GrVkInterface(GetProc getProc,
ACQUIRE_PROC(EnumerateDeviceExtensionProperties, instance, VK_NULL_HANDLE);
ACQUIRE_PROC(EnumerateDeviceLayerProperties, instance, VK_NULL_HANDLE);
- if (extensionFlags & kKHR_get_physical_device_properties2_GrVkExtensionFlag) {
- // Also Instance Proc.
- ACQUIRE_PROC(GetPhysicalDeviceProperties2KHR, instance, VK_NULL_HANDLE);
- }
-
if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
// Also instance Procs.
ACQUIRE_PROC(CreateDebugReportCallbackEXT, instance, VK_NULL_HANDLE);
@@ -191,11 +186,6 @@ GrVkInterface::GrVkInterface(GetProc getProc,
ACQUIRE_PROC(CmdNextSubpass, VK_NULL_HANDLE, device);
ACQUIRE_PROC(CmdEndRenderPass, VK_NULL_HANDLE, device);
ACQUIRE_PROC(CmdExecuteCommands, VK_NULL_HANDLE, device);
-
- if (extensionFlags & kEXT_discard_rectangles_GrVkExtensionFlag) {
- // Also Device Proc.
- ACQUIRE_PROC(CmdSetDiscardRectangleEXT, VK_NULL_HANDLE, device);
- }
}
#ifdef SK_DEBUG
@@ -348,12 +338,6 @@ bool GrVkInterface::validate(uint32_t extensionFlags) const {
RETURN_FALSE_INTERFACE
}
- if (extensionFlags & kKHR_get_physical_device_properties2_GrVkExtensionFlag) {
- if (nullptr == fFunctions.fGetPhysicalDeviceProperties2KHR) {
- RETURN_FALSE_INTERFACE
- }
- }
-
if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
if (nullptr == fFunctions.fCreateDebugReportCallbackEXT ||
nullptr == fFunctions.fDebugReportMessageEXT ||
@@ -361,13 +345,6 @@ bool GrVkInterface::validate(uint32_t extensionFlags) const {
RETURN_FALSE_INTERFACE
}
}
-
- if (extensionFlags & kEXT_discard_rectangles_GrVkExtensionFlag) {
- if (nullptr == fFunctions.fCmdSetDiscardRectangleEXT) {
- RETURN_FALSE_INTERFACE
- }
- }
-
return true;
}
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index 5891f4cb59..a247078f72 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -239,21 +239,6 @@ static void setup_viewport_scissor_state(VkPipelineViewportStateCreateInfo* view
SkASSERT(viewportInfo->viewportCount == viewportInfo->scissorCount);
}
-static void setup_discard_rectangles_state(const GrWindowRectsState& windowState,
- const GrCaps* caps,
- VkPipelineDiscardRectangleStateCreateInfoEXT* info) {
- SkASSERT(windowState.numWindows() <= caps->maxWindowRectangles());
- memset(info, 0, sizeof(VkPipelineDiscardRectangleStateCreateInfoEXT));
- info->sType = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT;
- info->pNext = nullptr;
- info->flags = 0;
- info->discardRectangleMode =
- GrWindowRectsState::Mode::kExclusive == windowState.mode() ?
- VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT : VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT;
- info->discardRectangleCount = windowState.numWindows();
- info->pDiscardRectangles = nullptr; // This is set dynamically
-}
-
static void setup_multisample_state(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
const GrCaps* caps,
@@ -424,21 +409,17 @@ static void setup_raster_state(const GrPipeline& pipeline,
rasterInfo->lineWidth = 1.0f;
}
-static void setup_dynamic_state(const GrPipeline& pipeline,
- VkPipelineDynamicStateCreateInfo* dynamicInfo,
- SkSTArray<4, VkDynamicState>* dynamicStates) {
+static void setup_dynamic_state(VkPipelineDynamicStateCreateInfo* dynamicInfo,
+ VkDynamicState* dynamicStates) {
memset(dynamicInfo, 0, sizeof(VkPipelineDynamicStateCreateInfo));
dynamicInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
dynamicInfo->pNext = VK_NULL_HANDLE;
dynamicInfo->flags = 0;
- dynamicStates->push_back(VK_DYNAMIC_STATE_VIEWPORT);
- dynamicStates->push_back(VK_DYNAMIC_STATE_SCISSOR);
- if (pipeline.getWindowRectsState().enabled()) {
- dynamicStates->push_back(VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT);
- }
- dynamicStates->push_back(VK_DYNAMIC_STATE_BLEND_CONSTANTS);
- dynamicInfo->dynamicStateCount = dynamicStates->count();
- dynamicInfo->pDynamicStates = dynamicStates->begin();
+ dynamicStates[0] = VK_DYNAMIC_STATE_VIEWPORT;
+ dynamicStates[1] = VK_DYNAMIC_STATE_SCISSOR;
+ dynamicStates[2] = VK_DYNAMIC_STATE_BLEND_CONSTANTS;
+ dynamicInfo->dynamicStateCount = 3;
+ dynamicInfo->pDynamicStates = dynamicStates;
}
GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
@@ -477,9 +458,9 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
VkPipelineRasterizationStateCreateInfo rasterInfo;
setup_raster_state(pipeline, gpu->caps(), &rasterInfo);
- SkSTArray<4, VkDynamicState> dynamicStates;
+ VkDynamicState dynamicStates[3];
VkPipelineDynamicStateCreateInfo dynamicInfo;
- setup_dynamic_state(pipeline, &dynamicInfo, &dynamicStates);
+ setup_dynamic_state(&dynamicInfo, dynamicStates);
VkGraphicsPipelineCreateInfo pipelineCreateInfo;
memset(&pipelineCreateInfo, 0, sizeof(VkGraphicsPipelineCreateInfo));
@@ -503,15 +484,6 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
pipelineCreateInfo.basePipelineHandle = VK_NULL_HANDLE;
pipelineCreateInfo.basePipelineIndex = -1;
- VkPipelineDiscardRectangleStateCreateInfoEXT discardRectanglesInfo;
- if (pipeline.getWindowRectsState().enabled()) {
- SkASSERT(GrCaps::WindowRectsSupport::kNone != gpu->caps()->windowRectsSupport());
- setup_discard_rectangles_state(pipeline.getWindowRectsState(), gpu->caps(),
- &discardRectanglesInfo);
- discardRectanglesInfo.pNext = pipelineCreateInfo.pNext;
- pipelineCreateInfo.pNext = &discardRectanglesInfo;
- }
-
VkPipeline vkPipeline;
VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->device(),
cache, 1,
@@ -528,6 +500,31 @@ void GrVkPipeline::freeGPUData(const GrVkGpu* gpu) const {
GR_VK_CALL(gpu->vkInterface(), DestroyPipeline(gpu->device(), fPipeline, nullptr));
}
+void GrVkPipeline::SetDynamicScissorRectState(GrVkGpu* gpu,
+ GrVkCommandBuffer* cmdBuffer,
+ const GrRenderTarget* renderTarget,
+ GrSurfaceOrigin rtOrigin,
+ SkIRect scissorRect) {
+ if (!scissorRect.intersect(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()))) {
+ scissorRect.setEmpty();
+ }
+
+ VkRect2D scissor;
+ scissor.offset.x = scissorRect.fLeft;
+ scissor.extent.width = scissorRect.width();
+ if (kTopLeft_GrSurfaceOrigin == rtOrigin) {
+ scissor.offset.y = scissorRect.fTop;
+ } else {
+ SkASSERT(kBottomLeft_GrSurfaceOrigin == rtOrigin);
+ scissor.offset.y = renderTarget->height() - scissorRect.fBottom;
+ }
+ scissor.extent.height = scissorRect.height();
+
+ SkASSERT(scissor.offset.x >= 0);
+ SkASSERT(scissor.offset.y >= 0);
+ cmdBuffer->setScissor(gpu, 0, 1, &scissor);
+}
+
void GrVkPipeline::SetDynamicViewportState(GrVkGpu* gpu,
GrVkCommandBuffer* cmdBuffer,
const GrRenderTarget* renderTarget) {
@@ -542,48 +539,6 @@ void GrVkPipeline::SetDynamicViewportState(GrVkGpu* gpu,
cmdBuffer->setViewport(gpu, 0, 1, &viewport);
}
-inline static void skrect_to_vkrect(SkIRect skrect,
- const GrRenderTarget* renderTarget,
- GrSurfaceOrigin rtOrigin,
- VkRect2D* vkrect) {
- if (!skrect.intersect(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()))) {
- skrect.setEmpty();
- }
-
- vkrect->offset.x = skrect.fLeft;
- vkrect->extent.width = skrect.width();
- if (kTopLeft_GrSurfaceOrigin == rtOrigin) {
- vkrect->offset.y = skrect.fTop;
- } else {
- SkASSERT(kBottomLeft_GrSurfaceOrigin == rtOrigin);
- vkrect->offset.y = renderTarget->height() - skrect.fBottom;
- }
- vkrect->extent.height = skrect.height();
-}
-
-void GrVkPipeline::SetDynamicScissorRectState(GrVkGpu* gpu,
- GrVkCommandBuffer* cmdBuffer,
- const GrRenderTarget* renderTarget,
- GrSurfaceOrigin rtOrigin,
- SkIRect scissorRect) {
- VkRect2D scissor;
- skrect_to_vkrect(scissorRect, renderTarget, rtOrigin, &scissor);
- cmdBuffer->setScissor(gpu, 0, 1, &scissor);
-}
-
-void GrVkPipeline::SetDynamicDiscardRectanglesState(GrVkGpu* gpu,
- GrVkCommandBuffer* cmdBuffer,
- const GrRenderTarget* renderTarget,
- GrSurfaceOrigin rtOrigin,
- const GrWindowRectangles& windowRectangles) {
- const SkIRect* skrects = windowRectangles.data();
- VkRect2D vkrects[GrWindowRectangles::kMaxWindows];
- for (int i = 0; i < windowRectangles.count(); ++i) {
- skrect_to_vkrect(skrects[i], renderTarget, rtOrigin, &vkrects[i]);
- }
- cmdBuffer->setDiscardRectangles(gpu, 0, windowRectangles.count(), vkrects);
-}
-
void GrVkPipeline::SetDynamicBlendConstantState(GrVkGpu* gpu,
GrVkCommandBuffer* cmdBuffer,
GrPixelConfig pixelConfig,
diff --git a/src/gpu/vk/GrVkPipeline.h b/src/gpu/vk/GrVkPipeline.h
index ad77037c52..88c3d5f915 100644
--- a/src/gpu/vk/GrVkPipeline.h
+++ b/src/gpu/vk/GrVkPipeline.h
@@ -22,7 +22,6 @@ class GrStencilSettings;
class GrVkCommandBuffer;
class GrVkGpu;
class GrVkRenderPass;
-class GrWindowRectangles;
struct SkIRect;
class GrVkPipeline : public GrVkResource {
@@ -40,12 +39,9 @@ public:
VkPipeline pipeline() const { return fPipeline; }
- static void SetDynamicViewportState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*);
static void SetDynamicScissorRectState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*,
GrSurfaceOrigin, SkIRect);
- static void SetDynamicDiscardRectanglesState(GrVkGpu*, GrVkCommandBuffer*,
- const GrRenderTarget*, GrSurfaceOrigin,
- const GrWindowRectangles&);
+ static void SetDynamicViewportState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*);
static void SetDynamicBlendConstantState(GrVkGpu*, GrVkCommandBuffer*, GrPixelConfig,
const GrXferProcessor&);
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 5256c6dbcd..17197750ab 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -571,9 +571,9 @@ bool GrVkPipelineState::Desc::Build(Desc* desc,
const GrPipeline& pipeline,
const GrStencilSettings& stencil,
GrPrimitiveType primitiveType,
- const GrCaps& caps) {
+ const GrShaderCaps& caps) {
if (!INHERITED::Build(desc, primProc, primitiveType == GrPrimitiveType::kPoints, pipeline,
- *caps.shaderCaps())) {
+ caps)) {
return false;
}
@@ -587,12 +587,5 @@ bool GrVkPipelineState::Desc::Build(Desc* desc,
b.add32((uint32_t)primitiveType);
- if (GrCaps::WindowRectsSupport::kNone != caps.windowRectsSupport()) {
- const GrWindowRectsState& windowState = pipeline.getWindowRectsState();
- uint32_t mode = (0u - (uint32_t)windowState.mode());
- SkASSERT(0u == mode || ~0u == mode);
- b.add32((uint32_t)windowState.numWindows() ^ mode);
- }
-
return true;
}
diff --git a/src/gpu/vk/GrVkPipelineState.h b/src/gpu/vk/GrVkPipelineState.h
index 0eb822a65b..2794b99d22 100644
--- a/src/gpu/vk/GrVkPipelineState.h
+++ b/src/gpu/vk/GrVkPipelineState.h
@@ -77,7 +77,7 @@ public:
const GrPipeline&,
const GrStencilSettings&,
GrPrimitiveType primitiveType,
- const GrCaps&);
+ const GrShaderCaps&);
private:
typedef GrProgramDesc INHERITED;
};
diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp
index 37dc4a6cf9..caffe05bd5 100644
--- a/src/gpu/vk/GrVkPipelineStateCache.cpp
+++ b/src/gpu/vk/GrVkPipelineStateCache.cpp
@@ -93,7 +93,7 @@ GrVkPipelineState* GrVkResourceProvider::PipelineStateCache::refPipelineState(
// Get GrVkProgramDesc
GrVkPipelineState::Desc desc;
if (!GrVkPipelineState::Desc::Build(&desc, primProc, pipeline, stencil,
- primitiveType, *fGpu->caps())) {
+ primitiveType, *fGpu->caps()->shaderCaps())) {
GrCapsDebugf(fGpu->caps(), "Failed to build vk program descriptor!\n");
return nullptr;
}
diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp
index d250ec6d61..27cb119efc 100644
--- a/src/gpu/vk/GrVkRenderTarget.cpp
+++ b/src/gpu/vk/GrVkRenderTarget.cpp
@@ -8,7 +8,6 @@
#include "GrVkRenderTarget.h"
#include "GrRenderTargetPriv.h"
-#include "GrVkCaps.h"
#include "GrVkCommandBuffer.h"
#include "GrVkFramebuffer.h"
#include "GrVkGpu.h"
@@ -33,7 +32,7 @@ GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu,
: GrSurface(gpu, desc)
, GrVkImage(info, ownership)
// for the moment we only support 1:1 color to stencil
- , GrRenderTarget(gpu, desc, ComputeFlags(gpu->vkCaps()))
+ , GrRenderTarget(gpu, desc)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(new GrVkImage(msaaInfo, GrBackendObjectOwnership::kOwned))
, fResolveAttachmentView(resolveAttachmentView)
@@ -56,7 +55,7 @@ GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu,
: GrSurface(gpu, desc)
, GrVkImage(info, ownership)
// for the moment we only support 1:1 color to stencil
- , GrRenderTarget(gpu, desc, ComputeFlags(gpu->vkCaps()))
+ , GrRenderTarget(gpu, desc)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(new GrVkImage(msaaInfo, GrBackendObjectOwnership::kOwned))
, fResolveAttachmentView(resolveAttachmentView)
@@ -76,7 +75,7 @@ GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu,
GrBackendObjectOwnership ownership)
: GrSurface(gpu, desc)
, GrVkImage(info, ownership)
- , GrRenderTarget(gpu, desc, ComputeFlags(gpu->vkCaps()))
+ , GrRenderTarget(gpu, desc)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(nullptr)
, fResolveAttachmentView(nullptr)
@@ -96,7 +95,7 @@ GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu,
GrBackendObjectOwnership ownership)
: GrSurface(gpu, desc)
, GrVkImage(info, ownership)
- , GrRenderTarget(gpu, desc, ComputeFlags(gpu->vkCaps()))
+ , GrRenderTarget(gpu, desc)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(nullptr)
, fResolveAttachmentView(nullptr)
@@ -106,14 +105,6 @@ GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu,
this->createFramebuffer(gpu);
}
-inline GrRenderTargetFlags GrVkRenderTarget::ComputeFlags(const GrVkCaps& vkCaps) {
- GrRenderTargetFlags flags = GrRenderTargetFlags::kNone;
- if (GrCaps::WindowRectsSupport::kNone != vkCaps.windowRectsSupport()) {
- flags |= GrRenderTargetFlags::kWindowRectsSupport;
- }
- return flags;
-}
-
GrVkRenderTarget*
GrVkRenderTarget::Create(GrVkGpu* gpu,
SkBudgeted budgeted,
diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h
index 2ea065bc34..18a0bd3eea 100644
--- a/src/gpu/vk/GrVkRenderTarget.h
+++ b/src/gpu/vk/GrVkRenderTarget.h
@@ -15,7 +15,6 @@
#include "GrVkRenderPass.h"
#include "GrVkResourceProvider.h"
-class GrVkCaps;
class GrVkCommandBuffer;
class GrVkFramebuffer;
class GrVkGpu;
@@ -92,8 +91,6 @@ protected:
const GrVkImageView* colorAttachmentView,
GrBackendObjectOwnership);
- static GrRenderTargetFlags ComputeFlags(const GrVkCaps&);
-
GrVkGpu* getVkGpu() const;
void onAbandon() override;