Flutter Engine
The Flutter Engine
Functions
GrVkOpsRenderPass.cpp File Reference
#include "src/gpu/ganesh/vk/GrVkOpsRenderPass.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkRect.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/ganesh/vk/GrBackendDrawableInfo.h"
#include "src/gpu/ganesh/GrBackendUtils.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrOpFlushState.h"
#include "src/gpu/ganesh/GrPipeline.h"
#include "src/gpu/ganesh/GrRenderTarget.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/vk/GrVkBuffer.h"
#include "src/gpu/ganesh/vk/GrVkCommandBuffer.h"
#include "src/gpu/ganesh/vk/GrVkCommandPool.h"
#include "src/gpu/ganesh/vk/GrVkFramebuffer.h"
#include "src/gpu/ganesh/vk/GrVkGpu.h"
#include "src/gpu/ganesh/vk/GrVkImage.h"
#include "src/gpu/ganesh/vk/GrVkPipeline.h"
#include "src/gpu/ganesh/vk/GrVkRenderPass.h"
#include "src/gpu/ganesh/vk/GrVkRenderTarget.h"
#include "src/gpu/ganesh/vk/GrVkResourceProvider.h"
#include "src/gpu/ganesh/vk/GrVkSemaphore.h"
#include "src/gpu/ganesh/vk/GrVkTexture.h"

Go to the source code of this file.

Functions

void get_vk_load_store_ops (GrLoadOp loadOpIn, GrStoreOp storeOpIn, VkAttachmentLoadOp *loadOp, VkAttachmentStoreOp *storeOp)
 
void adjust_bounds_to_granularity (SkIRect *dstBounds, const SkIRect &srcBounds, const VkExtent2D &granularity, int maxWidth, int maxHeight)
 

Function Documentation

◆ adjust_bounds_to_granularity()

void adjust_bounds_to_granularity ( SkIRect dstBounds,
const SkIRect srcBounds,
const VkExtent2D granularity,
int  maxWidth,
int  maxHeight 
)

Definition at line 140 of file GrVkOpsRenderPass.cpp.

144 {
145 // Adjust Width
146 if ((0 != granularity.width && 1 != granularity.width)) {
147 // Start with the right side of rect so we know if we end up going pass the maxWidth.
148 int rightAdj = srcBounds.fRight % granularity.width;
149 if (rightAdj != 0) {
150 rightAdj = granularity.width - rightAdj;
151 }
152 dstBounds->fRight = srcBounds.fRight + rightAdj;
153 if (dstBounds->fRight > maxWidth) {
154 dstBounds->fRight = maxWidth;
155 dstBounds->fLeft = 0;
156 } else {
157 dstBounds->fLeft = srcBounds.fLeft - srcBounds.fLeft % granularity.width;
158 }
159 } else {
160 dstBounds->fLeft = srcBounds.fLeft;
161 dstBounds->fRight = srcBounds.fRight;
162 }
163
164 // Adjust height
165 if ((0 != granularity.height && 1 != granularity.height)) {
166 // Start with the bottom side of rect so we know if we end up going pass the maxHeight.
167 int bottomAdj = srcBounds.fBottom % granularity.height;
168 if (bottomAdj != 0) {
169 bottomAdj = granularity.height - bottomAdj;
170 }
171 dstBounds->fBottom = srcBounds.fBottom + bottomAdj;
172 if (dstBounds->fBottom > maxHeight) {
173 dstBounds->fBottom = maxHeight;
174 dstBounds->fTop = 0;
175 } else {
176 dstBounds->fTop = srcBounds.fTop - srcBounds.fTop % granularity.height;
177 }
178 } else {
179 dstBounds->fTop = srcBounds.fTop;
180 dstBounds->fBottom = srcBounds.fBottom;
181 }
182}
int32_t fBottom
larger y-axis bounds
Definition: SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition: SkRect.h:34
int32_t fLeft
smaller x-axis bounds
Definition: SkRect.h:33
int32_t fRight
larger x-axis bounds
Definition: SkRect.h:35
uint32_t width
Definition: vulkan_core.h:2858
uint32_t height
Definition: vulkan_core.h:2859

◆ get_vk_load_store_ops()

void get_vk_load_store_ops ( GrLoadOp  loadOpIn,
GrStoreOp  storeOpIn,
VkAttachmentLoadOp loadOp,
VkAttachmentStoreOp storeOp 
)

Definition at line 37 of file GrVkOpsRenderPass.cpp.

38 {
39 switch (loadOpIn) {
40 case GrLoadOp::kLoad:
42 break;
45 break;
48 break;
49 default:
50 SK_ABORT("Invalid LoadOp");
52 }
53
54 switch (storeOpIn) {
57 break;
60 break;
61 default:
62 SK_ABORT("Invalid StoreOp");
64 }
65}
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
@ VK_ATTACHMENT_LOAD_OP_CLEAR
Definition: vulkan_core.h:2149
@ VK_ATTACHMENT_LOAD_OP_LOAD
Definition: vulkan_core.h:2148
@ VK_ATTACHMENT_LOAD_OP_DONT_CARE
Definition: vulkan_core.h:2150
@ VK_ATTACHMENT_STORE_OP_DONT_CARE
Definition: vulkan_core.h:2157
@ VK_ATTACHMENT_STORE_OP_STORE
Definition: vulkan_core.h:2156