aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glformats.h
Commit message (Collapse)AuthorAgeFilesLines
* mesa/glformats: Add a helper function _mesa_is_srgb_format()Eduardo Lima Mitev2016-03-031-0/+3
| | | | | | Returns true if the passed format is an sRGB format, false otherwise. Reviewed-by: Dave Airlie <[email protected]>
* mesa: support GL_RED/GL_RG in ES2 contexts when driver support existsIlia Mirkin2015-11-281-1/+2
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93126 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]> Cc: "11.0 11.1" <[email protected]>
* mesa: Move _mesa_base_tex_format() from teximage to glformats filesEduardo Lima Mitev2015-09-281-0/+2
| | | | | | | | | | | | | | | | | This function will be needed as part of validating the combination of format, type and internal format of texture pixel operations, which happens in glformats files. Specifically, we want to be able to obtain the base format of a resolved effective internal format, to compare it with the original internal format passed. Also, since this function deals solely with GL formats, it fits better in glformats where the rest of similar format functionality rests. The function is moved as-is, without any modification. Cc: "11.0" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Mark Janes <[email protected]>
* mesa: don't enable online compression for ASTC formatsNanley Chery2015-08-261-0/+3
| | | | | | | | | | | | | In agreement with the ASTC spec, this makes calls to TexImage*D unsuccessful. Implied by the spec, Generate[Texture]Mipmap and [Copy]Tex[Sub]Image*D calls must be unsuccessful as well. v2. actually force attempts to compress online to fail. v3. indentation (Matt). v4. update copytexture_error_check to account for CopyTexImage*D (Chad). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: Add a helper function _mesa_unpack_format_to_base_format()Anuj Phogat2015-07-241-0/+3
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: add const qualifer on _mesa_is_compressed_format()Brian Paul2015-05-261-1/+1
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* Mesa: Add support for HALF_FLOAT_OES type.Kalyan Kondapally2015-01-291-1/+2
| | | | | | | | | This patch adds needed support for accepting HALF_FLOAT_OES as valid type for TexImage*D and TexSubImage*D when Texture FLoat extensions are supported. Signed-off-by: Kevin Rogovin <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Add helper to convert a GL format and type to a mesa (array) format.Iago Toral Quiroga2015-01-121-0/+2
| | | | | | | | | | | | v2 after review by Jason Ekstrand: - Move _mesa_format_from_format_and_type to glformats - Return a mesa_format for GL_UNSIGNED_INT_8_8_8_8(_REV) v3: - Adapted to the new implementation of mesa_array_format as a plain uint32_t bitfield. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Expose compute_component_mapping as _mesa_compute_component_mappingIago Toral Quiroga2015-01-121-0/+3
| | | | | | | | | | | | | | This is necessary to handle conversions between array types where the driver does not support the dst format requested by the client and chooses a different format instead. We will need this in _mesa_format_convert, so move it to format_utils.c, prefix it with '_mesa_' and make it available to other files. v2: - Move _mesa_compute_component_mapping to glformats Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add utility function _mesa_is_enum_format_unorm()Anuj Phogat2014-08-041-0/+3
| | | | | | | | V2: Add missing formats. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add a helper function _mesa_is_enum_format_unsized()Anuj Phogat2014-08-041-0/+3
| | | | | | | | | | Function is utilized by next patch in the series. V2: Add missing formats. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add utility function _mesa_is_enum_format_snorm()Anuj Phogat2014-08-041-0/+3
| | | | | | Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* Remove the ATI_envmap_bumpmap extensionJason Ekstrand2014-06-301-3/+0
| | | | | | | | | | | As far as I can tell, the Intel mesa driver is the only driver in the world still supporting this legacy extension. If someone wants to do bump mapping, they can use shaders. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v1] Reviewed-by: Chris Forbes <[email protected]> [v2] Reviewed-by: Ian Romanick <[email protected]> [v3]
* Remove _mesa_is_type_integer and _mesa_is_enum_format_or_type_integerNeil Roberts2014-06-131-6/+0
| | | | | | | | | | | | | | | | | | | | | | | The comment for _mesa_is_type_integer is confusing because it says that it returns whether the type is an “integer (non-normalized)” format. I don't think it makes sense to say whether a type is normalized or not because it depends on what format it is used with. For example, GL_RGBA+GL_UNSIGNED_BYTE is normalized but GL_RGBA_INTEGER+GL_UNSIGNED_BYTE isn't. If the normalized comment is just a mistake then it still doesn't make much sense because it is missing the packed-pixel types such as GL_UNSIGNED_INT_5_6_5. If those were added then it effectively just returns type != GL_FLOAT. That function was only used in _mesa_is_enum_format_or_type_integer. This function effectively checks whether the format is non-normalized or the type is an integer. I can't think of any situation where that check would make sense. As far as I can tell neither of these functions have ever been used anywhere so we should just remove them to avoid confusion. These functions were added in 9ad8f431b2a47060bf05517246ab0fa8d249c800. Reviewed-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_typeIan Romanick2013-01-171-2/+1
| | | | | | | | | | Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already done in texture_error_check because these combinations aren't allowed on desktop GL either. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glformats: add _mesa_es3_error_check_format_and_typeMatt Turner2013-01-141-0/+5
| | | | | | | | | This function checks for ES3 compatible format/type/internalFormat/dimension combinations. [[email protected]: additional tweaks for gles3-gtf] Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glformats: add _mesa_base_format_component_countJordan Justen2013-01-121-0/+3
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glformats: add functions to detect signed/unsigned integer typesJordan Justen2013-01-121-0/+6
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix computation of default vertex attrib stride for 2_10_10_10 formats.Paul Berry2012-12-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if the client program didn't specify a stride when setting up a vertex attribute, we used _mesa_sizeof_type() to compute the size of the type, and multiplied it by the number of components. This didn't work for the 2_10_10_10 formats, since _mesa_sizeof_type() returns -1 for those types, resulting in all kinds of havoc, since it was causing the hardware to be programmed with a negative stride value. This patch adds a new function _mesa_bytes_per_vertex_attrib(), which is similar to the existing function _mesa_bytes_per_pixel(), but which computes the size of a vertex attribute based on the type and the number of formats. For packed formats (currently only the 2_10_10_10 formats), it verifies that the number of components is correct and returns the size of the packed format. For unpacked formats, it returns the size of the type times the number of components. In addition, this patch adds an assertion so that if we ever forget to update _mesa_bytes_per_vertex_attrib() when adding a new vertex format, we'll see the problem quickly rather than having to debug a subtle conformance test failure. Fixes GLES3 conformance tests vertex_type_2_10_10_10_rev_{conversion,divisor,stride_pointer}.test. Reviewed-by: Brian Paul <[email protected]>
* mesa: move some helper functions from fboobject.c to glformats.cMarek Olšák2012-11-291-0/+6
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: move _mesa_es_error_check_format_and_type() to glformats.cBrian Paul2012-09-261-0/+4
| | | | | | Where the non-ES _mesa_error_check_format_and_type() function lives. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add generic compressed -> uncompressed format helperBrian Paul2012-08-241-0/+3
| | | | | | | _mesa_generic_compressed_format_to_uncompressed_format() probably wins the prize for longest function name in Mesa. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: move _mesa_error_check_format_and_type() to glformats.cBrian Paul2012-07-241-0/+4
| | | | | Now all the format/type-related helper functions are in glformats.c and image.c is just image-related functions.
* mesa: move more format helper functions to glformats.cBrian Paul2012-07-241-1/+19
|
* mesa: move some format helper functions to glformats.cBrian Paul2012-07-241-0/+24
|
* mesa: add glformats integer type/format detection routinesJordan Justen2012-07-211-0/+57
_mesa_is_integer_format is moved to formats.c and renamed as _mesa_is_enum_format_integer. _mesa_is_format_unsigned, _mesa_is_type_integer, _mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer are added. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>