#include "dawn/native/opengl/TextureGL.h"
#include <limits>
#include <utility>
#include "dawn/common/Assert.h"
#include "dawn/common/Constants.h"
#include "dawn/common/Math.h"
#include "dawn/native/ChainUtils.h"
#include "dawn/native/EnumMaskIterator.h"
#include "dawn/native/opengl/BufferGL.h"
#include "dawn/native/opengl/CommandBufferGL.h"
#include "dawn/native/opengl/DeviceGL.h"
#include "dawn/native/opengl/UtilsGL.h"
namespace dawn::native::opengl {
namespace {
GLenum TargetForTextureViewDimension(wgpu::TextureViewDimension dimension, uint32_t sampleCount) { … }
bool RequiresCreatingNewTextureView(
const TextureBase* texture,
const UnpackedPtr<TextureViewDescriptor>& textureViewDescriptor) { … }
void AllocateTexture(const OpenGLFunctions& gl,
GLenum target,
GLsizei samples,
GLuint levels,
GLenum internalFormat,
const Extent3D& size) { … }
void FramebufferTextureHelper(const OpenGLFunctions& gl,
GLenum textarget,
GLenum target,
GLenum attachment,
GLuint textureHandle,
GLuint mipLevel,
GLuint arrayLayer) { … }
}
ResultOrError<Ref<Texture>> Texture::Create(Device* device,
const UnpackedPtr<TextureDescriptor>& descriptor) { … }
Texture::Texture(Device* device, const UnpackedPtr<TextureDescriptor>& descriptor)
: … { … }
Texture::Texture(Device* device, const UnpackedPtr<TextureDescriptor>& descriptor, GLuint handle)
: … { … }
Texture::~Texture() { … }
void Texture::DestroyImpl() { … }
GLuint Texture::GetHandle() const { … }
GLenum Texture::GetGLTarget() const { … }
const GLFormat& Texture::GetGLFormat() const { … }
MaybeError Texture::ClearTexture(const SubresourceRange& range,
TextureBase::ClearValue clearValue) { … }
MaybeError Texture::EnsureSubresourceContentInitialized(const SubresourceRange& range) { … }
TextureView::TextureView(TextureBase* texture, const UnpackedPtr<TextureViewDescriptor>& descriptor)
: … { … }
TextureView::~TextureView() { … }
void TextureView::DestroyImpl() { … }
GLuint TextureView::GetHandle() const { … }
GLenum TextureView::GetGLTarget() const { … }
void TextureView::BindToFramebuffer(GLenum target, GLenum attachment, GLuint depthSlice) { … }
GLenum TextureView::GetInternalFormat() const { … }
}