Page MenuHome

Workbench: Port shaders to use GPUShaderCreateInfo
ClosedPublic

Authored by Clément Foucault (fclem) on Jan 24 2022, 1:36 PM.

Details

Summary

Also adds a few things to GPUShader for easily create shaders.
Heavy usage of macros to compose the createInfo and avoid
duplications and copy paste bugs.
This makes the link between the shader request functions
(in workbench_shader.cc) and the actual createInfo a bit
obscure since the names are composed and not searchable.

Diff Detail

Repository
rB Blender

Event Timeline

Clément Foucault (fclem) requested review of this revision.Jan 24 2022, 1:36 PM
Clément Foucault (fclem) created this revision.

Did a first pass. Some minor changes.
Will test drive it on Mac before approving.

source/blender/draw/engines/workbench/workbench_shader.cc
32

Could these be cleaned up?

source/blender/draw/intern/shaders/draw_view_info.hh
94

Not related to this change, would expected it to be Type::MAT4

source/blender/gpu/intern/gpu_shader.cc
252 ↗(On Diff #47374)

Should also be used in gpu_shaders_builtin.

  • Fix image tansparency cutoff
  • Fix legacy modelmat path
  • Fix legacy modelmat path patch
  • Cleanup: Share definition of world data UBO
  • Merge branch 'master' into tmp-workbench-shader-create-infos
Jeroen Bakker (jbakker) requested changes to this revision.Jan 25 2022, 11:35 AM

In the legacy part the single color and random colors aren't working.
This is how the draw instance emulation is implemented in the draw manager. This should be moved to the GPU module, but might be a task on its own.

This revision now requires changes to proceed.Jan 25 2022, 11:35 AM
  • Port more of the draw glue layer to GPUShaderCreateInfo
  • Merge branch 'master' into tmp-workbench-shader-create-infos
  • Merge branch 'master' into tmp-workbench-shader-create-infos
  • Merge branch 'master' into tmp-workbench-shader-create-infos

Just checked on M1 and issues have been addressed.

This revision is now accepted and ready to land.Jan 26 2022, 10:34 AM
  • Merge branch 'master' into tmp-workbench-shader-create-infos