diff options
author | wm4 <wm4@nowhere> | 2015-09-25 18:58:17 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-25 19:18:16 +0200 |
commit | 0ae8aebb89b5d0b2226a5d3852a9c72cd52da2ff (patch) | |
tree | 4f9517ae03b50d21b534a8cfcdcbbdcdd8d326b5 /waftools/fragments | |
parent | 361040f9d912140832192af78808218d601c7465 (diff) |
video: refactor GPU memcpy usage
Make the GPU memcpy from the dxva2 code generally useful to other parts
of the player.
We need to check at configure time whether SSE intrinsics work at all.
(At least in this form, they won't work on clang, for example. It also
won't work on non-x86.)
Introduce a mp_image_copy_gpu(), and make the dxva2 code use it. Do some
awkward stuff to share the existing code used by mp_image_copy(). I'm
hoping that FFmpeg will sooner or later provide a function like this, so
we can remove most of this again. (There is a patch, bit it's stuck in
limbo since forever.)
All this is used by the following commit.
Diffstat (limited to 'waftools/fragments')
-rw-r--r-- | waftools/fragments/sse.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/waftools/fragments/sse.c b/waftools/fragments/sse.c new file mode 100644 index 0000000000..e9689cda17 --- /dev/null +++ b/waftools/fragments/sse.c @@ -0,0 +1,18 @@ +#pragma GCC push_options +#pragma GCC target("sse4.1") +#include <smmintrin.h> + +void *a_ptr; + +int main(void) +{ + __m128i xmm0; + __m128i* p = (__m128i*)a_ptr; + + _mm_sfence(); + + xmm0 = _mm_stream_load_si128(p + 1); + _mm_store_si128(p + 2, xmm0); + + return 0; +} |