Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added notes on the next steps for SDL 1.3

Moved fill and copy routines to their own files.
  • Loading branch information
slouken committed Aug 16, 2007
1 parent 1ca5a39 commit 1946a4e0577d9451c4b5b20d1f345e2764f168a1
10 NOTES
@@ -157,6 +157,16 @@ Change textures to static/streaming. Static textures are not lockable,
streaming textures are lockable and may have system memory pixels available.
SDL_compat will use a streaming video texture, and will never be HWSURFACE,
but may be PREALLOC, if system memory pixels are available.
*** DONE Thu Aug 16 14:18:42 PDT 2007

The software renderer will be abstracted so the surface management can be
used by any renderer that provides functions to copy surfaces to the window.

Blitters...
----
Copy blit and fill rect are optimized with MMX and SSE now.

Here are the pieces we still need:
- Merging SDL texture capabilities into the SDL surface system
- Generic fallback blitter architecture
- Custom fast path blitters
@@ -24,7 +24,7 @@
#include "SDL_video.h"
#include "SDL_sysvideo.h"
#include "SDL_blit.h"
#include "SDL_blit_copy.h"
#include "SDL_copy.h"
#include "SDL_RLEaccel_c.h"
#include "SDL_pixels_c.h"

@@ -23,10 +23,38 @@

#include "SDL_video.h"
#include "SDL_blit.h"
#include "SDL_blit_copy.h"
#include "SDL_copy.h"


#ifdef __SSE__
/* This assumes 16-byte aligned src and dst */
static __inline__ void
SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
{
int i;

__m128 values[4];
for (i = len / 64; i--;) {
_mm_prefetch(src, _MM_HINT_NTA);
values[0] = *(__m128 *) (src + 0);
values[1] = *(__m128 *) (src + 16);
values[2] = *(__m128 *) (src + 32);
values[3] = *(__m128 *) (src + 48);
_mm_stream_ps((float *) (dst + 0), values[0]);
_mm_stream_ps((float *) (dst + 16), values[1]);
_mm_stream_ps((float *) (dst + 32), values[2]);
_mm_stream_ps((float *) (dst + 48), values[3]);
src += 64;
dst += 64;
}

if (len & 63)
SDL_memcpy(dst, src, len & 63);
}
#endif /* __SSE__ */

#ifdef __MMX__
/* This assumes 8-byte aligned src and dst */
static __inline__ void
SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
{
@@ -60,32 +88,6 @@ SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
}
#endif /* __MMX__ */

#ifdef __SSE__
static __inline__ void
SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
{
int i;

__m128 values[4];
for (i = len / 64; i--;) {
_mm_prefetch(src, _MM_HINT_NTA);
values[0] = *(__m128 *) (src + 0);
values[1] = *(__m128 *) (src + 16);
values[2] = *(__m128 *) (src + 32);
values[3] = *(__m128 *) (src + 48);
_mm_stream_ps((float *) (dst + 0), values[0]);
_mm_stream_ps((float *) (dst + 16), values[1]);
_mm_stream_ps((float *) (dst + 32), values[2]);
_mm_stream_ps((float *) (dst + 48), values[3]);
src += 64;
dst += 64;
}

if (len & 63)
SDL_memcpy(dst, src, len & 63);
}
#endif /* __SSE__ */

void
SDL_BlitCopy(SDL_BlitInfo * info)
{
File renamed without changes.

0 comments on commit 1946a4e

Please sign in to comment.