Fixed SkSL dFdy rehydrate test
dFdy wasn't working due to the DSL never having been started. Bug: skia:12985 Change-Id: Ic58018e3dec3e9df15c2e784f8732ee99e793353 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513938 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
parent
d6d3cabb49
commit
7b662215f9
@ -13,6 +13,7 @@
|
||||
#include "include/private/SkSLModifiers.h"
|
||||
#include "include/private/SkSLProgramElement.h"
|
||||
#include "include/private/SkSLStatement.h"
|
||||
#include "include/sksl/DSLCore.h"
|
||||
#include "src/sksl/SkSLAnalysis.h"
|
||||
#include "src/sksl/SkSLCompiler.h"
|
||||
#include "src/sksl/SkSLThreadContext.h"
|
||||
@ -282,6 +283,7 @@ std::unique_ptr<Program> Rehydrator::program() {
|
||||
ModifiersPool* oldModifiersPool = context.fModifiersPool;
|
||||
context.fConfig = config.get();
|
||||
fSymbolTable = fCompiler.moduleForProgramKind(config->fKind).fSymbols;
|
||||
dsl::Start(&fCompiler, config->fKind, config->fSettings);
|
||||
auto modifiers = std::make_unique<ModifiersPool>();
|
||||
context.fModifiersPool = modifiers.get();
|
||||
this->symbolTable();
|
||||
@ -290,9 +292,15 @@ std::unique_ptr<Program> Rehydrator::program() {
|
||||
context.fModifiersPool = oldModifiersPool;
|
||||
Program::Inputs inputs;
|
||||
inputs.fUseFlipRTUniform = this->readU8();
|
||||
return std::make_unique<Program>(nullptr, std::move(config), fCompiler.fContext,
|
||||
std::move(elements), /*sharedElements=*/std::vector<const ProgramElement*>(),
|
||||
std::move(modifiers), fSymbolTable, /*pool=*/nullptr, inputs);
|
||||
std::unique_ptr<Pool> pool = std::move(ThreadContext::MemoryPool());
|
||||
pool->detachFromThread();
|
||||
std::unique_ptr<Program> result = std::make_unique<Program>(nullptr, std::move(config),
|
||||
fCompiler.fContext, std::move(elements),
|
||||
/*sharedElements=*/std::vector<const ProgramElement*>(), std::move(modifiers),
|
||||
fSymbolTable, std::move(pool), inputs);
|
||||
fSymbolTable = fSymbolTable->fParent;
|
||||
dsl::End();
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<ProgramElement>> Rehydrator::elements() {
|
||||
|
@ -357,8 +357,7 @@ SKSL_TEST_GPU_ES3(SkSLIntrinsicAbsInt, "intrinsics/AbsInt.sksl")
|
||||
SKSL_TEST(SkSLIntrinsicCeil, "intrinsics/Ceil.sksl")
|
||||
SKSL_TEST_GPU_ES3(SkSLIntrinsicDeterminant, "intrinsics/Determinant.sksl")
|
||||
SKSL_TEST_GPU_ES3(SkSLIntrinsicDFdx, "intrinsics/DFdx.sksl")
|
||||
// TODO(skia:12985): This test currently fails its REHYDRATE variant.
|
||||
// SKSL_TEST_GPU_ES3(SkSLIntrinsicDFdy, "intrinsics/DFdy.sksl")
|
||||
SKSL_TEST_GPU_ES3(SkSLIntrinsicDFdy, "intrinsics/DFdy.sksl")
|
||||
SKSL_TEST_GPU_ES3(SkSLIntrinsicFloatBitsToInt, "intrinsics/FloatBitsToInt.sksl")
|
||||
SKSL_TEST_GPU_ES3(SkSLIntrinsicFloatBitsToUint, "intrinsics/FloatBitsToUint.sksl")
|
||||
SKSL_TEST_GPU_ES3(SkSLIntrinsicFwidth, "intrinsics/Fwidth.sksl")
|
||||
|
Loading…
Reference in New Issue
Block a user