17ec681f3SmrgName 27ec681f3Smrg 37ec681f3Smrg MESA_bgra 47ec681f3Smrg 57ec681f3SmrgName Strings 67ec681f3Smrg 77ec681f3Smrg GL_MESA_bgra 87ec681f3Smrg 97ec681f3SmrgContact 107ec681f3Smrg 117ec681f3Smrg Gert Wollny (gert.wollny 'at' collabora.com) 127ec681f3Smrg 137ec681f3SmrgNotice 147ec681f3Smrg 157ec681f3Smrg Copyright (c) 2021 Collabora LTD 167ec681f3Smrg Copyright (c) 2009-2013 The Khronos Group Inc. Copyright terms at 177ec681f3Smrg http://www.khronos.org/registry/speccopyright.html 187ec681f3Smrg 197ec681f3SmrgVersion 207ec681f3Smrg 217ec681f3Smrg Version 1, 2021/04/30. 227ec681f3Smrg Based on EXT_bgra version 1, modified 1997/05/19. 237ec681f3Smrg 247ec681f3SmrgNumber 257ec681f3Smrg 267ec681f3Smrg TBD 277ec681f3Smrg 287ec681f3SmrgDependencies 297ec681f3Smrg 307ec681f3Smrg OpenGL ES 2.0 is required. 317ec681f3Smrg Written based on the wording of the OpenGL ES 3.2 specification. 327ec681f3Smrg There are interactions with the extensions EXT_clear_texture. 337ec681f3Smrg 347ec681f3SmrgOverview 357ec681f3Smrg 367ec681f3Smrg MESA_bgra extends the list of combinations host-memory color formats 377ec681f3Smrg with internal formats to include BGRA and BGR as acceptable formats 387ec681f3Smrg with RGB8/SRGB8 and RGBA/sRGB8_ALPHA8 as internal formats respectively. 397ec681f3Smrg This feature is of interest in virtualized environments, where the host 407ec681f3Smrg supports OpenGL ES only, and the virtualized guest is supposed to support 417ec681f3Smrg a subset of OpenGL including textures created with the format BGRA. 427ec681f3Smrg 437ec681f3SmrgIP Status 447ec681f3Smrg 457ec681f3Smrg Open-source; freely implementable. 467ec681f3Smrg 477ec681f3SmrgIssues 487ec681f3Smrg 497ec681f3Smrg None. 507ec681f3Smrg 517ec681f3SmrgNew Procedures and Functions 527ec681f3Smrg 537ec681f3Smrg None 547ec681f3Smrg 557ec681f3SmrgNew Tokens 567ec681f3Smrg 577ec681f3Smrg Accepted by the <format> parameter of TexImage2D and TexSubImage2D: 587ec681f3Smrg 597ec681f3Smrg GL_BGR_EXT 0x80E0 607ec681f3Smrg GL_BGRA_EXT 0x80E1 617ec681f3Smrg 627ec681f3SmrgAdditions to Chapter 8 of the GLES 3.2 Specification (Textures and Samplers) 637ec681f3Smrg 647ec681f3Smrg Add to table 8.2 (Pixels data formats, valid combinations of format, 657ec681f3Smrg type, and unsized internalformat). 667ec681f3Smrg 677ec681f3Smrg Format Type External Internal Format 687ec681f3Smrg Bytes 697ec681f3Smrg per Pixel 707ec681f3Smrg ------------------------------------------------------------- 717ec681f3Smrg BGRA UNSIGNED_BYTE 4 RGBA 727ec681f3Smrg BGR UNSIGNED_BYTE 3 RGB 737ec681f3Smrg 747ec681f3Smrg 757ec681f3Smrg 767ec681f3Smrg Add to table 8.5 (Pixels data formats). 777ec681f3Smrg 787ec681f3Smrg Format Name Elements Meaning and Order Target Buffer 797ec681f3Smrg ------------------------------------------------------------- 807ec681f3Smrg BGR_EXT B, G, R Color 817ec681f3Smrg BGRA_EXT B, G, R, A Color 827ec681f3Smrg 837ec681f3Smrg 847ec681f3Smrg Add to table 8.9 (Effective internal format correspondig to 857ec681f3Smrg external format). 867ec681f3Smrg 877ec681f3Smrg Format Type Effective 887ec681f3Smrg Internal format 897ec681f3Smrg ------------------------------------------------------------- 907ec681f3Smrg BGRA_EXT UNSIGNED_BYTE RGBA8 917ec681f3Smrg BGR_EXT UNSIGNED_BYTE RGB8 927ec681f3Smrg 937ec681f3SmrgInteractions with EXT_clear_texture 947ec681f3Smrg 957ec681f3Smrg When EXT_clear_texture is supported the accepted formats for 967ec681f3Smrg ClearTextureEXT and ClearSubTextureEXT are extended to include 977ec681f3Smrg the entries added above. 987ec681f3Smrg 997ec681f3Smrg 1007ec681f3SmrgRevision History 1017ec681f3Smrg 1027ec681f3Smrg Original draft, revision 1.0, May 4, 2021 (Gert Wollny) 1037ec681f3Smrg rewrite EXT_bgra against OpenGL ES 3.2 instead of OpenGL 1,0. 1047ec681f3Smrg 1057ec681f3Smrg Revision 1.1 (May 5. 2021): Add the new tokens, and fix 1067ec681f3Smrg Clear*Texture function names. 107