src/tests/gl_tests/TextureTest.cpp


Log

Author Commit Date CI Message
Jamie Madill 7ffdda9a 2016-09-08T13:26:51 D3D11: Don't allow fast unpack from GL_ALPHA8. This format is one that doesn't support buffer SRV creation. It seems like there is no equivalent dEQP test for this format. BUG=angleproject:1503 Change-Id: I9ecdb9406ca0b62dd54b450d2b50341d76584b2b Reviewed-on: https://chromium-review.googlesource.com/381435 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez e731d8aa 2016-09-07T10:56:25 TextureTest: suppress failure for newly added test. BUG=angleproject:1493 BUG=chromium:638323 Change-Id: I5cab149c735158fe810f002e47cc3c5c75bc503b Reviewed-on: https://chromium-review.googlesource.com/381951 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 14718767 2016-09-06T15:56:54 Remove usage of std::log2 in tests. For some reason, this was giving a link error on Android. Change it to use the mathutil version to be sure. BUG=angleproject:1493 BUG=chromium:638323 Change-Id: I454ba4609d7818f50c668bb7c1a3b684f9ca8444 Reviewed-on: https://chromium-review.googlesource.com/381671 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9e3d7aa0 2016-09-02T15:19:43 D3D11: Work around small mipped stencil textures. AMD has a bug with 2x2 and 1x1 mips of depth/stencil textures. Formats D24S8 and D32FS8 both seem to render black for the very small mips. We can work around this by selectively caching a copy of the texture data that only has depth information, since stencil isn't filterable in OpenGL ES. BUG=angleproject:1493 BUG=chromium:638323 Change-Id: Iebef42c4680018d9854dbe789d677823167213dd Reviewed-on: https://chromium-review.googlesource.com/380037 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev 1be913cf 2016-07-11T17:59:16 Add support for ES31 context creation The dEQP test for context creation passes. SH_WEBGL3_SPEC has been added, but it should be considered whether we should keep it, remove it or rename it. It was added so that there is a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file has been modified so that some tokens from es3 can be also used in es31 as well. A separate macro ES3_1_ONLY is added so that some tokens are limited only for es 310 shaders. BUG=angleproject:1442 TEST=angle_unittests Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba Reviewed-on: https://chromium-review.googlesource.com/360300 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 3c754194 2016-06-27T19:36:41 Skip Texture2DTestES3.UnpackSkipImages2D test on Adreno Android GLES Due to a bug in Adreno glTexImage2D with GL_UNPACK_SKIP_IMAGES. BUG=angleproject:1429 TEST=Texture2DTestES3.UnpackSkipImages2D Change-Id: Iccb4cc968915a623f0aed099b81e759c6e4343f7 Reviewed-on: https://chromium-review.googlesource.com/356494 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov ad6c0452 2016-06-24T22:24:37 Skip SamplerInStruct AsFunctionParameter tests on Adreno Android GLES Due to Adreno bug in compiling struct function parameter in shader. BUG=angleproject:1427 TEST=SamplerInStructAsFunctionParameterTest SamplerInStructArrayAsFunctionParameterTest SamplerInNestedStructAsFunctionParameterTest Change-Id: I979312885f2047e78b61530c97703854a4be1586 Reviewed-on: https://chromium-review.googlesource.com/356125 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov afcec834 2016-06-21T22:19:51 Skip Texture2DTestES3.TextureLuminance16ImplicitAlpha1 on Adreno Android GLES Due to Adreno bug in GL_HALF_FLOAT support BUG=angleproject:1420 TEST=Texture2DTestES3.TextureLuminance16ImplicitAlpha1 Change-Id: Id9bc12da21048a557325f076202ec482675320e3 Reviewed-on: https://chromium-review.googlesource.com/354782 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Corentin Wallez c7f59d02 2016-06-20T10:12:08 Suppress a Wintel/OpenGL failure on a new test. BUG=angleproject:1388 Change-Id: I4d346ca3c6914e56055aa6492d9d013634a1b9ad Reviewed-on: https://chromium-review.googlesource.com/353693 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 218cf9ee 2016-05-20T13:55:24 Fix unpacking overlapping unpack buffer rows on NVIDIA GL When unpack parameters are set so that rows being read overlap in the unpack buffer stored in GPU memory, NVIDIA GL driver may not upload the last pixels of the last one or more rows of a texture. The driver may also crash when the amount of overlap is high. This issue affects both TexImage* and TexSubImage* calls. Work around the issue by uploading textures row by row when the rows being read overlap in the unpack buffer. The workaround could possibly be optimized by uploading several of the first rows with a single call in some cases where the amount of overlap is low, but this is expected to be a rarely used corner case, so the added complexity that the optimization would create seems like a bad tradeoff. The issue does not seem to be triggered when the layers (images) of a 3D texture overlap, as long as the rows inside the images don't. The workaround has been ported from Chromium. This patch adds setting dirty bits when unpack state is set in StateManagerGL. The included test case also reveals some issue in the D3D backend, but this is left to be addressed later. BUG=angleproject:1376 TEST=angle_end2end_tests Change-Id: I7dbe73ebb70bbbc284fa92381546f4f2f832d333 Reviewed-on: https://chromium-review.googlesource.com/346430 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 989cac34 2016-06-08T16:18:49 Validate that unpack skip is in bounds Unpack skip needs to be taken into account when determining which part of the unpack buffer is read. This is now done in the out-of-bounds check when validating texture upload calls. Unpack skip code is removed from D3D9 backend, since skip is not supported in GLES2. BUG=angleproject:1411 TEST=angle_end2end_tests Change-Id: I0db4db0877a352613c57e2820e5b650edb5a73ab Reviewed-on: https://chromium-review.googlesource.com/352450 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 95faa233 2016-06-07T14:01:53 Do not apply UNPACK_SKIP_IMAGES for 2D textures on D3D Resubmitted with test skip added for Intel OpenGL. GLES 3.0.4 section 3.8.3: "For the purposes of decoding the texture image, TexImage2D is equivalent to calling TexImage3D with corresponding arguments and depth of 1, except that UNPACK_SKIP_IMAGES is ignored." An "applySkipImages" boolean parameter is added to the functions in the D3D backend that apply skip offset to the unpack pointer. In case 2D texture data is uploaded, the parameter is set to false and UNPACK_SKIP_IMAGES is not applied. BUG=angleproject:1406 TEST=angle_end2end_tests Change-Id: I5878439e3d38dbae89cc2452a056c2d6bbf9e0b3 Reviewed-on: https://chromium-review.googlesource.com/351330 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Geoff Lang a1d6c4dc 2016-06-09T18:00:42 Revert "Do not apply UNPACK_SKIP_IMAGES for 2D textures on D3D" The Windows Intel GPU FYI bot started failing the Texture2DTestES3.UnpackSkipImages2D/ES3_OPENGL test after this CL. Example: https://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28New%20Intel%29/builds/866 This reverts commit ac3575b27296398baebeb6c891871c6dac7df338. Change-Id: I5120261f5cf1ece9b21e4a94f63f85e014d2d8e4 Reviewed-on: https://chromium-review.googlesource.com/351280 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho ac3575b2 2016-06-07T14:01:53 Do not apply UNPACK_SKIP_IMAGES for 2D textures on D3D GLES 3.0.4 section 3.8.3: "For the purposes of decoding the texture image, TexImage2D is equivalent to calling TexImage3D with corresponding arguments and depth of 1, except that UNPACK_SKIP_IMAGES is ignored." An "applySkipImages" boolean parameter is added to the functions in the D3D backend that apply skip offset to the unpack pointer. In case 2D texture data is uploaded, the parameter is set to false and UNPACK_SKIP_IMAGES is not applied. BUG=angleproject:1406 TEST=angle_end2end_tests Change-Id: Iedc2b05377adee8d5c2504511a87421f4b1db18d Reviewed-on: https://chromium-review.googlesource.com/350465 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Vincent Lang 25ab4510 2016-05-13T18:13:59 Implement GL_EXT_texture_norm16 extension BUG=angleproject:1365 Change-Id: I972b156ecb41ff44bc1f6365373ab386bacc85f1 Reviewed-on: https://chromium-review.googlesource.com/346530 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho e8528d89 2016-05-16T17:50:52 Fix determining texture mipmap completeness The code didn't previously take base level properly into account when determining how many levels to check when checking for texture completeness. The code is refactored so that the "q" value in spec, that is the maximum mipmap level for determining completeness, can be queried from TextureState. This value is used now for checking completeness. This requires moving ImageDescs under TextureState. Functions that operate on the ImageDesc array are also moved from Texture to TextureState. TextureState members are also renamed to start with the "m" prefix and made private. Also handle levels outside the base/max level range consistently in eglCreateImageKHR validation. We interpret the spec so that if the level used for the EGL image is not a part of the texture levels that affect texture completeness, an error is generated. BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: I038ef24aa83e0a6905ca3c0bbada5989eecb00d9 Reviewed-on: https://chromium-review.googlesource.com/344880 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho be815a4f 2016-05-12T20:38:38 Apply effective base and max level on GL backend This works around GL drivers that neglect to clamp the base level or max level of immutable textures. BUG=angleproject:596 BUG=610800 TEST=angle_end2end_tests Change-Id: Ie4e04aaa9253f2befd73bccefa7759486b3ef487 Reviewed-on: https://chromium-review.googlesource.com/344590 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 87fc71c4 2016-05-11T14:25:21 D3D: Reallocate storage when texture format changes with base level Different levels of the same texture may have different formats, so changing the base level may affect the format that should be used for the storage. Take this into account in the D3D backend. The added test fails on some GL drivers. TEST=angle_end2end_tests BUG=angleproject:596 Change-Id: I5380e942694a75685ebb510edb01c0489e0d5179 Reviewed-on: https://chromium-review.googlesource.com/344230 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 0f2ef7f9 2016-05-11T12:51:05 Suppress and end2end failure caused by a Mesa bug BUG=610800 Change-Id: I4ee6ba589afc98277c3cf50b8f57afb184b11216 Reviewed-on: https://chromium-review.googlesource.com/343994 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho a314b61c 2016-03-10T16:43:00 Determine D3D texture storage size with correct base level The size of the texture storage is now determined by extrapolating the level zero texture dimensions from the base level dimensions. This fixes crashing when images for levels below the base level are not defined, and also fixes texture storage dimensions being calculated wrong in case the levels outside the used level range have dimensions that are inconsistent with the dimensions inside the used level range. Checking texture level completeness in TextureD3D is now done based on the dimensions of the base level, and levels that are outside the base level to max level range are not taken into account. Textures are marked incomplete in case their base level is greater than their max level. Changing the base level can also affect the size of the storage required for the texture. Old storage is now discarded when the base level is changed and the new base level calls for different storage dimensions. Code in TextureD3D is refactored so that "base level" actually means the base level of the texture specified through the GLES API, and "level zero" is used where TextureD3D would sometimes previously use "base level". Changing either the base level or max level can also affect texture completeness, so invalidate the cached completeness in Texture if they are changed. Some of the added tests are still failing on Intel and NVIDIA OpenGL drivers because of driver bugs. Tests also fail on OSX. BUG=angleproject:596 TEST=angle_end2end_tests, dEQP-GLES3.functional.texture.* (no regressions), dEQP-GLES3.functional.shaders.texture_functions.* (no regressions), dEQP-GLES3.functional.state_query.texture.* (no regressions) Change-Id: Icd73d6e29f84a341ed5ff36d5ec5cb2f469cb4e8 Reviewed-on: https://chromium-review.googlesource.com/333352 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho b97a3e77 2016-04-13T14:31:52 Clean up MipmapTest This refactoring is done to prepare for adding more mipmap tests for ES3 where base level / max level is changed from 0. 1. Reuse drawQuad() from ANGLETest instead of having completely custom quad drawing code, and reuse the same clear+draw function for both 2D and cube map texture tests. 2. Add a helper function for clearing texture level 0 with glClear. 3. Remove a few redundant texture binding and useProgram calls. 4. Rely on sampler uniforms being set to 0 by default and texture unit 0 being active by default. 5. Remove "Offscreen" from variable names. 6. Split SetUp functions to helper functions. 7. Reuse FillWithRGBA from TextureTest also in MipmapTest. BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: I9fd738f4b8b0a19c7aa1d267f7dbaa40a6935631 Reviewed-on: https://chromium-review.googlesource.com/338791 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho a1c917f2 2016-04-06T13:50:03 Suppress samplers in structs test failures on Intel OpenGL Some of the tests made to verify D3D implementation of samplers in structs are failing on Intel's OpenGL drivers, so suppress the failures. Since the test was crashing in shader program setup, shader program setup needs to be moved out of the SetUp() function of the texture tests. BUG=600758 TEST=angle_end2end_tests Change-Id: I1b6e788d900425e914572d2a3d7ef1fc43146f50 Reviewed-on: https://chromium-review.googlesource.com/337500 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 9696316d 2016-03-21T11:54:33 Support ESSL structs containing samplers on D3D Since HLSL can't natively handle samplers in structs, samplers need to be extracted out of structs into separate variables in the translated shader code. In HLSL 4.1, samplers that were in structs go into the normal sampler arrays and are identified by index constants. In other HLSL versions, samplers that were in structs are translated as uniform variables. These transformations are done inside the HLSL output classes, not as tree transformations. This helps to keep the uniform API provided by the shader translator intact. Wherever a struct containing samplers is passed into a user-defined function, the translated HLSL code passes the separate sampler variables alongside a struct where the samplers have been removed. The D3D backend in libANGLE queries the uniform registers of any samplers that were in uniform structs, and adds them to the register maps, so that correct sampler state gets assigned to them. The extracted sampler variables are prefixed with "angle_" instead of the usual "_" to prevent any name conflicts between them and regular variables. BUG=angleproject:504 TEST=angle_end2end_tests, dEQP-GLES*.functional.shaders.struct.uniform.* (all pass), dEQP-GLES*.functional.uniform_api.* (most now pass) Change-Id: Ib79cba2fa0ff8257a973d70dfd917a64f0ca1efb Reviewed-on: https://chromium-review.googlesource.com/333743 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 9e3c615e 2016-03-29T21:58:33 Suppress end2end failures for the new Linux Intel bot. Since this is a new bot, we should make it green ASAP so we can catch any new regressions. BUG=angleproject:1346 Change-Id: I2c1288b8115a9d7980d5a3f37753b35cbb837486 Reviewed-on: https://chromium-review.googlesource.com/336050 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 356f5165 2016-03-18T14:19:41 Add a texture data fill helper function to tests Several tests need to initialize arrays of RGBA texture data. Add a helper function for this to reduce duplication and to make the code more readable. BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: Id4a35b34a8fad25c2dc263ad8635dd43355a4f17 Reviewed-on: https://chromium-review.googlesource.com/333911 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 518b9fab 2016-03-02T11:26:02 Suppress some failing end2end_tests on Intel. BUG=589851 Change-Id: Ia580cee30e6842aaddb4683025f425166f0f6120 Reviewed-on: https://chromium-review.googlesource.com/329735 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill f09bf669 2016-03-02T11:26:01 Revert "Suppress some failing end2end_tests on Intel." This reverts commit 7208f6994cf7d810c2226965362aad43d2a66f53. Still some failures on Intel, requires a slightly different solution. BUG=589851 Change-Id: I6ac6599249e9e0f6319c917e04734cd48ca9274d Reviewed-on: https://chromium-review.googlesource.com/329734 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7208f699 2016-02-29T10:47:35 Suppress some failing end2end_tests on Intel. BUG=589851 Change-Id: I91588014784a8a9b75389aeb596923458c30d80a Reviewed-on: https://chromium-review.googlesource.com/329427 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 6ee394a1 2016-02-18T13:30:09 Add initializer function to more texture formats All GL RGB formats that ANGLE stores as RGBA formats under the covers need to have their alpha channel set to 1. See GLES 3.0.4 table 3.24 for the relevant spec. In some cases, this is handled by the dataInitializerFunction associated with the format. Previously, some texture formats had the function set correctly, but not all. Associating formats with the datainitializerFormat is now a responsibility of the gen_texture_format_table.py script. The new automation there makes sure that all GL RGB formats emulated with RGBA formats get a data initializer function. Tests are added in end2end_tests for most of the RGB formats. BUG=angleproject:1318 TEST=angle_end2end_tests Change-Id: Iad860357f33d87c625445ea6c58a53af47e0b547 Reviewed-on: https://chromium-review.googlesource.com/328253 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho bce743ab 2016-01-15T17:18:28 Use texture base level to implement textureSize on D3D11 HLSL HLSL GetDimensions call doesn't take the texture base level into account, so ANGLE needs to use the texture base level passed in uniforms to emulate ESSL textureSize() which does take it into account. After this change the relevant dEQP tests pass on NVIDIA, Intel is still suffering from an issue where a wrong value is returned when the lod is > 0 (tested on Intel HD Graphics 4600). AMD is also suffering from an unknown issue. BUG=angleproject:596 TEST=dEQP-GLES3.functional.shaders.texture_functions.texturesize.* (all pass on NVIDIA now), angle_end2end_tests Change-Id: I13e33d126008ecdf2b89461a3fb5040949cf19e2 Reviewed-on: https://chromium-review.googlesource.com/322123 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Geoff Lang e0cc2a4a 2016-01-20T10:58:17 Enable all angle_end2end_tests targeting OpenGL and OpenGL ES backends. Added failure supressions and filed bugs for failing tests. BUG=angleproject:1145 BUG=angleproject:1289 BUG=angleproject:1291 BUG=angleproject:1292 BUG=angleproject:1293 BUG=angleproject:1296 Change-Id: Ida78ba855500fe8a6ce6154d43ee01520330e3b1 Reviewed-on: https://chromium-review.googlesource.com/322695 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Austin Kinross d544cc9f 2016-01-11T15:26:42 Fail any ANGLE test if it outputs D3D11 SDK message in debug mode Also: - Disable some Feature Level 9_3 tests that trigger SDK messages - Fix a debug object name issue. If you try to assign a debug name to an object twice then you get an SDK warning message. This can occur if you 'create' two objects (e.g. Rasterizer States) with identical DESCs on the same device, since D3D11 can optimize this and return the same object both times. - Disable the message checks in Line Loops tests, since the tests trigger incorrect D3D11 SDK messages on Win7 machines BUG=angleproject:667;angleproject:1282 Change-Id: I7284fb3a11377afde24e0014e21dbcea80ebb126 Reviewed-on: https://chromium-review.googlesource.com/321393 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Tested-by: Austin Kinross <aukinros@microsoft.com>
Olli Etuaho a7416ff7 2016-01-18T12:22:55 Fix texture completeness check when base level > 0 is used ANGLE would previously treat a texture as incomplete whenever its base level was above 0. This was because the base level wasn't being taken into account correctly when determining what size the image at a specific mip level should be. Fix this by taking the base level into account when determining the expected size. BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: I4b05514aed2858797ea46cf3570c3c40e5efc508 Reviewed-on: https://chromium-review.googlesource.com/322132 Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho c8c99a0a 2016-01-14T16:47:22 Add a texture test with a mix of different sampler types This test makes sure that even if sampler / texture registers get grouped together based on type in the HLSL backend of the shader translator, the D3D renderer still has the right register index information for each ESSL sampler. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: Id09f96cfa903cd20c8e7229980fa363bb07b6045 Reviewed-on: https://chromium-review.googlesource.com/322200 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 1a679900 2016-01-14T12:21:47 Test shadow sampler + 3D sampler in the same shader Shadow samplers use a different sampler object type in D3D11 HLSL than other ESSL samplers. They need to be able to coexist in the same shader. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: I960f6a41c0237ed912b072527e14aebeca98cf7c Reviewed-on: https://chromium-review.googlesource.com/322120 Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Olli Etuaho 51f1c0f0 2016-01-13T16:16:24 Add a workaround for default framebuffer sometimes being SRGB On some GL driver/window system combinations the default framebuffer may do SRGB conversion, which affects the values written there by draw operations and read by readPixels. This is known to happen at least on some Intel systems. For this reason, use an FBO with a known format instead in the texture end2end tests. This enables turning on most TextureTest cases on the OpenGL backend. Tested on Intel HD 4600. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: I5a39bd1dadf15b7c52793a0f66d67e9f61618b83 Reviewed-on: https://chromium-review.googlesource.com/321612 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 19d48db1 2016-01-13T14:43:21 Fix incorrect delete function call in TextureTest The test must call glDeleteBuffers to delete a buffer instead of glDeleteTextures. This was one reason behind the texture tests failing on the GL backend. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: I67042f6948146f3c3fca9e01231b0c4935a6f08d Reviewed-on: https://chromium-review.googlesource.com/321611 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 5faa15bf 2016-01-11T13:32:48 Fix null sampler warning in TextureTest.TextureNPOT_GL_ALPHA_UBYTE The test deliberately tries to render a scene using an invalid texture. ANGLE rendered this correctly, but when it bound the dummy 1x1 black texture that's used instead of invalid textures, it didn't bind a sampler state. This meant that D3D had no pixel shader samplers bound, and outputted a debug warning. Also, technically the test should have been setting GL_UNPACK_ALIGNMENT=1, but that wasn't impacting the result of the test. BUG=angleproject:1248 Change-Id: I871706d518077ea840a585ae0df8f9176e130cb1 Reviewed-on: https://chromium-review.googlesource.com/321391 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 2173db3d 2016-01-12T13:55:14 Add sampler array tests This adds some coverage for samplers that is missing from dEQP. The shaders in the added tests both have a sampler array with two samplers. The test shaders sample both textures, add up the results, and the tests then check that the results of the shaders are correct. Only constant indexing is used to access the sampler arrays. One test accesses the sampler array in the main function, another one first passes the array as a parameter to a user-defined function. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: I9a0100705ac0da4905d50da37c0149fdbdd24c42 Reviewed-on: https://chromium-review.googlesource.com/321623 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4644a20b 2016-01-12T15:12:53 Add a test for sampler as a function parameter This adds some coverage for samplers that's missing from dEQP. The test shader passes a sampler to an user-defined function, samples the texture there and sets the returned sample to gl_FragColor. The test then checks that the shader result is correct. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: I2cc511e591a4af01515c6fb38fd43c5f15337bcb Reviewed-on: https://chromium-review.googlesource.com/321622 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 53a2da13 2016-01-11T15:43:32 Test drawing with a shader with two different sampler types This adds some test coverage that's missing from dEQP. The test uses two different samplers in a shader, a cube map sampler and a 2D texture sampler, adds the sampling results together and checks if the result is correct. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: If21e24c964fc208b5d1ccd446834dabf13194944 Reviewed-on: https://chromium-review.googlesource.com/321621 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4a8329f2 2016-01-11T17:12:57 Refactoring: Split TextureTest to multiple classes This removes the cube map setup and the draw scale parameter from the tests that don't need them, and reuses the code for setting up the window and the shader program for most of the texture tests. The tests are now structured as follows: TexCoordDrawTest: Test class that sets up a shader program for drawing with texture coordinates. Vertex shader source can be overridden in subclasses, and fragment shader source must be specified in subclasses. Texture2DTest: Inherits TexCoordDrawTest, sets up a 2D texture and a shader for drawing from it. Texture2DTestWithDrawScale: Inherits Texture2DTest, adding a scale parameter that scales the quad that gets drawn. TextureCubeTest: Inherits TexCoordDrawTest, sets up a cube map and a 2D texture and a shader for drawing from them. Texture2DArrayTestES3: Inherits TexCoordDrawTest. Reserves a texture ID and sets up an ESSL3 shader for drawing from a 2D texture array. Also add a few comments about where things being tested are specified. Also, ANGLETest::drawQuad parameter names are renamed to make their meaning clearer. The parameters affect the vertex shader attribute values, which the shader may use for other things besides setting the vertex position. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: Id673e36d5883aaaf47f2f830c2a1ad0ca293d578 Reviewed-on: https://chromium-review.googlesource.com/321620 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 183d7e24 2015-11-20T15:59:09 Remove predefined precision qualifiers from ESSL3 samplers New sampler types in ESSL3 should not have default precision qualifiers. This is specified in ESSL 3.00.4 section 4.5.4. BUG=angleproject:1222 TEST=angle_unittests Change-Id: I9c8e7a5fbb4278db80de79bcaeebaf23e64242a0 Reviewed-on: https://chromium-review.googlesource.com/312048 Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Austin Kinross 08528e17 2015-10-07T16:24:40 glTexSubImage2D should always allow non-power-of-two inputs If GL_OES_texture_npot isn't active then ANGLE currently prevents calls to glTexSubImage2D with: - level > 0 - width/height NPOT This isn't correct. It is legitimate to supply data to a NPOT subregion of a POT texture via glTexSubImage2D. Fixes these dEQP tests on 9_3: dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.a8_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.a8_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.l8_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.l8_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.la88_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.la88_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgb565_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgb565_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgb888_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgb888_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgba4444_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgba4444_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgba5551_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgba5551_cube dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgba8888_2d dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.rgba8888_cube Change-Id: I5889a27edbfa807995fa20b16f36456f676b80fc Reviewed-on: https://chromium-review.googlesource.com/304612 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1ea9aaad 2015-10-07T11:13:55 Add suppressions for several Intel failures. Also add a new test for UBOs to end2end_tests. BUG=540538 Change-Id: I6ffa6ba061a2c33811c65719deaa4302f1dbd704 Reviewed-on: https://chromium-review.googlesource.com/304521 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 412f17da 2015-09-25T08:43:54 Suppress TextureLimitsTest.MaxCombinedTextures on Intel GL. This test probably triggers a driver bug. BUG=angleproject:1123 Change-Id: I81921e7faf51ac60f1175a04ee17e920a346059d Reviewed-on: https://chromium-review.googlesource.com/302461 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3d3d2f20 2015-09-23T16:47:51 Re-re-land "Move sampler validation to the GL layer." This previously was D3D-only, but is required for every draw call. This completes the work of removing the D3D-specific Impl methods from ProgramImpl. Also add several regression tests to cover texture and sampler validation. Re-land with a fix for duplicate sampler active uniforms. Re-re-land with a fix for a test comparison warning on Linux. BUG=angleproject:1123 Change-Id: Iaf7b33861c07b9ceed4bd53ac2f010d35f05df45 Reviewed-on: https://chromium-review.googlesource.com/301712 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6d246510 2015-09-23T18:04:10 Revert "Re-land "Move sampler validation to the GL layer."" Build failure on Linux: In file included from ../../third_party/angle/src/tests/gl_tests/UniformTest.cpp:7: In file included from ../../third_party/angle/src/tests/test_utils/ANGLETest.h:10: ../../testing/gtest/include/gtest/gtest.h:1392:16: error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare] if (expected == actual) { ~~~~~~~~ ^ ~~~~~~ ../../testing/gtest/include/gtest/gtest.h:1422:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here return CmpHelperEQ(expected_expression, actual_expression, expected, ^ ../../third_party/angle/src/tests/gl_tests/UniformTest.cpp:487:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here EXPECT_EQ(GL_SAMPLER_2D, type); ^ BUG=angleproject:1123 This reverts commit 6cbf4385280c4c1dd97f0882ecb18dbc4c341fd4. Change-Id: I95279b37d253e3ea78faa53f3773f2dc3d17df95 Reviewed-on: https://chromium-review.googlesource.com/302030 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6cbf4385 2015-09-22T19:12:11 Re-land "Move sampler validation to the GL layer." This previously was D3D-only, but is required for every draw call. This completes the work of removing the D3D-specific Impl methods from ProgramImpl. Also add several regression tests to cover texture and sampler validation. Re-land with a fix for duplicate sampler active uniforms. BUG=angleproject:1123 Change-Id: Iefef06e7901873c98bf2ba7864efd16a4c6435d3 Reviewed-on: https://chromium-review.googlesource.com/301581 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3aa23a7c 2015-09-22T19:03:33 Revert "Move sampler validation to the GL layer." Probably causing failures in the dEQP-GLES2 GL back-end tests: dEQP-GLES2.functional.uniform_api.info_query.basic.sampler2D_both BUG=angleproject:1123 This reverts commit 6fa156b66da2090c98f1a044a948694c7ac83324. Change-Id: I3cc993c34aae4a108037ce81709b71d16ece814e Reviewed-on: https://chromium-review.googlesource.com/301580 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6fa156b6 2015-09-22T10:17:01 Move sampler validation to the GL layer. This previously was D3D-only, but is required for every draw call. This completes the work of removing the D3D-specific Impl methods from ProgramImpl. Also add several regression tests to cover texture and sampler validation. BUG=angleproject:1123 Change-Id: I167cbc8f47b4a397d2ae6cc507bdac35168bcacd Reviewed-on: https://chromium-review.googlesource.com/299400 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2453dbcb 2015-07-14T11:35:42 Fix 2D array texture redefinition. Only happens with texture formats that require initialization. BUG=angleproject:1069 TEST=dEQP-GLES3.functional.texture.format.sized.2d_array.* all pass Change-Id: I215d1262cddcde4ed218b6f023e67747cbc3eeaf Reviewed-on: https://chromium-review.googlesource.com/285347 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@google.com>
Corentin Wallez 322653bf 2015-06-17T18:33:56 Fix Chromium build of angle_end2end_tests BUG=angleproject:892 Change-Id: I9922046fc9e4d82d7034405f5952263f982c6529 Reviewed-on: https://chromium-review.googlesource.com/278159 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang c422207e 2015-05-25T13:19:48 Disable some tests due to failures on Intel OpenGL. BUG=angleproject:884 Change-Id: Iceb571807a2232dae22703953e12e1af4bba5a87 Reviewed-on: https://chromium-review.googlesource.com/273029 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang f34d1db9 2015-05-20T14:10:46 Add table entries for almost all the remaining GL texture formats. BUG=angleproject:884 BUG=angleproject:967 Change-Id: I113757dd9e1fae8fe0241a7286be979a90891b53 Reviewed-on: https://chromium-review.googlesource.com/270275 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/273135
Geoff Lang 859dcb88 2015-05-25T15:12:54 Revert "Add table entries for almost all the remaining GL texture formats." Missing include of <limits> for linux. This reverts commit aa3a5fadebb2bad0be07eb2963a9d23f901c4c49. Change-Id: Iafebfbc6154b4fe3a94e3f8b91b5ff496631c1f1 Reviewed-on: https://chromium-review.googlesource.com/273134 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang aa3a5fad 2015-05-20T14:10:46 Add table entries for almost all the remaining GL texture formats. BUG=angleproject:884 BUG=angleproject:967 Change-Id: I0b05841272f4410c33ee4e4c3654846f07b7c39b Reviewed-on: https://chromium-review.googlesource.com/270275 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 08a8438f 2015-05-20T14:08:07 Remove un-needed swapBuffers calls in the tests. If a glReadPixels is done after a swapBuffers, it's results are often undefined. bug=angleproject:967 Change-Id: I4a99ca47624347ecbc0a5c084e93b997c92e1b31 Reviewed-on: https://chromium-review.googlesource.com/272423 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez d3970de4 2015-05-14T11:07:48 Move ANGLETest back in test_utils, leaving a proxy header for Chromium BUG=angleproject:892 Change-Id: Ibd494813be87e996096077d6e208cc92461b8f49 Reviewed-on: https://chromium-review.googlesource.com/271154 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez ac3ab882 2015-05-12T13:31:28 Temporarily move back ANGLETest in end2end_tests This path needs to a Chrome change before it can change. BUG=angleproject:892 Change-Id: I549737383b9720a2e7d83ee5e3145d71716f04cb Reviewed-on: https://chromium-review.googlesource.com/270457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 9cb9583e 2015-05-11T10:21:48 Move end2end and standalone tests to gl_tests and egl_tests Also introduce a test_utils directory that contains helpers used for all types of tests. BUG=angleproject:892 Change-Id: I9e1bff895020ffd3a109162283971a290a1098bd Reviewed-on: https://chromium-review.googlesource.com/270198 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>