diff options
author | 2016-07-29 08:14:20 -0700 | |
---|---|---|
committer | 2016-07-29 08:14:20 -0700 | |
commit | e0d362929d6569e8737d80dead791c640390e819 (patch) | |
tree | 3943140ef518a4fc3962672a74039cb776f1ef48 /tools/flags | |
parent | 0d9990f052670a8af29e1e775c414810f8fc6e86 (diff) |
Add test configs for instanced rendering
Adds the following configs and enables them on select bots:
glinst, glinst4, glinstdit4, glinst16, glinstdit16,
esinst, esinst4, esinstdit4
Makes general changes to GrContextOptions, GrCaps, etc. to facilitate
this.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2182783004
Review-Url: https://codereview.chromium.org/2182783004
Diffstat (limited to 'tools/flags')
-rw-r--r-- | tools/flags/SkCommonFlagsConfig.cpp | 65 | ||||
-rw-r--r-- | tools/flags/SkCommonFlagsConfig.h | 6 |
2 files changed, 44 insertions, 27 deletions
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp index 4a4684ff5c..215fbdbfc0 100644 --- a/tools/flags/SkCommonFlagsConfig.cpp +++ b/tools/flags/SkCommonFlagsConfig.cpp @@ -29,6 +29,7 @@ static const char configHelp[] = "Options: 565 8888 debug gpu gl gpudebug gpudft gpunull " "msaa16 msaa4 glmsaa4 gpuf16 gpusrgb glsrgb nonrendering null nullgpu " "nvpr16 nvpr4 nvprdit16 nvprdit4 glnvpr4 glnvprdit4 pdf skp svg xps" + "glinst glinst4 glinstdit4 glinst16 glinstdit16 esinst esinst4 esinsdit4" #if SK_ANGLE #ifdef SK_BUILD_FOR_WIN " angle" @@ -54,7 +55,7 @@ static const char configExtendedHelp[] = "Possible backends and options:\n" #if SK_SUPPORT_GPU "\n" - "gpu(api=string,color=string,dit=bool,nvpr=bool,samples=int)\tGPU backend\n" + "gpu(api=string,color=string,dit=bool,nvpr=bool,inst=bool,samples=int)\tGPU backend\n" "\tapi\ttype: string\tdefault: native.\n" "\t Select graphics API to use with gpu backend.\n" "\t Options:\n" @@ -138,25 +139,33 @@ static const struct { const char* options; } gPredefinedConfigs[] = { #if SK_SUPPORT_GPU - { "gpu", "gpu", "" }, - { "gl", "gpu", "api=gl" }, - { "msaa4", "gpu", "samples=4" }, - { "glmsaa4", "gpu", "api=gl,samples=4" }, - { "msaa16", "gpu", "samples=16" }, - { "nvpr4", "gpu", "nvpr=true,samples=4" }, - { "glnvpr4", "gpu", "api=gl,nvpr=true,samples=4" }, - { "nvpr16", "gpu", "nvpr=true,samples=16" }, - { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" }, - { "glnvprdit4", "gpu", "api=gl,nvpr=true,samples=4,dit=true" }, - { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" }, - { "gpuf16", "gpu", "color=f16" }, - { "gpusrgb", "gpu", "color=srgb" }, - { "glsrgb", "gpu", "api=gl,color=srgb" }, - { "gpudft", "gpu", "dit=true" }, - { "gpudebug", "gpu", "api=debug" }, - { "gpunull", "gpu", "api=null" }, - { "debug", "gpu", "api=debug" }, - { "nullgpu", "gpu", "api=null" } + { "gpu", "gpu", "" }, + { "gl", "gpu", "api=gl" }, + { "msaa4", "gpu", "samples=4" }, + { "glmsaa4", "gpu", "api=gl,samples=4" }, + { "msaa16", "gpu", "samples=16" }, + { "nvpr4", "gpu", "nvpr=true,samples=4" }, + { "glnvpr4", "gpu", "api=gl,nvpr=true,samples=4" }, + { "nvpr16", "gpu", "nvpr=true,samples=16" }, + { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" }, + { "glnvprdit4", "gpu", "api=gl,nvpr=true,samples=4,dit=true" }, + { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" }, + { "glinst", "gpu", "api=gl,inst=true" }, + { "glinst4", "gpu", "api=gl,inst=true,samples=4" }, + { "glinstdit4", "gpu", "api=gl,inst=true,samples=4,dit=true" }, + { "glinst16", "gpu", "api=gl,inst=true,samples=16" }, + { "glinstdit16", "gpu", "api=gl,inst=true,samples=16,dit=true" }, + { "esinst", "gpu", "api=gles,inst=true" }, + { "esinst4", "gpu", "api=gles,inst=true,samples=4" }, + { "esinstdit4", "gpu", "api=gles,inst=true,samples=4,dit=true" }, + { "gpuf16", "gpu", "color=f16" }, + { "gpusrgb", "gpu", "color=srgb" }, + { "glsrgb", "gpu", "api=gl,color=srgb" }, + { "gpudft", "gpu", "dit=true" }, + { "gpudebug", "gpu", "api=debug" }, + { "gpunull", "gpu", "api=null" }, + { "debug", "gpu", "api=debug" }, + { "nullgpu", "gpu", "api=null" } #if SK_ANGLE #ifdef SK_BUILD_FOR_WIN , { "angle", "gpu", "api=angle" } @@ -190,12 +199,13 @@ SkCommandLineConfig::~SkCommandLineConfig() { #if SK_SUPPORT_GPU SkCommandLineConfigGpu::SkCommandLineConfigGpu( - const SkString& tag, const SkTArray<SkString>& viaParts, - ContextType contextType, bool useNVPR, bool useDIText, int samples, - SkColorType colorType, sk_sp<SkColorSpace> colorSpace) + const SkString& tag, const SkTArray<SkString>& viaParts, ContextType contextType, bool useNVPR, + bool useInstanced, bool useDIText, int samples, SkColorType colorType, + sk_sp<SkColorSpace> colorSpace) : SkCommandLineConfig(tag, SkString("gpu"), viaParts) , fContextType(contextType) , fUseNVPR(useNVPR) + , fUseInstanced(useInstanced) , fUseDIText(useDIText) , fSamples(samples) , fColorType(colorType) @@ -303,6 +313,8 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeGL_ContextType; bool seenUseNVPR = false; bool useNVPR = false; + bool seenUseInstanced = false; + bool useInstanced = false; bool seenUseDIText =false; bool useDIText = false; bool seenSamples = false; @@ -328,6 +340,9 @@ 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; @@ -342,8 +357,8 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, return nullptr; } } - return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useDIText, samples, - colorType, colorSpace); + return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useInstanced, useDIText, + samples, colorType, colorSpace); } #endif diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h index dc38977cb8..641c68b3ee 100644 --- a/tools/flags/SkCommonFlagsConfig.h +++ b/tools/flags/SkCommonFlagsConfig.h @@ -52,11 +52,12 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig { public: typedef sk_gpu_test::GrContextFactory::ContextType ContextType; SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts, - ContextType contextType, bool useNVPR, bool useDIText, int samples, - SkColorType colorType, sk_sp<SkColorSpace> colorSpace); + ContextType contextType, bool useNVPR, bool useInstanced, bool useDIText, + int samples, SkColorType colorType, sk_sp<SkColorSpace> colorSpace); const SkCommandLineConfigGpu* asConfigGpu() const override { return this; } ContextType getContextType() const { return fContextType; } bool getUseNVPR() const { return fUseNVPR; } + bool getUseInstanced() const { return fUseInstanced; } bool getUseDIText() const { return fUseDIText; } int getSamples() const { return fSamples; } SkColorType getColorType() const { return fColorType; } @@ -65,6 +66,7 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig { private: ContextType fContextType; bool fUseNVPR; + bool fUseInstanced; bool fUseDIText; int fSamples; SkColorType fColorType; |