default:
; /* fallthrough */
}
-
+
if (ctx->Extensions.TDFX_texture_compression_FXT1) {
switch (internalFormat) {
case GL_COMPRESSED_RGB_FXT1_3DFX:
/**
* Allocate a texture image structure.
- *
+ *
* Called via ctx->Driver.NewTextureImage() unless overriden by a device
* driver.
*
if (!texObj)
return NULL;
-
+
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
if (!texImage) {
texImage = ctx->Driver.NewTextureImage(ctx);
*
* \param ctx GL context.
* \param target texture target.
- *
+ *
* \return the maximum number of allowed mipmap levels for the given
* texture target, or zero if passed a bad target.
*
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s%dD(height = %d)", function, dims, subHeight);
return GL_TRUE;
- }
+ }
}
return GL_FALSE;
return ctx->Extensions.ARB_texture_cube_map_array;
default:
return GL_FALSE;
- }
+ }
}
/**
* Test the glTexImage[123]D() parameters for errors.
- *
+ *
* \param ctx GL context.
* \param dimensions texture image dimensions (must be 1, 2 or 3).
* \param target texture target given by the user (already validated).
* \param height image height given by the user.
* \param depth image depth given by the user.
* \param border image border given by the user.
- *
+ *
* \return GL_TRUE if a error is found, GL_FALSE otherwise
*
* Verifies each of the parameters against the constants specified in
internalFormat);
} else {
if (format != internalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%dD(format = %s, internalFormat = %s)",
- dimensions,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(internalFormat));
- return GL_TRUE;
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(format = %s, internalFormat = %s)",
+ dimensions,
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(internalFormat));
+ return GL_TRUE;
}
err = _mesa_es_error_check_format_and_type(format, type, dimensions);
/**
* Test glTexSubImage[123]D() parameters for errors.
- *
+ *
* \param ctx GL context.
* \param dimensions texture image dimensions (must be 1, 2 or 3).
* \param target texture target given by the user (already validated)
* \param width image width given by the user.
* \param height image height given by the user.
* \param depth image depth given by the user.
- *
+ *
* \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
*
* Verifies each of the parameters against the constants specified in
/**
* Test glCopyTexImage[12]D() parameters for errors.
- *
+ *
* \param ctx GL context.
* \param dimensions texture image dimensions (must be 1, 2 or 3).
* \param target texture target given by the user.
* \param width image width given by the user.
* \param height image height given by the user.
* \param border texture border.
- *
+ *
* \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
- *
+ *
* Verifies each of the parameters against the constants specified in
* __struct gl_contextRec::Const and the supported extensions, and according
* to the OpenGL specification.
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)",
dimensions, _mesa_lookup_enum_by_nr(target));
return GL_TRUE;
- }
+ }
/* level check */
if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
return f;
}
+
/**
* Adjust pixel unpack params and image dimensions to strip off the
* one-pixel texture border.
*height = *height - 2; /* reduce the height by two border pixels */
}
- if (*depth >= 3 && target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) {
+ if (*depth >= 3 &&
+ target != GL_TEXTURE_2D_ARRAY &&
+ target != GL_TEXTURE_CUBE_MAP_ARRAY) {
unpackNew->SkipImages++; /* skip the border */
*depth = *depth - 2; /* reduce the depth by two border pixels */
}
_mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)",
dims, _mesa_lookup_enum_by_nr(target));
return;
- }
+ }
if (ctx->NewState & _NEW_PIXEL)
_mesa_update_state(ctx);
targetOK = GL_FALSE;
break;
}
-
+
if (!targetOK) {
_mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage%uD(target)",
dims);
}
}
+
static gl_format
validate_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
{
_mesa_unlock_texture(ctx, texObj);
}
+
/** GL_ARB_texture_buffer_object */
void GLAPIENTRY
_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
texbufferrange(ctx, target, internalFormat, bufObj, 0, buffer ? -1 : 0);
}
+
/** GL_ARB_texture_buffer_range */
void GLAPIENTRY
_mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer,
texbufferrange(ctx, target, internalFormat, bufObj, offset, size);
}
+
static GLboolean
is_renderable_texture_format(struct gl_context *ctx, GLenum internalformat)
{
return baseFormat != 0 && baseFormat != GL_STENCIL_INDEX;
}
+
/** GL_ARB_texture_multisample */
static GLboolean
check_multisample_target(GLuint dims, GLenum target)
}
}
+
static void
teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
GLint internalformat, GLsizei width, GLsizei height,
texImage->FixedSampleLocations = fixedsamplelocations;
if (width > 0 && height > 0 && depth > 0) {
-
if (!ctx->Driver.AllocTextureStorage(ctx, texObj, 1,
width, height, depth)) {
/* tidy up the texture image state. strictly speaking,
}
}
+
void GLAPIENTRY
_mesa_TexImage2DMultisample(GLenum target, GLsizei samples,
GLint internalformat, GLsizei width,
GLsizei height, GLboolean fixedsamplelocations)
{
teximagemultisample(2, target, samples, internalformat,
- width, height, 1, fixedsamplelocations, GL_FALSE, "glTexImage2DMultisample");
+ width, height, 1, fixedsamplelocations, GL_FALSE,
+ "glTexImage2DMultisample");
}
+
void GLAPIENTRY
_mesa_TexImage3DMultisample(GLenum target, GLsizei samples,
GLint internalformat, GLsizei width,
GLboolean fixedsamplelocations)
{
teximagemultisample(3, target, samples, internalformat,
- width, height, depth, fixedsamplelocations, GL_FALSE, "glTexImage3DMultisample");
+ width, height, depth, fixedsamplelocations, GL_FALSE,
+ "glTexImage3DMultisample");
}
GLsizei height, GLboolean fixedsamplelocations)
{
teximagemultisample(2, target, samples, internalformat,
- width, height, 1, fixedsamplelocations, GL_TRUE, "glTexStorage2DMultisample");
+ width, height, 1, fixedsamplelocations, GL_TRUE,
+ "glTexStorage2DMultisample");
}
+
void GLAPIENTRY
_mesa_TexStorage3DMultisample(GLenum target, GLsizei samples,
GLenum internalformat, GLsizei width,
GLboolean fixedsamplelocations)
{
teximagemultisample(3, target, samples, internalformat,
- width, height, depth, fixedsamplelocations, GL_TRUE, "glTexStorage3DMultisample");
+ width, height, depth, fixedsamplelocations, GL_TRUE,
+ "glTexStorage3DMultisample");
}