summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/format_pack.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Autogenerate most of format_pack.cJason Ekstrand2015-01-121-2982/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were auto-generating it before. The problem was that the autogeneration tool we were using was called "copy, paste, and edit". Let's use a more sensible solution. Signed-off-by: Jason Ekstrand <[email protected]> v2 by Samuel Iglesias <[email protected]> - Remove format_pack.c as it is now autogenerated - Add usage of INDENT_FLAGS in Makefile.am - Remove trailing blank line v3 by Samuel Iglesias <[email protected]> - Merge format_convert.py into format_parser.py - Adapt pack_*_* function generations - Fix out-of-tree build v4 by Samuel Iglesias <[email protected]> - _get_datatype() is now a helper function v5 by Samuel Iglesias <[email protected]> - format_pack.c.mako is now format_pack.py, with the template code inlined. It now auto-generates format_pack.c - Simplify Makefile.am change. - Modify SConscript to build format_pack.c with scons. - Remove run_mako.py - Add format_pack.c to gitignore v6 by Samuel Iglesias <[email protected]>: - Don't allow float to non-normalized integer format conversions. - Add non-normalized formats support for ubyte packing functions. Merge the previously separated patch. - Add clamping for non-normalized integer formats in pack_ubyte*() v7 by Samuel Iglesias <[email protected]>: - Add assert to check that sRGB formats are 8-bit size. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix A1R5G5B5 packing/unpackingJason Ekstrand2015-01-121-7/+1
| | | | | | | | As with B5G6R5, these have been left broken with comments saying they are. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORMJason Ekstrand2015-01-121-8/+2
| | | | | | | | | | | | | | Aparently, the packing/unpacking functions for these formats have differed from the format description in formats.h. Instead of fixing this, people simply left a comment saying it was broken. Let's actually fix it for real. v2 by Samuel Iglesias <[email protected]>: - Fix comment in formats.h Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Add MESA_FORMAT_{A8R8G8B8, X8R8G8B8, X8B8G8R8}_SRGB (v2)Richard Sandiford2014-09-171-0/+60
| | | | | | | | | | | | This means that each 8888 SRGB format has a reversed counterpart, which is necessary for handling big-endian mesa<->gallium mappings. v2: fix missing i965 additions. (Jason) fix 127->255 max alpha for SRGB formats. (Jason) v1: Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Richard Sandiford <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: Add MESA_FORMAT_A8L8_{SNORM,SRGB}Richard Sandiford2014-09-171-0/+37
| | | | | | | | | | | | | The associated UNORM format already existed. This means that each LnAn format has a reversed counterpart, which is necessary for handling big-endian mesa<->gallium mappings. [airlied: rebased onto current master] Signed-off-by: Richard Sandiford <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix SRGB alpha channel value in pack_float_R8G8B8X8_SRGBDave Airlie2014-09-171-1/+1
| | | | | | | | | Jason pointed out the bug on review adding new formats, but the existing format also appears to have the bug, so use 255 as the max, these are SRGB no SNORM. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/main: Use the RGB <-> sRGB conversion functions in libmesautilJason Ekstrand2014-08-041-67/+35
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* main/format_pack: Fix a wrong datatype in pack_ubyte_R8G8_UNORMJason Ekstrand2014-07-181-1/+1
| | | | | | | | Before it was only storing one of the color components due to truncation. With this patch it now properly stores all of them. Reviewed-by: Brian Paul <[email protected]> Cc: "10.2" <[email protected]>
* Remove the ATI_envmap_bumpmap extensionJason Ekstrand2014-06-301-25/+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]
* mesa: rename format_(un)pack.c functions to match format names (pt. 7)Brian Paul2014-03-261-22/+22
| | | | | | | | | | | sed commands: s/z_Z24_S8\b/S8_UINT_Z24_UNORM/g s/z_S8_Z24\b/Z24_UNORM_S8_UINT/g s/z_Z16\b/Z_UNORM16/g s/z_Z32\b/Z_UNORM32/g s/z_Z32_FLOAT/Z_FLOAT32/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 6)Brian Paul2014-03-261-4/+4
| | | | | | | | sed commands: s/ARGB2101010_UINT\b/B10G10R10A2_UINT/g s/ABGR2101010_UINT\b/R10G10B10A2_UINT/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 5)Brian Paul2014-03-261-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sed commands: s/SIGNED_R_UNORM8\b/R_SNORM8/g s/SIGNED_RG88_REV\b/R8G8_SNORM/g s/SIGNED_RGBX8888\b/X8B8G8R8_SNORM/g s/SIGNED_A8B8G8R8_UNORM\b/A8B8G8R8_SNORM/g s/SIGNED_R8G8B8A8_UNORM\b/R8G8B8A8_SNORM/g s/SIGNED_R_UNORM16\b/R_SNORM16/g s/SIGNED_R16G16_UNORM\b/R16G16_SNORM/g s/SIGNED_RGB_16\b/RGB_SNORM16/g s/SIGNED_RGBA_16\b/RGBA_SNORM16/g s/SIGNED_A_UNORM8\b/A_SNORM8/g s/SIGNED_L_UNORM8\b/L_SNORM8/g s/SIGNED_L8A8_UNORM\b/L8A8_SNORM/g s/SIGNED_L_UNORM8\b/I_SNORM8/g s/SIGNED_A_UNORM16\b/A_SNORM16/g s/SIGNED_L_UNORM16\b/L_SNORM16/g s/SIGNED_L16A16_UNORM\b/LA_SNORM16/g s/SIGNED_L_UNORM16\b/I_SNORM16/g s/XBGR16161616_SNORM\b/RGBX_SNORM16/g s/SIGNED_G8R8_UNORM\b/G8R8_SNORM/g s/SIGNED_G16R16_UNORM\b/G16R16_SNORM/g s/SIGNED_I_UNORM8\b/I_SNORM8/g s/SIGNED_I_UNORM16\b/I_SNORM16/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 4)Brian Paul2014-03-261-28/+28
| | | | | | | | | | | | | | | sed commands: s/SRGBA_UNORM8\b/A8B8G8R8_SRGB/g s/SABGR_UNORM8\b/R8G8B8A8_SRGB/g s/SARGB8\b/B8G8R8A8_SRGB/g s/XBGR8888_SRGB\b/R8G8B8X8_SRGB/g s/XRGB8888_SRGB\b/B8G8R8X8_SRGB/g s/SL_UNORM8\b/L_SRGB8/g s/SLA_UNORM8\b/L8A8_SRGB/g manually changed SRGB8 -> BGR_SRGB8 Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 3)Brian Paul2014-03-261-45/+45
| | | | | | | | | | | | | | | | | | | sed commands: s/LUMINANCE_FLOAT32\b/L_FLOAT32/g s/LUMINANCE_FLOAT16\b/L_FLOAT16/g s/LUMINANCE_ALPHA_FLOAT32\b/LA_FLOAT32/g s/LUMINANCE_ALPHA_FLOAT16\b/LA_FLOAT16/g s/ALPHA_FLOAT32\b/A_FLOAT32/g s/ALPHA_FLOAT16\b/A_FLOAT16/g s/XBGR32323232_FLOAT\b/RGBX_FLOAT32/g s/RGB9_E5_FLOAT\b/R9G9B9E5_FLOAT/g s/R11_G11_B10_FLOAT\b/R11G11B10_FLOAT/g s/INTENSITY_FLOAT16\b/I_FLOAT16/g s/INTENSITY_FLOAT32\b/I_FLOAT32/g v2: removed a few redundant/no-op substitutions Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 2)Brian Paul2014-03-261-12/+12
| | | | | | | | | | | | sed commands: s/ABGR2101010\b/R10G10B10A2_UNORM/g s/XRGB2101010_UNORM\b/B10G10R10X2_UNORM/g s/XBGR16161616_UNORM\b/RGBX_UNORM16/g s/ABGR2101010\b/R10G10B10A2_UNORM/g s/I8\b/I_UNORM8/g s/I16\b/I_UNORM16/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 1)Brian Paul2014-03-261-251/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sed commands: s/RGBA8888\b/A8B8G8R8_UNORM/g s/RGBA8888_REV\b/R8G8B8A8_UNORM/g s/ARGB8888\b/B8G8R8A8_UNORM/g s/ARGB8888_REV\b/A8R8G8B8_UNORM/g s/RGBA8888\b/X8B8G8R8_UNORM/g s/RGBA8888_REV\b/R8G8B8X8_UNORM/g s/XRGB8888\b/B8G8R8X8_UNORM/g s/XRGB8888_REV\b/X8R8G8B8_UNORM/g s/RGB888\b/BGR_UNORM8/g s/BGR888\b/RGB_UNORM8/g s/RGB565\b/B5G6R5_UNORM/g s/RGB565_REV\b/R5G6B5_UNORM/g s/ARGB4444\b/B4G4R4A4_UNORM/g s/ARGB4444_REV\b/A4R4G4B4_UNORM/g s/RGBA5551\b/A1B5G5R5_UNORM/g s/ARGB1555\b/B5G5R5A1_UNORM/g s/ARGB1555_REV\b/A1R5G5B5_UNORM/g s/AL44\b/L4A4_UNORM/g s/AL88\b/L8A8_UNORM/g s/AL88_REV\b/A8L8_UNORM/g s/AL1616\b/L16A16_UNORM/g s/AL1616_REV\b/A16L16_UNORM/g s/RGB332\b/B2G3R3_UNORM/g s/A8\b/A_UNORM8/g s/A16\b/A_UNORM16/g s/L8\b/L_UNORM8/g s/L16\b/L_UNORM16/g s/L8\b/I_UNORM8/g s/L16\b/I_UNORM16/g s/R8\b/R_UNORM8/g s/GR88\b/R8G8_UNORM/g s/RG88\b/G8R8_UNORM/g s/R16\b/R_UNORM16/g s/GR1616\b/R16G16_UNORM/g s/RG1616\b/G16R16_UNORM/g s/ARGB2101010\b/B10G10R10A2_UNORM/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename MESA_FORMAT_X8Z24_UNORM -> MESA_FORMAT_X8_UINT_Z24_UNORMBrian Paul2014-03-101-6/+6
| | | | | | | To follow the example of MESA_FORMAT_Z24_UNORM_X8_UINT. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add MESA_FORMAT_R8G8B8A8_SRGBBrian Paul2014-03-061-0/+27
| | | | | | | | To match PIPE_FORMAT_R8G8B8A8_SRGB. v2: fix component name copy&paste bugs Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: fix copy & paste bugs in pack_ubyte_SRGB8()Brian Paul2014-03-061-2/+2
| | | | | Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: fix copy & paste bugs in pack_ubyte_SARGB8()Brian Paul2014-03-061-2/+2
| | | | | Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: add MESA_FORMAT_B8G8R8X8_SRGBChia-I Wu2014-03-061-0/+18
| | | | | | | The format is needed to represent an RGB-only winsys framebuffer that is sRGB-capable. Reviewed-by: Brian Paul <[email protected]>
* mesa: fix packing/unpacking for MESA_FORMAT_A4R4G4B4_UNORMBrian Paul2014-03-051-1/+1
| | | | | | | | | Spotted by Chia-I Wu. v2: also fix unpack_ubyte_ARGB4444_REV() Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.Kenneth Graunke2014-02-091-11/+11
| | | | | | | | | | | | | | | | | | | | In commit eeed49f5f290793870c60b5b635b977a732a1eb4, Mark accidentally renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their sense. The commit message was correct, but what sed commands actually got run didn't match that. This patch swaps the two enum names, reversing them. This should undo the damage, but might break things if people have manually fixed a few instances in the meantime... Mark's commit also failed to mention renames: s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g but those seem okay. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add warning to _REV pack/unpack functions with incorrect behaviorMark Mueller2014-01-311-1/+6
| | | | | Signed-off-by: Mark Mueller <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: Fix Type A _INT formats to MESA_FORMAT naming standardMark Mueller2014-01-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Replace Type A _INT formats names with _SINT to match naming spec, and update type C formats as follows: s/MESA_FORMAT_R_INT8\b/MESA_FORMAT_R_SINT8/g s/MESA_FORMAT_R_INT16\b/MESA_FORMAT_R_SINT16/g s/MESA_FORMAT_R_INT32\b/MESA_FORMAT_R_SINT32/g s/MESA_FORMAT_RG_INT8\b/MESA_FORMAT_RG_SINT8/g s/MESA_FORMAT_RG_INT16\b/MESA_FORMAT_RG_SINT16/g s/MESA_FORMAT_RG_INT32\b/MESA_FORMAT_RG_SINT32/g s/MESA_FORMAT_RGB_INT8\b/MESA_FORMAT_RGB_SINT8/g s/MESA_FORMAT_RGB_INT16\b/MESA_FORMAT_RGB_SINT16/g s/MESA_FORMAT_RGB_INT32\b/MESA_FORMAT_RGB_SINT32/g s/MESA_FORMAT_RGBA_INT8\b/MESA_FORMAT_RGBA_SINT8/g s/MESA_FORMAT_RGBA_INT16\b/MESA_FORMAT_RGBA_SINT16/g s/MESA_FORMAT_RGBA_INT32\b/MESA_FORMAT_RGBA_SINT32/g s/\bMESA_FORMAT_RED_RGTC1\b/MESA_FORMAT_R_RGTC1_UNORM/g s/\bMESA_FORMAT_SIGNED_RED_RGTC1\b/MESA_FORMAT_R_RGTC1_SNORM/g s/\bMESA_FORMAT_RG_RGTC2\b/MESA_FORMAT_RG_RGTC2_UNORM/g s/\bMESA_FORMAT_SIGNED_RG_RGTC2\b/MESA_FORMAT_RG_RGTC2_SNORM/g s/\bMESA_FORMAT_L_LATC1\b/MESA_FORMAT_L_LATC1_UNORM/g s/\bMESA_FORMAT_SIGNED_L_LATC1\b/MESA_FORMAT_L_LATC1_SNORM/g s/\bMESA_FORMAT_LA_LATC2\b/MESA_FORMAT_LA_LATC2_UNORM/g s/\bMESA_FORMAT_SIGNED_LA_LATC2\b/MESA_FORMAT_LA_LATC2_SNORM/g
* mesa: Fix MESA_FORMAT names containg SIGNEDMark Mueller2014-01-271-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | Update comments. Replace format names containing SIGNED with SNORM appended w/decoration per the format name spec: s/MESA_FORMAT_SIGNED_R8\b/MESA_FORMAT_R_SNORM8/g s/MESA_FORMAT_SIGNED_RG88_REV\b/MESA_FORMAT_R8G8_SNORM/g s/MESA_FORMAT_SIGNED_RGBX8888\b/MESA_FORMAT_X8B8G8R8_SNORM/g s/MESA_FORMAT_SIGNED_RGBA8888\b/MESA_FORMAT_A8B8G8R8_SNORM/g s/MESA_FORMAT_SIGNED_RGBA8888_REV\b/MESA_FORMAT_R8G8B8A8_SNORM/g s/MESA_FORMAT_SIGNED_R16\b/MESA_FORMAT_R_SNORM16/g s/MESA_FORMAT_SIGNED_GR1616\b/MESA_FORMAT_R16G16_SNORM/g s/MESA_FORMAT_SIGNED_RGB_16\b/MESA_FORMAT_RGB_SNORM16/g s/MESA_FORMAT_SIGNED_RGBA_16\b/MESA_FORMAT_RGBA_SNORM16/g s/MESA_FORMAT_SIGNED_A8\b/MESA_FORMAT_A_SNORM8/g s/MESA_FORMAT_SIGNED_I8\b/MESA_FORMAT_I_SNORM8/g s/MESA_FORMAT_SIGNED_L8\b/MESA_FORMAT_L_SNORM8/g s/MESA_FORMAT_SIGNED_A16\b/MESA_FORMAT_A_SNORM16/g s/MESA_FORMAT_SIGNED_I16\b/MESA_FORMAT_I_SNORM16/g s/MESA_FORMAT_SIGNED_L16\b/MESA_FORMAT_L_SNORM16/g s/MESA_FORMAT_SIGNED_AL88\b/MESA_FORMAT_L8A8_SNORM/g s/MESA_FORMAT_SIGNED_RG88\b/MESA_FORMAT_G8R8_SNORM/g s/MESA_FORMAT_SIGNED_RG1616\b/MESA_FORMAT_G16R16_SNORM/g
* mesa: Fix MESA_FORMAT names with ALPH, INTENSITY, and LUMINANCEMark Mueller2014-01-271-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compressed spelled out color components ALPHA, INTENSITY, and LUMINANCE to A, I, and L: s/MESA_FORMAT_ALPHA_UINT8\b/MESA_FORMAT_A_UINT8/g' s/MESA_FORMAT_ALPHA_UINT16\b/MESA_FORMAT_A_UINT16/g' s/MESA_FORMAT_ALPHA_UINT32\b/MESA_FORMAT_A_UINT32/g' s/MESA_FORMAT_ALPHA_INT32\b/MESA_FORMAT_A_SINT32/g' s/MESA_FORMAT_ALPHA_INT16\b/MESA_FORMAT_A_SINT16/g' s/MESA_FORMAT_ALPHA_INT8\b/MESA_FORMAT_A_SINT8/g' s/MESA_FORMAT_INTENSITY_UINT8\b/MESA_FORMAT_I_UINT8/g' s/MESA_FORMAT_INTENSITY_UINT16\b/MESA_FORMAT_I_UINT16/g' s/MESA_FORMAT_INTENSITY_UINT32\b/MESA_FORMAT_I_UINT32/g' s/MESA_FORMAT_INTENSITY_INT32\b/MESA_FORMAT_I_SINT32/g' s/MESA_FORMAT_INTENSITY_INT16\b/MESA_FORMAT_I_SINT16/g' s/MESA_FORMAT_INTENSITY_INT8\b/MESA_FORMAT_I_SINT8/g' s/MESA_FORMAT_LUMINANCE_UINT8\b/MESA_FORMAT_L_UINT8/g' s/MESA_FORMAT_LUMINANCE_UINT16\b/MESA_FORMAT_L_UINT16/g' s/MESA_FORMAT_LUMINANCE_UINT32\b/MESA_FORMAT_L_UINT32/g' s/MESA_FORMAT_LUMINANCE_INT32\b/MESA_FORMAT_L_SINT32/g' s/MESA_FORMAT_LUMINANCE_INT16\b/MESA_FORMAT_L_SINT16/g' s/MESA_FORMAT_LUMINANCE_INT8\b/MESA_FORMAT_L_SINT8/g' s/MESA_FORMAT_LUMINANCE_ALPHA_UINT8\b/MESA_FORMAT_LA_UINT8/g' s/MESA_FORMAT_LUMINANCE_ALPHA_UINT16\b/MESA_FORMAT_LA_UINT16/g' s/MESA_FORMAT_LUMINANCE_ALPHA_UINT32\b/MESA_FORMAT_LA_UINT32/g' s/MESA_FORMAT_LUMINANCE_ALPHA_INT32\b/MESA_FORMAT_LA_SINT32/g' s/MESA_FORMAT_LUMINANCE_ALPHA_INT16\b/MESA_FORMAT_LA_SINT16/g' s/MESA_FORMAT_LUMINANCE_ALPHA_INT8\b/MESA_FORMAT_LA_SINT8/g' s/MESA_FORMAT_ALPHA_FLOAT16\b/MESA_FORMAT_A_FLOAT16/g' s/MESA_FORMAT_ALPHA_FLOAT32\b/MESA_FORMAT_A_FLOAT32/g' s/MESA_FORMAT_INTESITY_FLOAT16\b/MESA_FORMAT_I_FLOAT16/g' s/MESA_FORMAT_INTESITY_FLOAT32\b/MESA_FORMAT_I_FLOAT32/g' s/MESA_FORMAT_INTENSITY_FLOAT16\b/MESA_FORMAT_I_FLOAT16/g' s/MESA_FORMAT_INTENSITY_FLOAT32\b/MESA_FORMAT_I_FLOAT32/g' s/MESA_FORMAT_LUMINANCE_FLOAT16\b/MESA_FORMAT_L_FLOAT16/g' s/MESA_FORMAT_LUMINANCE_FLOAT32\b/MESA_FORMAT_L_FLOAT32/g' s/MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16\b/MESA_FORMAT_LA_FLOAT16/g' s/MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32\b/MESA_FORMAT_LA_FLOAT32/g'
* mesa: Change many Type P MESA_FORMATs to meet naming specMark Mueller2014-01-271-134/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion of Type P formats as follows (w/related comment fixes): s/MESA_FORMAT_RGB565\b/MESA_FORMAT_B5G6R5_UNORM/g s/MESA_FORMAT_RGB565_REV\b/MESA_FORMAT_R5G6B5_UNORM/g s/MESA_FORMAT_ARGB4444\b/MESA_FORMAT_B4G4R4A4_UNORM/g s/MESA_FORMAT_ARGB4444_REV\b/MESA_FORMAT_A4R4G4B4_UNORM/g s/MESA_FORMAT_RGBA5551\b/MESA_FORMAT_A1B5G5R5_UNORM/g s/MESA_FORMAT_XBGR8888_SNORM\b/MESA_FORMAT_R8G8B8X8_SNORM/g s/MESA_FORMAT_XBGR8888_SRGB\b/MESA_FORMAT_R8G8B8X8_SRGB/g s/MESA_FORMAT_ARGB1555\b/MESA_FORMAT_B5G5R5A1_UNORM/g s/MESA_FORMAT_ARGB1555_REV\b/MESA_FORMAT_A1R5G5B5_UNORM/g s/MESA_FORMAT_AL44\b/MESA_FORMAT_L4A4_UNORM/g s/MESA_FORMAT_RGB332\b/MESA_FORMAT_B2G3R3_UNORM/g s/MESA_FORMAT_ARGB2101010\b/MESA_FORMAT_B10G10R10A2_UNORM/g s/MESA_FORMAT_Z24_S8\b/MESA_FORMAT_S8_UINT_Z24_UNORM/g s/MESA_FORMAT_S8_Z24\b/MESA_FORMAT_Z24_UNORM_S8_UINT/g s/MESA_FORMAT_X8_Z24\b/MESA_FORMAT_Z24_UNORM_X8_UINT/g s/MESA_FORMAT_Z24_X8\b/MESA_FORMAT_X8Z24_UNORM/g s/MESA_FORMAT_RGB9_E5_FLOAT\b/MESA_FORMAT_R9G9B9E5_FLOAT/g s/MESA_FORMAT_R11_G11_B10_FLOAT\b/MESA_FORMAT_R11G11B10_FLOAT/g s/MESA_FORMAT_Z32_FLOAT_X24S8\b/MESA_FORMAT_Z32_FLOAT_S8X24_UINT/g s/MESA_FORMAT_ABGR2101010_UINT\b/MESA_FORMAT_R10G10B10A2_UINT/g s/MESA_FORMAT_XRGB4444_UNORM\b/MESA_FORMAT_B4G4R4X4_UNORM/g s/MESA_FORMAT_XRGB1555_UNORM\b/MESA_FORMAT_B5G5R5X1_UNORM/g s/MESA_FORMAT_XRGB2101010_UNORM\b/MESA_FORMAT_B10G10R10X2_UNORM/g s/MESA_FORMAT_AL88\b/MESA_FORMAT_L8A8_UNORM/g s/MESA_FORMAT_AL88_REV\b/MESA_FORMAT_A8L8_UNORM/g s/MESA_FORMAT_AL1616\b/MESA_FORMAT_L16A16_UNORM/g s/MESA_FORMAT_AL1616_REV\b/MESA_FORMAT_A16L16_UNORM/g s/MESA_FORMAT_RG88\b/MESA_FORMAT_G8R8_UNORM/g s/MESA_FORMAT_GR88\b/MESA_FORMAT_R8G8_UNORM/g s/MESA_FORMAT_GR1616\b/MESA_FORMAT_R16G16_UNORM/g s/MESA_FORMAT_RG1616\b/MESA_FORMAT_G16R16_UNORM/g s/MESA_FORMAT_SRGBA8\b/MESA_FORMAT_A8B8G8R8_SRGB/g s/MESA_FORMAT_SARGB8\b/MESA_FORMAT_B8G8R8A8_SRGB/g s/MESA_FORMAT_SLA8\b/MESA_FORMAT_L8A8_SRGB/g Conflicts: src/mesa/drivers/dri/i965/brw_surface_formats.c src/mesa/main/format_pack.c src/mesa/main/format_unpack.c src/mesa/main/formats.c src/mesa/main/texformat.c src/mesa/main/texstore.c
* mesa: Change many Type A MESA_FORMATs to meet naming standardMark Mueller2014-01-271-86/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update comments. Conversion of the following Type A formats: s/MESA_FORMAT_RGB888\b/MESA_FORMAT_BGR_UNORM8/g s/MESA_FORMAT_BGR888\b/MESA_FORMAT_RGB_UNORM8/g s/MESA_FORMAT_A8\b/MESA_FORMAT_A_UNORM8/g s/MESA_FORMAT_A16\b/MESA_FORMAT_A_UNORM16/g s/MESA_FORMAT_L8\b/MESA_FORMAT_L_UNORM8/g s/MESA_FORMAT_L16\b/MESA_FORMAT_L_UNORM16/g s/MESA_FORMAT_I8\b/MESA_FORMAT_I_UNORM8/g s/MESA_FORMAT_I16\b/MESA_FORMAT_I_UNORM16/g s/MESA_FORMAT_R8\b/MESA_FORMAT_R_UNORM8/g s/MESA_FORMAT_R16\b/MESA_FORMAT_R_UNORM16/g s/MESA_FORMAT_Z16\b/MESA_FORMAT_Z_UNORM16/g s/MESA_FORMAT_Z32\b/MESA_FORMAT_Z_UNORM32/g s/MESA_FORMAT_S8\b/MESA_FORMAT_S_UINT8/g s/MESA_FORMAT_SRGB8\b/MESA_FORMAT_BGR_SRGB8/g s/MESA_FORMAT_RGBA_16\b/MESA_FORMAT_RGBA_UNORM16/g s/MESA_FORMAT_SL8\b/MESA_FORMAT_L_SRGB8/g s/MESA_FORMAT_Z32_FLOAT\b/MESA_FORMAT_Z_FLOAT32/g s/MESA_FORMAT_XBGR16161616_UNORM\b/MESA_FORMAT_RGBX_UNORM16/g s/MESA_FORMAT_XBGR16161616_SNORM\b/MESA_FORMAT_RGBX_SNORM16/g s/MESA_FORMAT_XBGR16161616_FLOAT\b/MESA_FORMAT_RGBX_FLOAT16/g s/MESA_FORMAT_XBGR16161616_UINT\b/MESA_FORMAT_RGBX_UINT16/g s/MESA_FORMAT_XBGR16161616_SINT\b/MESA_FORMAT_RGBX_SINT16/g s/MESA_FORMAT_XBGR32323232_FLOAT\b/MESA_FORMAT_RGBX_FLOAT32/g s/MESA_FORMAT_XBGR32323232_UINT\b/MESA_FORMAT_RGBX_UINT32/g s/MESA_FORMAT_XBGR32323232_SINT\b/MESA_FORMAT_RGBX_SINT32/g s/MESA_FORMAT_XBGR8888_UINT\b/MESA_FORMAT_RGBX_UINT8/g s/MESA_FORMAT_XBGR8888_SINT\b/MESA_FORMAT_RGBX_SINT8/g
* mesa: Rename 4 color component unsigned byte MESA_FORMATsMark Mueller2014-01-271-38/+38
| | | | | | | | | | | | | Change all 4 color component unsigned byte formats to meet spec for P Type formats: s/MESA_FORMAT_RGBA8888\b/MESA_FORMAT_A8B8G8R8_UNORM/g s/MESA_FORMAT_RGBA8888_REV\b/MESA_FORMAT_R8G8B8A8_UNORM/g s/MESA_FORMAT_ARGB8888\b/MESA_FORMAT_B8G8R8A8_UNORM/g s/MESA_FORMAT_ARGB8888_REV\b/MESA_FORMAT_A8R8G8B8_UNORM/g s/MESA_FORMAT_RGBX8888\b/MESA_FORMAT_X8B8G8R8_UNORM/g s/MESA_FORMAT_RGBX8888_REV\b/MESA_FORMAT_R8G8B8X8_UNORM/g s/MESA_FORMAT_XRGB8888\b/MESA_FORMAT_B8G8R8X8_UNORM/g s/MESA_FORMAT_XRGB8888_REV\b/MESA_FORMAT_X8R8G8B8_UNORM/g
* mesa: change gl_format to mesa_formatMark Mueller2014-01-271-15/+15
| | | | s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
* mesa: Add MESA_FORMAT_SIGNED_RG88 and _RG1616.Francisco Jerez2014-01-151-0/+28
| | | | | | | | | | | | Including pack/unpack and texstore code. ARB_shader_image_load_store requires support for the GL_RG8_SNORM and GL_RG16_SNORM formats, which map to MESA_FORMAT_SIGNED_GR88 and MESA_FORMAT_SIGNED_GR1616 on little-endian hosts, and MESA_FORMAT_SIGNED_RG88 and MESA_FORMAT_SIGNED_RG1616 respectively on big-endian hosts -- only the former were already present, add support for the latter. Acked-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Add MESA_FORMAT_ABGR2101010.Francisco Jerez2014-01-151-0/+29
| | | | | | | | Including pack/unpack and texstore code. This texture format is a requirement for ARB_shader_image_load_store. Acked-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[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: add RGBX formats for existing GL RGB texture formatsMarek Olšák2013-02-071-0/+186
| | | | v2: fix compilation of swrast
* mesa: fixup inconsistent naming of RG16 formatsMarek Olšák2013-02-061-8/+8
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fix assorted MSVC conversion warnings in format_pack.cBrian Paul2012-11-061-10/+10
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa formats: add MESA_FORMAT_ABGR2101010_UINTJordan Justen2012-07-211-0/+28
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix truncated value warningDylan Noblesmith2012-04-131-1/+1
| | | | | | | | | | | | Silences a clang warning: format_pack.c:2546:30: warning: implicit conversion from 'int' to 'GLubyte' (aka 'unsigned char') changes value from 65535 to 255 [-Wconstant-conversion] d[i] = d[i] ? 0xffff : 0x0; ~ ^~~~~~ Reviewed-by: Brian Paul <[email protected]>
* mesa: use z32f_x24s8 struct in format pack/unpack codeBrian Paul2012-02-151-12/+19
| | | | | | | | And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row(). As suggested by José. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack codeBrian Paul2012-02-151-0/+13
| | | | | | | | Added in _mesa_pack_uint_24_8_depth_stencil_row(). This could be hit by something like glDrawPixels(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: added _mesa_pack_ubyte_rgba_rect()Brian Paul2012-01-301-0/+42
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()Brian Paul2012-01-131-1/+1
| | | | | | | | The AL44 format occupies one byte, not two. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: add some 'f' suffixes to silence MSVC warningsBrian Paul2012-01-071-4/+4
|
* mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.Eric Anholt2012-01-061-1/+1
| | | | | | | | | We were converting our ubyte stencil value to a float. Just write it as a uint, which overwrites the X24 part of X24S8 with 0 but shouldn't matter. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add _mesa_pack_colormask()Brian Paul2011-12-241-0/+75
| | | | | | For generating bit-wise colormasks for arbitrary pixel formats. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix possible precision issues in pack/unpack/fetch functionsMarek Olšák2011-12-121-10/+10
| | | | | | | | | | | | | | | | | GLfloat doesn't have enough precision to exactly represent 0xffffff and 0xffffffff. (and a reciprocal of those, if I am not mistaken) If -ffast-math is enabled, using GLfloat causes assertion failures in: - fbo-blit-d24s8 - fbo-depth-sample-compare - fbo-readpixels-depth-formats - glean/depthStencil For example: fbo-depth-sample-compare: main/format_unpack.c:1769: unpack_float_z_Z24_X8: Assertion `dst[i] <= 1.0F' failed. Reviewed-by: Brian Paul <[email protected]>
* mesa: new format_pack.c codeBrian Paul2011-12-081-0/+2496
This code packs colors, Z, stencil, etc. in the various mesa pixel formats. Will be used for things like glDrawPixels, glTexImage, glAccum, etc.