51 auto const numItems =
texture->GetNumItems();
57 for (
unsigned int item = 0; item < numItems; ++item)
70 for (
unsigned int item = 0; item < numItems; ++item)
90 auto const numItems =
texture->GetNumItems();
95 for (
unsigned int item = 0; item < numItems; ++item)
108 auto const numLevels =
texture->GetNumLevels();
109 for (
unsigned int item = 0; item < numItems; ++item)
127 auto const numItems =
texture->GetNumItems();
132 for (
unsigned int item = 0; item < numItems; ++item)
145 auto const numLevels =
texture->GetNumLevels();
146 for (
unsigned int item = 0; item < numItems; ++item)
164 auto const numItems =
texture->GetNumItems();
165 auto const numLevels =
texture->GetNumLevels();
166 for (
unsigned int item = 0; item < numItems; ++item)
185 LogWarning(
"Texture usage is not DYNAMIC_UPDATE.");
212 auto const numItems =
texture->GetNumItems();
213 if (item >= numItems)
215 LogWarning(
"Item for Texture is out of range");
220 auto const numLevels =
texture->GetNumLevels();
221 if (level >= numLevels)
223 LogWarning(
"Level for Texture is out of range");
230 LogWarning(
"Staging buffer not defined for level=" + level);
235 auto numBytes =
texture->GetNumBytesFor(level);
236 if ((
nullptr ==
data) || (0 == numBytes))
238 LogWarning(
"No target data for Texture level=" + level);
262 LogWarning(
"Cannot update automatically generated mipmaps in GPU");
267 auto const numItems =
texture->GetNumItems();
268 if (item >= numItems)
270 LogWarning(
"Item for TextureArray is out of range");
275 auto const numLevels =
texture->GetNumLevels();
276 if (level >= numLevels)
278 LogWarning(
"Level for TextureArray is out of range");
283 auto numBytes =
texture->GetNumBytesFor(level);
284 if ((
nullptr ==
data) || (0 == numBytes))
286 LogWarning(
"No source data for TextureArray level=" + level);
315 auto const copyType =
texture->GetCopyType();
317 auto const createPixelUnpackBuffers =
319 (copyType == Resource::COPY_BIDIRECTIONAL);
321 auto const createPixelPackBuffers =
323 (copyType == Resource::COPY_BIDIRECTIONAL);
330 if (createPixelUnpackBuffers)
348 if (createPixelPackBuffers)
void APIENTRY glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void *pixels)
void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
void APIENTRY glDeleteBuffers(GLsizei n, const GLuint *buffers)
GLuint mLevelPixelUnpackBuffer[Texture::MAX_MIPMAP_LEVELS]
virtual bool CopyCpuToGpu() override
#define GL_PIXEL_UNPACK_BUFFER
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
bool DoCopyCpuToGpu(unsigned int item, unsigned int level)
static GLenum const msCubeFaceTarget[6]
#define GL_PIXEL_PACK_BUFFER
bool PreparedForCopy(GLenum access) const
void APIENTRY glPixelStorei(GLenum pname, GLint param)
#define GL_PACK_ALIGNMENT
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z
void APIENTRY glBindTexture(GLenum target, GLuint texture)
void APIENTRY glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void *data)
#define GL_TEXTURE_BASE_LEVEL
virtual bool CopyGpuToCpu() override
#define GL_TEXTURE_MAX_LEVEL
void APIENTRY glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
GLuint mLevelPixelPackBuffer[Texture::MAX_MIPMAP_LEVELS]
#define GL_UNPACK_ALIGNMENT
void APIENTRY glGenBuffers(GLsizei n, GLuint *buffers)
virtual void LoadTextureLevel(unsigned int item, unsigned int level, void const *data)=0
#define LogWarning(message)
void APIENTRY glBindBuffer(GLenum target, GLuint buffer)
GLsizeiptr const void GLenum usage
GL4TextureArray(TextureArray const *gtTexture, GLenum target, GLenum targetBinding)
void APIENTRY glGetIntegerv(GLenum pname, GLint *data)
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
virtual bool Update() override
TextureArray * GetTexture() const
virtual ~GL4TextureArray()
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X
void APIENTRY glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X
virtual bool GenerateMipmaps()
virtual bool CanAutoGenerateMipmaps() const =0
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y
void APIENTRY glGenerateMipmap(GLenum target)