util/shader_utils.cpp


Log

Author Commit Date CI Message
Amirali Abdolrashidi 5f9548c3 2023-05-19T11:51:04 Vulkan: Free the garbage memory before realloc Currently image allocations fall back to system memory in case of a device OOM. However, in some cases, it is also possible to gain some memory by freeing garbage memory from the device. This allows us to keep the allocation on the device memory. * Updated the image allocation fallback, so we will try cleaning the garbage memory through the renderer before retrying the allocation. * finishOneCommandBatchAndCleanup() in RendererVk, which will call a similar function in its CommandQueue. It will be called until there are no more in-flight submissions. * The existing finishOneCommandBatchAndCleanup() in CommandQueue has been renamed to finishOneCommandBatchAndCleanupImpl(). * Updated the flags used for VMA image allocations. If any device memory is freed after garbage cleanup to make enough space for the new allocation, it will take precedence over the system memory. * Added unit tests in which a new image allocation could happen on the device after freeing the garbage memory. * They use a 2D texture and a 2D texture array for garbage. Bug: b/280304441 Change-Id: Ia5e605e180833b44af8c77550ab1b0b8ba21724e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4547941 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 1d04539f 2022-09-06T15:20:32 Fix xfb tests rendering points Some xfb tests render points and verify a coordinate away from the points is unchanged as a means to break the render pass. Due to lack of output to gl_PointSize, these tests are flaky on SwiftShader. Bug: angleproject:7625 Change-Id: I7347516bb755ace87d57df3467c59055f28f1d69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877783 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny c394adfc 2022-08-11T10:43:14 ANGLE: reorder program and shader creation When MEC re-creates the program creation, it first creates the program, and then the shader stages, and since the Handles are handed out from the same handle allocator, the numbers are different if the creation order is different. Since the logic to capture a shader program is more involved to be changed, re-arrange the calls in CompileProgramInternal. Bug: angleproject:7564 Change-Id: I28617cc67e7ca59d8ce181785cc159fe876655b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3826257 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Jamie Madill ca96cba9 2022-06-16T11:33:14 Make ReadEntireFileToString return a std::string. Note: this makes the method unavailable for export from angle_util, which is probably why it was designed the way it was in the first place. However, we import the test utils source file as a static lib into each test executable and test shared module, so it works. Bug: angleproject:7404 Change-Id: Ia957268882c2b8529643660d7d4f34d142c0dc43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3708602 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi b0d75fb5 2022-05-31T16:55:23 Vulkan: Use 64-bit counters Some upcoming counters don't fit in 32 bits. Bug: angleproject:5881 Change-Id: I2de8a603cabdb5f7417c29d5f37a50899485d6d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3679488 Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 389ae6b9 2022-05-09T08:44:50 Add extension for read-only DS feedback loops. This will facilitate testing. Also moves some feedback loop tests from FramebufferTest to a specialized test class. Bug: angleproject:4778 Bug: angleproject:4969 Change-Id: I61235f2663a58644bf506254a869f550f1706de3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634726 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3739a195 2022-03-09T13:56:36 perf tests: Record perf counter metrics. This adds a new command line argument that will allow the user to specify perf counters to record into the test output. Bug: angleproject:4918 Change-Id: Ia7432ff96eadf13ef681f67d2d503d00fd83e06e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516970 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 68f06888 2021-03-23T16:38:50 Perf Tests: Trigger test failure on API errors. A prior refactor had broken the method we used to cause test steps to fail on API errors. This CL restores the path. We detected this when analyzing a particular GLES trace that contained invalid GLES calls. Bug: angleproject:5788 Change-Id: I26940e49cf73ce6050ea6ee274d5c5748835a167 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2782008 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Mohan Maiya dd5705e7 2021-03-24T08:18:24 Add missing qualifier type handling in translator Translator checks tessellation shader unsized array type qualifier. sample in/sample out were missing in handling qualifier type. Bug: angleproject:5557 Test: GLSLTest_ES31.VaryingTessellationSampleInAndOut* Change-Id: I8a2f2c4c4fcc9cc88000d3b2d448ab51fb9e5d38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2776263 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi bc82325e 2020-11-24T21:58:30 Fix RedGreenGradient to not output 0 for half the image The shader directly used v_position.xy as output color, but for half of the image x and y are negative and the respective channel became zero. This change makes the shader use v_position.xy*0.5+0.5. Additionally, the tests that use this shader are changed to mathematically derive the pixel colors instead of using magic numbers. Bug: angleproject:5395 Change-Id: Ic11c362c22ca725aa173faa5fd6033a02a4303fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2559265 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9a47fe71 2020-10-26T10:43:45 Use 4 colors in Checkered test shader This shader previously output red and green in a checkered pattern (with four regions). This makes it hard to verify that the output is not rotated / flipped. This change makes the shader output: +--------+--------+ | red | blue | +--------+--------+ | green | yellow | +--------+--------+ Bug: angleproject:4901 Change-Id: I02723306dec17d1419f11d9f76e96b1cefc3bf06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2498261 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ba7f8913 2020-09-12T23:23:01 Samples: Enable Debug callback. This moves the debug callback code into a common location. For ease of access it's in shader_utils since that file has access to the GL API. Bug: angleproject:5040 Change-Id: Iab9de47c2d520a5618ea6825852f8afa63565c8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408715 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tim Van Patten 5559351c 2020-08-11T14:23:32 Vulkan: Correctly determine mip level in resolveColorWithCommand() FramebufferVk::resolveColorWithCommand() is currently using the wrong mip level value by using the GL index value, rather than calculating the VK value from (index value - the base level). Bug: angleproject:4753 Test: FramebufferTest_ES31::MultisampleResolveIntoMipMapWithBlit() Change-Id: I8ddaeb21c4957b46880f5ef5f6a78242c04b4dcd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2349951 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 15cff312 2020-06-10T22:44:22 Move lod-sampling shaders to shader utils Will be reused in a test in a following change. Bug: angleproject:2914 Change-Id: I4e255d5c762f2a6c064b06c558519d82ec6ead5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2239085 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Alexis Hetu 73bf99b7 2020-04-29T16:20:09 Fix clearing the program's validation-related cache too early When attempting to link a new program, the program must be marked as unlinked, but the validation-related caching should not be cleared yet, since we can still use the previously linked program if linking fails at this point. Added an angle end2end test which fails without this fix and passes with this fix. Fixes the following WebGL 1.0.4 test with SwANGLE: conformance/programs/program-test.html Bug: angleproject:3557 Change-Id: Ib6722ba88803979e8f292c9b7b81f85cc0304662 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2173538 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Cody Northrop f623bd2e 2020-04-14T10:35:13 Tests: Add program pipeline object tests This CL adds two program pipeline object (PPO) tests based on code inspection during review. They are both disabled awaiting fixes. * The first (DetachAndModifyShader) tests a bug that shaders aren't detached immediately on call. * The second (DifferentTextureTypes) tests PPOs with mismatched texture types. They should not link if the programs use a texture in non-matching ways. Test: ProgramPipelineTest31.DetachAndModifyShader* Test: ProgramPipelineTest31.DifferentTextureTypes* Bug: b/151462886 Bug: b/151449648 Bug: angleproject:3570 Change-Id: Ief0937397d31c972bf5e3a8d56b02d2dbd5a604b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2146997 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 95a736bd 2019-10-09T10:26:25 Reland "Add more test_utils functions." This is a reland of 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c Re-land uses static linking with angle_util. The root cause of the CFI error wasn't solved. Static linking works around the problem by not using any export rules. Second re-land fixes missing imports for libEGL and libGLESv2 static varieties. Original change's description: > Add more test_utils functions. > > Includes methods for creating temporary files, deleting files, and > reading files into a string. Also renames GetPathSeparator to mention > it's only used for environment variables. Includes a new virtual type > angle::Process that will be used to implement cross-platform async > Process launching for tests. Also includes a way to specify a custom > crash handler callback. > > Also adds a few unit tests for the new functionality. They are disabled > on Android because the functions are not needed by the new test runner. > > Bug: angleproject:3162 > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Bug: chromium:1015810 Bug: angleproject:3162 Change-Id: I2a18b819b0f91df610ad12ffedea2b38349fe7cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879859 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 1efcbdb6 2019-10-22T12:32:04 Vulkan: Fix sampler object lifetime. Using the same scheme as we do for VkImageViews we can track VkSampler lifetime using SharedResourceUse. This fixes the race condition that could occur when samplers are deleted in one Context while being used in another. This fixes the last known resource lifetime issue. The multithreading tests should now pass without validation errors. Also adds regression tests to angle_end2end_tests. Bug: angleproject:2464 Change-Id: I9dbed5062a0863b240ddf1a9b5d28560334934de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869548 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill f939cb63 2019-10-20T21:44:36 Revert "Reland "Add more test_utils functions."" This reverts commit 7923e234bc458eda5936b8cb4f09fa19e28c0452. Reason for revert: Fails compilation on rollers: [2097/6048] SOLINK ./lib_angle_unittests__library.cr.so FAILED: lib_angle_unittests__library.cr.so lib_angle_unittests__library.cr.so.TOC lib.unstripped/lib_angle_unittests__library.cr.so python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../third_party/android_ndk/toolch...(too long) ld.lld: error: undefined symbol: glCreateShader >>> referenced by shader_utils.cpp >>> angle_util_static/shader_utils.o:(CompileShader(unsigned int, char const*)) in archive obj/third_party/angle/libangle_util_static.a ld.lld: error: undefined symbol: glShaderSource Original change's description: > Reland "Add more test_utils functions." > > This is a reland of 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c > > Re-land uses static linking with angle_util. The root cause > of the CFI error wasn't solved. Static linking works around > the problem by not using any export rules. > > Original change's description: > > Add more test_utils functions. > > > > Includes methods for creating temporary files, deleting files, and > > reading files into a string. Also renames GetPathSeparator to mention > > it's only used for environment variables. Includes a new virtual type > > angle::Process that will be used to implement cross-platform async > > Process launching for tests. Also includes a way to specify a custom > > crash handler callback. > > > > Also adds a few unit tests for the new functionality. They are disabled > > on Android because the functions are not needed by the new test runner. > > > > Bug: angleproject:3162 > > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > > Commit-Queue: Jamie Madill <jmadill@chromium.org> > > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > > Bug: chromium:1015810 > Bug: angleproject:3162 > Change-Id: I6a2c1e7b585a13ca846759f32da0777c00d7f7e6 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869541 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=ynovikov@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: I975b2214411906cb981bffa04fa50e0a65ff8b4e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1015810, angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1870811 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7923e234 2019-10-09T10:26:25 Reland "Add more test_utils functions." This is a reland of 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c Re-land uses static linking with angle_util. The root cause of the CFI error wasn't solved. Static linking works around the problem by not using any export rules. Original change's description: > Add more test_utils functions. > > Includes methods for creating temporary files, deleting files, and > reading files into a string. Also renames GetPathSeparator to mention > it's only used for environment variables. Includes a new virtual type > angle::Process that will be used to implement cross-platform async > Process launching for tests. Also includes a way to specify a custom > crash handler callback. > > Also adds a few unit tests for the new functionality. They are disabled > on Android because the functions are not needed by the new test runner. > > Bug: angleproject:3162 > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Bug: chromium:1015810 Bug: angleproject:3162 Change-Id: I6a2c1e7b585a13ca846759f32da0777c00d7f7e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869541 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lan Wei 0cb09633 2019-10-18T15:50:10 Revert "Add more test_utils functions." This reverts commit 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c. Reason for revert: 1 Test Suite(s) failed. angle_unittests failed because of: TestUtils.RunApp on Linux CFI https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI Original change's description: > Add more test_utils functions. > > Includes methods for creating temporary files, deleting files, and > reading files into a string. Also renames GetPathSeparator to mention > it's only used for environment variables. Includes a new virtual type > angle::Process that will be used to implement cross-platform async > Process launching for tests. Also includes a way to specify a custom > crash handler callback. > > Also adds a few unit tests for the new functionality. They are disabled > on Android because the functions are not needed by the new test runner. > > Bug: angleproject:3162 > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> TBR=ynovikov@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: I1441bfbae31712f72b4aebeeea9cd711c3975a5d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869254 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5fcfcea4 2019-10-09T10:26:25 Add more test_utils functions. Includes methods for creating temporary files, deleting files, and reading files into a string. Also renames GetPathSeparator to mention it's only used for environment variables. Includes a new virtual type angle::Process that will be used to implement cross-platform async Process launching for tests. Also includes a way to specify a custom crash handler callback. Also adds a few unit tests for the new functionality. They are disabled on Android because the functions are not needed by the new test runner. Bug: angleproject:3162 Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 88596bea 2019-06-13T14:17:48 Vulkan: Implement a texture descriptor cache. We noticed a significant hotspot in vkAllocateDesctiptorSets. The app was repeatedly cycling through a few combinations of active textures. For each state change in ANGLE we were allocating a new desctiptor set. This in turn would trigger internal driver memory allocation and cause jank. Using a cache avoids allocations entirely since the application is rotating through a stable set of textures. The descriptor cache is stored in each program. It is indexed by a set of 32-bit serials. Each texture generates a unique serial for every combination of VkImage and VkSampler that the texture owns. The texture descriptor is refreshed every time a texture changes or is rebound. The descriptor cache is accessed via an unoredered map with the texture serial sets as the hash key. We also store the maximum active texture index in the cache key so we don't need to hash and memcmp on all 64 active textures. This will currently fail if more than MAX_UINT serials are generated. But that number is high enough that it shouldn't be possible to hit in practice in a practical amount of time. Requires shifting the texture sync to ContextVk so we can get the new serial after the textures are updated. And to make sure to update the image layouts even if the descriptors are not dirty. Improves performance of the T-Rex demo. Also improves the score of the texture state change microbenchmark by about 40%. Bug: angleproject:3117 Change-Id: Ieb9bec1e8c1a7619814afab767a1980b959a8241 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642226 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 0a56f0e3 2019-05-14T17:07:27 Vulkan: Update front face mode during syncState() When handling DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING in syncState(), the call to update the front face was missing, so culling could be enabled for the wrong front faces. Bug: angleproject:3237 Test: Verify 3D apps render (more) correctly Test: New SimpleStateChangeTest end2end tests Change-Id: I1d94a977bea9e48d90b5346861e5565d2371cadd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1611753 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi f2a1c384 2019-05-21T16:32:49 Vulkan: Implement multisampled framebuffers Simultaneously implements ANGLE_framebuffer_multisample and ES3 multisampled framebuffers. Additionally, implements ES3 framebuffer blitting where multisampled framebuffers are involved. Bug: angleproject:3203 Bug: angleproject:3204 Bug: angleproject:3200 Change-Id: I5694a30f71168e807688a9568e3742b81d907918 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1622667 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 35cd7332 2018-12-02T12:03:33 Refactor test shader style. This change enforces a lot more consistency. We pass const char * to the Compile functions instead of std::string. Also fixes the indentation of C++11 block comments to be more consistent. Bug: angleproject:2995 Change-Id: Id6e5ea94055d8cbd420df4ea2e81b2d96cb5ce78 Reviewed-on: https://chromium-review.googlesource.com/c/1357103 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yizhou Jiang 7818a85c 2018-09-06T15:02:04 Implement GL_ANGLE_texture_multisample API part Support GL_ANGLE_texture_multisample extension. This patch adds enums of multisampled texture and texStorage2DMultisampleANGLE API. TEST=angle_end2end_tests.exe --gtest_filter=TextureMultisampleTest* TEST=angle_end2end_tests.exe --gtest_filter=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: I2cab997edc33aa2d0be6082381545335423f64e0 Reviewed-on: https://chromium-review.googlesource.com/c/804613 Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 624fbdcf 2018-10-01T11:54:05 Refactor CompileProgram utility Tests often need to call gl functions to set up program related state after glCreateProgram has been called but prior to glLinkProgram is called. Add a callback function to the CompileProgram utility function to fulfill this need. This reduces code duplication considerably in several tests. An alternative way to improve CompileProgram would be to split it into several different utility functions. This might be slightly easier to read, but would also be a larger refactoring and require more checks at the call site. This will make it easier to implement EXT_blend_func_extended tests, which need to bind fragment outputs to different slots. BUG=angleproject:1085 TEST=angle_end2end_tests Change-Id: I3ac8b7bdc21c6a1f14517bc7df0cf6f35abd7612 Reviewed-on: https://chromium-review.googlesource.com/1254062 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill b36a4816 2018-09-25T10:15:11 Vulkan: Add OpenGL line segment rasterization. Line rasterization rules are implemented using a shader patch. The patch does a small test and discards pixels that are outside of the OpenGL line region. The feature is disabled on Android until we can determine the root cause of the test failures. Bug: angleproject:2598 Change-Id: Ic76c5e40fa3ceff7643e735e66f5a9050240c80b Reviewed-on: https://chromium-review.googlesource.com/1120153 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
jchen10 a155bacf 2018-08-16T15:26:39 ParallelCompile: Parallelize shader translation This changes to construct a new ShHandle of compiler for each Shader, and use it to translate the shader source in a background thread. Bug: chromium:849576 Change-Id: Ib49952c7292321ee6aa1c5996f8f7927f40d8f04 Reviewed-on: https://chromium-review.googlesource.com/1177195 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho dff32a0d 2018-08-28T14:35:50 Support multisample arrays in shader programs The added tests check that using textureSize() and texelFetch() on textures with a fixed point format return expected results. texelFetch is also covered for integer format textures. dEQP GLES 3.1 tests also cover a variety of multisampled array texture formats. BUG=angleproject:2775 TEST=angle_end2end_tests, angle_deqp_gles31_tests Change-Id: I99b422e24b39e3563ed72f0fb85c9c1907df807d Reviewed-on: https://chromium-review.googlesource.com/1196521 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 7ae70d8f 2018-07-06T13:47:01 ParallelCompile: Parallelize D3D linking This adds a new linking state to Program. If a Program is in linking state, on the one hand the foreground thread may continue issuing more GL calls, and on the other hand the background linking threads may be accessing Program internally too. Without a proper constraint there must be conflicts between them. For this purpose, we block any further GL calls to Program until it's actually linked. In addition, we prohibit parallel linking an active program, so that ProgramD3D does not have to worry about such similar conflicts. Also changes the WorkerThread to support limiting the number of concurrently running worker threads. BUG=chromium:849576 Change-Id: I52618647539323f8bf27201320bdf7301c4982e6 Reviewed-on: https://chromium-review.googlesource.com/1127495 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 5804dc8e 2018-04-13T14:11:46 Refactor GL tests to use a shader library Instead of having the same simple shaders repeated over and over in the test code, reuse a single shader library. BUG=angleproject:2474 TEST=angle_end2end_tests Change-Id: I13f8ca8c0125e6d30f1761639bf8c3f69e0e77d2 Reviewed-on: https://chromium-review.googlesource.com/1012078 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao 4ed05da2 2018-02-02T14:26:15 ES31: Add link validation on geometry shader itself This patch intends to support program link validation on geometry shader itself. A link error should occur when linking a program with a geometry shader that lacks input primitive or output primitive or the declaration of 'max_vertices'. This patch also adds the support of linking a program with geometry shader in angle_end2end_tests. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.shaders.linkage.es31.geometry.varying.rules.unspecified_* Change-Id: I25fb08514753102f5dd3ab86211c05d2ca4fd185 Reviewed-on: https://chromium-review.googlesource.com/898842 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 401345e4 2017-08-21T10:52:40 D3D11: Move more state into StateManager11. This moves the input layout cache and vertex and index data managers and related info into the state manager. This makes it easier to manage the state application with regards to dirty bits. Also updates the dirty current value handling in StateManager11. BUG=angleproject:1156 BUG=angleproject:2052 Change-Id: I8de968a1f8416363aa1c49d9e9da129942d21275 Reviewed-on: https://chromium-review.googlesource.com/616783 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill bd044ed8 2017-06-05T12:59:21 Defer shader compiles when possible. When using the program binary memory cache inside ANGLE, this will give a potential fast path. If the user doesn't query the shader compile status or info log before calling LinkProgram, then we can check the program cache before translating the program, and if it finds a hit, we don't even need to call the translator. To preserve the shader settings at compile time, a reference to the current shader translator is kept in a binding pointer on the call to compile. This mirrors a similar implementation in Chromium's command buffer. Also the compile options and source are cached at compile to preserve the correct shader state. BUG=angleproject:1897 Change-Id: I3c046d7ac8c3b5c8cc169c4802ffe47f95537212 Reviewed-on: https://chromium-review.googlesource.com/517379 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a7d12dc7 2016-12-13T15:08:19 Store uniform block bindings in program binaries. This affects all back-ends - we weren't saving this. Note that bindings can only be set after program linking. The spec is fairly clear in that any programs saved must be loadable and runnable under the same set of state, which would include block bindings. Also add validation for zero binary formats in GetProgramBinary. Also add a workaround for AMD where the block bindings were not applied properly after link, similarly to our original bug. This CL also includes a few fixups for GLProgram (raii). BUG=angleproject:1637 Change-Id: Iae068eb4e1e4c763aa9f9332c033e38708026c8f Reviewed-on: https://chromium-review.googlesource.com/418393 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 4c4c8e72 2016-08-04T12:25:34 Add compute program compilation and linking support Compute shaders can be now compiled and linked to create programs. Some tests are added to verify successful and unsuccessful compute shader linking. The patch also replaces std::array<int, 3> with a custom struct WorkGroupSize. BUG=angleproject:1442 TEST=angle_end2end_tests TEST=angle_unittests Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84 Reviewed-on: https://chromium-review.googlesource.com/366740 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 67946766 2016-03-08T15:43:55 Improve info log length checks Extend the info log length checks to shader_utils used by tests, and treat info log with length 1 as empty, since it can only include the null terminator. At least the Intel GL driver may generate "\0" as info log in some situations, for example when compiling a user-defined function with 50000 parameters. BUG=angleproject:1323 Change-Id: I00f2965539ec235cb949c80c2a9e1d063d32fa15 Reviewed-on: https://chromium-review.googlesource.com/331461 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 90c253a6 2015-12-15T15:14:08 Add an instancing perf test. BUG=526217 BUG=angleproject:1164 Change-Id: Ia353a3b2fa0ab0e8b7fd15d72bb63e5ecb7833b1 Reviewed-on: https://chromium-review.googlesource.com/301469 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez f0ca9a0c 2015-09-14T11:53:10 Remove the usage of some c++11 library features That were causing compilation error in Chromium Mac builds BUG=angleproject:891 Change-Id: I45777451b300928e8c8d232a5b7ecffa7f1c3cbe Reviewed-on: https://chromium-review.googlesource.com/299721 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill ca03b35c 2015-09-02T12:38:13 Re-land "Compute packed varyings in ProgramD3D only." Instead of storing varying information in the shader, use a temporary set when linking a D3D program. This also means we won't have to modify information in the Shader object when linking a D3D program. This completes the refactoring for PackedVaryings. Re-land with fix for missing init of PackedVarying::vertexOnly. BUG=angleproject:1123 Change-Id: If110809c3817d88b0370ac575d739d7385b067d9 Reviewed-on: https://chromium-review.googlesource.com/296731 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c437046f 2015-09-01T17:27:40 Revert "Compute packed varyings in ProgramD3D only." Likely the cause of Windows bot failures. BUG=angleproject:1123 This reverts commit 532061bbfb160586a06f0e47b6bbb5350e735203. Change-Id: Ia4f0161b97bfbf2adb4cafaa5fa5484f04fad245 Reviewed-on: https://chromium-review.googlesource.com/296710 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 532061bb 2015-08-31T15:16:45 Compute packed varyings in ProgramD3D only. Instead of storing varying information in the shader, use a temporary set when linking a D3D program. This also means we won't have to modify information in the Shader object when linking a D3D program. This completes the refactoring for PackedVaryings. BUG=angleproject:1123 Change-Id: I241610e87f7d14f3e18b0d8bd84f1a3509c05dfd Reviewed-on: https://chromium-review.googlesource.com/295193 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Cooper Partin 4d61f7ed 2015-08-12T10:56:50 Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' Additional warnings found with more testing and added C4267 warning disable only for angle_libpng BUG=angleproject:1120 Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb Reviewed-on: https://chromium-review.googlesource.com/293028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Minmin Gong 794e0009 2015-04-07T18:31:54 Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data) Change-Id: Id0e06d7d6600344d858f00dabc219d79289bbc82 Reviewed-on: https://chromium-review.googlesource.com/265020 Tested-by: Minmin Gong <mgong@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b3584fb4 2015-04-09T17:34:21 Revert "Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)" Causing a build failure on Mac/Clang: ./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens] #else if defined(_MSC_VER) http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136 This reverts commit 3b26e231d99154814eb428f75a67bbe7a21adadc. Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7 Reviewed-on: https://chromium-review.googlesource.com/264983 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Minmin Gong 3b26e231 2015-04-07T18:31:54 Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data) Change-Id: I73d9a2b9ad16f032be974b9c819de0dc1247c2ea Reviewed-on: https://chromium-review.googlesource.com/264533 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b4fd0c96 2014-10-01T17:40:24 Replace usages of std::vector::data in most cases. In some parts of ANGLE code, we were using std::vector::data to get a pointer to the first element. Sadly, this is c++11 only, which isn't currently supported on Chromium. This was causing a breakage on Android. We should probably refrain from using data except on D3D-only code, which we know will be Visual Studio. BUG=angle:767 Change-Id: Ibc10577368435a13f62d74d77c95076482cd8f82 Reviewed-on: https://chromium-review.googlesource.com/220920 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5704d6e8 2014-08-26T13:16:38 Add some shared utility methods to the utils project. BUG=angle:730 Change-Id: I268c7f76ee9a14ab82f646ae8ebf4eed100bf86d Reviewed-on: https://chromium-review.googlesource.com/213509 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>