97 auto const numLevels =
texture->GetNumLevels();
127 auto const numLevels =
texture->GetNumLevels();
143 auto const numLevels =
texture->GetNumLevels();
160 LogWarning(
"Texture usage is not DYNAMIC_UPDATE.");
187 auto const numLevels =
texture->GetNumLevels();
188 if (level >= numLevels)
190 LogWarning(
"Level for Texture is out of range");
197 LogWarning(
"Staging buffer not defined for level=" + level);
202 auto numBytes =
texture->GetNumBytesFor(level);
203 if ((
nullptr ==
data) || (0 == numBytes))
205 LogWarning(
"No target data for Texture level=" + level);
229 LogWarning(
"Cannot update automatically generated mipmaps in GPU");
234 auto const numLevels =
texture->GetNumLevels();
235 if (level >= numLevels)
237 LogWarning(
"Level for Texture is out of range");
242 auto numBytes =
texture->GetNumBytesFor(level);
243 if ((
nullptr ==
data) || (0 == numBytes))
245 LogWarning(
"No source data for Texture level=" + level);
297 auto const copyType =
texture->GetCopyType();
299 auto const createPixelUnpackBuffers =
301 (copyType == Resource::COPY_BIDIRECTIONAL);
303 auto const createPixelPackBuffers =
305 (copyType == Resource::COPY_BIDIRECTIONAL);
312 if (createPixelUnpackBuffers)
330 if (createPixelPackBuffers)
void APIENTRY glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void *pixels)
virtual bool CanAutoGenerateMipmaps() const =0
void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
void APIENTRY glDeleteBuffers(GLsizei n, const GLuint *buffers)
GLuint mLevelPixelPackBuffer[Texture::MAX_MIPMAP_LEVELS]
#define GL_PIXEL_UNPACK_BUFFER
#define GL_PIXEL_PACK_BUFFER
bool PreparedForCopy(GLenum access) const
GL4TextureSingle(TextureSingle const *gtTexture, GLenum target, GLenum targetBinding)
void APIENTRY glPixelStorei(GLenum pname, GLint param)
#define GL_PACK_ALIGNMENT
void APIENTRY glBindTexture(GLenum target, GLuint texture)
void APIENTRY glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void *data)
#define GL_TEXTURE_BASE_LEVEL
#define GL_TEXTURE_MAX_LEVEL
virtual bool CopyGpuToCpu() override
void APIENTRY glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
#define GL_UNPACK_ALIGNMENT
virtual bool GenerateMipmaps()
void APIENTRY glGenBuffers(GLsizei n, GLuint *buffers)
TextureSingle * GetTexture() const
virtual void LoadTextureLevel(unsigned int level, void const *data)=0
virtual bool Update() override
#define LogWarning(message)
void APIENTRY glBindBuffer(GLenum target, GLuint buffer)
GLsizeiptr const void GLenum usage
void APIENTRY glGetIntegerv(GLenum pname, GLint *data)
GLuint mLevelPixelUnpackBuffer[Texture::MAX_MIPMAP_LEVELS]
virtual ~GL4TextureSingle()
void APIENTRY glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
bool DoCopyCpuToGpu(unsigned int level)
void APIENTRY glGenerateMipmap(GLenum target)
virtual bool CopyCpuToGpu() override