void
_mesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei samples)
+ GLsizei height, GLsizei samples,
+ GLsizei storageSamples)
{
const GLenum baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (samples != 0) {
assert(samples > 0);
assert(_mesa_check_sample_count(ctx, GL_RENDERBUFFER,
- internalFormat, samples) == GL_NO_ERROR);
+ internalFormat, samples,
+ storageSamples) == GL_NO_ERROR);
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
static void
renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei samples, const char *func)
+ GLsizei height, GLsizei samples, GLsizei storageSamples,
+ const char *func)
{
GLenum baseFormat;
GLenum sample_count_error;
if (samples == NO_SAMPLES) {
/* NumSamples == 0 indicates non-multisampling */
samples = 0;
+ storageSamples = 0;
}
else {
/* check the sample count;
* note: driver may choose to use more samples than what's requested
*/
sample_count_error = _mesa_check_sample_count(ctx, GL_RENDERBUFFER,
- internalFormat, samples);
+ internalFormat, samples, storageSamples);
/* Section 2.5 (GL Errors) of OpenGL 3.0 specification, page 16:
*
* "If a negative number is provided where an argument of type sizei or
* sizeiptr is specified, the error INVALID VALUE is generated."
*/
- if (samples < 0) {
+ if (samples < 0 || storageSamples < 0) {
sample_count_error = GL_INVALID_VALUE;
}
if (sample_count_error != GL_NO_ERROR) {
- _mesa_error(ctx, sample_count_error, "%s(samples=%d)", func, samples);
+ _mesa_error(ctx, sample_count_error,
+ "%s(samples=%d, storageSamples=%d)", func, samples,
+ storageSamples);
return;
}
}
- _mesa_renderbuffer_storage(ctx, rb, internalFormat, width, height, samples);
+ _mesa_renderbuffer_storage(ctx, rb, internalFormat, width, height, samples,
+ storageSamples);
}
/**
static void
renderbuffer_storage_named(GLuint renderbuffer, GLenum internalFormat,
GLsizei width, GLsizei height, GLsizei samples,
- const char *func)
+ GLsizei storageSamples, const char *func)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- renderbuffer_storage(ctx, rb, internalFormat, width, height, samples, func);
+ renderbuffer_storage(ctx, rb, internalFormat, width, height, samples,
+ storageSamples, func);
}
/**
static void
renderbuffer_storage_target(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height, GLsizei samples,
- const char *func)
+ GLsizei storageSamples, const char *func)
{
GET_CURRENT_CONTEXT(ctx);
}
renderbuffer_storage(ctx, ctx->CurrentRenderbuffer, internalFormat, width,
- height, samples, func);
+ height, samples, storageSamples, func);
}
* a token value here just for error reporting purposes.
*/
renderbuffer_storage_target(target, internalFormat, width, height,
- NO_SAMPLES, "glRenderbufferStorage");
+ NO_SAMPLES, 0, "glRenderbufferStorage");
}
GLsizei width, GLsizei height)
{
renderbuffer_storage_target(target, internalFormat, width, height,
- samples, "glRenderbufferStorageMultisample");
+ samples, samples,
+ "glRenderbufferStorageMultisample");
}
break;
}
- renderbuffer_storage_target(target, internalFormat, width, height, 0,
+ renderbuffer_storage_target(target, internalFormat, width, height, 0, 0,
"glRenderbufferStorageEXT");
}
* a token value here just for error reporting purposes.
*/
renderbuffer_storage_named(renderbuffer, internalformat, width, height,
- NO_SAMPLES, "glNamedRenderbufferStorage");
+ NO_SAMPLES, 0, "glNamedRenderbufferStorage");
}
void GLAPIENTRY
GLsizei width, GLsizei height)
{
renderbuffer_storage_named(renderbuffer, internalformat, width, height,
- samples,
+ samples, samples,
"glNamedRenderbufferStorageMultisample");
}