Merge remote-tracking branch 'upstream/master' into moar-gpu

This commit is contained in:
wheremyfoodat 2023-08-03 20:26:12 +03:00
commit f84935142a
17 changed files with 698 additions and 62 deletions

View file

@ -91,6 +91,7 @@ class ShaderEmitter : public Xbyak::CodeGenerator {
void recCMP(const PICAShader& shader, u32 instruction);
void recDP3(const PICAShader& shader, u32 instruction);
void recDP4(const PICAShader& shader, u32 instruction);
void recDPH(const PICAShader& shader, u32 instruction);
void recEMIT(const PICAShader& shader, u32 instruction);
void recEND(const PICAShader& shader, u32 instruction);
void recEX2(const PICAShader& shader, u32 instruction);
@ -111,7 +112,6 @@ class ShaderEmitter : public Xbyak::CodeGenerator {
void recRSQ(const PICAShader& shader, u32 instruction);
void recSETEMIT(const PICAShader& shader, u32 instruction);
void recSGE(const PICAShader& shader, u32 instruction);
void recSGEI(const PICAShader& shader, u32 instruction);
void recSLT(const PICAShader& shader, u32 instruction);
MAKE_LOG_FUNCTION(log, shaderJITLogger)

View file

@ -23,6 +23,7 @@ namespace ShaderOpcodes {
LG2 = 0x06,
LIT = 0x07,
MUL = 0x08,
SGE = 0x09,
SLT = 0x0A,
FLR = 0x0B,
MAX = 0x0C,

View file

@ -13,6 +13,7 @@ namespace ConfigMem {
Datetime0 = 0x1FF81020,
WifiMac = 0x1FF81060,
NetworkState = 0x1FF81067,
SliderState3D = 0x1FF81080,
LedState3D = 0x1FF81084,
BatteryState = 0x1FF81085,
Unknown1086 = 0x1FF81086,

View file

@ -52,6 +52,9 @@ class Kernel {
// Top 8 bits are the major version, bottom 8 are the minor version
u16 kernelVersion = 0;
// Shows whether a reschedule will be need
bool needReschedule = false;
Handle makeArbiter();
Handle makeProcess(u32 id);
Handle makePort(const char* name);
@ -73,7 +76,6 @@ private:
void switchThread(int newThreadIndex);
void sortThreads();
std::optional<int> getNextThread();
void switchToNextThread();
void rescheduleThreads();
bool canThreadRun(const Thread& t);
bool shouldWaitOnObject(KernelObject* object);
@ -126,6 +128,7 @@ private:
void getResourceLimit();
void getResourceLimitLimitValues();
void getResourceLimitCurrentValues();
void getSystemInfo();
void getSystemTick();
void getThreadID();
void getThreadPriority();
@ -168,6 +171,15 @@ public:
void serviceSVC(u32 svc);
void reset();
void requireReschedule() { needReschedule = true; }
void evalReschedule() {
if (needReschedule) {
needReschedule = false;
rescheduleThreads();
}
}
Handle makeObject(KernelObjectType type) {
if (handleCounter > KernelHandles::Max) [[unlikely]] {
Helpers::panic("Hlep we somehow created enough kernel objects to overflow this thing");