Commit Graph

4 Commits

Author SHA1 Message Date
John Stiles
dbd4e6f0c0 Move ProgramKind and ProgramSettings types out of SkSL::Program.
This change will allow these types to be forward-declared; C++ doesn't
allow forward declaration of types declared inside a struct. Moving
these types out of Programs resulted in a large diff.

The Settings::Value helper class has been moved inside of the
IRGenerator. In practice, it was actually just an implementation detail
of how IRGenerator looks up caps-values by name. It seems very unlikely
that this will be necessary elsewhere going forward.

Change-Id: I6119417fae608f1c492a27de746d2b550ef8ca20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370836
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-16 19:30:48 +00:00
John Stiles
d1eab8b52e Replace more instances of sk_OutColor with explicit returns.
Change-Id: Ie6abd063e8954c004c856f555a82937ff4e6c0a8
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344296
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 15:14:09 +00:00
Brian Osman
d7e7659cad Move GrShaderCaps from Program::Settings to Compiler
This ties the caps to the compiler instance, paving the way for
pre-optimizing the shared code. Most of the time, the compiler is
created and owned the GPU instance, so this is fine. For runtime
effects, we now use the shared (device-agnostic) compiler instance
for the first compile, even on GPU. It's configured with caps that
apply no workarounds. We pass the user's SkSL to the backend as
cleanly as possible, and then apply any workarounds once it's part
of the full program.

Bug: skia:10905
Bug: skia:10868
Change-Id: Ifcf8d7ebda5d43ad8e180f06700a261811da83de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331493
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-04 19:38:33 +00:00
John Stiles
80f240a3d3 Revive SkSLFPTestbed for basic verification of CPP/H codegen.
This brings back the basics from SkSLFPTest.cpp. This file was removed
entirely in http://review.skia.org/319029 but, in retrospect, it's still
a good idea for dm to verify that CPPCodeGen and HCodeGen can do their
jobs. And, like SkSLGLSLTestbed, this gives us a good place to attach
the debugger in dm for testing CPP/H-specific code generation bugs.

Change-Id: I514192bacd63021708dbd02a0276a3d55a43195f
Bug: skia:10684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329370
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-23 20:32:35 +00:00