#include "src/gpu/graphite/dawn/DawnGraphicsPipeline.h"
#include "include/gpu/graphite/TextureInfo.h"
#include "include/private/base/SkTemplates.h"
#include "src/gpu/SkSLToBackend.h"
#include "src/gpu/Swizzle.h"
#include "src/gpu/graphite/Attribute.h"
#include "src/gpu/graphite/ContextUtils.h"
#include "src/gpu/graphite/GraphicsPipelineDesc.h"
#include "src/gpu/graphite/Log.h"
#include "src/gpu/graphite/RenderPassDesc.h"
#include "src/gpu/graphite/RendererProvider.h"
#include "src/gpu/graphite/UniformManager.h"
#include "src/gpu/graphite/dawn/DawnCaps.h"
#include "src/gpu/graphite/dawn/DawnErrorChecker.h"
#include "src/gpu/graphite/dawn/DawnGraphiteTypesPriv.h"
#include "src/gpu/graphite/dawn/DawnGraphiteUtilsPriv.h"
#include "src/gpu/graphite/dawn/DawnResourceProvider.h"
#include "src/gpu/graphite/dawn/DawnSharedContext.h"
#include "src/gpu/graphite/dawn/DawnUtilsPriv.h"
#include "src/sksl/SkSLProgramSettings.h"
#include "src/sksl/SkSLUtil.h"
#include "src/sksl/ir/SkSLProgram.h"
#include <vector>
namespace skgpu::graphite {
namespace {
inline wgpu::VertexFormat attribute_type_to_dawn(VertexAttribType type) { … }
wgpu::CompareFunction compare_op_to_dawn(CompareOp op) { … }
wgpu::StencilOperation stencil_op_to_dawn(StencilOp op) { … }
wgpu::StencilFaceState stencil_face_to_dawn(DepthStencilSettings::Face face) { … }
size_t create_vertex_attributes(SkSpan<const Attribute> attrs,
int shaderLocationOffset,
std::vector<wgpu::VertexAttribute>* out) { … }
static wgpu::BlendFactor blend_coeff_to_dawn_blend(const DawnCaps& caps, skgpu::BlendCoeff coeff) { … }
static wgpu::BlendFactor blend_coeff_to_dawn_blend_for_alpha(const DawnCaps& caps,
skgpu::BlendCoeff coeff) { … }
static wgpu::BlendOperation blend_equation_to_dawn_blend_op(skgpu::BlendEquation equation) { … }
struct AsyncPipelineCreationBase { … };
}
#if defined(__EMSCRIPTEN__)
struct DawnGraphicsPipeline::AsyncPipelineCreation : public AsyncPipelineCreationBase {};
#else
struct DawnGraphicsPipeline::AsyncPipelineCreation : public AsyncPipelineCreationBase { … };
#endif
#if !defined(__EMSCRIPTEN__)
usingnamespaceycbcrUtils;
bool gather_immutable_samplers(const SkSpan<uint32_t> samplerData,
DawnResourceProvider* resourceProvider,
skia_private::AutoTArray<sk_sp<DawnSampler>>& outImmutableSamplers) { … }
#endif
sk_sp<DawnGraphicsPipeline> DawnGraphicsPipeline::Make(const DawnSharedContext* sharedContext,
DawnResourceProvider* resourceProvider,
const RuntimeEffectDictionary* runtimeDict,
const GraphicsPipelineDesc& pipelineDesc,
const RenderPassDesc& renderPassDesc) { … }
DawnGraphicsPipeline::DawnGraphicsPipeline(
const skgpu::graphite::SharedContext* sharedContext,
PipelineInfo* pipelineInfo,
std::unique_ptr<AsyncPipelineCreation> asyncCreationInfo,
BindGroupLayouts groupLayouts,
PrimitiveType primitiveType,
uint32_t refValue,
bool hasStepUniforms,
bool hasPaintUniforms,
bool hasGradientBuffer,
int numFragmentTexturesAndSamplers,
skia_private::AutoTArray<sk_sp<DawnSampler>> immutableSamplers)
: … { … }
DawnGraphicsPipeline::~DawnGraphicsPipeline() { … }
void DawnGraphicsPipeline::freeGpuData() { … }
const wgpu::RenderPipeline& DawnGraphicsPipeline::dawnRenderPipeline() const { … }
}