case GL_CLEAR_BUFFER:
case GL_TEXTURE_VIEW:
case GL_VIEW_COMPATIBILITY_CLASS:
+ case GL_NUM_TILING_TYPES_EXT:
+ case GL_TILING_TYPES_EXT:
/* The ARB_internalformat_query spec says:
*
* "If the <pname> parameter to GetInternalformativ is not SAMPLES
*/
switch(pname) {
case GL_SAMPLES:
+ case GL_TILING_TYPES_EXT:
break;
case GL_MAX_COMBINED_DIMENSIONS:
case GL_TEXTURE_COMPRESSED_BLOCK_WIDTH:
case GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT:
case GL_TEXTURE_COMPRESSED_BLOCK_SIZE:
+ case GL_NUM_TILING_TYPES_EXT:
buffer[0] = 0;
break;
* implementation the "unsupported" answer should be given.
* This is not an error."
*
- * For OpenGL ES, queries can only be used with GL_RENDERBUFFER or MS.
+ * Note that legality of targets has already been verified.
*/
switch(target){
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_3D:
- if (!_mesa_is_desktop_gl(ctx))
- return false;
break;
case GL_TEXTURE_1D_ARRAY:
/* additional checks for compressed textures */
if (_mesa_is_compressed_format(ctx, internalformat) &&
- (!_mesa_target_can_be_compressed(ctx, target, internalformat, NULL) ||
- _mesa_format_no_online_compression(ctx, internalformat)))
+ !_mesa_target_can_be_compressed(ctx, target, internalformat, NULL))
return false;
break;
* implementation accepts it for any texture specification commands, and
* - unsized or base internal format, if the implementation accepts
* it for texture or image specification.
+ *
+ * But also:
+ * "If the particualar <target> and <internalformat> combination do not make
+ * sense, or if a particular type of <target> is not supported by the
+ * implementation the "unsupported" answer should be given. This is not an
+ * error.
*/
GLint buffer[1];
- /* At this point an internalformat is valid if it is valid as a texture or
- * as a renderbuffer format. The checks are different because those methods
- * return different values when passing non supported internalformats */
- if (_mesa_base_tex_format(ctx, internalformat) < 0 &&
- _mesa_base_fbo_format(ctx, internalformat) == 0)
- return false;
+ if (target == GL_RENDERBUFFER) {
+ if (_mesa_base_fbo_format(ctx, internalformat) == 0) {
+ return false;
+ }
+ } else if (target == GL_TEXTURE_BUFFER) {
+ if (_mesa_validate_texbuffer_format(ctx, internalformat) ==
+ MESA_FORMAT_NONE) {
+ return false;
+ }
+ } else {
+ if (_mesa_base_tex_format(ctx, internalformat) < 0) {
+ return false;
+ }
+ }
/* Let the driver have the final word */
ctx->Driver.QueryInternalFormat(ctx, target, internalformat,
case GL_FRAMEBUFFER_RENDERABLE_LAYERED:
case GL_FRAMEBUFFER_BLEND:
case GL_FILTER:
+ /*
+ * TODO seems a tad optimistic just saying yes to everything here.
+ * Even for combinations which make no sense...
+ * And things like TESS_CONTROL_TEXTURE should definitely default to
+ * NONE if the driver doesn't even support tessellation...
+ */
params[0] = GL_FULL_SUPPORT;
break;
+ case GL_NUM_TILING_TYPES_EXT:
+ params[0] = 2;
+ break;
+ case GL_TILING_TYPES_EXT:
+ params[0] = GL_OPTIMAL_TILING_EXT;
+ params[1] = GL_LINEAR_TILING_EXT;
+ break;
default:
_set_default_response(pname, params);
mesa_format texformat;
if (target != GL_RENDERBUFFER) {
- if (!_mesa_legal_get_tex_level_parameter_target(ctx, target, true))
- goto end;
-
baseformat = _mesa_base_tex_format(ctx, internalformat);
} else {
baseformat = _mesa_base_fbo_format(ctx, internalformat);
* and glGetRenderbufferParameteriv functions.
*/
if (pname == GL_INTERNALFORMAT_SHARED_SIZE) {
- if (_mesa_has_EXT_texture_shared_exponent(ctx) &&
- target != GL_TEXTURE_BUFFER &&
- target != GL_RENDERBUFFER &&
- texformat == MESA_FORMAT_R9G9B9E5_FLOAT) {
+ if (texformat == MESA_FORMAT_R9G9B9E5_FLOAT) {
buffer[0] = 5;
}
goto end;
if (!_mesa_has_ARB_shader_image_load_store(ctx))
goto end;
- if (!_mesa_legal_get_tex_level_parameter_target(ctx, target, true))
+ /* As pointed by the spec quote below, this pname query should return
+ * the same value that GetTexParameter. So if the target is not valid
+ * for GetTexParameter we return the unsupported value. The check below
+ * is the same target check used by GetTexParameter.
+ */
+ int targetIndex = _mesa_tex_target_to_index(ctx, target);
+ if (targetIndex < 0 || targetIndex == TEXTURE_BUFFER_INDEX)
goto end;
/* From spec: "Equivalent to calling GetTexParameter with <value> set
}
break;
+ case GL_NUM_TILING_TYPES_EXT:
+ case GL_TILING_TYPES_EXT:
+ ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
+ buffer);
+ break;
+
default:
unreachable("bad param");
}