refactor(libSceAgc): add subdirs + new separated src
This commit is contained in:
parent
114c11aa88
commit
888abd280f
|
|
@ -1,131 +0,0 @@
|
|||
#include "prx/libSceAgc/Command/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbAcquireMem(CommandBuffer* buf, uint32_t gcr_cntl, const volatile void* base, uint64_t size_bytes, uint32_t poll_cycles) {
|
||||
(void)buf;
|
||||
(void)gcr_cntl;
|
||||
(void)base;
|
||||
(void)size_bytes;
|
||||
(void)poll_cycles;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbAcquireMemGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbCondExec(CommandBuffer* buf, const volatile uint32_t* address, uint32_t num_dwords) {
|
||||
(void)buf;
|
||||
(void)address;
|
||||
(void)num_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbCondExecGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t dst_cache_policy, uint64_t dst_address, uint8_t src, uint8_t src_cache_policy, uint64_t src_address_or_immediate, uint8_t item_size, uint8_t write_confirm) {
|
||||
(void)buf;
|
||||
(void)dst;
|
||||
(void)dst_cache_policy;
|
||||
(void)dst_address;
|
||||
(void)src;
|
||||
(void)src_cache_policy;
|
||||
(void)src_address_or_immediate;
|
||||
(void)item_size;
|
||||
(void)write_confirm;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbDispatchIndirect(CommandBuffer* buf, const volatile void* indirect_args, uint32_t modifier) {
|
||||
(void)buf;
|
||||
(void)indirect_args;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbDmaData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t dstCachePolicy, std::uint64_t dstAddress, std::uint8_t src, std::uint8_t srcCachePolicy, std::uint64_t srcAddress, std::uint32_t numBytes, std::uint8_t waitForPrevious, std::uint8_t writeConfirm) {
|
||||
return Agc::Command::WriteDma(buf, true, 0, dst, dstCachePolicy, dstAddress, src, srcCachePolicy, srcAddress, numBytes, waitForPrevious, writeConfirm, 0, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbEventWrite(CommandBuffer* buf, std::uint8_t eventType, const volatile void* address) {
|
||||
Agc::Command::CheckBits(eventType, 0x3fu, __func__);
|
||||
Agc::Command::Require(address == nullptr, __func__, "ACB event address is not supported");
|
||||
return Agc::Command::Emit(buf, 0x46u, {eventType | (eventType == 7 ? 0x400u : 0u)}, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbJumpGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbPopMarker(CommandBuffer* buf) {
|
||||
(void)buf;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbPushMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbResetQueue(CommandBuffer* buf, uint32_t op) {
|
||||
(void)buf;
|
||||
(void)op;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbSetMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWaitRegMem(CommandBuffer* buf, std::uint8_t size, std::uint8_t compareFunction, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t reference, std::uint64_t mask, std::uint32_t pollCycles) {
|
||||
return Agc::Command::WriteWait(buf, size, compareFunction, 0, cachePolicy, address, reference, mask, pollCycles, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWriteData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t cachePolicy, std::uint64_t address, const void* data, std::uint32_t numDwords, std::uint8_t increment, std::uint8_t writeConfirm) {
|
||||
return Agc::Command::WriteData(buf, true, dst, cachePolicy, address, data, numDwords, increment, writeConfirm, __func__);
|
||||
}
|
||||
std::uint64_t APS5_VABI sceAgcAcbCopyDataGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbJump(CommandBuffer* buf, std::uint8_t cachePolicy, const std::uint32_t* target, std::uint32_t sizeInDwords) {
|
||||
(void)buf;
|
||||
(void)cachePolicy;
|
||||
(void)target;
|
||||
(void)sizeInDwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcAcbWaitOnAddressGetSize(std::uint8_t size) {
|
||||
(void)size;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_CONTROL_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_CONTROL_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_DISPATCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_DISPATCH_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_MEMORY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_MEMORY_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_SYNC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_SYNC_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
#include "prx/libSceAgc/Acb/include/Control.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbJump(CommandBuffer* buf, std::uint8_t cachePolicy, const std::uint32_t* target, std::uint32_t sizeInDwords) {
|
||||
(void)buf;
|
||||
(void)cachePolicy;
|
||||
(void)target;
|
||||
(void)sizeInDwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbJumpGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbResetQueue(CommandBuffer* buf, uint32_t op) {
|
||||
(void)buf;
|
||||
(void)op;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbPushMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbPopMarker(CommandBuffer* buf) {
|
||||
(void)buf;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbSetMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#include "prx/libSceAgc/Acb/include/Dispatch.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbDispatchIndirect(CommandBuffer* buf, const volatile void* indirect_args, uint32_t modifier) {
|
||||
(void)buf;
|
||||
(void)indirect_args;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
#include "prx/libSceAgc/Acb/include/Memory.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbAcquireMem(CommandBuffer* buf, uint32_t gcr_cntl, const volatile void* base, uint64_t size_bytes, uint32_t poll_cycles) {
|
||||
(void)buf;
|
||||
(void)gcr_cntl;
|
||||
(void)base;
|
||||
(void)size_bytes;
|
||||
(void)poll_cycles;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbAcquireMemGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t dst_cache_policy, uint64_t dst_address, uint8_t src, uint8_t src_cache_policy, uint64_t src_address_or_immediate, uint8_t item_size, uint8_t write_confirm) {
|
||||
(void)buf;
|
||||
(void)dst;
|
||||
(void)dst_cache_policy;
|
||||
(void)dst_address;
|
||||
(void)src;
|
||||
(void)src_cache_policy;
|
||||
(void)src_address_or_immediate;
|
||||
(void)item_size;
|
||||
(void)write_confirm;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcAcbCopyDataGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbDmaData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t dstCachePolicy, std::uint64_t dstAddress, std::uint8_t src, std::uint8_t srcCachePolicy, std::uint64_t srcAddress, std::uint32_t numBytes, std::uint8_t waitForPrevious, std::uint8_t writeConfirm) {
|
||||
return Agc::Command::WriteDma(buf, true, 0, dst, dstCachePolicy, dstAddress, src, srcCachePolicy, srcAddress, numBytes, waitForPrevious, writeConfirm, 0, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWriteData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t cachePolicy, std::uint64_t address, const void* data, std::uint32_t numDwords, std::uint8_t increment, std::uint8_t writeConfirm) {
|
||||
return Agc::Command::WriteData(buf, true, dst, cachePolicy, address, data, numDwords, increment, writeConfirm, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#include "prx/libSceAgc/Acb/include/Sync.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbCondExec(CommandBuffer* buf, const volatile uint32_t* address, uint32_t num_dwords) {
|
||||
(void)buf;
|
||||
(void)address;
|
||||
(void)num_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbCondExecGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWaitRegMem(CommandBuffer* buf, std::uint8_t size, std::uint8_t compareFunction, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t reference, std::uint64_t mask, std::uint32_t pollCycles) {
|
||||
return Agc::Command::WriteWait(buf, size, compareFunction, 0, cachePolicy, address, reference, mask, pollCycles, __func__);
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcAcbWaitOnAddressGetSize(std::uint8_t size) {
|
||||
(void)size;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbEventWrite(CommandBuffer* buf, std::uint8_t eventType, const volatile void* address) {
|
||||
Agc::Command::CheckBits(eventType, 0x3fu, __func__);
|
||||
Agc::Command::Require(address == nullptr, __func__, "ACB event address is not supported");
|
||||
return Agc::Command::Emit(buf, 0x46u, {eventType | (eventType == 7 ? 0x400u : 0u)}, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +1,47 @@
|
|||
add_library(libSceAgc SHARED EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Command/Packet.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Command/Memory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Shader/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Shader/ShaderUtils.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Acb/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Cb/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbDraw/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbFlow/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Predication/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/Export.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Acb/src/Control.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Acb/src/Dispatch.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Acb/src/Memory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Acb/src/Sync.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Cb/src/Branch.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Cb/src/Dispatch.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Cb/src/Registers.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Cb/src/Sync.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Command/src/Memory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Command/src/Packet.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbDraw/src/DrawIndexed.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbDraw/src/DrawNonIndexed.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbDraw/src/IndexBuffer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbDraw/src/Instancing.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbDraw/src/Stats.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbFlow/src/Control.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbFlow/src/Dispatch.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbFlow/src/Memory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbFlow/src/Sync.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/ContextState.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/Display.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/Init.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/Marker.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/Predication.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/Registers.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DcbState/src/Workload.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/PacketInfo.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/RegisterDefaults.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/ShaderFusion.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/Suspend.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/CondExec.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/Dma.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/IndirectRegisters.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/Jump.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/Nop.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/QueueEndOfPipeAction.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/Rewind.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/WaitRegMem.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Predication/src/Predication.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Shader/src/CreateShader.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Shader/src/InterpolantMapping.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Shader/src/PrimState.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Shader/src/ShaderUtils.cpp
|
||||
)
|
||||
|
||||
target_include_directories(libSceAgc PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
|
|
|
|||
|
|
@ -1,102 +0,0 @@
|
|||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbBranch(CommandBuffer* buf, std::uint8_t mode, std::uint8_t compareFunction, const volatile std::uint64_t* compareAddress, std::uint64_t mask, std::uint64_t reference, std::uint8_t cachePolicy1, const volatile std::uint32_t* buffer1, std::uint32_t sizeInDwords1, std::uint8_t cachePolicy2, const volatile std::uint32_t* buffer2, std::uint32_t sizeInDwords2) {
|
||||
Agc::Command::CheckBits(mode, 3, __func__);
|
||||
Agc::Command::CheckBits(compareFunction, 7, __func__);
|
||||
Agc::Command::CheckBits(cachePolicy1, 3, __func__);
|
||||
Agc::Command::CheckBits(cachePolicy2, 3, __func__);
|
||||
Agc::Command::CheckBits(sizeInDwords1, 0xfffffu, __func__);
|
||||
Agc::Command::CheckBits(sizeInDwords2, 0xfffffu, __func__);
|
||||
const auto address = reinterpret_cast<std::uintptr_t>(compareAddress);
|
||||
const auto first = reinterpret_cast<std::uintptr_t>(buffer1);
|
||||
const auto second = reinterpret_cast<std::uintptr_t>(buffer2);
|
||||
Agc::Command::CheckAddress(address, 8, __func__);
|
||||
Agc::Command::CheckAddress(first, 4, __func__);
|
||||
Agc::Command::CheckAddress(second, 4, __func__);
|
||||
return Agc::Command::Emit(buf, 0x3fu, {mode | (static_cast<std::uint32_t>(compareFunction) << 8u), static_cast<std::uint32_t>(address), static_cast<std::uint32_t>(address >> 32u), static_cast<std::uint32_t>(mask), static_cast<std::uint32_t>(mask >> 32u), static_cast<std::uint32_t>(reference), static_cast<std::uint32_t>(reference >> 32u), static_cast<std::uint32_t>(first), static_cast<std::uint32_t>(first >> 32u), sizeInDwords1 | (static_cast<std::uint32_t>(cachePolicy1) << 28u), static_cast<std::uint32_t>(second), static_cast<std::uint32_t>(second >> 32u), sizeInDwords2 | (static_cast<std::uint32_t>(cachePolicy2) << 28u)}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetUcRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues) {
|
||||
return Agc::Command::WriteRegisterRange(buf, 0x79u, offset, values, numValues, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcCbCondWrite(CommandBuffer* buf, uint32_t cond, uint32_t a, uint32_t b, uint32_t c) {
|
||||
(void)buf;
|
||||
(void)cond;
|
||||
(void)a;
|
||||
(void)b;
|
||||
(void)c;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcCbBranchGetSize() {
|
||||
return 56;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbDispatch(CommandBuffer* buf, std::uint32_t threadGroupX, std::uint32_t threadGroupY, std::uint32_t threadGroupZ, std::uint32_t modifier) {
|
||||
Agc::Command::CheckBits(modifier, 0xa038u, __func__);
|
||||
return Agc::Command::Emit(buf, 0x15u, {threadGroupX, threadGroupY, threadGroupZ, modifier | 0x41u}, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbDispatchGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbNop_nid_postfix(CommandBuffer* buf, std::uint32_t sizeInDwords) {
|
||||
return Agc::Command::WriteNop(buf, sizeInDwords, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbNopGetSize(uint32_t size_in_dwords) {
|
||||
(void)size_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbQueueEndOfPipeActionGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcCbReleaseMem(CommandBuffer* buf, uint8_t action, uint16_t gcr_cntl, uint8_t dst, uint8_t cache_policy, const volatile Label* address, uint8_t data_sel, uint64_t data, uint16_t gds_offset, uint16_t gds_size, uint8_t interrupt, uint32_t interrupt_ctx_id) {
|
||||
(void)buf;
|
||||
(void)action;
|
||||
(void)gcr_cntl;
|
||||
(void)dst;
|
||||
(void)cache_policy;
|
||||
(void)address;
|
||||
(void)data_sel;
|
||||
(void)data;
|
||||
(void)gds_offset;
|
||||
(void)gds_size;
|
||||
(void)interrupt;
|
||||
(void)interrupt_ctx_id;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetShRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues) {
|
||||
return Agc::Command::WriteRegisterRange(buf, 0x76u, offset, values, numValues, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbSetShRegisterRangeDirectGetSize(uint32_t num_values) {
|
||||
(void)num_values;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetShRegistersDirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteRegisters(buf, 0x76u, regs, numRegs, true, __func__);
|
||||
}
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetUcRegistersDirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteRegisters(buf, 0x79u, regs, numRegs, false, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_BRANCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_BRANCH_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_DISPATCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_DISPATCH_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_REGISTERS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_REGISTERS_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_SYNC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_SYNC_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#include "prx/libSceAgc/Cb/include/Branch.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbBranch(CommandBuffer* buf, std::uint8_t mode, std::uint8_t compareFunction, const volatile std::uint64_t* compareAddress, std::uint64_t mask, std::uint64_t reference, std::uint8_t cachePolicy1, const volatile std::uint32_t* buffer1, std::uint32_t sizeInDwords1, std::uint8_t cachePolicy2, const volatile std::uint32_t* buffer2, std::uint32_t sizeInDwords2) {
|
||||
Agc::Command::CheckBits(mode, 3, __func__);
|
||||
Agc::Command::CheckBits(compareFunction, 7, __func__);
|
||||
Agc::Command::CheckBits(cachePolicy1, 3, __func__);
|
||||
Agc::Command::CheckBits(cachePolicy2, 3, __func__);
|
||||
Agc::Command::CheckBits(sizeInDwords1, 0xfffffu, __func__);
|
||||
Agc::Command::CheckBits(sizeInDwords2, 0xfffffu, __func__);
|
||||
const auto address = reinterpret_cast<std::uintptr_t>(compareAddress);
|
||||
const auto first = reinterpret_cast<std::uintptr_t>(buffer1);
|
||||
const auto second = reinterpret_cast<std::uintptr_t>(buffer2);
|
||||
Agc::Command::CheckAddress(address, 8, __func__);
|
||||
Agc::Command::CheckAddress(first, 4, __func__);
|
||||
Agc::Command::CheckAddress(second, 4, __func__);
|
||||
return Agc::Command::Emit(buf, 0x3fu, {mode | (static_cast<std::uint32_t>(compareFunction) << 8u), static_cast<std::uint32_t>(address), static_cast<std::uint32_t>(address >> 32u), static_cast<std::uint32_t>(mask), static_cast<std::uint32_t>(mask >> 32u), static_cast<std::uint32_t>(reference), static_cast<std::uint32_t>(reference >> 32u), static_cast<std::uint32_t>(first), static_cast<std::uint32_t>(first >> 32u), sizeInDwords1 | (static_cast<std::uint32_t>(cachePolicy1) << 28u), static_cast<std::uint32_t>(second), static_cast<std::uint32_t>(second >> 32u), sizeInDwords2 | (static_cast<std::uint32_t>(cachePolicy2) << 28u)}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcCbBranchGetSize() {
|
||||
return 56;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcCbCondWrite(CommandBuffer* buf, uint32_t cond, uint32_t a, uint32_t b, uint32_t c) {
|
||||
(void)buf;
|
||||
(void)cond;
|
||||
(void)a;
|
||||
(void)b;
|
||||
(void)c;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#include "prx/libSceAgc/Cb/include/Dispatch.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbDispatch(CommandBuffer* buf, std::uint32_t threadGroupX, std::uint32_t threadGroupY, std::uint32_t threadGroupZ, std::uint32_t modifier) {
|
||||
Agc::Command::CheckBits(modifier, 0xa038u, __func__);
|
||||
return Agc::Command::Emit(buf, 0x15u, {threadGroupX, threadGroupY, threadGroupZ, modifier | 0x41u}, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbDispatchGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#include "prx/libSceAgc/Cb/include/Registers.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetUcRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues) {
|
||||
return Agc::Command::WriteRegisterRange(buf, 0x79u, offset, values, numValues, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetShRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues) {
|
||||
return Agc::Command::WriteRegisterRange(buf, 0x76u, offset, values, numValues, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbSetShRegisterRangeDirectGetSize(uint32_t num_values) {
|
||||
(void)num_values;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetShRegistersDirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteRegisters(buf, 0x76u, regs, numRegs, true, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetUcRegistersDirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteRegisters(buf, 0x79u, regs, numRegs, false, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#include "prx/libSceAgc/Cb/include/Sync.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbNop_nid_postfix(CommandBuffer* buf, std::uint32_t sizeInDwords) {
|
||||
return Agc::Command::WriteNop(buf, sizeInDwords, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbNopGetSize(uint32_t size_in_dwords) {
|
||||
(void)size_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbQueueEndOfPipeActionGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcCbReleaseMem(CommandBuffer* buf, uint8_t action, uint16_t gcr_cntl, uint8_t dst, uint8_t cache_policy, const volatile Label* address, uint8_t data_sel, uint64_t data, uint16_t gds_offset, uint16_t gds_size, uint8_t interrupt, uint32_t interrupt_ctx_id) {
|
||||
(void)buf;
|
||||
(void)action;
|
||||
(void)gcr_cntl;
|
||||
(void)dst;
|
||||
(void)cache_policy;
|
||||
(void)address;
|
||||
(void)data_sel;
|
||||
(void)data;
|
||||
(void)gds_offset;
|
||||
(void)gds_size;
|
||||
(void)interrupt;
|
||||
(void)interrupt_ctx_id;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_COMMAND_MEMORY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_COMMAND_MEMORY_HPP
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_COMMAND_INCLUDE_MEMORY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_COMMAND_INCLUDE_MEMORY_HPP
|
||||
|
||||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
|
||||
namespace Agc::Command {
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_COMMAND_PACKET_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_COMMAND_PACKET_HPP
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_COMMAND_INCLUDE_PACKET_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_COMMAND_INCLUDE_PACKET_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <initializer_list>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#include "prx/libSceAgc/Command/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndex(CommandBuffer* buf, uint32_t index_count, const volatile void* index_addr, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
(void)index_addr;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndirectMulti(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint32_t count_indirect, uint32_t max_count_or_count, const volatile void* count_addr, uint32_t stride_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)count_indirect;
|
||||
(void)max_count_or_count;
|
||||
(void)count_addr;
|
||||
(void)stride_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndirectMultiGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexIndirectMultiGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexIndirectGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexAuto(CommandBuffer* buf, uint32_t index_count, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexAutoGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexIndirect(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexIndirectMulti(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint32_t count_indirect, uint32_t max_count_or_count, const volatile void* count_addr, uint32_t stride_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)count_indirect;
|
||||
(void)max_count_or_count;
|
||||
(void)count_addr;
|
||||
(void)stride_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexMultiInstanced(CommandBuffer* buf, uint32_t index_count, const volatile void* index_addr, const volatile void* object_ids, uint32_t instance_count, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
(void)index_addr;
|
||||
(void)object_ids;
|
||||
(void)instance_count;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexMultiInstancedGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexOffset(CommandBuffer* buf, uint32_t index_offset, uint32_t index_count, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_offset;
|
||||
(void)index_count;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexOffsetGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndirect(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndirectGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexBuffer(CommandBuffer* buf, std::uint64_t indexAddress) {
|
||||
Agc::Command::CheckAddress(indexAddress, 2, __func__);
|
||||
return Agc::Command::Emit(buf, 0x26u, {static_cast<std::uint32_t>(indexAddress), static_cast<std::uint32_t>(indexAddress >> 32u)}, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetIndexCount(CommandBuffer* buf, uint32_t index_count) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexSize(CommandBuffer* buf, std::uint8_t indexSize, std::uint8_t cachePolicy) {
|
||||
Agc::Command::Require(indexSize <= 2, __func__, "invalid index element size");
|
||||
Agc::Command::CheckBits(cachePolicy, 3, __func__);
|
||||
return Agc::Command::Emit(buf, 0x7au, {0x20000243u, 0x400u | indexSize | (static_cast<std::uint32_t>(cachePolicy) << 6u)}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetNumInstances(CommandBuffer* buf, std::uint32_t numInstances) {
|
||||
return Agc::Command::Emit(buf, 0x2fu, {numInstances}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetNumInstancesGetSize() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetBaseIndirectArgs(CommandBuffer* buf, uint32_t shader_type, const volatile void* indirect_base_addr) {
|
||||
(void)buf;
|
||||
(void)shader_type;
|
||||
(void)indirect_base_addr;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbGetLodStats(CommandBuffer* buf, std::uint8_t cachePolicy, const volatile void* buffer, std::uint32_t bufferSizeInBytes, std::uint32_t resetCount, std::uint8_t forceReset, std::uint8_t reportAndReset, std::uint32_t reportingIntervalIn100kClocks) {
|
||||
Agc::Command::CheckBits(cachePolicy, 3, __func__);
|
||||
Agc::Command::CheckBits(resetCount, 0xffu, __func__);
|
||||
Agc::Command::CheckBits(forceReset, 1, __func__);
|
||||
Agc::Command::CheckBits(reportAndReset, 1, __func__);
|
||||
Agc::Command::CheckBits(reportingIntervalIn100kClocks, 0xffu, __func__);
|
||||
const auto address = reinterpret_cast<std::uintptr_t>(buffer);
|
||||
Agc::Command::CheckAddress(address, 64, __func__);
|
||||
const auto control = (static_cast<std::uint32_t>(cachePolicy) << 28u) | (static_cast<std::uint32_t>(reportAndReset) << 19u) | (static_cast<std::uint32_t>(forceReset) << 18u) | (resetCount << 10u) | (reportingIntervalIn100kClocks << 2u);
|
||||
return Agc::Command::Emit(buf, 0x8eu, {bufferSizeInBytes, static_cast<std::uint32_t>(address), static_cast<std::uint32_t>(address >> 32u), control}, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWINDEXED_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWINDEXED_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWNONINDEXED_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWNONINDEXED_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INDEXBUFFER_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INDEXBUFFER_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INSTANCING_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INSTANCING_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_STATS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_STATS_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
#include "prx/libSceAgc/DcbDraw/include/DrawIndexed.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndex(CommandBuffer* buf, uint32_t index_count, const volatile void* index_addr, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
(void)index_addr;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexAuto(CommandBuffer* buf, uint32_t index_count, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexAutoGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexOffset(CommandBuffer* buf, uint32_t index_offset, uint32_t index_count, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_offset;
|
||||
(void)index_count;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexOffsetGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexIndirect(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexIndirectGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexIndirectMulti(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint32_t count_indirect, uint32_t max_count_or_count, const volatile void* count_addr, uint32_t stride_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)count_indirect;
|
||||
(void)max_count_or_count;
|
||||
(void)count_addr;
|
||||
(void)stride_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexIndirectMultiGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexMultiInstanced(CommandBuffer* buf, uint32_t index_count, const volatile void* index_addr, const volatile void* object_ids, uint32_t instance_count, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
(void)index_addr;
|
||||
(void)object_ids;
|
||||
(void)instance_count;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexMultiInstancedGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#include "prx/libSceAgc/DcbDraw/include/DrawNonIndexed.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndirect(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndirectGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndirectMulti(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint32_t count_indirect, uint32_t max_count_or_count, const volatile void* count_addr, uint32_t stride_in_bytes, uint64_t modifier) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)count_indirect;
|
||||
(void)max_count_or_count;
|
||||
(void)count_addr;
|
||||
(void)stride_in_bytes;
|
||||
(void)modifier;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndirectMultiGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include "prx/libSceAgc/DcbDraw/include/IndexBuffer.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexBuffer(CommandBuffer* buf, std::uint64_t indexAddress) {
|
||||
Agc::Command::CheckAddress(indexAddress, 2, __func__);
|
||||
return Agc::Command::Emit(buf, 0x26u, {static_cast<std::uint32_t>(indexAddress), static_cast<std::uint32_t>(indexAddress >> 32u)}, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetIndexCount(CommandBuffer* buf, uint32_t index_count) {
|
||||
(void)buf;
|
||||
(void)index_count;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexSize(CommandBuffer* buf, std::uint8_t indexSize, std::uint8_t cachePolicy) {
|
||||
Agc::Command::Require(indexSize <= 2, __func__, "invalid index element size");
|
||||
Agc::Command::CheckBits(cachePolicy, 3, __func__);
|
||||
return Agc::Command::Emit(buf, 0x7au, {0x20000243u, 0x400u | indexSize | (static_cast<std::uint32_t>(cachePolicy) << 6u)}, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#include "prx/libSceAgc/DcbDraw/include/Instancing.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetNumInstances(CommandBuffer* buf, std::uint32_t numInstances) {
|
||||
return Agc::Command::Emit(buf, 0x2fu, {numInstances}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetNumInstancesGetSize() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetBaseIndirectArgs(CommandBuffer* buf, uint32_t shader_type, const volatile void* indirect_base_addr) {
|
||||
(void)buf;
|
||||
(void)shader_type;
|
||||
(void)indirect_base_addr;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#include "prx/libSceAgc/DcbDraw/include/Stats.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbGetLodStats(CommandBuffer* buf, std::uint8_t cachePolicy, const volatile void* buffer, std::uint32_t bufferSizeInBytes, std::uint32_t resetCount, std::uint8_t forceReset, std::uint8_t reportAndReset, std::uint32_t reportingIntervalIn100kClocks) {
|
||||
Agc::Command::CheckBits(cachePolicy, 3, __func__);
|
||||
Agc::Command::CheckBits(resetCount, 0xffu, __func__);
|
||||
Agc::Command::CheckBits(forceReset, 1, __func__);
|
||||
Agc::Command::CheckBits(reportAndReset, 1, __func__);
|
||||
Agc::Command::CheckBits(reportingIntervalIn100kClocks, 0xffu, __func__);
|
||||
const auto address = reinterpret_cast<std::uintptr_t>(buffer);
|
||||
Agc::Command::CheckAddress(address, 64, __func__);
|
||||
const auto control = (static_cast<std::uint32_t>(cachePolicy) << 28u) | (static_cast<std::uint32_t>(reportAndReset) << 19u) | (static_cast<std::uint32_t>(forceReset) << 18u) | (resetCount << 10u) | (reportingIntervalIn100kClocks << 2u);
|
||||
return Agc::Command::Emit(buf, 0x8eu, {bufferSizeInBytes, static_cast<std::uint32_t>(address), static_cast<std::uint32_t>(address >> 32u), control}, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
#include "prx/libSceAgc/Command/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
#include "shader/recompilier/Recompiler.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbAcquireMem(CommandBuffer* buf, uint8_t engine, uint32_t cb_db_op, uint32_t gcr_cntl, const volatile void* base, uint64_t size_bytes, uint32_t poll_cycles) {
|
||||
(void)buf;
|
||||
(void)engine;
|
||||
(void)cb_db_op;
|
||||
(void)gcr_cntl;
|
||||
(void)base;
|
||||
(void)size_bytes;
|
||||
(void)poll_cycles;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbAcquireMemGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbCondExec(CommandBuffer* buf, const volatile uint32_t* address, uint32_t num_dwords) {
|
||||
(void)buf;
|
||||
(void)address;
|
||||
(void)num_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbCondExecGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t dst_cache_policy, uint64_t dst_address, uint8_t src, uint8_t src_cache_policy, uint64_t src_address_or_immediate, uint8_t item_size, uint8_t write_confirm) {
|
||||
(void)buf;
|
||||
(void)dst;
|
||||
(void)dst_cache_policy;
|
||||
(void)dst_address;
|
||||
(void)src;
|
||||
(void)src_cache_policy;
|
||||
(void)src_address_or_immediate;
|
||||
(void)item_size;
|
||||
(void)write_confirm;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDmaData(CommandBuffer* buf, std::uint8_t engine, std::uint8_t dst, std::uint8_t dstCachePolicy, std::uint64_t dstAddress, std::uint8_t src, std::uint8_t srcCachePolicy, std::uint64_t srcAddress, std::uint32_t numBytes, std::uint8_t waitForPrevious, std::uint8_t writeConfirm, std::uint8_t blockEngine) {
|
||||
return Agc::Command::WriteDma(buf, false, engine, dst, dstCachePolicy, dstAddress, src, srcCachePolicy, srcAddress, numBytes, waitForPrevious, writeConfirm, blockEngine, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDispatchIndirect(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint32_t flags) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)flags;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDispatchIndirectGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbEventWrite(CommandBuffer* buf, std::uint8_t eventType, const volatile void* address) {
|
||||
Agc::Command::CheckBits(eventType, 0x3fu, __func__);
|
||||
if ((eventType & 0xfeu) == 0x38u) {
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
Agc::Command::CheckAddress(guestAddress, 8, __func__);
|
||||
return Agc::Command::Emit(buf, 0x46u, {0x100u | eventType, static_cast<std::uint32_t>(guestAddress), static_cast<std::uint32_t>(guestAddress >> 32u)}, __func__);
|
||||
}
|
||||
Agc::Command::Require(address == nullptr, __func__, "this event does not use an address");
|
||||
const auto eventIndex = eventType == 7 || eventType == 15 || eventType == 16 ? 0x400u : 0u;
|
||||
return Agc::Command::Emit(buf, 0x46u, {eventIndex | eventType}, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbJump(CommandBuffer* buf, uint8_t mode, uint8_t cache_policy, const uint32_t* target, uint32_t size_in_dwords) {
|
||||
(void)buf;
|
||||
(void)mode;
|
||||
(void)cache_policy;
|
||||
(void)target;
|
||||
(void)size_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbJumpGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbResetQueue(CommandBuffer* buf, uint32_t op, uint32_t state) {
|
||||
(void)buf;
|
||||
(void)op;
|
||||
(void)state;
|
||||
const std::array<std::uint32_t, 1> code = {0xbf810000u};
|
||||
const std::array<std::uint32_t, 1> capabilities = {1u};
|
||||
const std::array<ShaderRecompiler::RegisterValue, 3> shaderRegisters = {{{0x207u, 1u}, {0x208u, 1u}, {0x209u, 1u}}};
|
||||
const std::array<ShaderRecompiler::MemoryRegion, 1> memory = {{{0x10000u, std::as_bytes(std::span(code))}}};
|
||||
const ShaderRecompiler::RecompileRequest request{
|
||||
{ShaderRecompiler::ShaderStage::Compute, 0x10000u, code, 0, {}},
|
||||
{64, 0, {}, shaderRegisters, {}, {}, memory},
|
||||
{0x00403000u, 0x00010600u, 64, capabilities, {}, {1024, 1024, 64}, 1024, 32768},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
(void)ShaderRecompiler::Recompile(request);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbRewind(CommandBuffer* buf, uint32_t initial_state) {
|
||||
(void)buf;
|
||||
(void)initial_state;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbRewindGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbStallCommandBufferParser(CommandBuffer* buf) {
|
||||
return Agc::Command::Emit(buf, 0x42u, {0}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbWaitRegMem(CommandBuffer* buf, std::uint8_t size, std::uint8_t compareFunction, std::uint8_t operation, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t reference, std::uint64_t mask, std::uint32_t pollCycles) {
|
||||
return Agc::Command::WriteWait(buf, size, compareFunction, operation, cachePolicy, address, reference, mask, pollCycles, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbWaitOnAddressGetSize(uint32_t size) {
|
||||
(void)size;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbWaitUntilSafeForRendering(CommandBuffer* buf, uint32_t video_out_handle, uint32_t display_buffer_index) {
|
||||
(void)buf;
|
||||
(void)video_out_handle;
|
||||
(void)display_buffer_index;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbWriteData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t cachePolicy, std::uint64_t address, const void* data, std::uint32_t numDwords, std::uint8_t increment, std::uint8_t writeConfirm) {
|
||||
return Agc::Command::WriteData(buf, false, dst, cachePolicy, address, data, numDwords, increment, writeConfirm, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbWriteDataGetSize(uint32_t num_dwords) {
|
||||
(void)num_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
std::uint64_t APS5_VABI sceAgcDcbEventWriteGetSize(std::uint8_t eventType) {
|
||||
(void)eventType;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcDcbCopyDataGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_CONTROL_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_CONTROL_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_DISPATCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_DISPATCH_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_MEMORY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_MEMORY_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_SYNC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_SYNC_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
#include "prx/libSceAgc/DcbFlow/include/Control.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
#include "shader/recompilier/Recompiler.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbJump(CommandBuffer* buf, uint8_t mode, uint8_t cache_policy, const uint32_t* target, uint32_t size_in_dwords) {
|
||||
(void)buf;
|
||||
(void)mode;
|
||||
(void)cache_policy;
|
||||
(void)target;
|
||||
(void)size_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbJumpGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbResetQueue(CommandBuffer* buf, uint32_t op, uint32_t state) {
|
||||
(void)buf;
|
||||
(void)op;
|
||||
(void)state;
|
||||
const std::array<std::uint32_t, 1> code = {0xbf810000u};
|
||||
const std::array<std::uint32_t, 1> capabilities = {1u};
|
||||
const std::array<ShaderRecompiler::RegisterValue, 3> shaderRegisters = {{{0x207u, 1u}, {0x208u, 1u}, {0x209u, 1u}}};
|
||||
const std::array<ShaderRecompiler::MemoryRegion, 1> memory = {{{0x10000u, std::as_bytes(std::span(code))}}};
|
||||
const ShaderRecompiler::RecompileRequest request{
|
||||
{ShaderRecompiler::ShaderStage::Compute, 0x10000u, code, 0, {}},
|
||||
{64, 0, {}, shaderRegisters, {}, {}, memory},
|
||||
{0x00403000u, 0x00010600u, 64, capabilities, {}, {1024, 1024, 64}, 1024, 32768},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
(void)ShaderRecompiler::Recompile(request);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbRewind(CommandBuffer* buf, uint32_t initial_state) {
|
||||
(void)buf;
|
||||
(void)initial_state;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbRewindGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbWaitUntilSafeForRendering(CommandBuffer* buf, uint32_t video_out_handle, uint32_t display_buffer_index) {
|
||||
(void)buf;
|
||||
(void)video_out_handle;
|
||||
(void)display_buffer_index;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#include "prx/libSceAgc/DcbFlow/include/Dispatch.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
#include "shader/recompilier/Recompiler.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDispatchIndirect(CommandBuffer* buf, uint32_t data_offset_in_bytes, uint32_t flags) {
|
||||
(void)buf;
|
||||
(void)data_offset_in_bytes;
|
||||
(void)flags;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDispatchIndirectGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
#include "prx/libSceAgc/DcbFlow/include/Memory.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
#include "shader/recompilier/Recompiler.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbAcquireMem(CommandBuffer* buf, uint8_t engine, uint32_t cb_db_op, uint32_t gcr_cntl, const volatile void* base, uint64_t size_bytes, uint32_t poll_cycles) {
|
||||
(void)buf;
|
||||
(void)engine;
|
||||
(void)cb_db_op;
|
||||
(void)gcr_cntl;
|
||||
(void)base;
|
||||
(void)size_bytes;
|
||||
(void)poll_cycles;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbAcquireMemGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t dst_cache_policy, uint64_t dst_address, uint8_t src, uint8_t src_cache_policy, uint64_t src_address_or_immediate, uint8_t item_size, uint8_t write_confirm) {
|
||||
(void)buf;
|
||||
(void)dst;
|
||||
(void)dst_cache_policy;
|
||||
(void)dst_address;
|
||||
(void)src;
|
||||
(void)src_cache_policy;
|
||||
(void)src_address_or_immediate;
|
||||
(void)item_size;
|
||||
(void)write_confirm;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcDcbCopyDataGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDmaData(CommandBuffer* buf, std::uint8_t engine, std::uint8_t dst, std::uint8_t dstCachePolicy, std::uint64_t dstAddress, std::uint8_t src, std::uint8_t srcCachePolicy, std::uint64_t srcAddress, std::uint32_t numBytes, std::uint8_t waitForPrevious, std::uint8_t writeConfirm, std::uint8_t blockEngine) {
|
||||
return Agc::Command::WriteDma(buf, false, engine, dst, dstCachePolicy, dstAddress, src, srcCachePolicy, srcAddress, numBytes, waitForPrevious, writeConfirm, blockEngine, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbWriteData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t cachePolicy, std::uint64_t address, const void* data, std::uint32_t numDwords, std::uint8_t increment, std::uint8_t writeConfirm) {
|
||||
return Agc::Command::WriteData(buf, false, dst, cachePolicy, address, data, numDwords, increment, writeConfirm, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbWriteDataGetSize(uint32_t num_dwords) {
|
||||
(void)num_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#include "prx/libSceAgc/DcbFlow/include/Sync.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
#include "shader/recompilier/Recompiler.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbCondExec(CommandBuffer* buf, const volatile uint32_t* address, uint32_t num_dwords) {
|
||||
(void)buf;
|
||||
(void)address;
|
||||
(void)num_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbCondExecGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbWaitRegMem(CommandBuffer* buf, std::uint8_t size, std::uint8_t compareFunction, std::uint8_t operation, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t reference, std::uint64_t mask, std::uint32_t pollCycles) {
|
||||
return Agc::Command::WriteWait(buf, size, compareFunction, operation, cachePolicy, address, reference, mask, pollCycles, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbWaitOnAddressGetSize(uint32_t size) {
|
||||
(void)size;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbEventWrite(CommandBuffer* buf, std::uint8_t eventType, const volatile void* address) {
|
||||
Agc::Command::CheckBits(eventType, 0x3fu, __func__);
|
||||
if ((eventType & 0xfeu) == 0x38u) {
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
Agc::Command::CheckAddress(guestAddress, 8, __func__);
|
||||
return Agc::Command::Emit(buf, 0x46u, {0x100u | eventType, static_cast<std::uint32_t>(guestAddress), static_cast<std::uint32_t>(guestAddress >> 32u)}, __func__);
|
||||
}
|
||||
Agc::Command::Require(address == nullptr, __func__, "this event does not use an address");
|
||||
const auto eventIndex = eventType == 7 || eventType == 15 || eventType == 16 ? 0x400u : 0u;
|
||||
return Agc::Command::Emit(buf, 0x46u, {eventIndex | eventType}, __func__);
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcDcbEventWriteGetSize(std::uint8_t eventType) {
|
||||
(void)eventType;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbStallCommandBufferParser(CommandBuffer* buf) {
|
||||
return Agc::Command::Emit(buf, 0x42u, {0}, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetCxRegisterDirect(CommandBuffer* buf, ShaderRegister reg) {
|
||||
(void)buf;
|
||||
(void)reg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbSetBaseDispatchIndirectArgsGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbQueueEndOfShaderActionGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbGetLodStatsGetSize() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetShRegistersIndirectGetSize(std::uint32_t numRegs) {
|
||||
Agc::Command::CheckBits(numRegs, 0x3fffu, __func__);
|
||||
return 20;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbSetBaseDrawIndirectArgsGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t APS5_VABI sceAgcDcbContextStateOpGetSize(uint32_t operation) {
|
||||
(void)operation;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbSetCxRegisterDirectGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetCxRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteIndirectRegisters(buf, 0x9fu, regs, numRegs, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetShRegisterDirect(CommandBuffer* buf, ShaderRegister reg) {
|
||||
(void)buf;
|
||||
(void)reg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetShRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteIndirectRegisters(buf, 0x63u, regs, numRegs, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetUcRegisterDirect(CommandBuffer* buf, ShaderRegister reg) {
|
||||
(void)buf;
|
||||
(void)reg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetUcRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteIndirectRegisters(buf, 0x64u, regs, numRegs, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbContextStateOp(CommandBuffer* buf, uint32_t operation) {
|
||||
(void)buf;
|
||||
(void)operation;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetFlip(CommandBuffer* buf, uint32_t video_out_handle, int32_t display_buffer_index, uint32_t flip_mode, int64_t flip_arg) {
|
||||
(void)buf;
|
||||
(void)video_out_handle;
|
||||
(void)display_buffer_index;
|
||||
(void)flip_mode;
|
||||
(void)flip_arg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
APS5_EXPORT("23LRUSvYu1M", sceAgcInit);
|
||||
int APS5_VABI sceAgcInit(uint32_t* state, uint32_t ver) {
|
||||
(void)state;
|
||||
(void)ver;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
APS5_EXPORT("qj7QZpgr9Uw", sceAgcDcbContextStateAnotherOp);
|
||||
uint32_t* APS5_VABI sceAgcDcbContextStateAnotherOp(CommandBuffer* buf, uint32_t operation) {
|
||||
(void)buf;
|
||||
(void)operation;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// unconfirmed signature
|
||||
uint32_t* APS5_VABI sceAgcDcbPrimeUtcl2(CommandBuffer* buf, const volatile void* address, uint32_t size_in_bytes) {
|
||||
(void)buf;
|
||||
(void)address;
|
||||
(void)size_in_bytes;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetPredication(CommandBuffer* buf, uint8_t condition, uint8_t op, uint8_t wait_op, const volatile void* address, uint32_t count_in_dwords) {
|
||||
(void)buf;
|
||||
(void)condition;
|
||||
(void)op;
|
||||
(void)wait_op;
|
||||
(void)address;
|
||||
(void)count_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbPopMarker(CommandBuffer* buf) {
|
||||
(void)buf;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbPushMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadComplete(CommandBuffer* buf, uint32_t stream_id, uint32_t workload_id) {
|
||||
(void)buf;
|
||||
(void)stream_id;
|
||||
(void)workload_id;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadsActive(CommandBuffer* buf, uint32_t stream_id, const uint32_t* workload_ids, uint32_t workload_count) {
|
||||
(void)buf;
|
||||
(void)stream_id;
|
||||
(void)workload_ids;
|
||||
(void)workload_count;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_CONTEXTSTATE_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_CONTEXTSTATE_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_DISPLAY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_DISPLAY_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_INIT_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_INIT_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_MARKER_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_MARKER_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_PREDICATION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_PREDICATION_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_REGISTERS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_REGISTERS_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_WORKLOAD_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_WORKLOAD_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
#include "prx/libSceAgc/DcbState/include/ContextState.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbContextStateOp(CommandBuffer* buf, uint32_t operation) {
|
||||
(void)buf;
|
||||
(void)operation;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint64_t APS5_VABI sceAgcDcbContextStateOpGetSize(uint32_t operation) {
|
||||
(void)operation;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
APS5_EXPORT("qj7QZpgr9Uw", sceAgcDcbContextStateAnotherOp);
|
||||
uint32_t* APS5_VABI sceAgcDcbContextStateAnotherOp(CommandBuffer* buf, uint32_t operation) {
|
||||
(void)buf;
|
||||
(void)operation;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbSetBaseDispatchIndirectArgsGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbSetBaseDrawIndirectArgsGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbQueueEndOfShaderActionGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbGetLodStatsGetSize() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include "prx/libSceAgc/DcbState/include/Display.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetFlip(CommandBuffer* buf, uint32_t video_out_handle, int32_t display_buffer_index, uint32_t flip_mode, int64_t flip_arg) {
|
||||
(void)buf;
|
||||
(void)video_out_handle;
|
||||
(void)display_buffer_index;
|
||||
(void)flip_mode;
|
||||
(void)flip_arg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbPrimeUtcl2(CommandBuffer* buf, const volatile void* address, uint32_t size_in_bytes) {
|
||||
(void)buf;
|
||||
(void)address;
|
||||
(void)size_in_bytes;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#include "prx/libSceAgc/DcbState/include/Init.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
APS5_EXPORT("23LRUSvYu1M", sceAgcInit);
|
||||
int APS5_VABI sceAgcInit(uint32_t* state, uint32_t ver) {
|
||||
(void)state;
|
||||
(void)ver;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#include "prx/libSceAgc/DcbState/include/Marker.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbPopMarker(CommandBuffer* buf) {
|
||||
(void)buf;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbPushMarker(CommandBuffer* buf, const char* str, uint32_t color) {
|
||||
(void)buf;
|
||||
(void)str;
|
||||
(void)color;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#include "prx/libSceAgc/DcbState/include/Predication.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetPredication(CommandBuffer* buf, uint8_t condition, uint8_t op, uint8_t wait_op, const volatile void* address, uint32_t count_in_dwords) {
|
||||
(void)buf;
|
||||
(void)condition;
|
||||
(void)op;
|
||||
(void)wait_op;
|
||||
(void)address;
|
||||
(void)count_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
#include "prx/libSceAgc/DcbState/include/Registers.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetCxRegisterDirect(CommandBuffer* buf, ShaderRegister reg) {
|
||||
(void)buf;
|
||||
(void)reg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbSetCxRegisterDirectGetSize(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetCxRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteIndirectRegisters(buf, 0x9fu, regs, numRegs, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetShRegisterDirect(CommandBuffer* buf, ShaderRegister reg) {
|
||||
(void)buf;
|
||||
(void)reg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetShRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteIndirectRegisters(buf, 0x63u, regs, numRegs, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetShRegistersIndirectGetSize(std::uint32_t numRegs) {
|
||||
Agc::Command::CheckBits(numRegs, 0x3fffu, __func__);
|
||||
return 20;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetUcRegisterDirect(CommandBuffer* buf, ShaderRegister reg) {
|
||||
(void)buf;
|
||||
(void)reg;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetUcRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs) {
|
||||
return Agc::Command::WriteIndirectRegisters(buf, 0x64u, regs, numRegs, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#include "prx/libSceAgc/DcbState/include/Workload.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadComplete(CommandBuffer* buf, uint32_t stream_id, uint32_t workload_id) {
|
||||
(void)buf;
|
||||
(void)stream_id;
|
||||
(void)workload_id;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadsActive(CommandBuffer* buf, uint32_t stream_id, const uint32_t* workload_ids, uint32_t workload_count) {
|
||||
(void)buf;
|
||||
(void)stream_id;
|
||||
(void)workload_ids;
|
||||
(void)workload_count;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_PACKETINFO_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_PACKETINFO_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_REGISTERDEFAULTS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_REGISTERDEFAULTS_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SHADERFUSION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SHADERFUSION_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SUSPEND_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SUSPEND_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#include "prx/libSceAgc/Misc/include/PacketInfo.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t APS5_VABI sceAgcGetPacketSize(uint32_t* packet) {
|
||||
(void)packet;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcGetDataPacketPayloadAddress(uint32_t** addr, uint32_t* cmd, int type) {
|
||||
(void)addr;
|
||||
(void)cmd;
|
||||
(void)type;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
APS5_EXPORT("V++UgBtQhn0", sceAgcGetDataPacketPayloadAnotherAddress);
|
||||
int APS5_VABI sceAgcGetDataPacketPayloadAnotherAddress(uint32_t** addr, uint32_t* cmd, int type) {
|
||||
(void)addr;
|
||||
(void)cmd;
|
||||
(void)type;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#include "prx/libSceAgc/Misc/include/RegisterDefaults.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults2(uint32_t ver) {
|
||||
(void)ver;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults2Internal(uint32_t ver) {
|
||||
(void)ver;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
#include "prx/libSceAgc/Misc/include/ShaderFusion.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
|
|
@ -10,18 +12,6 @@ struct SizeAlign {
|
|||
|
||||
extern "C" {
|
||||
|
||||
uint32_t APS5_VABI sceAgcGetPacketSize(uint32_t* packet) {
|
||||
(void)packet;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults2(uint32_t ver) {
|
||||
(void)ver;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
APS5_EXPORT("fd5Bp5tGTgo", sceAgcUnknownFuseShaderHalves);
|
||||
int APS5_VABI sceAgcUnknownFuseShaderHalves(Shader* fused_result, const Shader* front, const Shader* back, void* scratch_mem) {
|
||||
(void)fused_result;
|
||||
|
|
@ -41,15 +31,6 @@ int APS5_VABI sceAgcUnknownGetFusedShaderSize(SizeAlign* dst, const Shader* fron
|
|||
return 0;
|
||||
}
|
||||
|
||||
APS5_EXPORT("V++UgBtQhn0", sceAgcGetDataPacketPayloadAnotherAddress);
|
||||
int APS5_VABI sceAgcGetDataPacketPayloadAnotherAddress(uint32_t** addr, uint32_t* cmd, int type) {
|
||||
(void)addr;
|
||||
(void)cmd;
|
||||
(void)type;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
APS5_EXPORT("k0E7vkgqAuE", sceAgcCreateInterpolantMappingVsPs);
|
||||
int APS5_VABI sceAgcCreateInterpolantMappingVsPs(ShaderRegister* regs, const Shader* vs, const Shader* ps) {
|
||||
(void)regs;
|
||||
|
|
@ -59,23 +40,4 @@ int APS5_VABI sceAgcCreateInterpolantMappingVsPs(ShaderRegister* regs, const Sha
|
|||
return 0;
|
||||
}
|
||||
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults2Internal(uint32_t ver) {
|
||||
(void)ver;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcGetDataPacketPayloadAddress(uint32_t** addr, uint32_t* cmd, int type) {
|
||||
(void)addr;
|
||||
(void)cmd;
|
||||
(void)type;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSuspendPoint(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#include "prx/libSceAgc/Misc/include/Suspend.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSuspendPoint(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
#include "prx/libSceAgc/Command/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcDmaDataPatchSetDstAddressOrOffset(std::uint32_t* cmd, std::uint64_t address) {
|
||||
Agc::Command::ValidatePacket(cmd, 0x50u, 7, __func__);
|
||||
cmd[4] = static_cast<std::uint32_t>(address);
|
||||
cmd[5] = static_cast<std::uint32_t>(address >> 32u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcDmaDataPatchSetSrcAddressOrOffsetOrImmediate(std::uint32_t* cmd, std::uint64_t address) {
|
||||
Agc::Command::ValidatePacket(cmd, 0x50u, 7, __func__);
|
||||
cmd[2] = static_cast<std::uint32_t>(address);
|
||||
cmd[3] = static_cast<std::uint32_t>(address >> 32u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcJumpPatchSetTarget(uint32_t* cmd, const volatile uint32_t* target, uint32_t size_in_dwords) {
|
||||
(void)cmd;
|
||||
(void)target;
|
||||
(void)size_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchAddress(uint32_t* cmd, const volatile Label* address) {
|
||||
(void)cmd;
|
||||
(void)address;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcSetNop(CommandBuffer* buf, std::uint32_t sizeDw) {
|
||||
return Agc::Command::WriteNop(buf, sizeDw, __func__);
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchData(uint32_t* cmd, uint32_t context_id, uint32_t data_sel, uint64_t data) {
|
||||
(void)cmd;
|
||||
(void)context_id;
|
||||
(void)data_sel;
|
||||
(void)data;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcRewindPatchSetRewindState(uint32_t* cmd, uint8_t state) {
|
||||
(void)cmd;
|
||||
(void)state;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchAddress(std::uint32_t* cmd, const volatile void* address) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
const auto alignment = ((wait[0] >> 8u) & 0xffu) == 0x3cu ? 4u : 8u;
|
||||
Agc::Command::CheckAddress(guestAddress, alignment, __func__);
|
||||
Agc::Command::CheckBits(guestAddress, 0xffffffffffffull, __func__);
|
||||
cmd[2] = (cmd[2] & 0xffff0000u) | static_cast<std::uint32_t>(guestAddress >> 32u);
|
||||
cmd[3] = static_cast<std::uint32_t>(guestAddress);
|
||||
wait[2] = static_cast<std::uint32_t>(guestAddress);
|
||||
wait[3] = static_cast<std::uint32_t>(guestAddress >> 32u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchReference(std::uint32_t* cmd, std::uint64_t reference) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
Agc::Command::CheckBits(reference, 0xffffffffu, __func__);
|
||||
wait[4] = static_cast<std::uint32_t>(reference);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcCondExecPatchSetCommandAddress(uint32_t* cmd, const volatile uint32_t* command) {
|
||||
(void)cmd;
|
||||
(void)command;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcCondExecPatchSetEnd(uint32_t* cmd, const volatile uint32_t* buffer) {
|
||||
(void)cmd;
|
||||
(void)buffer;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs) {
|
||||
Agc::Command::PatchIndirectCount(cmd, 0x9fu, numRegs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs) {
|
||||
Agc::Command::PatchIndirectAddress(cmd, 0x9fu, regs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchSetNumRegisters(uint32_t* cmd, uint32_t num_regs) {
|
||||
(void)cmd;
|
||||
(void)num_regs;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs) {
|
||||
Agc::Command::PatchIndirectCount(cmd, 0x63u, numRegs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs) {
|
||||
Agc::Command::PatchIndirectAddress(cmd, 0x63u, regs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchSetNumRegisters(uint32_t* cmd, uint32_t num_regs) {
|
||||
(void)cmd;
|
||||
(void)num_regs;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs) {
|
||||
Agc::Command::PatchIndirectCount(cmd, 0x64u, numRegs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs) {
|
||||
Agc::Command::PatchIndirectAddress(cmd, 0x64u, regs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchSetNumRegisters(uint32_t* cmd, uint32_t num_regs) {
|
||||
(void)cmd;
|
||||
(void)num_regs;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
int APS5_VABI sceAgcAsyncCondExecPatchSetCommandAddress(std::uint32_t* cmd, const volatile std::uint32_t* command) {
|
||||
(void)cmd;
|
||||
(void)command;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcAsyncCondExecPatchSetEnd(std::uint32_t* cmd, const volatile std::uint32_t* buffer) {
|
||||
(void)cmd;
|
||||
(void)buffer;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_CONDEXEC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_CONDEXEC_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_DMA_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_DMA_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_INDIRECTREGISTERS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_INDIRECTREGISTERS_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_JUMP_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_JUMP_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_NOP_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_NOP_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_QUEUEENDOFPIPEACTION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_QUEUEENDOFPIPEACTION_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_REWIND_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_REWIND_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_WAITREGMEM_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_WAITREGMEM_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#include "prx/libSceAgc/Patch/include/CondExec.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCondExecPatchSetCommandAddress(uint32_t* cmd, const volatile uint32_t* command) {
|
||||
(void)cmd;
|
||||
(void)command;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcCondExecPatchSetEnd(uint32_t* cmd, const volatile uint32_t* buffer) {
|
||||
(void)cmd;
|
||||
(void)buffer;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcAsyncCondExecPatchSetCommandAddress(std::uint32_t* cmd, const volatile std::uint32_t* command) {
|
||||
(void)cmd;
|
||||
(void)command;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcAsyncCondExecPatchSetEnd(std::uint32_t* cmd, const volatile std::uint32_t* buffer) {
|
||||
(void)cmd;
|
||||
(void)buffer;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#include "prx/libSceAgc/Patch/include/Dma.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcDmaDataPatchSetDstAddressOrOffset(std::uint32_t* cmd, std::uint64_t address) {
|
||||
Agc::Command::ValidatePacket(cmd, 0x50u, 7, __func__);
|
||||
cmd[4] = static_cast<std::uint32_t>(address);
|
||||
cmd[5] = static_cast<std::uint32_t>(address >> 32u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcDmaDataPatchSetSrcAddressOrOffsetOrImmediate(std::uint32_t* cmd, std::uint64_t address) {
|
||||
Agc::Command::ValidatePacket(cmd, 0x50u, 7, __func__);
|
||||
cmd[2] = static_cast<std::uint32_t>(address);
|
||||
cmd[3] = static_cast<std::uint32_t>(address >> 32u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
#include "prx/libSceAgc/Patch/include/IndirectRegisters.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs) {
|
||||
Agc::Command::PatchIndirectCount(cmd, 0x9fu, numRegs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs) {
|
||||
Agc::Command::PatchIndirectAddress(cmd, 0x9fu, regs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchSetNumRegisters(uint32_t* cmd, uint32_t num_regs) {
|
||||
(void)cmd;
|
||||
(void)num_regs;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs) {
|
||||
Agc::Command::PatchIndirectCount(cmd, 0x63u, numRegs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs) {
|
||||
Agc::Command::PatchIndirectAddress(cmd, 0x63u, regs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchSetNumRegisters(uint32_t* cmd, uint32_t num_regs) {
|
||||
(void)cmd;
|
||||
(void)num_regs;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs) {
|
||||
Agc::Command::PatchIndirectCount(cmd, 0x64u, numRegs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs) {
|
||||
Agc::Command::PatchIndirectAddress(cmd, 0x64u, regs, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchSetNumRegisters(uint32_t* cmd, uint32_t num_regs) {
|
||||
(void)cmd;
|
||||
(void)num_regs;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#include "prx/libSceAgc/Patch/include/Jump.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcJumpPatchSetTarget(uint32_t* cmd, const volatile uint32_t* target, uint32_t size_in_dwords) {
|
||||
(void)cmd;
|
||||
(void)target;
|
||||
(void)size_in_dwords;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#include "prx/libSceAgc/Patch/include/Nop.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcSetNop(CommandBuffer* buf, std::uint32_t sizeDw) {
|
||||
return Agc::Command::WriteNop(buf, sizeDw, __func__);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#include "prx/libSceAgc/Patch/include/QueueEndOfPipeAction.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchAddress(uint32_t* cmd, const volatile Label* address) {
|
||||
(void)cmd;
|
||||
(void)address;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchData(uint32_t* cmd, uint32_t context_id, uint32_t data_sel, uint64_t data) {
|
||||
(void)cmd;
|
||||
(void)context_id;
|
||||
(void)data_sel;
|
||||
(void)data;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#include "prx/libSceAgc/Patch/include/Rewind.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcRewindPatchSetRewindState(uint32_t* cmd, uint8_t state) {
|
||||
(void)cmd;
|
||||
(void)state;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#include "prx/libSceAgc/Patch/include/WaitRegMem.hpp"
|
||||
|
||||
#include "prx/libSceAgc/Command/include/Memory.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchAddress(std::uint32_t* cmd, const volatile void* address) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
const auto alignment = ((wait[0] >> 8u) & 0xffu) == 0x3cu ? 4u : 8u;
|
||||
Agc::Command::CheckAddress(guestAddress, alignment, __func__);
|
||||
Agc::Command::CheckBits(guestAddress, 0xffffffffffffull, __func__);
|
||||
cmd[2] = (cmd[2] & 0xffff0000u) | static_cast<std::uint32_t>(guestAddress >> 32u);
|
||||
cmd[3] = static_cast<std::uint32_t>(guestAddress);
|
||||
wait[2] = static_cast<std::uint32_t>(guestAddress);
|
||||
wait[3] = static_cast<std::uint32_t>(guestAddress >> 32u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchReference(std::uint32_t* cmd, std::uint64_t reference) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
Agc::Command::CheckBits(reference, 0xffffffffu, __func__);
|
||||
wait[4] = static_cast<std::uint32_t>(reference);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PREDICATION_INCLUDE_PREDICATION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PREDICATION_INCLUDE_PREDICATION_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
#include "prx/libSceAgc/Predication/include/Predication.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
|
|
@ -19,4 +21,5 @@ int APS5_VABI sceAgcSetRangePredication(uint32_t* start, const volatile uint32_t
|
|||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,166 +0,0 @@
|
|||
#include <cstdio>
|
||||
#include <stdexcept>
|
||||
#include <prx/libc/include/General.hpp>
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
#include "ShaderUtils.hpp"
|
||||
#include "ShaderConstants.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCreateShader(Shader** dst, void* header, const volatile void* code) {
|
||||
constexpr auto fn = __func__;
|
||||
if (dst == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": dst is null");
|
||||
}
|
||||
if (header == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": header is null");
|
||||
}
|
||||
if (code == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": code is null");
|
||||
}
|
||||
|
||||
auto* h = static_cast<Shader*>(header);
|
||||
|
||||
ResolveRelativePtr(h->cx_registers);
|
||||
ResolveRelativePtr(h->sh_registers);
|
||||
ResolveRelativePtr(h->user_data);
|
||||
ResolveRelativePtr(h->specials);
|
||||
ResolveRelativePtr(h->input_semantics);
|
||||
ResolveRelativePtr(h->output_semantics);
|
||||
|
||||
if (h->user_data != nullptr) {
|
||||
ResolveRelativePtr(h->user_data->direct_resource_offset);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[0]);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[1]);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[2]);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[3]);
|
||||
}
|
||||
|
||||
h->code = code;
|
||||
|
||||
if (h->file_header != ShaderRegs::SHADER_FILE_HEADER_MAGIC) {
|
||||
throw std::runtime_error(std::string(fn) + ": invalid file_header magic");
|
||||
}
|
||||
if (h->version != ShaderRegs::SHADER_VERSION) {
|
||||
throw std::runtime_error(std::string(fn) + ": unsupported shader version");
|
||||
}
|
||||
|
||||
const auto base = reinterpret_cast<std::uint64_t>(code);
|
||||
|
||||
if ((base & ShaderRegs::SHADER_BASE_ALIGN_MASK) != 0) {
|
||||
throw std::runtime_error(std::string(fn) + ": code address violates alignment mask");
|
||||
}
|
||||
|
||||
int result = PatchProgramAddressRegister(h->sh_registers, h->num_sh_registers, h->type, base);
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
*dst = h;
|
||||
APS5_LOG_OUT("OK type=%u sh_regs=%u shader_size=%u", h->type, h->num_sh_registers, h->shader_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcCreatePrimState(ShaderRegister* cx_regs, ShaderRegister* uc_regs, const Shader* hs, const Shader* gs, std::uint32_t prim_type) {
|
||||
if (cx_regs == nullptr && uc_regs == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
if (gs == nullptr) {
|
||||
throw std::runtime_error(std::string(__func__) + ": gs is null");
|
||||
}
|
||||
|
||||
if (cx_regs != nullptr) {
|
||||
cx_regs[0] = gs->specials->vgt_shader_stages_en;
|
||||
if ((cx_regs[0].value & ShaderRegs::VGT_SHADER_STAGES_GS_BIT) != 0) {
|
||||
cx_regs[1] = gs->specials->vgt_gs_out_prim_type;
|
||||
} else {
|
||||
cx_regs[1].offset = ShaderRegs::VGT_GS_OUT_PRIM_TYPE;
|
||||
cx_regs[1].value = GraphicsPrimTypeToGsOut(prim_type);
|
||||
}
|
||||
|
||||
if (hs != nullptr) {
|
||||
cx_regs[0].value |= hs->specials->vgt_shader_stages_en.value;
|
||||
if ((cx_regs[0].value & ShaderRegs::VGT_SHADER_STAGES_GS_BIT) == 0) {
|
||||
cx_regs[1] = hs->specials->vgt_gs_out_prim_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uc_regs != nullptr) {
|
||||
uc_regs[0] = gs->specials->ge_cntl;
|
||||
uc_regs[1] = gs->specials->ge_user_vgpr_en;
|
||||
uc_regs[2].offset = ShaderRegs::VGT_PRIMITIVE_TYPE;
|
||||
uc_regs[2].value = prim_type;
|
||||
|
||||
if (hs != nullptr) {
|
||||
uc_regs[1] = hs->specials->ge_user_vgpr_en;
|
||||
}
|
||||
}
|
||||
|
||||
APS5_LOG_OUT("OK prim_type=%u", prim_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcUpdatePrimState(ShaderRegister* cx_regs, ShaderRegister* uc_regs, std::uint32_t prim_type) {
|
||||
if (cx_regs != nullptr && (cx_regs[0].value & (ShaderRegs::VGT_SHADER_STAGES_GS_BIT | ShaderRegs::VGT_SHADER_STAGES_NGG_BIT)) == 0) {
|
||||
cx_regs[1].value &= ~0x7u;
|
||||
cx_regs[1].value |= GraphicsPrimTypeToGsOut(prim_type);
|
||||
}
|
||||
|
||||
if (uc_regs != nullptr) {
|
||||
uc_regs[2].value &= ~0x1Fu;
|
||||
uc_regs[2].value |= prim_type;
|
||||
}
|
||||
|
||||
APS5_LOG_OUT("OK prim_type=%u", prim_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
APS5_EXPORT("HV4j+E0MBHE", sceAgcCreateInterpolantMapping);
|
||||
int APS5_VABI sceAgcCreateInterpolantMapping(ShaderRegister* regs, const Shader* gs, const Shader* ps) {
|
||||
constexpr auto fn = __func__;
|
||||
if (regs == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": regs is null");
|
||||
}
|
||||
|
||||
if (ps == nullptr || ps->num_input_semantics == 0) {
|
||||
FillIdentityInterpolants(regs, 0);
|
||||
APS5_LOG_CHARS_OUT("OK identity ps_inputs=0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ps->num_input_semantics != 0 && ps->input_semantics == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": ps->input_semantics is null but num_input_semantics != 0");
|
||||
}
|
||||
|
||||
if (gs == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": gs is null");
|
||||
}
|
||||
|
||||
if (gs->num_output_semantics != 0 && gs->output_semantics == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": gs->output_semantics is null but num_output_semantics != 0");
|
||||
}
|
||||
|
||||
for (std::uint32_t i = 0; i < ps->num_input_semantics; ++i) {
|
||||
const ShaderSemantic& psSemantic = ps->input_semantics[i];
|
||||
const ShaderSemantic* gsSemantic = FindOutputSemantic(gs, psSemantic.semantic);
|
||||
const std::uint32_t psWord = ShaderSemanticWord(psSemantic);
|
||||
|
||||
std::uint32_t value = ((psWord & 0x00300000u) != 0)
|
||||
? CreateInterpolantF16Value(psWord, gsSemantic)
|
||||
: CreateInterpolantNonF16Value(psWord, gsSemantic);
|
||||
|
||||
value = (gsSemantic == nullptr)
|
||||
? CreateInterpolantDefaultValue(value, psWord)
|
||||
: CreateInterpolantMappingValue(value, psWord, ShaderSemanticWord(*gsSemantic));
|
||||
|
||||
SetInterpolantRegister(regs, i, value);
|
||||
}
|
||||
|
||||
FillIdentityInterpolants(regs, ps->num_input_semantics);
|
||||
APS5_LOG_OUT("OK ps_inputs=%u gs_outputs=%u", ps->num_input_semantics, gs->num_output_semantics);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_CREATESHADER_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_CREATESHADER_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_INTERPOLANTMAPPING_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_INTERPOLANTMAPPING_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_PRIMSTATE_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_PRIMSTATE_HPP
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef CORE_LIBS_LIBSCEAGC_SHADER_SHADERS_HPP
|
||||
#define CORE_LIBS_LIBSCEAGC_SHADER_SHADERS_HPP
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_SHADERCONSTANTS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_SHADERCONSTANTS_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
#ifndef CORE_LIBS_LIBSCEAGC_SHADER_UTILS_HPP
|
||||
#define CORE_LIBS_LIBSCEAGC_SHADER_UTILS_HPP
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_SHADERUTILS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_SHADERUTILS_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include "SceShaders.hpp"
|
||||
#include "ShaderConstants.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderConstants.hpp"
|
||||
|
||||
template <typename T>
|
||||
void ResolveRelativePtr(T*& field) {
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
#include "prx/libSceAgc/Shader/include/CreateShader.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <stdexcept>
|
||||
#include <prx/libc/include/General.hpp>
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderUtils.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderConstants.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCreateShader(Shader** dst, void* header, const volatile void* code) {
|
||||
constexpr auto fn = __func__;
|
||||
if (dst == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": dst is null");
|
||||
}
|
||||
if (header == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": header is null");
|
||||
}
|
||||
if (code == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": code is null");
|
||||
}
|
||||
|
||||
auto* h = static_cast<Shader*>(header);
|
||||
|
||||
ResolveRelativePtr(h->cx_registers);
|
||||
ResolveRelativePtr(h->sh_registers);
|
||||
ResolveRelativePtr(h->user_data);
|
||||
ResolveRelativePtr(h->specials);
|
||||
ResolveRelativePtr(h->input_semantics);
|
||||
ResolveRelativePtr(h->output_semantics);
|
||||
|
||||
if (h->user_data != nullptr) {
|
||||
ResolveRelativePtr(h->user_data->direct_resource_offset);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[0]);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[1]);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[2]);
|
||||
ResolveRelativePtr(h->user_data->sharp_resource_offset[3]);
|
||||
}
|
||||
|
||||
h->code = code;
|
||||
|
||||
if (h->file_header != ShaderRegs::SHADER_FILE_HEADER_MAGIC) {
|
||||
throw std::runtime_error(std::string(fn) + ": invalid file_header magic");
|
||||
}
|
||||
if (h->version != ShaderRegs::SHADER_VERSION) {
|
||||
throw std::runtime_error(std::string(fn) + ": unsupported shader version");
|
||||
}
|
||||
|
||||
const auto base = reinterpret_cast<std::uint64_t>(code);
|
||||
|
||||
if ((base & ShaderRegs::SHADER_BASE_ALIGN_MASK) != 0) {
|
||||
throw std::runtime_error(std::string(fn) + ": code address violates alignment mask");
|
||||
}
|
||||
|
||||
int result = PatchProgramAddressRegister(h->sh_registers, h->num_sh_registers, h->type, base);
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
*dst = h;
|
||||
APS5_LOG_OUT("OK type=%u sh_regs=%u shader_size=%u", h->type, h->num_sh_registers, h->shader_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
#include "prx/libSceAgc/Shader/include/InterpolantMapping.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <stdexcept>
|
||||
#include <prx/libc/include/General.hpp>
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderUtils.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderConstants.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
APS5_EXPORT("HV4j+E0MBHE", sceAgcCreateInterpolantMapping);
|
||||
int APS5_VABI sceAgcCreateInterpolantMapping(ShaderRegister* regs, const Shader* gs, const Shader* ps) {
|
||||
constexpr auto fn = __func__;
|
||||
if (regs == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": regs is null");
|
||||
}
|
||||
|
||||
if (ps == nullptr || ps->num_input_semantics == 0) {
|
||||
FillIdentityInterpolants(regs, 0);
|
||||
APS5_LOG_CHARS_OUT("OK identity ps_inputs=0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ps->num_input_semantics != 0 && ps->input_semantics == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": ps->input_semantics is null but num_input_semantics != 0");
|
||||
}
|
||||
|
||||
if (gs == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": gs is null");
|
||||
}
|
||||
|
||||
if (gs->num_output_semantics != 0 && gs->output_semantics == nullptr) {
|
||||
throw std::runtime_error(std::string(fn) + ": gs->output_semantics is null but num_output_semantics != 0");
|
||||
}
|
||||
|
||||
for (std::uint32_t i = 0; i < ps->num_input_semantics; ++i) {
|
||||
const ShaderSemantic& psSemantic = ps->input_semantics[i];
|
||||
const ShaderSemantic* gsSemantic = FindOutputSemantic(gs, psSemantic.semantic);
|
||||
const std::uint32_t psWord = ShaderSemanticWord(psSemantic);
|
||||
|
||||
std::uint32_t value = ((psWord & 0x00300000u) != 0)
|
||||
? CreateInterpolantF16Value(psWord, gsSemantic)
|
||||
: CreateInterpolantNonF16Value(psWord, gsSemantic);
|
||||
|
||||
value = (gsSemantic == nullptr)
|
||||
? CreateInterpolantDefaultValue(value, psWord)
|
||||
: CreateInterpolantMappingValue(value, psWord, ShaderSemanticWord(*gsSemantic));
|
||||
|
||||
SetInterpolantRegister(regs, i, value);
|
||||
}
|
||||
|
||||
FillIdentityInterpolants(regs, ps->num_input_semantics);
|
||||
APS5_LOG_OUT("OK ps_inputs=%u gs_outputs=%u", ps->num_input_semantics, gs->num_output_semantics);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
#include "prx/libSceAgc/Shader/include/PrimState.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <stdexcept>
|
||||
#include <prx/libc/include/General.hpp>
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderUtils.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderConstants.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCreatePrimState(ShaderRegister* cx_regs, ShaderRegister* uc_regs, const Shader* hs, const Shader* gs, std::uint32_t prim_type) {
|
||||
if (cx_regs == nullptr && uc_regs == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
if (gs == nullptr) {
|
||||
throw std::runtime_error(std::string(__func__) + ": gs is null");
|
||||
}
|
||||
|
||||
if (cx_regs != nullptr) {
|
||||
cx_regs[0] = gs->specials->vgt_shader_stages_en;
|
||||
if ((cx_regs[0].value & ShaderRegs::VGT_SHADER_STAGES_GS_BIT) != 0) {
|
||||
cx_regs[1] = gs->specials->vgt_gs_out_prim_type;
|
||||
} else {
|
||||
cx_regs[1].offset = ShaderRegs::VGT_GS_OUT_PRIM_TYPE;
|
||||
cx_regs[1].value = GraphicsPrimTypeToGsOut(prim_type);
|
||||
}
|
||||
|
||||
if (hs != nullptr) {
|
||||
cx_regs[0].value |= hs->specials->vgt_shader_stages_en.value;
|
||||
if ((cx_regs[0].value & ShaderRegs::VGT_SHADER_STAGES_GS_BIT) == 0) {
|
||||
cx_regs[1] = hs->specials->vgt_gs_out_prim_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uc_regs != nullptr) {
|
||||
uc_regs[0] = gs->specials->ge_cntl;
|
||||
uc_regs[1] = gs->specials->ge_user_vgpr_en;
|
||||
uc_regs[2].offset = ShaderRegs::VGT_PRIMITIVE_TYPE;
|
||||
uc_regs[2].value = prim_type;
|
||||
|
||||
if (hs != nullptr) {
|
||||
uc_regs[1] = hs->specials->ge_user_vgpr_en;
|
||||
}
|
||||
}
|
||||
|
||||
APS5_LOG_OUT("OK prim_type=%u", prim_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcUpdatePrimState(ShaderRegister* cx_regs, ShaderRegister* uc_regs, std::uint32_t prim_type) {
|
||||
if (cx_regs != nullptr && (cx_regs[0].value & (ShaderRegs::VGT_SHADER_STAGES_GS_BIT | ShaderRegs::VGT_SHADER_STAGES_NGG_BIT)) == 0) {
|
||||
cx_regs[1].value &= ~0x7u;
|
||||
cx_regs[1].value |= GraphicsPrimTypeToGsOut(prim_type);
|
||||
}
|
||||
|
||||
if (uc_regs != nullptr) {
|
||||
uc_regs[2].value &= ~0x1Fu;
|
||||
uc_regs[2].value |= prim_type;
|
||||
}
|
||||
|
||||
APS5_LOG_OUT("OK prim_type=%u", prim_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdexcept>
|
||||
#include "ShaderUtils.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderUtils.hpp"
|
||||
|
||||
using namespace ShaderRegs;
|
||||
|
||||
Loading…
Reference in New Issue