diff options
author | Alejandro Piñeiro <[email protected]> | 2016-05-05 11:28:37 +0200 |
---|---|---|
committer | Alejandro Piñeiro <[email protected]> | 2016-06-02 08:54:10 +0200 |
commit | c1ceee6cc966e25fb1e68d267bafdeb4528bc980 (patch) | |
tree | bbbd00f13966848ca37ebfc574b64e5da4297813 /src/mesa/drivers/dri/i965/brw_formatquery.c | |
parent | 58617bcebe1d0d5e8d360fec2c9dabf8771b0f7a (diff) |
i965/formatquery: remove INTERNALFORMAT_PREFERRED implementation
Right now the implementation only checks if the internalformat is
supported or not. But that implementation is wrong, returning
unsupported for some internalformats. Additionally, checking if
the internalformat is supported or not is already done at mesa/main
before calling the driver hook, so this new check is not needed.
Acked-by: Eduardo Lima <[email protected]>
Acked-by: Antia Puentes <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_formatquery.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_formatquery.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_formatquery.c b/src/mesa/drivers/dri/i965/brw_formatquery.c index 210109b39f7..8f7a910415f 100644 --- a/src/mesa/drivers/dri/i965/brw_formatquery.c +++ b/src/mesa/drivers/dri/i965/brw_formatquery.c @@ -65,46 +65,6 @@ brw_query_samples_for_format(struct gl_context *ctx, GLenum target, } } -/** - * Returns a generic GL type from an internal format, so that it can be used - * together with the base format to obtain a mesa_format by calling - * mesa_format_from_format_and_type(). - */ -static GLenum -get_generic_type_for_internal_format(GLenum internalFormat) -{ - if (_mesa_is_color_format(internalFormat)) { - if (_mesa_is_enum_format_unsigned_int(internalFormat)) - return GL_UNSIGNED_BYTE; - else if (_mesa_is_enum_format_signed_int(internalFormat)) - return GL_BYTE; - } else { - switch (internalFormat) { - case GL_STENCIL_INDEX: - case GL_STENCIL_INDEX8: - return GL_UNSIGNED_BYTE; - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - return GL_UNSIGNED_SHORT; - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_UNSIGNED_INT; - case GL_DEPTH_COMPONENT32F: - return GL_FLOAT; - case GL_DEPTH_STENCIL: - case GL_DEPTH24_STENCIL8: - return GL_UNSIGNED_INT_24_8; - case GL_DEPTH32F_STENCIL8: - return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; - default: - /* fall-through */ - break; - } - } - - return GL_FLOAT; -} - void brw_query_internal_format(struct gl_context *ctx, GLenum target, GLenum internalFormat, GLenum pname, GLint *params) @@ -129,37 +89,6 @@ brw_query_internal_format(struct gl_context *ctx, GLenum target, break; } - case GL_INTERNALFORMAT_PREFERRED: { - params[0] = GL_NONE; - - /* We need to resolve an internal format that is compatible with - * the passed internal format, and optimal to the driver. By now, - * we just validate that the passed internal format is supported by - * the driver, and if so return the same internal format, otherwise - * return GL_NONE. - * - * For validating the internal format, we use the - * ctx->TextureFormatSupported map to check that a BRW surface format - * exists, that can be derived from the internal format. But this - * expects a mesa_format, not an internal format. So we need to "come up" - * with a type that is generic enough, to resolve the mesa_format first. - */ - GLenum type = get_generic_type_for_internal_format(internalFormat); - - /* Get a mesa_format from the internal format and type. */ - GLint base_format = _mesa_base_tex_format(ctx, internalFormat); - if (base_format != -1) { - mesa_format mesa_format = - _mesa_format_from_format_and_type(base_format, type); - - if (mesa_format < MESA_FORMAT_COUNT && - ctx->TextureFormatSupported[mesa_format]) { - params[0] = internalFormat; - } - } - break; - } - default: /* By default, we call the driver hook's fallback function from the frontend, * which has generic implementation for all pnames. |