#ifndef skgpu_graphite_DawnGraphiteUtilsPriv_DEFINED
#define skgpu_graphite_DawnGraphiteUtilsPriv_DEFINED
#include "include/core/SkImageInfo.h"
#include "src/gpu/graphite/ResourceTypes.h"
#include "src/gpu/graphite/dawn/DawnGraphiteTypesPriv.h"
#include "src/sksl/SkSLProgramKind.h"
#include "src/sksl/ir/SkSLProgram.h"
#include "webgpu/webgpu_cpp.h"
namespace SkSL {
class Compiler;
struct ProgramSettings;
}
namespace skgpu {
class ShaderErrorHandler;
}
namespace skgpu::graphite {
class DawnSharedContext;
bool DawnFormatIsDepthOrStencil(wgpu::TextureFormat);
bool DawnFormatIsDepth(wgpu::TextureFormat);
bool DawnFormatIsStencil(wgpu::TextureFormat);
wgpu::TextureFormat DawnDepthStencilFlagsToFormat(SkEnumBitMask<DepthStencilFlags>);
bool DawnCompileWGSLShaderModule(const DawnSharedContext* sharedContext,
const char* label,
const std::string& wgsl,
wgpu::ShaderModule* module,
ShaderErrorHandler*);
#if !defined(__EMSCRIPTEN__)
namespace ycbcrUtils {
bool DawnDescriptorIsValid(const wgpu::YCbCrVkDescriptor&);
bool DawnDescriptorUsesExternalFormat(const wgpu::YCbCrVkDescriptor&);
static constexpr int kIntsNeededKnownFormat = …;
static constexpr int kIntsNeededExternalFormat = …;
static constexpr int kUsesExternalFormatBits = …;
static constexpr int kYcbcrModelBits = …;
static constexpr int kYcbcrRangeBits = …;
static constexpr int kXChromaOffsetBits = …;
static constexpr int kYChromaOffsetBits = …;
static constexpr int kChromaFilterBits = …;
static constexpr int kForceExplicitReconBits = …;
static constexpr int kComponentBits = …;
static constexpr int kUsesExternalFormatShift = …;
static constexpr int kYcbcrModelShift = …;
static constexpr int kYcbcrRangeShift = …;
static constexpr int kXChromaOffsetShift = …;
static constexpr int kYChromaOffsetShift = …;
static constexpr int kChromaFilterShift = …;
static constexpr int kForceExplicitReconShift = …;
static constexpr int kComponentRShift = …;
static constexpr int kComponentGShift = …;
static constexpr int kComponentBShift = …;
static constexpr int kComponentAShift = …;
static constexpr uint32_t kUseExternalFormatMask = …;
static constexpr uint32_t kYcbcrModelMask = …;
static constexpr uint32_t kYcbcrRangeMask = …;
static constexpr uint32_t kXChromaOffsetMask = …;
static constexpr uint32_t kYChromaOffsetMask = …;
static constexpr uint32_t kChromaFilterMask = …;
static constexpr uint32_t kForceExplicitReconMask = …;
static constexpr uint32_t kComponentRMask = …;
static constexpr uint32_t kComponentBMask = …;
static constexpr uint32_t kComponentGMask = …;
static constexpr uint32_t kComponentAMask = …;
}
#endif
}
#endif