37 fDimensions = that.fDimensions;
43 fDawnTexture = that.fDawnTexture;
44 fDawnTextureView = that.fDawnTextureView;
49 fMtlTexture = that.fMtlTexture;
54 fVkImage = that.fVkImage;
55 fMutableState = that.fMutableState;
56 fMemoryAlloc = that.fMemoryAlloc;
70 if (fDimensions != that.fDimensions || fInfo != that.fInfo) {
77 if (fDawnTexture != that.fDawnTexture) {
80 if (fDawnTextureView != that.fDawnTextureView) {
87 if (fMtlTexture != that.fMtlTexture) {
94 if (fVkImage != that.fVkImage) {
106 fMutableState->set(newState);
110 return fMutableState;
115 : fDimensions{static_cast<int32_t>(wgpuTextureGetWidth(
texture)),
116 static_cast<int32_t>(wgpuTextureGetHeight(
texture))}
119 , fDawnTextureView(nullptr) {}
122 const DawnTextureInfo&
info,
124 : fDimensions(planeDimensions)
127 , fDawnTextureView(nullptr) {
129#if defined(__EMSCRIPTEN__)
133 info.fAspect == wgpu::TextureAspect::Plane0Only ||
134 info.fAspect == wgpu::TextureAspect::Plane1Only ||
135 info.fAspect == wgpu::TextureAspect::Plane2Only);
141static DawnTextureInfo strip_copy_usage(
const DawnTextureInfo&
info) {
143 result.fUsage &= ~(wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc);
148 const DawnTextureInfo&
info,
149 WGPUTextureView textureView)
150 : fDimensions(dimensions)
151 , fInfo(strip_copy_usage(
info))
152 , fDawnTexture(nullptr)
153 , fDawnTextureView(textureView) {}
155WGPUTexture BackendTexture::getDawnTexturePtr()
const {
162WGPUTextureView BackendTexture::getDawnTextureViewPtr()
const {
164 return fDawnTextureView;
172 : fDimensions(dimensions)
173 , fInfo(MtlTextureInfo(mtlTexture))
174 , fMtlTexture(mtlTexture) {}
176CFTypeRef BackendTexture::getMtlTexture()
const {
186 const VulkanTextureInfo&
info,
188 uint32_t queueFamilyIndex,
190 VulkanAlloc vulkanMemoryAllocation)
191 : fDimensions(dimensions)
195 , fMemoryAlloc(vulkanMemoryAllocation)
198VkImage BackendTexture::getVkImage()
const {
213uint32_t BackendTexture::getVkQueueFamilyIndex()
const {
221const VulkanAlloc* BackendTexture::getMemoryAlloc()
const {
223 return &fMemoryAlloc;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SK_ABORT(message,...)
sk_sp< T > sk_make_sp(Args &&... args)
BackendTexture & operator=(const BackendTexture &)
void setMutableState(const skgpu::MutableTextureState &)
const TextureInfo & info() const
bool operator==(const BackendTexture &) const
BackendApi backend() const
SK_API sk_sp< GrDirectContext > MakeVulkan(const skgpu::VulkanBackendContext &, const GrContextOptions &)
sk_sp< const SkImage > image
SK_API uint32_t GetVkQueueFamilyIndex(const MutableTextureState &state)
SK_API VkImageLayout GetVkImageLayout(const MutableTextureState &state)
DawnTextureInfo DawnTextureInfoFromWGPUTexture(WGPUTexture texture)
@ VK_IMAGE_LAYOUT_UNDEFINED