return format;
}
+/**
+ * Returns a corresponding base format for a given internal floating point
+ * format as specifed by OES_texture_float.
+ */
+static GLenum
+oes_float_internal_format(const struct gl_context *ctx,
+ GLenum format, GLenum type)
+{
+ switch (type) {
+ case GL_FLOAT:
+ if (ctx->Extensions.OES_texture_float) {
+ switch (format) {
+ case GL_RGBA32F:
+ return GL_RGBA;
+ case GL_RGB32F:
+ return GL_RGB;
+ case GL_ALPHA32F_ARB:
+ return GL_ALPHA;
+ case GL_LUMINANCE32F_ARB:
+ return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA32F_ARB:
+ return GL_LUMINANCE_ALPHA;
+ default:
+ break;
+ }
+ }
+ break;
+
+ case GL_HALF_FLOAT_OES:
+ if (ctx->Extensions.OES_texture_half_float) {
+ switch (format) {
+ case GL_RGBA16F:
+ return GL_RGBA;
+ case GL_RGB16F:
+ return GL_RGB;
+ case GL_ALPHA16F_ARB:
+ return GL_ALPHA;
+ case GL_LUMINANCE16F_ARB:
+ return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA16F_ARB:
+ return GL_LUMINANCE_ALPHA;
+ default:
+ break;
+ }
+ }
+ break;
+ }
+ return format;
+}
+
/**
* Install gl_texture_image in a gl_texture_object according to the target
* and level parameters.
- *
+ *
* \param tObj texture object.
* \param target texture target.
* \param level image level.
* \sa gl_constants.
*/
GLint
-_mesa_max_texture_levels(struct gl_context *ctx, GLenum target)
+_mesa_max_texture_levels(const struct gl_context *ctx, GLenum target)
{
switch (target) {
case GL_TEXTURE_1D:
* Fills in the fields of \p img with the given information.
* Note: width, height and depth include the border.
*/
-static void
-init_teximage_fields_ms(struct gl_context *ctx,
+void
+_mesa_init_teximage_fields_ms(struct gl_context *ctx,
struct gl_texture_image *img,
GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLenum internalFormat,
mesa_format format,
GLuint numSamples, GLboolean fixedSampleLocations)
{
+ const GLint base_format =_mesa_base_tex_format(ctx, internalFormat);
GLenum target;
assert(img);
assert(width >= 0);
assert(depth >= 0);
target = img->TexObject->Target;
- img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
- assert(img->_BaseFormat != -1);
+ assert(base_format != -1);
+ img->_BaseFormat = (GLenum16)base_format;
img->InternalFormat = internalFormat;
img->Border = border;
img->Width = width;
GLint border, GLenum internalFormat,
mesa_format format)
{
- init_teximage_fields_ms(ctx, img, width, height, depth, border,
- internalFormat, format, 0, GL_TRUE);
+ _mesa_init_teximage_fields_ms(ctx, img, width, height, depth, border,
+ internalFormat, format, 0, GL_TRUE);
}
}
if (xoffset + subWidth > (GLint) destImage->Width) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(xoffset+width)", func);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(xoffset %d + width %d > %u)", func,
+ xoffset, subWidth, destImage->Width);
return GL_TRUE;
}
return GL_TRUE;
}
if (yoffset + subHeight > (GLint) destImage->Height) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(yoffset+height)", func);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(yoffset %d + height %d > %u)",
+ func, yoffset, subHeight, destImage->Height);
return GL_TRUE;
}
}
if (target == GL_TEXTURE_CUBE_MAP)
depth = 6;
if (zoffset + subDepth > depth) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(zoffset+depth)", func);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(zoffset %d + depth %d > %u)",
+ func, zoffset, subDepth, depth);
return GL_TRUE;
}
}
*/
GLboolean
_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target,
- GLuint numLevels, GLint level,
+ GLuint numLevels, MAYBE_UNUSED GLint level,
mesa_format format, GLuint numSamples,
GLint width, GLint height, GLint depth)
{
* Return true if the format is only valid for glCompressedTexImage.
*/
static bool
-compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
+compressedteximage_only_format(GLenum format)
{
switch (format) {
case GL_PALETTE4_RGB8_OES:
case GL_PALETTE8_R5_G6_B5_OES:
case GL_PALETTE8_RGBA4_OES:
case GL_PALETTE8_RGB5_A1_OES:
+ case GL_ATC_RGB_AMD:
+ case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
+ case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
return true;
default:
return false;
* Return true if the format doesn't support online compression.
*/
bool
-_mesa_format_no_online_compression(const struct gl_context *ctx, GLenum format)
+_mesa_format_no_online_compression(GLenum format)
{
return _mesa_is_astc_format(format) ||
_mesa_is_etc2_format(format) ||
- compressedteximage_only_format(ctx, format);
+ compressedteximage_only_format(format);
}
/* Writes to an GL error pointer if non-null and returns whether or not the
*
* This should also be applicable for glTexStorage3D(). Other available
* targets for these functions are: TEXTURE_3D and TEXTURE_CUBE_MAP_ARRAY.
+ *
+ * Section 8.7, page 179 of OpenGL ES 3.2 adds:
+ *
+ * An INVALID_OPERATION error is generated by CompressedTexImage3D
+ * if internalformat is one of the the formats in table 8.17 and target is
+ * not TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY or TEXTURE_3D.
+ *
+ * An INVALID_OPERATION error is generated by CompressedTexImage3D
+ * if internalformat is TEXTURE_CUBE_MAP_ARRAY and the “Cube Map
+ * Array” column of table 8.17 is not checked, or if internalformat
+ * is TEXTURE_- 3D and the “3D Tex.” column of table 8.17 is not
+ * checked.
+ *
+ * The instances of <internalformat> above should say <target>.
+ *
+ * Such table 8.17 has checked "Cube Map Array" column for all the
+ * cases. So in practice, TEXTURE_CUBE_MAP_ARRAY is now valid for OpenGL ES 3.2
*/
- if (layout == MESA_FORMAT_LAYOUT_ETC2 && _mesa_is_gles3(ctx))
+ if (layout == MESA_FORMAT_LAYOUT_ETC2 && _mesa_is_gles3(ctx) &&
+ !_mesa_is_gles32(ctx))
return write_error(error, GL_INVALID_OPERATION);
target_can_be_compresed = _mesa_has_texture_cube_map_array(ctx);
break;
* \param format pixel data format given by the user.
* \param type pixel data type given by the user.
* \param internalFormat internal format given by the user.
- * \param dimensions texture image dimensions (must be 1, 2 or 3).
* \param callerName name of the caller function to print in the error message
*
* \return true if a error is found, false otherwise
*/
static bool
texture_format_error_check_gles(struct gl_context *ctx, GLenum format,
- GLenum type, GLenum internalFormat,
- GLuint dimensions, const char *callerName)
+ GLenum type, GLenum internalFormat, const char *callerName)
{
- GLenum err;
-
- if (_mesa_is_gles3(ctx)) {
- err = _mesa_es3_error_check_format_and_type(ctx, format, type,
- internalFormat);
- if (err != GL_NO_ERROR) {
- _mesa_error(ctx, err,
- "%s(format = %s, type = %s, internalformat = %s)",
- callerName, _mesa_enum_to_string(format),
- _mesa_enum_to_string(type),
- _mesa_enum_to_string(internalFormat));
- return true;
- }
- }
- else {
- err = _mesa_es_error_check_format_and_type(ctx, format, type, dimensions);
- if (err != GL_NO_ERROR) {
- _mesa_error(ctx, err, "%s(format = %s, type = %s)",
- callerName, _mesa_enum_to_string(format),
- _mesa_enum_to_string(type));
- return true;
- }
+ GLenum err = _mesa_gles_error_check_format_and_type(ctx, format, type,
+ internalFormat);
+ if (err != GL_NO_ERROR) {
+ _mesa_error(ctx, err,
+ "%s(format = %s, type = %s, internalformat = %s)",
+ callerName, _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type),
+ _mesa_enum_to_string(internalFormat));
+ return true;
}
return false;
* Formats and types that require additional extensions (e.g., GL_FLOAT
* requires GL_OES_texture_float) are filtered elsewhere.
*/
+ char bufCallerName[20];
+ _mesa_snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
if (_mesa_is_gles(ctx) &&
- texture_format_error_check_gles(ctx, format, type, internalFormat,
- dimensions, "glTexImage%dD")) {
+ texture_format_error_check_gles(ctx, format, type,
+ internalFormat, bufCallerName)) {
return GL_TRUE;
}
"glTexImage%dD(target can't be compressed)", dimensions);
return GL_TRUE;
}
- if (_mesa_format_no_online_compression(ctx, internalFormat)) {
+ if (_mesa_format_no_online_compression(internalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexImage%dD(no compression for format)", dimensions);
return GL_TRUE;
GLint xoffset, GLint yoffset, GLint zoffset,
GLint width, GLint height, GLint depth,
GLenum format, GLenum type, const GLvoid *pixels,
- bool dsa, const char *callerName)
+ const char *callerName)
{
struct gl_texture_image *texImage;
GLenum err;
texImage = _mesa_select_tex_image(texObj, target, level);
if (!texImage) {
/* non-existant texture level */
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid texture image)",
- callerName);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid texture level %d)",
+ callerName, level);
return GL_TRUE;
}
return GL_TRUE;
}
+ GLenum internalFormat = _mesa_is_gles(ctx) ?
+ oes_float_internal_format(ctx, texImage->InternalFormat, type) :
+ texImage->InternalFormat;
+
/* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the
* combinations of format, internalFormat, and type that can be used.
* Formats and types that require additional extensions (e.g., GL_FLOAT
*/
if (_mesa_is_gles(ctx) &&
texture_format_error_check_gles(ctx, format, type,
- texImage->InternalFormat,
- dimensions, callerName)) {
+ internalFormat, callerName)) {
return GL_TRUE;
}
}
if (_mesa_is_format_compressed(texImage->TexFormat)) {
- if (_mesa_format_no_online_compression(ctx, texImage->InternalFormat)) {
+ if (_mesa_format_no_online_compression(texImage->InternalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(no compression for format)", callerName);
return GL_TRUE;
static GLboolean
copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
GLenum target, GLint level, GLint internalFormat,
- GLint width, GLint height, GLint border )
+ GLint border )
{
GLint baseFormat;
GLint rb_base_format;
if (_mesa_is_gles(ctx)) {
bool valid = true;
- if (_mesa_base_format_component_count(baseFormat) >
- _mesa_base_format_component_count(rb_base_format)) {
+ if (_mesa_components_in_format(baseFormat) >
+ _mesa_components_in_format(rb_base_format)) {
valid = false;
}
if (baseFormat == GL_DEPTH_COMPONENT ||
bool rb_is_srgb = false;
bool dst_is_srgb = false;
- if (ctx->Extensions.EXT_framebuffer_sRGB &&
+ if (ctx->Extensions.EXT_sRGB &&
_mesa_get_format_color_encoding(rb->Format) == GL_SRGB) {
rb_is_srgb = true;
}
* types for SNORM formats. Also, conversion to SNORM formats is not
* allowed by Table 3.2 on Page 110.
*/
- if (_mesa_is_enum_format_snorm(internalFormat)) {
+ if (!_mesa_has_EXT_render_snorm(ctx) &&
+ _mesa_is_enum_format_snorm(internalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
_mesa_enum_to_string(internalFormat));
_mesa_is_enum_format_unsigned_int(internalFormat) !=
_mesa_is_enum_format_unsigned_int(rb_internal_format)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(signed vs unsigned integer)", dimensions);
+ "glCopyTexImage%dD(signed vs unsigned integer)",
+ dimensions);
return GL_TRUE;
}
}
"glCopyTexImage%dD(target can't be compressed)", dimensions);
return GL_TRUE;
}
- if (_mesa_format_no_online_compression(ctx, internalFormat)) {
+ if (_mesa_format_no_online_compression(internalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%dD(no compression for format)", dimensions);
return GL_TRUE;
if (!texImage) {
/* destination image does not exist */
_mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(invalid texture image)", caller);
+ "%s(invalid texture level %d)", caller, level);
return GL_TRUE;
}
}
if (_mesa_is_format_compressed(texImage->TexFormat)) {
- if (_mesa_format_no_online_compression(ctx, texImage->InternalFormat)) {
+ if (_mesa_format_no_online_compression(texImage->InternalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(no compression for format)", caller);
return GL_TRUE;
return GL_TRUE;
}
+ /* From OpenGL ES 3.2 spec, section 8.6:
+ *
+ * "An INVALID_OPERATION error is generated by CopyTexSubImage3D,
+ * CopyTexImage2D, or CopyTexSubImage2D if the internalformat of the
+ * texture image being (re)specified is RGB9_E5"
+ */
+ if (texImage->InternalFormat == GL_RGB9_E5 &&
+ !_mesa_is_desktop_gl(ctx)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(invalid internal format %s)", caller,
+ _mesa_enum_to_string(texImage->InternalFormat));
+ return GL_TRUE;
+ }
+
if (!_mesa_source_buffer_exists(ctx, texImage->_BaseFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(missing readbuffer, format=%s)", caller,
* Check render to texture callback. Called from _mesa_HashWalk().
*/
static void
-check_rtt_cb(GLuint key, void *data, void *userData)
+check_rtt_cb(UNUSED GLuint key, void *data, void *userData)
{
struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
const struct cb_info *info = (struct cb_info *) userData;
/** Debug helper: override the user-requested internal format */
static GLenum
-override_internal_format(GLenum internalFormat, GLint width, GLint height)
+override_internal_format(GLenum internalFormat, UNUSED GLint width,
+ UNUSED GLint height)
{
#if 0
if (internalFormat == GL_RGBA16F_ARB ||
/* see if we've already chosen a format for the previous level */
if (level > 0) {
struct gl_texture_image *prevImage =
- _mesa_select_tex_image(texObj, target, level - 1);
+ _mesa_select_tex_image(texObj, target, level - 1);
/* See if the prev level is defined and has an internal format which
* matches the new internal format.
*/
}
}
- /* If the application requested compression to an S3TC format but we don't
- * have the DXTn library, force a generic compressed format instead.
- */
- if (internalFormat != format && format != GL_NONE) {
- const GLenum before = internalFormat;
-
- switch (internalFormat) {
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- if (!ctx->Mesa_DXTn)
- internalFormat = GL_COMPRESSED_RGB;
- break;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- if (!ctx->Mesa_DXTn)
- internalFormat = GL_COMPRESSED_RGBA;
- break;
- default:
- break;
- }
-
- if (before != internalFormat) {
- _mesa_warning(ctx,
- "DXT compression requested (%s), "
- "but libtxc_dxtn library not installed. Using %s "
- "instead.",
- _mesa_enum_to_string(before),
- _mesa_enum_to_string(internalFormat));
- }
- }
-
- /* choose format from scratch */
f = ctx->Driver.ChooseTextureFormat(ctx, target, internalFormat,
format, type);
assert(f != MESA_FORMAT_NONE);
* rarely-tested software fallback rendering.
*/
if (border && ctx->Const.StripTextureBorder) {
- strip_texture_border(target, &width, &height, &depth, unpack,
- &unpack_no_border);
+ strip_texture_border(target, &width, &height, &depth, unpack,
+ &unpack_no_border);
border = 0;
- unpack = &unpack_no_border;
+ unpack = &unpack_no_border;
}
if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_state(ctx);
+ _mesa_update_state(ctx);
_mesa_lock_texture(ctx, texObj);
{
- texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s%uD", func, dims);
- }
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s%uD", func, dims);
+ }
else {
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
}
}
+
/* This is a wrapper around teximage() so that we can force the KHR_no_error
* logic to be inlined without inlining the function into all the callers.
*/
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
ctx->Driver.EGLImageTargetTexture2D(ctx, target,
- texObj, texImage, image);
+ texObj, texImage, image);
_mesa_dirty_texobj(ctx, texObj);
}
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- bool dsa)
+ GLenum format, GLenum type, const GLvoid *pixels)
{
FLUSH_VERTICES(ctx, 0);
if (texsubimage_error_check(ctx, dims, texObj, target, level,
xoffset, yoffset, zoffset,
width, height, depth, format, type,
- pixels, false, callerName)) {
+ pixels, callerName)) {
return; /* error was detected */
}
texture_sub_image(ctx, dims, texObj, texImage, target, level,
xoffset, yoffset, zoffset, width, height, depth,
- format, type, pixels, false);
+ format, type, pixels);
}
texture_sub_image(ctx, dims, texObj, texImage, target, level,
xoffset, yoffset, zoffset, width, height, depth,
- format, type, pixels, false);
+ format, type, pixels);
}
* Implement all the glTextureSubImage1/2/3D() functions.
* Must split this out this way because of GL_TEXTURE_CUBE_MAP.
*/
-static void
+static ALWAYS_INLINE void
texturesubimage(struct gl_context *ctx, GLuint dims,
GLuint texture, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type, const GLvoid *pixels,
- const char *callerName)
+ const char *callerName, bool no_error)
{
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
_mesa_enum_to_string(type), pixels);
/* Get the texture object by Name. */
- texObj = _mesa_lookup_texture_err(ctx, texture, callerName);
- if (!texObj)
- return;
-
- /* check target (proxies not allowed) */
- if (!legal_texsubimage_target(ctx, dims, texObj->Target, true)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(target=%s)",
- callerName, _mesa_enum_to_string(texObj->Target));
- return;
+ if (!no_error) {
+ texObj = _mesa_lookup_texture_err(ctx, texture, callerName);
+ if (!texObj)
+ return;
+ } else {
+ texObj = _mesa_lookup_texture(ctx, texture);
}
- if (texsubimage_error_check(ctx, dims, texObj, texObj->Target, level,
- xoffset, yoffset, zoffset,
- width, height, depth, format, type,
- pixels, true, callerName)) {
- return; /* error was detected */
- }
+ if (!no_error) {
+ /* check target (proxies not allowed) */
+ if (!legal_texsubimage_target(ctx, dims, texObj->Target, true)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(target=%s)",
+ callerName, _mesa_enum_to_string(texObj->Target));
+ return;
+ }
+ if (texsubimage_error_check(ctx, dims, texObj, texObj->Target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth, format, type,
+ pixels, callerName)) {
+ return; /* error was detected */
+ }
+ }
/* Must handle special case GL_TEXTURE_CUBE_MAP. */
if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
* It seems reasonable to check for cube completeness of an arbitrary
* level here so that the image data has a consistent format and size.
*/
- if (!_mesa_cube_level_complete(texObj, level)) {
+ if (!no_error && !_mesa_cube_level_complete(texObj, level)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTextureSubImage%uD(cube map incomplete)",
dims);
texture_sub_image(ctx, 3, texObj, texImage, texObj->Target,
level, xoffset, yoffset, 0,
width, height, 1, format,
- type, pixels, true);
+ type, pixels);
pixels = (GLubyte *) pixels + imageStride;
}
}
texture_sub_image(ctx, dims, texObj, texImage, texObj->Target,
level, xoffset, yoffset, zoffset,
width, height, depth, format,
- type, pixels, true);
+ type, pixels);
}
}
+static void
+texturesubimage_error(struct gl_context *ctx, GLuint dims,
+ GLuint texture, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const char *callerName)
+{
+ texturesubimage(ctx, dims, texture, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type, pixels, callerName,
+ false);
+}
+
+
+static void
+texturesubimage_no_error(struct gl_context *ctx, GLuint dims,
+ GLuint texture, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const char *callerName)
+{
+ texturesubimage(ctx, dims, texture, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type, pixels, callerName,
+ true);
+}
+
+
void GLAPIENTRY
_mesa_TexSubImage1D_no_error(GLenum target, GLint level,
GLint xoffset, GLsizei width,
format, type, pixels, "glTexSubImage3D");
}
+
+void GLAPIENTRY
+_mesa_TextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid *pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ texturesubimage_no_error(ctx, 1, texture, level, xoffset, 0, 0, width, 1, 1,
+ format, type, pixels, "glTextureSubImage1D");
+}
+
+
void GLAPIENTRY
_mesa_TextureSubImage1D(GLuint texture, GLint level,
GLint xoffset, GLsizei width,
const GLvoid *pixels)
{
GET_CURRENT_CONTEXT(ctx);
- texturesubimage(ctx, 1, texture, level,
- xoffset, 0, 0,
- width, 1, 1,
- format, type, pixels, "glTextureSubImage1D");
+ texturesubimage_error(ctx, 1, texture, level, xoffset, 0, 0, width, 1, 1,
+ format, type, pixels, "glTextureSubImage1D");
+}
+
+
+void GLAPIENTRY
+_mesa_TextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ texturesubimage_no_error(ctx, 2, texture, level, xoffset, yoffset, 0, width,
+ height, 1, format, type, pixels,
+ "glTextureSubImage2D");
}
const GLvoid *pixels)
{
GET_CURRENT_CONTEXT(ctx);
- texturesubimage(ctx, 2, texture, level,
- xoffset, yoffset, 0,
- width, height, 1,
- format, type, pixels, "glTextureSubImage2D");
+ texturesubimage_error(ctx, 2, texture, level, xoffset, yoffset, 0, width,
+ height, 1, format, type, pixels,
+ "glTextureSubImage2D");
+}
+
+
+void GLAPIENTRY
+_mesa_TextureSubImage3D_no_error(GLuint texture, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLenum type, const GLvoid *pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ texturesubimage_no_error(ctx, 3, texture, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type, pixels,
+ "glTextureSubImage3D");
}
const GLvoid *pixels)
{
GET_CURRENT_CONTEXT(ctx);
- texturesubimage(ctx, 3, texture, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels, "glTextureSubImage3D");
+ texturesubimage_error(ctx, 3, texture, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type, pixels,
+ "glTextureSubImage3D");
}
}
}
+
static void
copytexsubimage_by_slice(struct gl_context *ctx,
struct gl_texture_image *texImage,
}
}
+
static GLboolean
formats_differ_in_component_sizes(mesa_format f1, mesa_format f2)
{
static bool
can_avoid_reallocation(const struct gl_texture_image *texImage,
GLenum internalFormat,
- mesa_format texFormat, GLint x, GLint y, GLsizei width,
+ mesa_format texFormat, GLsizei width,
GLsizei height, GLint border)
{
if (texImage->InternalFormat != internalFormat)
if (!no_error) {
if (copytexture_error_check(ctx, dims, target, level, internalFormat,
- width, height, border))
+ border))
return;
if (!_mesa_legal_texture_dimensions(ctx, target, level, width, height,
{
texImage = _mesa_select_tex_image(texObj, target, level);
if (texImage && can_avoid_reallocation(texImage, internalFormat, texFormat,
- x, y, width, height, border)) {
+ width, height, border)) {
_mesa_unlock_texture(ctx, texObj);
if (no_error) {
copy_texture_sub_image_no_error(ctx, dims, texObj, target, level, 0,
*/
else if (formats_differ_in_component_sizes (texFormat, rb->Format)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%uD(componenet size changed in"
+ "glCopyTexImage%uD(component size changed in"
" internal format)", dims);
return;
}
x += border;
width -= border * 2;
if (dims == 2) {
- y += border;
- height -= border * 2;
+ y += border;
+ height -= border * 2;
}
border = 0;
}
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
}
else {
GLint srcX = x, srcY = y, dstX = 0, dstY = 0, dstZ = 0;
border, false);
}
+
static void
copyteximage_no_error(struct gl_context *ctx, GLuint dims, GLenum target,
GLint level, GLenum internalFormat, GLint x, GLint y,
}
-
void GLAPIENTRY
_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
GLint x, GLint y, GLsizei width, GLsizei height,
void GLAPIENTRY
-_mesa_CopyTexSubImage1D( GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
+_mesa_CopyTexSubImage1D(GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width)
{
struct gl_texture_object* texObj;
const char *self = "glCopyTexSubImage1D";
x, y, width, 1, self);
}
+
void GLAPIENTRY
-_mesa_CopyTexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+_mesa_CopyTexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
struct gl_texture_object* texObj;
const char *self = "glCopyTexSubImage2D";
}
-
void GLAPIENTRY
-_mesa_CopyTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+_mesa_CopyTexSubImage3D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
struct gl_texture_object* texObj;
const char *self = "glCopyTexSubImage3D";
zoffset, x, y, width, height, self);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage1D(GLuint texture, GLint level,
GLint xoffset, GLint x, GLint y, GLsizei width)
0, x, y, width, 1, self);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage2D(GLuint texture, GLint level,
GLint xoffset, GLint yoffset,
}
-
void GLAPIENTRY
_mesa_CopyTextureSubImage3D(GLuint texture, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
x, y, width, 1);
}
+
void GLAPIENTRY
_mesa_CopyTexSubImage2D_no_error(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint x, GLint y, GLsizei width,
yoffset, 0, x, y, width, height);
}
+
void GLAPIENTRY
_mesa_CopyTexSubImage3D_no_error(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLint x, GLint y,
yoffset, zoffset, x, y, width, height);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset,
GLint x, GLint y, GLsizei width)
xoffset, 0, 0, x, y, width, 1);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint x, GLint y,
xoffset, yoffset, 0, x, y, width, height);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage3D_no_error(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLint x,
return true;
}
+
static struct gl_texture_object *
get_tex_obj_for_clear(struct gl_context *ctx,
const char *function,
return numFaces;
}
+
void GLAPIENTRY
-_mesa_ClearTexSubImage( GLuint texture, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const void *data )
+_mesa_ClearTexSubImage(GLuint texture, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const void *data)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_object *texObj;
}
if (numImages == 1) {
- if (check_clear_tex_image(ctx, "glClearTexSubImage",
- texImages[0],
+ if (check_clear_tex_image(ctx, "glClearTexSubImage", texImages[0],
format, type, data, clearValue[0])) {
ctx->Driver.ClearTexSubImage(ctx,
texImages[0],
/* loop over cube face images */
for (i = zoffset; i < zoffset + depth; i++) {
assert(i < MAX_FACES);
- if (!check_clear_tex_image(ctx, "glClearTexSubImage",
- texImages[i],
+ if (!check_clear_tex_image(ctx, "glClearTexSubImage", texImages[i],
format, type, data, clearValue[i]))
goto out;
}
_mesa_unlock_texture(ctx, texObj);
}
+
void GLAPIENTRY
_mesa_ClearTexImage( GLuint texture, GLint level,
GLenum format, GLenum type, const void *data )
texObj, level, texImages);
for (i = 0; i < numImages; i++) {
- if (!check_clear_tex_image(ctx, "glClearTexImage",
- texImages[i],
- format, type, data,
- clearValue[i]))
+ if (!check_clear_tex_image(ctx, "glClearTexImage", texImages[i], format,
+ type, data, clearValue[i]))
goto out;
}
*/
static GLboolean
compressed_subtexture_target_check(struct gl_context *ctx, GLenum target,
- GLint dims, GLenum format, bool dsa,
+ GLint dims, GLenum intFormat, bool dsa,
const char *caller)
{
GLboolean targetOK;
+ mesa_format format;
+ enum mesa_format_layout layout;
if (dsa && target == GL_TEXTURE_RECTANGLE) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid target %s)", caller,
* which is (at this time) only bptc. Otherwise we'd say s3tc (and
* more) are valid here, which they are not, but of course not
* mentioned by core spec.
+ *
+ * Also, from GL_KHR_texture_compression_astc_{hdr,ldr}:
+ *
+ * "Add a second new column "3D Tex." which is empty for all non-ASTC
+ * formats. If only the LDR profile is supported by the implementation,
+ * this column is also empty for all ASTC formats. If both the LDR and HDR
+ * profiles are supported, this column is checked for all ASTC formats."
+ *
+ * "An INVALID_OPERATION error is generated by CompressedTexSubImage3D if
+ * <format> is one of the formats in table 8.19 and <target> is not
+ * TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, or TEXTURE_3D.
+ *
+ * An INVALID_OPERATION error is generated by CompressedTexSubImage3D if
+ * <format> is TEXTURE_CUBE_MAP_ARRAY and the "Cube Map Array" column of
+ * table 8.19 is *not* checked, or if <format> is TEXTURE_3D and the "3D
+ * Tex." column of table 8.19 is *not* checked"
+ *
+ * And from GL_KHR_texture_compression_astc_sliced_3d:
+ *
+ * "Modify the "3D Tex." column to be checked for all ASTC formats."
*/
- switch (format) {
- /* These are the only 3D compression formats supported at this time */
- case GL_COMPRESSED_RGBA_BPTC_UNORM:
- case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:
- case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:
- case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:
+ format = _mesa_glenum_to_compressed_format(intFormat);
+ layout = _mesa_get_format_layout(format);
+ switch (layout) {
+ case MESA_FORMAT_LAYOUT_BPTC:
/* valid format */
break;
+ case MESA_FORMAT_LAYOUT_ASTC:
+ targetOK =
+ ctx->Extensions.KHR_texture_compression_astc_hdr ||
+ ctx->Extensions.KHR_texture_compression_astc_sliced_3d;
+ break;
default:
/* invalid format */
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid target %s for format %s)", caller,
_mesa_enum_to_string(target),
- _mesa_enum_to_string(format));
+ _mesa_enum_to_string(intFormat));
return GL_TRUE;
}
break;
/* this will catch any invalid compressed format token */
if (!_mesa_is_compressed_format(ctx, format)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "%s(format)", callerName);
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(format)", callerName);
return GL_TRUE;
}
if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(level=%d)",
- callerName, level);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", callerName, level);
return GL_TRUE;
}
expectedSize = compressed_tex_size(width, height, depth, format);
if (expectedSize != imageSize) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(size=%d)",
- callerName, imageSize);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(size=%d)", callerName, imageSize);
return GL_TRUE;
}
texImage = _mesa_select_tex_image(texObj, target, level);
if (!texImage) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(invalid texture image)",
- callerName);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid texture level %d)",
+ callerName, level);
return GL_TRUE;
}
if ((GLint) format != texImage->InternalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(format=%s)",
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s)",
callerName, _mesa_enum_to_string(format));
return GL_TRUE;
}
- if (compressedteximage_only_format(ctx, format)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(format=%s cannot be updated)",
+ if (compressedteximage_only_format(format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s cannot be updated)",
callerName, _mesa_enum_to_string(format));
return GL_TRUE;
}
- if (error_check_subtexture_negative_dimensions(ctx, dims,
- width, height, depth,
- callerName)) {
+ if (error_check_subtexture_negative_dimensions(ctx, dims, width, height,
+ depth, callerName)) {
return GL_TRUE;
}
- if (error_check_subtexture_dimensions(ctx, dims,
- texImage, xoffset, yoffset, zoffset,
- width, height, depth,
+ if (error_check_subtexture_dimensions(ctx, dims, texImage, xoffset, yoffset,
+ zoffset, width, height, depth,
callerName)) {
return GL_TRUE;
}
const GLvoid *data, bool dsa, bool no_error,
const char *caller)
{
- struct gl_texture_object *texObj;
+ struct gl_texture_object *texObj = NULL;
struct gl_texture_image *texImage;
GET_CURRENT_CONTEXT(ctx);
}
/* Copy in each face. */
- for (int i = 0; i < 6; ++i) {
+ for (int i = zoffset; i < zoffset + depth; ++i) {
texImage = texObj->Image[i][level];
assert(texImage);
compressed_texture_sub_image(ctx, 3, texObj, texImage,
texObj->Target, level, xoffset, yoffset,
- zoffset, width, height, 1, format,
+ 0, width, height, 1, format,
imageSize, pixels);
/* Compressed images don't have a client format */
"glCompressedTextureSubImage3D");
}
-static mesa_format
-get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
+mesa_format
+_mesa_get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
{
if (ctx->API == API_OPENGL_COMPAT) {
switch (internalFormat) {
case GL_RGBA8:
return MESA_FORMAT_R8G8B8A8_UNORM;
case GL_RGBA16:
- if (_mesa_is_gles(ctx))
+ if (_mesa_is_gles(ctx) && !_mesa_has_EXT_texture_norm16(ctx))
return MESA_FORMAT_NONE;
return MESA_FORMAT_RGBA_UNORM16;
case GL_RGBA16F_ARB:
case GL_RG8:
return MESA_FORMAT_R8G8_UNORM;
case GL_RG16:
- if (_mesa_is_gles(ctx))
+ if (_mesa_is_gles(ctx) && !_mesa_has_EXT_texture_norm16(ctx))
return MESA_FORMAT_NONE;
return MESA_FORMAT_R16G16_UNORM;
case GL_RG16F:
case GL_R8:
return MESA_FORMAT_R_UNORM8;
case GL_R16:
- if (_mesa_is_gles(ctx))
+ if (_mesa_is_gles(ctx) && !_mesa_has_EXT_texture_norm16(ctx))
return MESA_FORMAT_NONE;
return MESA_FORMAT_R_UNORM16;
case GL_R16F:
_mesa_validate_texbuffer_format(const struct gl_context *ctx,
GLenum internalFormat)
{
- mesa_format format = get_texbuffer_format(ctx, internalFormat);
+ mesa_format format = _mesa_get_texbuffer_format(ctx, internalFormat);
GLenum datatype;
if (format == MESA_FORMAT_NONE)
GLsizeiptr oldSize = texObj->BufferSize;
mesa_format format;
- /* NOTE: ARB_texture_buffer_object has interactions with
- * the compatibility profile that are not implemented.
+ /* NOTE: ARB_texture_buffer_object might not be supported in
+ * the compatibility profile.
*/
if (!_mesa_has_ARB_texture_buffer_object(ctx) &&
!_mesa_has_OES_texture_buffer(ctx)) {
}
GLboolean
-_mesa_is_renderable_texture_format(struct gl_context *ctx, GLenum internalformat)
+_mesa_is_renderable_texture_format(const struct gl_context *ctx,
+ GLenum internalformat)
{
/* Everything that is allowed for renderbuffers,
* except for a base format of GL_STENCIL_INDEX, unless supported.
static void
texture_image_multisample(struct gl_context *ctx, GLuint dims,
struct gl_texture_object *texObj,
+ struct gl_memory_object *memObj,
GLenum target, GLsizei samples,
GLint internalformat, GLsizei width,
GLsizei height, GLsizei depth,
GLboolean fixedsamplelocations,
- GLboolean immutable, const char *func)
+ GLboolean immutable, GLuint64 offset,
+ const char *func)
{
struct gl_texture_image *texImage;
GLboolean sizeOK, dimensionsOK, samplesOK;
}
if (!check_multisample_target(dims, target, dsa)) {
- if (dsa) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(target)", func);
- return;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
- return;
- }
+ GLenum err = dsa ? GL_INVALID_OPERATION : GL_INVALID_ENUM;
+ _mesa_error(ctx, err, "%s(target=%s)", func,
+ _mesa_enum_to_string(target));
+ return;
}
/* check that the specified internalformat is color/depth/stencil-renderable;
}
sample_count_error = _mesa_check_sample_count(ctx, target,
- internalformat, samples);
+ internalformat, samples, samples);
samplesOK = sample_count_error == GL_NO_ERROR;
/* Page 254 of OpenGL 4.4 spec says:
* However, if samples is not supported, then no error is generated.
*/
if (!samplesOK && !_mesa_is_proxy_texture(target)) {
- _mesa_error(ctx, sample_count_error, "%s(samples)", func);
+ _mesa_error(ctx, sample_count_error, "%s(samples=%d)", func, samples);
return;
}
if (_mesa_is_proxy_texture(target)) {
if (samplesOK && dimensionsOK && sizeOK) {
- init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
- internalformat, texFormat,
- samples, fixedsamplelocations);
+ _mesa_init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
+ internalformat, texFormat,
+ samples, fixedsamplelocations);
}
else {
/* clear all image fields */
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
- init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
- internalformat, texFormat,
- samples, fixedsamplelocations);
+ _mesa_init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
+ internalformat, texFormat,
+ samples, 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,
- * we're allowed to just leave this in whatever state we
- * like, but being tidy is good.
- */
- _mesa_init_teximage_fields(ctx, texImage,
- 0, 0, 0, 0, internalformat, texFormat);
+ if (memObj) {
+ if (!ctx->Driver.SetTextureStorageForMemoryObject(ctx, texObj,
+ memObj, 1, width,
+ height, depth,
+ offset)) {
+
+ _mesa_init_teximage_fields(ctx, texImage, 0, 0, 0, 0,
+ internalformat, texFormat);
+ }
+ } else {
+ if (!ctx->Driver.AllocTextureStorage(ctx, texObj, 1,
+ width, height, depth)) {
+ /* tidy up the texture image state. strictly speaking,
+ * we're allowed to just leave this in whatever state we
+ * like, but being tidy is good.
+ */
+ _mesa_init_teximage_fields(ctx, texImage, 0, 0, 0, 0,
+ internalformat, texFormat);
+ }
}
}
if (!texObj)
return;
- texture_image_multisample(ctx, 2, texObj, target, samples,
+ texture_image_multisample(ctx, 2, texObj, NULL, target, samples,
internalformat, width, height, 1,
- fixedsamplelocations, GL_FALSE,
+ fixedsamplelocations, GL_FALSE, 0,
"glTexImage2DMultisample");
}
if (!texObj)
return;
- texture_image_multisample(ctx, 3, texObj, target, samples,
+ texture_image_multisample(ctx, 3, texObj, NULL, target, samples,
internalformat, width, height, depth,
- fixedsamplelocations, GL_FALSE,
+ fixedsamplelocations, GL_FALSE, 0,
"glTexImage3DMultisample");
}
static bool
valid_texstorage_ms_parameters(GLsizei width, GLsizei height, GLsizei depth,
- GLsizei samples, unsigned dims)
+ unsigned dims)
{
GET_CURRENT_CONTEXT(ctx);
if (!texObj)
return;
- if (!valid_texstorage_ms_parameters(width, height, 1, samples, 2))
+ if (!valid_texstorage_ms_parameters(width, height, 1, 2))
return;
- texture_image_multisample(ctx, 2, texObj, target, samples,
+ texture_image_multisample(ctx, 2, texObj, NULL, target, samples,
internalformat, width, height, 1,
- fixedsamplelocations, GL_TRUE,
+ fixedsamplelocations, GL_TRUE, 0,
"glTexStorage2DMultisample");
}
if (!texObj)
return;
- if (!valid_texstorage_ms_parameters(width, height, depth, samples, 3))
+ if (!valid_texstorage_ms_parameters(width, height, depth, 3))
return;
- texture_image_multisample(ctx, 3, texObj, target, samples,
+ texture_image_multisample(ctx, 3, texObj, NULL, target, samples,
internalformat, width, height, depth,
- fixedsamplelocations, GL_TRUE,
+ fixedsamplelocations, GL_TRUE, 0,
"glTexStorage3DMultisample");
}
if (!texObj)
return;
- if (!valid_texstorage_ms_parameters(width, height, 1, samples, 2))
+ if (!valid_texstorage_ms_parameters(width, height, 1, 2))
return;
- texture_image_multisample(ctx, 2, texObj, texObj->Target, samples,
- internalformat, width, height, 1,
- fixedsamplelocations, GL_TRUE,
+ texture_image_multisample(ctx, 2, texObj, NULL, texObj->Target,
+ samples, internalformat, width, height, 1,
+ fixedsamplelocations, GL_TRUE, 0,
"glTextureStorage2DMultisample");
}
if (!texObj)
return;
- if (!valid_texstorage_ms_parameters(width, height, depth, samples, 3))
+ if (!valid_texstorage_ms_parameters(width, height, depth, 3))
return;
- texture_image_multisample(ctx, 3, texObj, texObj->Target, samples,
+ texture_image_multisample(ctx, 3, texObj, NULL, texObj->Target, samples,
internalformat, width, height, depth,
- fixedsamplelocations, GL_TRUE,
+ fixedsamplelocations, GL_TRUE, 0,
"glTextureStorage3DMultisample");
}
+
+void
+_mesa_texture_storage_ms_memory(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_object *texObj,
+ struct gl_memory_object *memObj,
+ GLenum target, GLsizei samples,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLboolean fixedSampleLocations,
+ GLuint64 offset, const char* func)
+{
+ assert(memObj);
+
+ texture_image_multisample(ctx, dims, texObj, memObj, target, samples,
+ internalFormat, width, height, depth,
+ fixedSampleLocations, GL_TRUE, offset,
+ func);
+}