From 26559541e67648794777fcecc546242494d21894 Mon Sep 17 00:00:00 2001 From: Cherry Date: Mon, 12 Jan 2026 19:51:36 +0300 Subject: [PATCH] Prefetch only on Windows --- src/rlgl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rlgl.h b/src/rlgl.h index fab7f0a6b..9cfbaf843 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -822,6 +822,10 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #if defined(RLGL_IMPLEMENTATION) +#if defined(_WIN32) +#include +#endif + // Expose OpenGL functions from glad in raylib #if defined(BUILD_LIBTYPE_SHARED) #define GLAD_API_CALL_EXPORT @@ -1491,8 +1495,10 @@ void rlEnd(void) // NOTE: Vertex position data is the basic information required for drawing void rlVertex3f(float x, float y, float z) { +#if defined(_WIN32) _mm_prefetch(RLGL.currentBatch->vertexBuffer + RLGL.currentBatch->currentBuffer, 1); _mm_prefetch(RLGL.currentBatch->draws + RLGL.currentBatch->drawCounter - 1, 0); +#endif float tx = x; float ty = y;