mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 23:10:33 +02:00
The C++ paths draw and sample four pixels at a time in vector lanes, while a JIT function only does one, and with a JIT function in use the span and quad paths were skipped. On x86 the JITs had become slower: Wipeout took 13% more wall time and 25% more CPU with them, God of War 3% more. They were also a second implementation of every GE rule, and ARM never had them. The SoftwareRendererJit setting goes with them. RasterizerRegCache.h keeps only the types the pixel and sampler functions take, as RasterizerTypes.h. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
70 lines
2.7 KiB
C++
70 lines
2.7 KiB
C++
// Copyright (c) 2021- PPSSPP Project.
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
// Official git repository and contact information can be found at
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
#pragma once
|
|
|
|
#include "ppsspp_config.h"
|
|
|
|
#include "Common/Common.h"
|
|
#include "Common/Math/SIMDHeaders.h"
|
|
|
|
#if PPSSPP_ARCH(ARM64_NEON)
|
|
#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64)
|
|
#include <arm64_neon.h>
|
|
#else
|
|
#include <arm_neon.h>
|
|
#endif
|
|
#endif
|
|
|
|
#include "GPU/Math3D.h"
|
|
|
|
namespace Rasterizer {
|
|
|
|
// How the pixel and sampler functions take vectors: in registers where the platform can.
|
|
#if PPSSPP_ARCH(ARM64_NEON)
|
|
typedef int32x4_t Vec4IntArg;
|
|
typedef int32x4_t Vec4IntResult;
|
|
typedef float32x4_t Vec4FloatArg;
|
|
static inline Vec4IntArg ToVec4IntArg(const Math3D::Vec4<int> &a) { return vld1q_s32(a.AsArray()); }
|
|
static inline Vec4IntArg ToVec4IntArg(const Vec4IntResult &a) { return a; }
|
|
static inline Vec4IntResult ToVec4IntResult(const Math3D::Vec4<int> &a) { return vld1q_s32(a.AsArray()); }
|
|
static inline Vec4FloatArg ToVec4FloatArg(const Math3D::Vec4<float> &a) { return vld1q_f32(a.AsArray()); }
|
|
#elif PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)
|
|
typedef __m128i Vec4IntArg;
|
|
typedef __m128i Vec4IntResult;
|
|
typedef __m128 Vec4FloatArg;
|
|
static inline Vec4IntArg ToVec4IntArg(const Math3D::Vec4<int> &a) { return a.ivec; }
|
|
static inline Vec4IntArg ToVec4IntArg(const Vec4IntResult &a) { return a; }
|
|
static inline Vec4IntResult ToVec4IntResult(const Math3D::Vec4<int> &a) { return a.ivec; }
|
|
static inline Vec4FloatArg ToVec4FloatArg(const Math3D::Vec4<float> &a) { return a.vec; }
|
|
#else
|
|
typedef const Math3D::Vec4<int> &Vec4IntArg;
|
|
typedef Math3D::Vec4<int> Vec4IntResult;
|
|
typedef const Math3D::Vec4<float> &Vec4FloatArg;
|
|
static inline Vec4IntArg ToVec4IntArg(const Math3D::Vec4<int> &a) { return a; }
|
|
static inline Vec4IntResult ToVec4IntResult(const Math3D::Vec4<int> &a) { return a; }
|
|
static inline Vec4FloatArg ToVec4FloatArg(const Math3D::Vec4<float> &a) { return a; }
|
|
#endif
|
|
|
|
#if PPSSPP_ARCH(AMD64) && PPSSPP_PLATFORM(WINDOWS) && (defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER))
|
|
#define SOFTRAST_CALL __vectorcall
|
|
#else
|
|
#define SOFTRAST_CALL
|
|
#endif
|
|
|
|
}; // namespace Rasterizer
|