aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/format_info.py
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Prepare for the MESA_FORMAT_* enum to be sparse.Eric Anholt2019-11-071-1/+1
| | | | | | | | | To redefine MESA_FORMAT in terms of PIPE_FORMAT enums, we need to fix places where we iterated up to MESA_FORMAT_COUNT. I use _mesa_get_format_name(f) == NULL as the signal that it's not an enum value with a MESA_FORMAT. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add support for array formats of depth and stencil.Eric Anholt2019-10-171-0/+5
| | | | | | | | | | | In desktop GL, you can specify things like GL_DEPTH_COMPONENT/GL_BYTE as a ReadPixels format, and we need to be able to represent that to see if we have proper MESA_FORMATs for them. That's exactly what the mesa_array_format enum is for. v2: Drop _mesa from static fn. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Rename gl_format_info to mesa_format_info.Eric Anholt2019-07-161-1/+1
| | | | | | | It's about MESA_FORMATs, after all. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: add GL_AMD_compressed_ATC_texture supportJonathan Marek2019-04-231-0/+2
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* python: Use explicit integer divisionsMathieu Bridon2018-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 2, divisions of integers return an integer: >>> 32 / 4 8 In Python 3 though, they return floats: >>> 32 / 4 8.0 However, Python 3 has an explicit integer division operator: >>> 32 // 4 8 That operator exists on Python >= 2.2, so let's use it everywhere to make the scripts compatible with both Python 2 and 3. In addition, using __future__.division tells Python 2 to behave the same way as Python 3, which helps ensure the scripts produce the same output in both versions of Python. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v2) Reviewed-by: Dylan Baker <[email protected]>
* python: Use the print functionMathieu Bridon2018-07-061-19/+21
| | | | | | | | | | | | In Python 2, `print` was a statement, but it became a function in Python 3. Using print functions everywhere makes the script compatible with Python versions >= 2.6, including Python 3. Signed-off-by: Mathieu Bridon <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* mesa/format_info: use designated initialiser listEric Engestrom2017-06-201-17/+20
| | | | | | | | Also, make that table const, since no-one is supposed to modify it anyway. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove shebang from python scriptsEmil Velikov2017-03-101-1/+0
| | | | | | | Analogous to earlier commit(s). Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: Add block depth field in struct gl_format_infoAnuj Phogat2016-05-031-2/+3
| | | | | | | This will be later required for 3D ASTC formats. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/formats: add MESA_LAYOUT_LATCNanley Chery2015-09-191-1/+1
| | | | | | | | | This enables us to predicate statments on a compressed format being a type of LATC format. Also, remove the comment that lists the enum (it was getting a tad long). Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: define the 2D ASTC formatsNanley Chery2015-08-261-0/+3
| | | | | | | | | | | | | Define the mesa formats and make changes necessary for compilation without errors. Also add support for _mesa_get_srgb_format_linear(). v2. conform the ASTC MESA_FORMAT enums to the existing naming convention. v3. remove ASTC cases for _mesa_get_uncompressed_format(). This function is only used for generating mipmaps - something ASTC formats do not support due to lack of online compression. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: store whether or not a format is sRGB in gl_format_infoNanley Chery2015-08-241-0/+2
| | | | | | | | v2: remove extra newline. v3: use bool instead of GLboolean. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: add more MESA_FORMAT_LAYOUTsNanley Chery2015-08-191-9/+1
| | | | | | | | | | Add the classes of compressed formats as layouts. This allows the detection of compressed formats belonging to a certain category of compressed formats. v2. simplify layout name construction (Ilia). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: improve error messaging for format CSV parserTapani Pälli2015-01-281-1/+1
| | | | | | | | Patch adds 2 error messages that point user directly to fix mispelled or impossible swizzle field for a format. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* main: Add a concept of an array formatJason Ekstrand2015-01-121-0/+16
| | | | | | | | | | | | | | | | | | | | An array format is a 32-bit integer format identifier that can represent any format that can be represented as an array of standard GL datatypes. Whie the MESA_FORMAT enums provide several of these, they don't account for all of them. v2 by Iago Toral Quiroga <[email protected]>: - Implement mesa_array_format as a plain bitfiled uint32_t type instead of using a struct inside a union to access the various components packed in it. This is necessary to support bigendian properly, as pointed out by Ian. - Squashed: Make float types normalized v3 by Iago Toral Quiroga <[email protected]>: - Include compiler.h in formats.h, which is necessary to build in MSVC as indicated by Brian Paul. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/format_info: Add support for the BPTC layoutNeil Roberts2014-08-121-0/+3
| | | | | | | | | | | | | | | | | | Adds the ‘bptc’ layout to get_channel_bits. The channel bits for BPTC depend on the mode but as it only has to be an approximation this sets it to 8 for the two UNORM formats and 16 for the two half-float formats. These represent the minimum number of bits of variation that can be generated by the interpolation of the two formats. This doesn't quite match what we do for S3TC which only returns 4 even though it can similarly generate 8 bits from the interpolation. However it does match what we return for ETC2. For reference, NVidia seems to return 8 bits for the UNORM formats and 32 bits for the half-float formats. v2: Change the number of bits to 8/8/8/8 for the UNORM formats and 16/16/16 for the half-float formats. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/format_info: Add support for compressed floating-point formatsNeil Roberts2014-08-121-1/+3
| | | | | | | | | If the name of a compressed texture format has ‘FLOAT’ in it it will now set the data type of the format to GL_FLOAT. This will be needed for the BPTC half-float formats. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/formats: Add layout and swizzle informationJason Ekstrand2014-08-051-0/+11
| | | | | | | v2: Move the MESA_FORMAT_SWIZZLE enum to the top of the file Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/formats: Remove IndexBitsJason Ekstrand2014-08-051-1/+1
| | | | | | | | Mesa hasn't supported color-indexed textures for some time. This is 0 for all texture formats, so we don't need to store it. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/main: Add python code to generate the format_info structureJason Ekstrand2014-08-051-0/+181
This adds a python script called format_info.py that is used to generate a single format_info.c file that contains the filled-out format_info array. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>