Page MenuHome

DrawEngine: Shader Test Suite
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Aug 21 2020, 3:19 PM.

Details

Summary

A test case that compiles all the GLSL shaders for workbench, gpencil, overlay and some
of eevee. Compilation is still platform dependent, but when run on a test-farm
with different hardware we will be able to detect GLSL compilation
errors early on.

The test will be compiled when WITH_GTEST and WITH_OPENGL_DRAW_TESTS
are On.

For eevee only the shaders inside eevee_shaders.c are included. EEVEE has some shaders
located inside the submodule. They aren't accessible to the outside and aren't added
to the test case. We should see how we want to add them. For the test cases it is better
to move them to eevee_shaders.c, but for eevee perspective it is better to keep them in
the submodule. Keeping them in the submodule could lead to situations that is harder to test.
as the shader could already have been initialized.

NOTE: currently when a shader fails can trigger a segmentation fault what stops the test runner.

Diff Detail

Repository
rB Blender
Branch
tmp-viewport-shader-test-suite (branched from master)
Build Status
Buildable 9718
Build 9718: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Aug 21 2020, 3:19 PM
Jeroen Bakker (jbakker) created this revision.
Clément Foucault (fclem) requested changes to this revision.Aug 21 2020, 4:09 PM

I'll fix background rendering first. Use the correct offscreen context for this test.

source/blender/gpu/intern/gpu_shader.cc
289 ↗(On Diff #28026)

Unwanted modifications?

This revision now requires changes to proceed.Aug 21 2020, 4:09 PM
  • use offscreen opengl context
  • replace assert with expect
  • remove unneeded files + changes
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Aug 21 2020, 4:55 PM
Jeroen Bakker (jbakker) marked an inline comment as done.Aug 25 2020, 11:36 AM
Jeroen Bakker (jbakker) added inline comments.
source/blender/draw/tests/workbench_shaders_test.cc
13

workbench_shaders as all possible shaders are tested.

20

Create a setup and teardown

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Merge branch 'master' into tmp-viewport-shader-test-suite
  • Renamed file + testcase
  • Merge branch 'master' into tmp-viewport-shader-test-suite
  • Merge branch 'master' into arcpatch-D8667
  • Add gpencil shader test case
Jeroen Bakker (jbakker) retitled this revision from Workbench: Shader Test Suite to Draw: Shader Test Suite.Aug 26 2020, 7:50 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) retitled this revision from Draw: Shader Test Suite to DrawEngine: Shader Test Suite.
  • Added testcase for overlay engine
  • Added eevee test cases
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Aug 26 2020, 8:36 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Enable the draw context state before testing
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Aug 28 2020, 8:04 AM

Keeping them in the submodule could lead to situations that is harder to test. as the shader could already have been initialized.

We might change this if needed but better do that after this patch.

The patch is in good shape. I think it's ready to be merged.

This revision is now accepted and ready to land.Aug 28 2020, 2:03 PM
This revision was automatically updated to reflect the committed changes.