src/tests/gl_tests/ProgramPipelineTest.cpp


Log

Author Commit Date CI Message
Mohan Maiya c8ee13c7 2021-04-02T12:19:33 Vulkan: Fix a validation bug in glBeginTransformFeedback Add logic to check the program or the pipeline before erroring out when validating glBeginTransformFeedeback. Bug: angleproject:5557 Test: ProgramPipelineXFBTest31.VaryingIOBlockSeparableProgramWithXFB* Change-Id: I0df8a8d87b3632745bc91dc2673f2fac31c6cdb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743440 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Tim Van Patten 0261b1d3 2021-03-31T10:48:08 PPO: Fix updating sampler uniforms between draws Updating sampler uniforms when using PPOs is currently broken, since the Context/State use the currently bound ProgramExecutable which belongs to the PPO, but the updates only happen to the Program's executable that the uniform belongs to. This change updates Program::updateSamplerUniform() to update any PPO ProgramExecutables with the updated texture information when a Program's sampler uniforms are updated, so the Context/State use the correct data. Bug: b/182409935 Test: ProgramPipelineTest31.SampleTextureAThenTextureB Test: SamplersTest31.SampleTextureAThenTextureB Change-Id: I3c4e156c6e0c781e706f321f0bd12baf484ff42a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2797951 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 323c5f24 2021-03-29T17:47:53 Validate PPO sampler uniforms "Command & Conquer: Rivals" uses PPOs and was hitting the following assert: angle::Result ContextVk::updateActiveTextures(const gl::Context *context) { ... for (size_t textureUnit : activeTextures) { gl::Texture *texture = textures[textureUnit]; gl::TextureType textureType = textureTypes[textureUnit]; ASSERT(textureType != gl::TextureType::InvalidEnum); This is the same assert that is generated by the test ProgramPipelineTest31.DifferentTextureTypes which is currently being skipped since it's known to fail. This CL refactors sampler validation into the ProgramExecutable to allow PPOs to take advantage of the shared code and behave correctly, since the necessary data is already copied into the PPO's ProgramExecutable via ProgramExecutable::updateActiveSamplers(). This also takes advantage of the subject/observer pattern that's already established between programs and PPOs to ensure only the PPOs that the program is a part of are updated when a program's sampler uniforms are updated. Bug: angleproject:3570 Bug: b/182409935 Test: ProgramPipelineTest31.DifferentTextureTypes Change-Id: I3d34efd66dc85e7ff23a8422cb14d5f90a5f7085 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2792862 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tim Van Patten ae937aae 2021-03-19T20:10:42 Detach separable shaders This effectively reverts the following CL: Vulkan: Don't detach separable shaders in Program::detachShader() https://chromium-review.googlesource.com/c/angle/angle/+/2084399 Bug: angleproject:3570 Bug: b/182409935 Test: ProgramPipelineTest31.DetachAndModifyShader Change-Id: Id69f732d1d4f3eea70b2de8c008452878eaf1682 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2776267 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten fe3a9ffb 2021-03-17T18:05:40 Support linking PPOs without attached Shaders The application "Command & Conquer: Rivals" uses the following pattern: // Create and link VS, save binary data glCreateProgram() glAttachShader() glLinkProgram() glGetProgramBinary() // Create and link FS, save binary data glCreateProgram() glAttachShader() glLinkProgram() glGetProgramBinary() ... // Create VS, load binary data glCreateProgram() glProgramBinary() // Create FS, load binary data glCreateProgram() glProgramBinary() ... glUseProgramStages(GL_VERTEX_SHADER_BIT) glUseProgramStages(GL_FRAGMENT_SHADER_BIT) glBindProgramPipeline() Later, when issuing the draw command that uses the PPO, the PPO must be linked with the Programs that were loaded via binary data. Those Programs don't have any Shaders attached, just linked. This CL adds support for linking Programs without attached Shaders. Bug: b/182409935 Test: ProgramPipelineTest31.ProgramBinary Change-Id: Ic5a4776e1374322665f45fbbcbf955838d093d02 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2770685 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten e3b9dbef 2021-03-17T18:01:02 Update PPO's executable when attached program is re-linked When a program that's being used by a PPO is successfully re-linked, the PPO's ProgramExecutable needs to be updated. This takes advantage of the subject/observer pattern that's already established between programs and PPOs to ensure only the PPOs that the program is a part of are updated. Bug: b/182409935 Test: ProgramPipelineTest31.ModifyAndRelinkShader Change-Id: Idcc11e7e819b4a9bef02bdd71afc8ea58111acc6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2770684 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 44b9579c 2021-03-10T08:10:33 Vulkan: Treat varyings in a separable program as active When separable programs are linked, varyings at the separable program's boundary need to be treated as active. Bug: angleproject:5557 Test: ProgramPipelineTest31.VaryingIOBlockSeparableProgram* Change-Id: I28af2bdf6478a408b3a7155ab4376ed6a19192f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2742659 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Yuly Novikov a6b16d29 2021-03-02T19:04:57 Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Ozone We only support ES2 on Ozone, so tests that depend on ES3 or ES31 support are not instantiated there. Bug: chromium:1183147 Change-Id: Id58bcd9b44a5b9a70b5ae8115e27c44f5dc81226 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2726550 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 3e33db95 2020-12-30T17:17:17 Merge Program/ProgramPipeline::getMergedVaryings(). This merges two very similar pieces of code into one simpler function. The function doesn't use any maps or indirection to build the merged varyings list. It also fixes a potential bug with IO blocks and name matching due to the code bifurcation. Bug: angleproject:5496 Change-Id: Ibf54faeeb01d1940570b366ed153fff7c9135c52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606533 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya ed87c16a 2020-11-15T11:30:47 Vulkan: Add GL_EXT_separate_shader_objects support All the functionality needed for this extension has already been implemented as part of core GLES31. Hook into that along with changes to validation layer to allow non-GLES31 contexts to call into these APIs as long as the extension is exposed. Bug: angleproject:3570 Test: ProgramPipelineTest.GenerateProgramPipelineObjectEXT* Change-Id: I92a61a47517c5cb9573874b2add6a744c9edb755 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2539121 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten 001c7e8c 2020-09-21T13:25:46 Vulkan: Link PPO during draw validation From the OpenGL ES 3.1 spec: 11.1.3.11 Validation It is not always possible to determine at link time if a program object can execute successfully, given that LinkProgram can not know the state of the remainder of the pipeline. Therefore validation is done when the first rendering command which triggers shader invocations is issued, to determine if the set of active program objects can be executed. For draws, this CL moves the PPO link operation to ValidateDrawStates() to generate PPO link failures within ANGLE's validation layer, so we fail any rendering commands during command validation. For dispatch, PPOs are linked during Context::prepareForDispatch(), where the PPO is converted from draw to compute, since that conversion requires a re-link. This re-link shouldn't fail due to errors that would have been caught during validation, since the compute shader must have successfully linked before it can be included in the PPO in the first place. We don't re-link when converting back to draw, since it's possible there are validation errors (which we want to catch during validation of the next rendering command). Bug: angleproject:5064 Test: dEQP.GLES31/functional_separate_shader_validation_es31_* Test: ContextNoErrorTest31.DrawWithPPO Test: ProgramPipelineTest31.VerifyPpoLinkErrorSignalledCorrectly Change-Id: Ibb249e893c007a83cc6b813f848a660bfa34ecb0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2422375 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
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>
Tim Van Patten 405f8e7b 2020-02-24T17:38:10 Vulkan: Support Program Pipeline Objects Add support for PPOs to the Vulkan back end. Bug: angleproject:3570 Change-Id: I5403456929847c185467b008d810f31ecfcb60cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2072652 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Tobin Ehlis 1a01b4b3 2019-11-11T16:41:07 Refactor end2end test macros This is a foundational CL to enabling the end2end tests on swiftshader. Refactored infrastructure with new ANGLE_INSTANTIATE_TEST_ES* macros that will run tests over all various combinations of all platforms for different ES versions. Just skipping failing tests initially to get the refactor landed. Bug: angleproject:4081 Bug: angleproject:4092 Change-Id: I017f6c3267179e49b6ae08cc7488096b423dcdb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1904635 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yunchao He 1f679cc6 2017-11-29T18:06:00 Code refactoring for angle::BitSet and EXPECT_GL_TRUE/FALSE. This change refactors two style issues to make it be consistent. 1) This CL uses "using" to replace "typedef" for all angle::BitSet<...>. 2) This CL uses EXPECT_GL_TRUE/FALSE to replace EXPECT_EQ for bool comparison. BUG=angleproject:2005 Change-Id: I4afad92313ea2457bbfedf80f917a5873d7f29ee Reviewed-on: https://chromium-review.googlesource.com/795871 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He a336b90f 2017-08-02T16:05:21 ES31: Impl program pipeline object management entries for GL backend. The program pipeline object management entries are: GenProgramPipelines DeleteProgramPipelines BindProgramPipeline IsProgramPipeline BUG:angleproject:2123 Change-Id: I114d054b90caf2ee3f9befef7439552a1c309bc4 Reviewed-on: https://chromium-review.googlesource.com/629978 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>