aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-12-07 14:34:36 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-08 13:41:10 +0000
commitf06c3582677270c741a5e4fb366ec8b5d4ec4c21 (patch)
treebe9fb470ef48933fdd5b6deb18ab3a01d373686b /tools
parent852ca318a16f9c455d2bed3efb2063dff0e4d068 (diff)
Remove instanced rendering
Change-Id: I4219b1d23a647b849ee41fe71b53e1c45edfc3f4 Reviewed-on: https://skia-review.googlesource.com/82241 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/flags/SkCommonFlagsConfig.cpp14
-rw-r--r--tools/flags/SkCommonFlagsConfig.h3
-rw-r--r--tools/gpu/GrContextFactory.cpp8
-rw-r--r--tools/gpu/GrContextFactory.h9
-rw-r--r--tools/viewer/Viewer.cpp31
5 files changed, 8 insertions, 57 deletions
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index fe9faaef1d..00db61a240 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -196,7 +196,7 @@ SkCommandLineConfig::~SkCommandLineConfig() {
#if SK_SUPPORT_GPU
SkCommandLineConfigGpu::SkCommandLineConfigGpu(
const SkString& tag, const SkTArray<SkString>& viaParts, ContextType contextType, bool useNVPR,
- bool useInstanced, bool useDIText, int samples, SkColorType colorType, SkAlphaType alphaType,
+ bool useDIText, int samples, SkColorType colorType, SkAlphaType alphaType,
sk_sp<SkColorSpace> colorSpace, bool useStencilBuffers, bool testThreading)
: SkCommandLineConfig(tag, SkString("gpu"), viaParts)
, fContextType(contextType)
@@ -209,14 +209,11 @@ SkCommandLineConfigGpu::SkCommandLineConfigGpu(
, fTestThreading(testThreading) {
if (useNVPR) {
fContextOverrides |= ContextOverrides::kRequireNVPRSupport;
- } else if (!useInstanced) {
+ } else {
// We don't disable NVPR for instanced configs. Otherwise the caps wouldn't use mixed
// samples and we couldn't test the mixed samples backend for simple shapes.
fContextOverrides |= ContextOverrides::kDisableNVPR;
}
- if (useInstanced) {
- fContextOverrides |= ContextOverrides::kUseInstanced;
- }
// Subtle logic: If the config has a color space attached, we're going to be rendering to sRGB,
// so we need that capability. In addition, to get the widest test coverage, we DO NOT require
// that we can disable sRGB decode. (That's for rendering sRGB sources to legacy surfaces).
@@ -399,8 +396,6 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kGL_ContextType;
bool seenUseNVPR = false;
bool useNVPR = false;
- bool seenUseInstanced = false;
- bool useInstanced = false;
bool seenUseDIText =false;
bool useDIText = false;
bool seenSamples = false;
@@ -431,9 +426,6 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
} else if (key.equals("nvpr") && !seenUseNVPR) {
valueOk = parse_option_bool(value, &useNVPR);
seenUseNVPR = true;
- } else if (key.equals("inst") && !seenUseInstanced) {
- valueOk = parse_option_bool(value, &useInstanced);
- seenUseInstanced = true;
} else if (key.equals("dit") && !seenUseDIText) {
valueOk = parse_option_bool(value, &useDIText);
seenUseDIText = true;
@@ -457,7 +449,7 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
if (!seenAPI) {
return nullptr;
}
- return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useInstanced, useDIText,
+ return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useDIText,
samples, colorType, alphaType, colorSpace, useStencils,
testThreading);
}
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index 18b138c468..49d536c0cd 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -54,7 +54,7 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig {
typedef sk_gpu_test::GrContextFactory::ContextType ContextType;
typedef sk_gpu_test::GrContextFactory::ContextOverrides ContextOverrides;
SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
- ContextType contextType, bool useNVPR, bool useInstanced, bool useDIText,
+ ContextType contextType, bool useNVPR, bool useDIText,
int samples, SkColorType colorType, SkAlphaType alphaType,
sk_sp<SkColorSpace> colorSpace, bool useStencilBuffers,
bool testThreading);
@@ -66,7 +66,6 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig {
!(fContextOverrides & ContextOverrides::kDisableNVPR));
return fContextOverrides & ContextOverrides::kRequireNVPRSupport;
}
- bool getUseInstanced() const { return fContextOverrides & ContextOverrides::kUseInstanced; }
bool getUseDIText() const { return fUseDIText; }
int getSamples() const { return fSamples; }
SkColorType getColorType() const { return fColorType; }
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 00c4b65edc..109d02896d 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -245,9 +245,6 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
if (ContextOverrides::kDisableNVPR & overrides) {
grOptions.fSuppressPathRendering = true;
}
- if (ContextOverrides::kUseInstanced & overrides) {
- grOptions.fEnableInstancedRendering = true;
- }
if (ContextOverrides::kAllowSRGBWithoutDecodeControl & overrides) {
grOptions.fRequireDecodeDisableForSRGB = false;
}
@@ -267,11 +264,6 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
return ContextInfo();
}
}
- if (ContextOverrides::kUseInstanced & overrides) {
- if (GrCaps::InstancedSupport::kNone == grCtx->caps()->instancedSupport()) {
- return ContextInfo();
- }
- }
if (ContextOverrides::kRequireSRGBSupport & overrides) {
if (!grCtx->caps()->srgbSupport()) {
return ContextInfo();
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h
index 6997ca1337..5f16ea8ca9 100644
--- a/tools/gpu/GrContextFactory.h
+++ b/tools/gpu/GrContextFactory.h
@@ -56,12 +56,11 @@ public:
enum class ContextOverrides {
kNone = 0x0,
kDisableNVPR = 0x1,
- kUseInstanced = 0x2,
- kAllowSRGBWithoutDecodeControl = 0x4,
- kAvoidStencilBuffers = 0x8,
+ kAllowSRGBWithoutDecodeControl = 0x2,
+ kAvoidStencilBuffers = 0x4,
- kRequireNVPRSupport = 0x10,
- kRequireSRGBSupport = 0x20,
+ kRequireNVPRSupport = 0x8,
+ kRequireSRGBSupport = 0x10,
};
static bool IsRenderingContext(ContextType type) {
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index c2e03b18cd..1cba520695 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -166,7 +166,6 @@ static DEFINE_int32(msaa, 0, "Number of subpixel samples. 0 for no HW antialiasi
static DEFINE_bool(cachePathMasks, true, "Allows path mask textures to be cached in GPU configs.");
DEFINE_pathrenderer_flag;
-static DEFINE_bool(instancedRendering, false, "Enable instanced rendering on GPU backends.");
DECLARE_int32(threads)
const char* kBackendTypeStrings[sk_app::Window::kBackendTypeCount] = {
@@ -252,7 +251,6 @@ const char* kSlideStateName = "Slide";
const char* kBackendStateName = "Backend";
const char* kMSAAStateName = "MSAA";
const char* kPathRendererStateName = "Path renderer";
-const char* kInstancedRenderingStateName = "Instanced rendering";
const char* kSoftkeyStateName = "Softkey";
const char* kSoftkeyHint = "Please select a softkey";
const char* kFpsStateName = "FPS";
@@ -320,7 +318,6 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
DisplayParams displayParams;
displayParams.fMSAASampleCount = FLAGS_msaa;
- displayParams.fGrContextOptions.fEnableInstancedRendering = FLAGS_instancedRendering;
displayParams.fGrContextOptions.fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
displayParams.fGrContextOptions.fAllowPathMaskCaching = FLAGS_cachePathMasks;
displayParams.fGrContextOptions.fExecutor = GpuExecutorForTools();
@@ -1250,10 +1247,6 @@ void Viewer::drawImGui(SkCanvas* canvas) {
}
const GrContext* ctx = fWindow->getGrContext();
- bool* inst = &params.fGrContextOptions.fEnableInstancedRendering;
- if (ctx && ImGui::Checkbox("Instanced Rendering", inst)) {
- paramsChanged = true;
- }
bool* wire = &params.fGrContextOptions.fWireframeMode;
if (ctx && ImGui::Checkbox("Wireframe Mode", wire)) {
paramsChanged = true;
@@ -1603,19 +1596,6 @@ void Viewer::updateUIState() {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kNone]);
}
- // Instanced rendering state
- Json::Value instState(Json::objectValue);
- instState[kName] = kInstancedRenderingStateName;
- instState[kValue] = kOFF;
- instState[kOptions] = Json::Value(Json::arrayValue);
- if (ctx) {
- if (fWindow->getRequestedDisplayParams().fGrContextOptions.fEnableInstancedRendering) {
- instState[kValue] = kON;
- }
- instState[kOptions].append(kOFF);
- instState[kOptions].append(kON);
- }
-
// Softkey state
Json::Value softkeyState(Json::objectValue);
softkeyState[kName] = kSoftkeyStateName;
@@ -1642,7 +1622,6 @@ void Viewer::updateUIState() {
state.append(backendState);
state.append(msaaState);
state.append(prState);
- state.append(instState);
state.append(softkeyState);
state.append(fpsState);
@@ -1703,16 +1682,6 @@ void Viewer::onUIStateChanged(const SkString& stateName, const SkString& stateVa
break;
}
}
- } else if (stateName.equals(kInstancedRenderingStateName)) {
- DisplayParams params = fWindow->getRequestedDisplayParams();
- bool value = !strcmp(stateValue.c_str(), kON);
- if (params.fGrContextOptions.fEnableInstancedRendering != value) {
- params.fGrContextOptions.fEnableInstancedRendering = value;
- fWindow->setRequestedDisplayParams(params);
- fWindow->inval();
- this->updateTitle();
- this->updateUIState();
- }
} else if (stateName.equals(kSoftkeyStateName)) {
if (!stateValue.equals(kSoftkeyHint)) {
fCommands.onSoftkey(stateValue);