#include "framebuffer.h"
#include "hash.h"
#include "image.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "mipmap.h"
#include "multisample.h"
* requires GL_OES_texture_float) are filtered elsewhere.
*/
char bufCallerName[20];
- _mesa_snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
+ snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
if (_mesa_is_gles(ctx) &&
texture_format_error_check_gles(ctx, format, type,
internalFormat, bufCallerName)) {
if (type != GL_UNSIGNED_SHORT_8_8_MESA &&
type != GL_UNSIGNED_SHORT_8_8_REV_MESA) {
char message[100];
- _mesa_snprintf(message, sizeof(message),
+ snprintf(message, sizeof(message),
"glTexImage%dD(format/type YCBCR mismatch)",
dimensions);
_mesa_error(ctx, GL_INVALID_ENUM, "%s", message);
}
if (border != 0) {
char message[100];
- _mesa_snprintf(message, sizeof(message),
+ snprintf(message, sizeof(message),
"glTexImage%dD(format=GL_YCBCR_MESA and border=%d)",
dimensions, border);
_mesa_error(ctx, GL_INVALID_VALUE, "%s", message);
break;
case TEX_MODE_CURRENT_NO_ERROR:
no_error = true;
+ /* fallthrough */
case TEX_MODE_CURRENT_ERROR:
default:
assert(textureOrIndex == 0);
*/
static bool
check_texture_buffer_target(struct gl_context *ctx, GLenum target,
- const char *caller)
+ const char *caller, bool dsa)
{
if (target != GL_TEXTURE_BUFFER_ARB) {
- _mesa_error(ctx, GL_INVALID_ENUM,
+ _mesa_error(ctx, dsa ? GL_INVALID_OPERATION : GL_INVALID_ENUM,
"%s(texture target is not GL_TEXTURE_BUFFER)", caller);
return false;
}
/* Need to catch a bad target before it gets to
* _mesa_get_current_tex_object.
*/
- if (!check_texture_buffer_target(ctx, target, "glTexBuffer"))
+ if (!check_texture_buffer_target(ctx, target, "glTexBuffer", false))
return;
if (buffer) {
/* Need to catch a bad target before it gets to
* _mesa_get_current_tex_object.
*/
- if (!check_texture_buffer_target(ctx, target, "glTexBufferRange"))
+ if (!check_texture_buffer_target(ctx, target, "glTexBufferRange", false))
return;
if (buffer) {
if (!texObj)
return;
- if (!check_texture_buffer_target(ctx, target, "glTextureBufferRangeEXT"))
+ if (!check_texture_buffer_target(ctx, target, "glTextureBufferRangeEXT", true))
return;
if (buffer) {
if (!texObj)
return;
- if (!check_texture_buffer_target(ctx, texObj->Target, "glTextureBuffer"))
+ if (!check_texture_buffer_target(ctx, texObj->Target, "glTextureBuffer", true))
return;
texture_buffer_range(ctx, texObj, internalFormat,
"glTextureBufferEXT");
if (!texObj ||
- !check_texture_buffer_target(ctx, texObj->Target, "glTextureBufferEXT"))
+ !check_texture_buffer_target(ctx, texObj->Target, "glTextureBufferEXT", true))
return;
texture_buffer_range(ctx, texObj, internalFormat,
"glMultiTexBufferEXT");
if (!texObj ||
- !check_texture_buffer_target(ctx, texObj->Target, "glMultiTexBufferEXT"))
+ !check_texture_buffer_target(ctx, texObj->Target, "glMultiTexBufferEXT", false))
return;
texture_buffer_range(ctx, texObj, internalFormat,
return;
if (!check_texture_buffer_target(ctx, texObj->Target,
- "glTextureBufferRange"))
+ "glTextureBufferRange", true))
return;
texture_buffer_range(ctx, texObj, internalFormat,