aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-02-27 10:37:40 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-07 14:40:10 +0000
commit22e536e3a1a09405d1c0e6f071717a726d86e8d4 (patch)
tree1fbcfdd6a6c60e612e22038770ae7eeb8e306ee4 /src/core
parent25d07fc354f9150f6d2292be27554db4fc454ad6 (diff)
make SkJumper stages normal Skia code
Enough clients are using Clang now that we can say, use Clang to build if you want these software pipeline stages to go fast. This lets us drop the offline build aspect of SkJumper stages, instead building as part of Skia using the SkOpts framework. I think everything should work, except I've (temporarily) removed AVX-512 support. I will put this back in a follow up. I have had to drop Windows down to __vectorcall and our narrower stage calling convention that keeps the d-registers on the stack. I tried forcing sysv_abi, but that crashed Clang. :/ Added a TODO to up the same narrower stage calling convention for lowp stages... we just *don't* today, for no good reason. Change-Id: Iaaa792ffe4deab3508d2dc5d0008c163c24b3383 Reviewed-on: https://skia-review.googlesource.com/110641 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkOpts.cpp19
-rw-r--r--src/core/SkOpts.h11
-rw-r--r--src/core/SkRasterPipeline.h6
3 files changed, 32 insertions, 4 deletions
diff --git a/src/core/SkOpts.cpp b/src/core/SkOpts.cpp
index 8a3d30e334..dbf60eaca5 100644
--- a/src/core/SkOpts.cpp
+++ b/src/core/SkOpts.cpp
@@ -40,6 +40,7 @@
#include "SkBlitRow_opts.h"
#include "SkChecksum_opts.h"
#include "SkMorphologyImageFilter_opts.h"
+#include "SkRasterPipeline_opts.h"
#include "SkSwizzler_opts.h"
#include "SkUtils_opts.h"
#include "SkXfermode_opts.h"
@@ -81,11 +82,26 @@ namespace SkOpts {
#undef DEFINE_DEFAULT
+#define M(st) (StageFn)SK_OPTS_NS::st,
+ StageFn stages_highp[] = { SK_RASTER_PIPELINE_STAGES(M) };
+ StageFn just_return_highp = (StageFn)SK_OPTS_NS::just_return;
+ void (*start_pipeline_highp)(size_t,size_t,size_t,size_t,void**)
+ = SK_OPTS_NS::start_pipeline;
+#undef M
+
+#define M(st) (StageFn)SK_OPTS_NS::lowp::st,
+ StageFn stages_lowp[] = { SK_RASTER_PIPELINE_STAGES(M) };
+ StageFn just_return_lowp = (StageFn)SK_OPTS_NS::lowp::just_return;
+ void (*start_pipeline_lowp)(size_t,size_t,size_t,size_t,void**)
+ = SK_OPTS_NS::lowp::start_pipeline;
+#undef M
+
// Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
void Init_ssse3();
void Init_sse41();
void Init_sse42();
void Init_avx();
+ void Init_hsw();
void Init_crc32();
static void init() {
@@ -104,7 +120,8 @@ namespace SkOpts {
#endif
#if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_AVX
- if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); }
+ if (SkCpu::Supports(SkCpu::AVX)) { Init_avx(); }
+ if (SkCpu::Supports(SkCpu::HSW)) { Init_hsw(); }
#endif
#elif defined(SK_CPU_ARM64)
diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h
index 6e6e16805a..7f4e06613e 100644
--- a/src/core/SkOpts.h
+++ b/src/core/SkOpts.h
@@ -54,6 +54,17 @@ namespace SkOpts {
static inline uint32_t hash(const void* data, size_t bytes, uint32_t seed=0) {
return hash_fn(data, bytes, seed);
}
+
+#define M(st) +1
+ // We can't necessarily express the type of SkJumper stage functions here,
+ // so we just use this void(*)(void) as a stand-in.
+ using StageFn = void(*)(void);
+ extern StageFn stages_highp[SK_RASTER_PIPELINE_STAGES(M)], just_return_highp;
+ extern StageFn stages_lowp [SK_RASTER_PIPELINE_STAGES(M)], just_return_lowp;
+
+ extern void (*start_pipeline_highp)(size_t,size_t,size_t,size_t, void**);
+ extern void (*start_pipeline_lowp )(size_t,size_t,size_t,size_t, void**);
+#undef M
}
#endif//SkOpts_DEFINED
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index 605eebee49..a37ea44e0c 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -17,8 +17,6 @@
#include <functional>
#include <vector>
-struct SkJumper_Engine;
-
/**
* SkRasterPipeline provides a cheap way to chain together a pixel processing pipeline.
*
@@ -163,7 +161,9 @@ private:
void* ctx;
};
- const SkJumper_Engine& build_pipeline(void**) const;
+ using StartPipelineFn = void(*)(size_t,size_t,size_t,size_t, void** program);
+ StartPipelineFn build_pipeline(void**) const;
+
void unchecked_append(StockStage, void*);
SkArenaAlloc* fAlloc;