GPUTextureDescriptor.h [plain text]
#pragma once
#if ENABLE(WEBGPU)
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
#if PLATFORM(COCOA)
OBJC_CLASS MTLTextureDescriptor;
#endif
namespace WebCore {
class GPUTextureDescriptor : public RefCounted<GPUTextureDescriptor> {
public:
static RefPtr<GPUTextureDescriptor> create(unsigned long pixelFormat, unsigned long width, unsigned long height, bool mipmapped);
WEBCORE_EXPORT ~GPUTextureDescriptor();
WEBCORE_EXPORT unsigned long width() const;
WEBCORE_EXPORT void setWidth(unsigned long);
WEBCORE_EXPORT unsigned long height() const;
WEBCORE_EXPORT void setHeight(unsigned long);
WEBCORE_EXPORT unsigned long sampleCount() const;
WEBCORE_EXPORT void setSampleCount(unsigned long);
WEBCORE_EXPORT unsigned long textureType() const;
WEBCORE_EXPORT void setTextureType(unsigned long);
WEBCORE_EXPORT unsigned long storageMode() const;
WEBCORE_EXPORT void setStorageMode(unsigned long);
WEBCORE_EXPORT unsigned long usage() const;
WEBCORE_EXPORT void setUsage(unsigned long);
#if PLATFORM(COCOA)
WEBCORE_EXPORT MTLTextureDescriptor *platformTextureDescriptor();
#endif
private:
GPUTextureDescriptor(unsigned long pixelFormat, unsigned long width, unsigned long height, bool mipmapped);
#if PLATFORM(COCOA)
RetainPtr<MTLTextureDescriptor> m_textureDescriptor;
#endif
};
} #endif