src/libGLESv2/formatutils.cpp


Log

Author Commit Date CI Message
Geoff Lang abce7620 2014-09-19T16:13:00 Fix some texture support queries ORing extensions instead of ANDing. A couple of formats that required two extensions would OR the checks together when they should have ANDed them and allowed the validation to be too permissive. Fixed the checks and added a new one that needs to OR the extension checks together to verify GL_DEPTH24_STENCIL8_OES support. BUG=angle:752 Change-Id: I2e1e12fd428358e975cd22eb685b9a8fb797161f Reviewed-on: https://chromium-review.googlesource.com/219094 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang d87878e3 2014-09-19T15:42:59 Remove the requirement that a format must be texturable to be renderable. Previously, to determine if a texture format was renderable, the texturable and renderable fields had to be and-ed together. This caused issues for formats such as D24S8 which can be renderable but not texturable depending on available extensions. Made the renderable flag a complete check that may be different than the textureable flag and removed assumptions that a format is texturable if renderable from the code. GL_DEPTH24_STENCIL8 now checks for ANGLE_depth_textures for texturability and ANGLE_depth_textures or OES_packed_depth_stencil for renderability. BUG=angle:752 Change-Id: I6d197cee72cc249e5996fa395303bdf43d246a87 Reviewed-on: https://chromium-review.googlesource.com/219093 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0b7eef7c 2014-06-12T14:10:47 Removed common_includes.h reordered includes. Since we are not using precompiled headers anymore, remove common_includes.h so that fewer files are included in cpp files. Reordered includes to be in the following order: 1) Local ANGLE project headers, ordered by directory in descending depth 2) GL headers 3) STL headers This helps enforce the include-what-you-use principal by reducing the number of STL headers unexpectedly shared between files. This include order conflicts with some of the Google c++ style guide which states that STL includes should be first but this helps us catch more issues. Change-Id: I8f7785f4ad574e253dd3c7b4fb1e54d3ce3b99fc Reviewed-on: https://chromium-review.googlesource.com/214850 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill ea24759f 2014-08-28T10:37:08 Remove remnants of old PCH code. Remove the precompiled.cpp file which was producing a build warning, and rename the header to make it clear we no longer support PCH. BUG=angle: Change-Id: I944081ae477b1478ca9c18924fb02bb920d420a7 Reviewed-on: https://chromium-review.googlesource.com/214187 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 5d601382 2014-07-22T15:14:06 Simplify formatutils.h by exposing the info structures. Removed all the separate query functions and simply expose the internal info structures. This reduces the number of std::map/std::set operations that were hidden behind the API. Moved the validation tables for ES3 format combinations and effective internal formats into validationES3.cpp so that formatutils.h only has generic GL format queries. BUG=angle:658 Change-Id: Ieb60d42b8eafcdb4f21dcbec130b39478ce5f7c5 Reviewed-on: https://chromium-review.googlesource.com/206835 Reviewed-by: Nicolas Capens <capn@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 493daf5a 2014-07-03T13:38:44 Update the format table to check support for filtering and rendering. Since filerability and renderability may depend on separate extensions, use functions to determine their support. Context now uses these functions to fill it's own TextureFormatCaps. BUG=angle:658 Change-Id: Ib4dc877ba7c24f84a3823fd5aa2e01a3b3621705 Reviewed-on: https://chromium-review.googlesource.com/206831 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e4a492be 2014-06-19T14:14:41 Remove the clientVersion parameter from the format utils. clientVersion was only useful for intitial validation of formats and not required for queries. Only use the client version and caps structure to validate if a format is available and then trust that it is supported past the validation layer. Fixed some inconsistancies between tables such as missing formats or incorrect load functions in the ES3 tables. BUG=angle:659 Change-Id: I8d33c902156ee6fb41efe937d93b0586191726e5 Reviewed-on: https://chromium-review.googlesource.com/201167 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 05b05028 2014-06-11T15:31:45 Add support for EXT_sRGB. BUG=angle:672 Change-Id: I001ff3dde7a39e545a535a399c02f3a6d91634c8 Reviewed-on: https://chromium-review.googlesource.com/203460 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang cec3590a 2014-04-16T10:52:36 Use a Caps structure to store extension and texture format support. Removes support for fallbacks in D3D9 texture formats. The fallback formats did not work properly anyways. BUG=angle:658 Change-Id: Idfa5183bf71fd8ebf4608f940f9d93177b9eff08 Reviewed-on: https://chromium-review.googlesource.com/200813 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang cdacacdd 2014-04-24T12:01:56 Add validation for unsized BGRA texture formats. BUG=angle:620 Change-Id: I956b7fc4ed0be99239e4ed1c63b51732727cc87f Reviewed-on: https://chromium-review.googlesource.com/196840 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill eb9baabb 2014-03-24T13:19:43 Pass pack state arguments instead of split parameters. Similar to unpack state, the PixelPackState struct encapsulates all the parameters related to pixel pack buffers. Passing the packstate makes functions more consise. BUG=angle:511 Change-Id: If6954a5085e9b8f828cfc8892a73e7c7514b0c8a Reviewed-on: https://chromium-review.googlesource.com/191032 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Shannon Woods 4d161bad 2014-03-17T18:13:30 Amends CopyTexImage validation to conform to new language in the ES 3.0.3 spec. bug=angle:582 Also performs format checks for non-subimage copies, and permits unsized format textures as destination for the copy. Change-Id: Id647bb968416fbd35e1c70e5da21c81367e08f07 Reviewed-on: https://chromium-review.googlesource.com/189431 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Nicolas Capens 0027fa9f 2014-02-20T14:26:42 Emulate integer cube texture sampling as an array of six 2D textures. BUG=angle:525 Change-Id: I3c3ec2cecebf9e745f0c02a132433e3076a6fdea Reviewed-on: https://chromium-review.googlesource.com/187534 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 1ec57f80 2013-10-16T11:43:23 Add support for GL_EXT_color_buffer_float. TRAC #23794 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Geoff Lang 632192dd 2013-10-04T13:40:46 Added support for EXT_texture_rg in D3D9 and D3D11. TRAC #22423 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Geoff Lang 85ea9abb 2013-10-10T13:50:34 Fixed the GL_FLOAT_32_UNSIGNED_INT_24_8_REV type having the incorrect number of bytes and allowed the depth stencil formats to specify that they have unused bits. TRAC #23540 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Geoff Lang 005df41f 2013-10-16T14:12:50 Use GLenum instead of GLint to store internal format variables. TRAC #23785 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Jamie Madill 0e0510fd 2013-10-10T15:46:23 Place the method responsible for checking for fast pixel unpack buffer support into the Renderer. TRAC #23997 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Geoff Lang d1e9a9a6 2013-09-30T15:22:57 Add missing ES3 unsized internal formats and properly return 1 for alpha in integer formats with no alpha channel. TRAC #23949 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Jamie Madill 89a0bf50 2013-09-18T14:36:24 Add initial implementation for PixelTransfer11, which will enable GPU buffer to texture and texture to buffer copies. This is necessary for fast implementation of ES3 PBOs. TRAC #23841 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Jamie Madill 3466a4d0 2013-09-18T14:36:20 Add a helper method to return the number of components in a texture format. TRAC #23841 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Jamie Madill 666e2866 2013-09-10T12:04:29 Ensure the 'slice' pixel unpack/pack alignment is only aligned based on the row stride. TRAC #23837 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Jamie Madill 1d855fed 2013-09-09T16:24:05 Fix an incorrect type entry for RGB565 in the ES3 formats table. TRAC #23823 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Jamie Madill 18a44701 2013-09-09T16:24:04 Fix the format table entry for RGB10_A2UI to be RGBA_INTEGER instead of RGBA. Also add a missing format mapping. TRAC #23823 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Geoff Lang b2f3d05c 2013-08-13T12:49:27 Replaced the custom component type and SRGB bool with GLenums. TRAC #23474 Author: Geoff Lang Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Geoff Lang f23eb28c 2013-07-22T10:52:19 Cache the index ranges at the gl::Buffer and rx::IndexBuffer levels so that ranges do not need to be re-calculated for direct buffers. Issue #451 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
Nicolas Capens 08be89da 2013-07-16T16:17:31 Make all depth formats texture filterable. TRAC #23532 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
Jamie Madill b70e5f7c 2013-07-10T16:57:52 Add support for copying from BGRA formats in CopyTexSubImage*. This is necessary for copying from the offscreen texture, which we keep in BGRA to align with Chrome's D3D9 format. TRAC #23501 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Authored-by: Jamie Madill
Jamie Madill a940ae49 2013-07-08T17:48:34 Add the missing HALF_FLOAT_OES type to the type info table. TRAC #23479 Signed-off-by: Shannon Woods Authored-by: Jamie Madill
Shannon Woods 9e73b210 2013-07-08T10:32:19 Marks formats renderable which had been missed and corrects table headers. TRAC #23273 Authored-by: Shannon Woods Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Geoff Lang a3495326 2013-06-18T15:16:15 Added ES3 internal format information about GL_DEPTH_COMPONENT32_OES and mapped DXGI_FORMAT_R32_TYPELESS textures to GL_DEPTH_COMPONENT32F. TRAC #23262 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
Geoff Lang fe28ca06 2013-06-04T10:10:48 Added table entries for reading colors from D3D and DXGI formats and writing colors to format/type combinations. TRAC #23256 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
Geoff Lang 24159226 2013-06-05T14:56:32 Fixed a bug where GetBlueBits was returning the count of green bits. TRAC #23278 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang
Geoff Lang 42b8b908 2013-06-05T16:08:21 Fixed a bug where GL_RBG565 was labled as a GL_RGBA internal format. TRAC #23279 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
Geoff Lang 18591b7c 2013-06-07T12:00:15 Capitalized the first letter of all private format util functions. TRAC #23212 Signed-off-by: Shannon Woods Author: Geoff Lang
Geoff Lang 74eb9155 2013-05-29T16:09:05 Fixed GL_RGB4 not being marked as color renderable in ES3. TRAC #23243 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang
shannonwoods@chromium.org d03f8970 2013-05-30T00:17:07 Added some missing format table entries. TRAC #23215 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2381 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org 96c62911 2013-05-30T00:17:00 Added support for SRGB textures. TRAC #23046 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2380 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org e81ea50b 2013-05-30T00:16:53 Added a function to determine if an internal format is SRGB. TRAC #23046 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2379 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org ffab47de 2013-05-30T00:16:22 Added validation for CopyTexImage with integer textures. TRAC #23049 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2375 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org e19409b5 2013-05-30T00:16:15 Added helper functions for determining if an internal format is an integer or floating point format. TRAC #23049 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2374 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org a05127a6 2013-05-30T00:16:07 Added support for integer and unsigned integer texture formats. TRAC #23049 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2373 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org 36d0be90 2013-05-30T00:15:59 Added support for SNORM texture formats. TRAC #23051 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2372 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org a43d829f 2013-05-30T00:15:50 Added support for GL_R11F_G11F_B10F textures. TRAC #23052 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2371 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org 92b9cd57 2013-05-30T00:14:48 Added support for the GL_RGB9_E5 format. git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2363 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org a32a2ba4 2013-05-30T00:14:40 Added support for GL_RED and GL_RG texture formats. TRAC #22955 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2362 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org 5d4468e9 2013-05-30T00:13:56 Add support for GL_UNSIGNED_INT_2_10_10_10_REV textures. TRAC #22956 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2356 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org a2ecfccc 2013-05-30T00:11:59 Moved utilities.h/cpp and mathutils.h to the shared common code folder. The HLSL translator needs to compute the sizes of various GL types for computing block layouts. TRAC #22930 Signed-off-by: Nicolas Capens Signed-off-by: Geoff Lang Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2342 736b8ea6-26fd-11df-bfd4-992fa37f6226
shannonwoods@chromium.org b8490f3c 2013-05-30T00:08:00 Created new helper functions for converting texture formats, loading images and generating mipmaps." TRAC #22972 Signed-off-by: Jamie Madill Signed-off-by: Nicolas Capens Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2313 736b8ea6-26fd-11df-bfd4-992fa37f6226