Add a SkVMDebugTrace flag to ProgramSettings.
When this is enabled, the SkVM code generator will emit trace instructions for debugging purposes. (The trace instructions are a work in progress, so at present, the flag doesn't do anything meaningful.) Change-Id: Ia7d66840d915b1a7e531a3069e641c840bb9c0eb Bug: skia:12614 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467764 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
This commit is contained in:
parent
78bfb85be7
commit
afa75bc522
@ -1,3 +1,5 @@
|
||||
/*#pragma settings SkVMDebugTrace*/
|
||||
|
||||
uniform half4 colorRed, colorGreen;
|
||||
|
||||
// Should return 5
|
||||
|
@ -527,7 +527,7 @@ bool Compiler::optimize(LoadedModule& module) {
|
||||
|
||||
bool Compiler::optimize(Program& program) {
|
||||
// The optimizer only needs to run when it is enabled.
|
||||
if (!program.fConfig->fSettings.fOptimize) {
|
||||
if (!program.fConfig->fSettings.fOptimize || program.fConfig->fSettings.fSkVMDebugTrace) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -215,6 +215,9 @@ static bool detect_shader_settings(const SkSL::String& text,
|
||||
if (settingsText.consumeSuffix(" Sharpen")) {
|
||||
settings->fSharpenTextures = true;
|
||||
}
|
||||
if (settingsText.consumeSuffix(" SkVMDebugTrace")) {
|
||||
settings->fSkVMDebugTrace = true;
|
||||
}
|
||||
|
||||
if (settingsText.empty()) {
|
||||
break;
|
||||
|
@ -40,6 +40,10 @@ struct ProgramSettings {
|
||||
// At present, zero is always used by our backends.
|
||||
int fDefaultUniformSet = 0;
|
||||
int fDefaultUniformBinding = 0;
|
||||
// Enables debug trace instructions in SkVM output. Trace instructions are used by the SkSL
|
||||
// debugger to map from SkVM-compiled output back into the original SkSL source. This setting
|
||||
// does nothing when rendering on an actual GPU.
|
||||
bool fSkVMDebugTrace = false;
|
||||
// Enables the SkSL optimizer.
|
||||
bool fOptimize = true;
|
||||
// (Requires fOptimize = true) Removes any uncalled functions other than main(). Note that a
|
||||
|
Loading…
Reference in New Issue
Block a user