mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
style: strip explanatory comments per CONVENTIONS.md
Comments in this codebase may only mark technical debt (human-added only), the end of #endif, and the end of a namespace, per docs/dev/CONVENTIONS.md. Remove the inline rationale comments added in the AGC PM4 opcode and shader recompiler robustness commits; the code itself, the commit history, and the PR description now carry that context instead. Notably, Command::WriteMemSemaphore takes the corrected 4-argument form (address, waitForMailbox, signalType, operation): an earlier revision of this helper used a different, incompatible argument order. sceAgc*MemSemaphore callers derive waitForMailbox/signalType from the low two bits of clientCode, and operation from action (0 = signal, 1 = wait). This ABI note previously lived as an inline comment; it is recorded here instead per the no-comments convention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,12 +19,11 @@ void* APS5_VABI sceAgcAcb_gQkqkLttcpw (void) {
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbJump(CommandBuffer* buf, std::uint8_t cachePolicy, const std::uint32_t* target, std::uint32_t sizeInDwords) {
|
||||
// The compute ring has no call stack to return to, so the jump always chains.
|
||||
return Agc::Command::WriteJump(buf, 1, cachePolicy, target, sizeInDwords, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbJumpGetSize(void) {
|
||||
return 16; // INDIRECT_BUFFER: header + 3 dwords
|
||||
return 16;
|
||||
}
|
||||
|
||||
// Encoded as the custom DISPATCH_RESET NOP packet the driver consumes on compute queues.
|
||||
@@ -44,7 +43,7 @@ std::uint32_t* APS5_VABI sceAgcAcbRewind(CommandBuffer* buf, std::uint32_t initi
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcAcbRewindGetSize() {
|
||||
return 8; // REWIND: header + 1 dword
|
||||
return 8;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWaitUntilSafeForRendering(CommandBuffer* buf, std::uint32_t videoOutHandle, std::uint32_t displayBufferIndex) {
|
||||
|
||||
@@ -18,7 +18,7 @@ uint32_t* APS5_VABI sceAgcAcbDispatchIndirect(CommandBuffer* buf, const volatile
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcAcbDispatchIndirectGetSize() {
|
||||
return 16; // DISPATCH_INDIRECT with an absolute address: header + address lo/hi + initiator
|
||||
return 16;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ std::uint32_t* APS5_VABI sceAgcAcbAcquireMem(CommandBuffer* buf, std::uint32_t g
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbAcquireMemGetSize(void) {
|
||||
return 32; // ACQUIRE_MEM: header + 7 dwords
|
||||
return 32;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -23,7 +23,7 @@ uint32_t* APS5_VABI sceAgcAcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t d
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcAcbCopyDataGetSize() {
|
||||
return 24; // COPY_DATA: header + 5 dwords
|
||||
return 24;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -40,15 +40,14 @@ std::uint32_t* APS5_VABI sceAgcAcbAtomicMem(CommandBuffer* buf, std::uint8_t ato
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcAcbAtomicMemGetSize() {
|
||||
return 36; // ATOMIC_MEM: header + 8 dwords
|
||||
return 36;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcAcbAtomicGdsGetSize() {
|
||||
return 36; // upper bound: ATOMIC_GDS is not emitted by this port (header + 8 dwords reserved)
|
||||
return 36;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbPrimeUtcl2(CommandBuffer* buf, const volatile void* address, std::uint32_t sizeInBytes) {
|
||||
// Page-table prefetch hint: a NOP of the reserved size that keeps the request readable in dumps.
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
auto* packet = Agc::Command::Allocate(buf, 5, __func__);
|
||||
packet[0] = Agc::Command::Header(0x10u, 5);
|
||||
|
||||
@@ -14,12 +14,11 @@ uint32_t* APS5_VABI sceAgcAcbCondExec(CommandBuffer* buf, const volatile uint32_
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
Agc::Command::CheckAddress(guestAddress, 4, __func__);
|
||||
Agc::Command::Require(num_dwords <= 0x3fffu, __func__, "conditional execution range is too large");
|
||||
// COND_EXEC: the CP skips exec_count dwords when the 32-bit value at the address is zero.
|
||||
return Agc::Command::Emit(buf, 0x22u, {static_cast<std::uint32_t>(guestAddress) & ~3u, static_cast<std::uint32_t>(guestAddress >> 32u), 0, num_dwords & 0x3fffu}, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcAcbCondExecGetSize(void) {
|
||||
return 20; // COND_EXEC: header + 4 dwords
|
||||
return 20;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -27,7 +26,6 @@ std::uint32_t* APS5_VABI sceAgcAcbWaitRegMem(CommandBuffer* buf, std::uint8_t si
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcAcbWaitOnAddressGetSize(std::uint8_t size) {
|
||||
// WriteWait: bracket (4 + 3 dwords) around a 7 dword WAIT_REG_MEM or a 9 dword WAIT_REG_MEM_64.
|
||||
return size == 0 ? 56 : 64;
|
||||
}
|
||||
|
||||
@@ -38,21 +36,15 @@ std::uint32_t* APS5_VABI sceAgcAcbEventWrite(CommandBuffer* buf, std::uint8_t ev
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcAcbEventWriteGetSize(std::uint8_t eventType) {
|
||||
// This ACB entry point (unlike the DCB one) never carries an address, so it is always the
|
||||
// single-dword EVENT_WRITE form regardless of event type.
|
||||
(void)eventType;
|
||||
return 8;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcAcbQueueEndOfShaderActionGetSize() {
|
||||
return 32; // upper bound, sized like the end-of-pipe RELEASE_MEM
|
||||
return 32;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbMemSemaphore(CommandBuffer* buf, std::uint8_t action, std::uint8_t clientCode, const volatile void* address) {
|
||||
// ABI correction: Command::WriteMemSemaphore takes the corrected 4-argument form
|
||||
// (address, waitForMailbox, signalType, operation) -- an earlier revision of this helper used a
|
||||
// different, incompatible argument order. `action` selects signal (0) vs wait (1); the low two
|
||||
// bits of `clientCode` carry the packet's signal-type and mailbox-wait flags.
|
||||
const std::uint8_t operation = action != 0 ? 7u : 6u;
|
||||
const std::uint8_t signalType = clientCode & 1u;
|
||||
const std::uint8_t waitForMailbox = (clientCode >> 1u) & 1u;
|
||||
|
||||
@@ -14,7 +14,7 @@ std::uint32_t* APS5_VABI sceAgcCbDispatch(CommandBuffer* buf, std::uint32_t thre
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcCbDispatchGetSize(void) {
|
||||
return 20; // DISPATCH_DIRECT: header + 4 dwords
|
||||
return 20;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace Agc::Command {
|
||||
std::uint32_t* WriteJump(CommandBuffer* buffer, std::uint8_t chain, std::uint8_t cachePolicy, const std::uint32_t* target, std::uint32_t sizeInDwords, const char* function);
|
||||
std::uint32_t* WriteRewind(CommandBuffer* buffer, std::uint32_t initialState, const char* function);
|
||||
std::uint32_t* WritePredication(CommandBuffer* buffer, std::uint8_t condition, std::uint8_t operation, std::uint8_t waitOperation, const volatile void* address, const char* function);
|
||||
// Signature corrected to (address, waitForMailbox, signalType, operation) to match the guest-facing
|
||||
// sceAgc*MemSemaphore entry points; an earlier revision of this helper took a different argument order.
|
||||
std::uint32_t* WriteMemSemaphore(CommandBuffer* buffer, const volatile void* address, std::uint8_t waitForMailbox, std::uint8_t signalType, std::uint8_t operation, const char* function);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ std::uint32_t* WriteJump(CommandBuffer* buffer, std::uint8_t chain, std::uint8_t
|
||||
CheckBits(cachePolicy, 3, function);
|
||||
CheckBits(sizeInDwords, 0xfffffu, function);
|
||||
CheckAddress(guestAddress, 4, function);
|
||||
// INDIRECT_BUFFER: address, then size in bits 19:0, chain (no return) in bit 20, cache policy in 29:28.
|
||||
return Emit(buffer, 0x3fu, {static_cast<std::uint32_t>(guestAddress) & ~3u, static_cast<std::uint32_t>(guestAddress >> 32u), 0x0f200000u | (static_cast<std::uint32_t>(cachePolicy) << 28u) | (static_cast<std::uint32_t>(chain) << 20u) | sizeInDwords}, function);
|
||||
}
|
||||
|
||||
@@ -24,7 +23,6 @@ std::uint32_t* WritePredication(CommandBuffer* buffer, std::uint8_t condition, s
|
||||
if (operation != 0) {
|
||||
CheckAddress(guestAddress, 8, function);
|
||||
}
|
||||
// SET_PREDICATION: condition in bit 8, wait in bit 12, operation in 18:16; operation 0 clears predication.
|
||||
return Emit(buffer, 0x20u, {(static_cast<std::uint32_t>(condition) << 8u) | (static_cast<std::uint32_t>(waitOperation) << 12u) | (static_cast<std::uint32_t>(operation) << 16u), static_cast<std::uint32_t>(guestAddress) & ~0xfu, static_cast<std::uint32_t>(guestAddress >> 32u)}, function);
|
||||
}
|
||||
|
||||
@@ -34,7 +32,6 @@ std::uint32_t* WriteMemSemaphore(CommandBuffer* buffer, const volatile void* add
|
||||
Require(operation == 6 || operation == 7, function, "invalid memory semaphore operation");
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
CheckAddress(guestAddress, 8, function);
|
||||
// MEM_SEMAPHORE: operation in 31:29 (6 signal, 7 wait), signal type in bit 20, mailbox wait in bit 16.
|
||||
return Emit(buffer, 0x39u, {static_cast<std::uint32_t>(guestAddress), static_cast<std::uint32_t>(guestAddress >> 32u), (static_cast<std::uint32_t>(operation) << 29u) | (static_cast<std::uint32_t>(signalType) << 20u) | (static_cast<std::uint32_t>(waitForMailbox) << 16u)}, function);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ std::uint32_t* WriteCopyData(CommandBuffer* buffer, bool compute, std::uint8_t d
|
||||
CheckBits(srcCachePolicy, 3, function);
|
||||
CheckBits(itemSize, 1, function);
|
||||
CheckBits(writeConfirm, 1, function);
|
||||
// Graphics selectors are (select << 1) | engine, compute selectors are the raw 4-bit COPY_DATA select values.
|
||||
const auto srcSelect = compute ? static_cast<std::uint32_t>(src) & 0xfu : (static_cast<std::uint32_t>(src) >> 1u) & 0xfu;
|
||||
const auto dstSelect = compute ? static_cast<std::uint32_t>(dst) & 0xfu : (static_cast<std::uint32_t>(dst) >> 1u) & 0xfu;
|
||||
const auto engine = compute ? 0u : static_cast<std::uint32_t>(src) & 1u;
|
||||
@@ -46,9 +45,7 @@ std::uint32_t* WriteAtomicMem(CommandBuffer* buffer, std::uint8_t atomicOp, std:
|
||||
CheckBits(cachePolicy, 3, function);
|
||||
CheckBits(loopInterval, 0x1fffu, function);
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
// Opcodes 96..127 are the 64-bit forms of 64..95.
|
||||
CheckAddress(guestAddress, (atomicOp & 0x60u) == 0x60u ? 8 : 4, function);
|
||||
// ATOMIC_MEM: control, address, source data, compare data, loop interval (9 dwords with the header).
|
||||
return Emit(buffer, 0x1eu, {atomicOp | (static_cast<std::uint32_t>(command) << 8u) | (static_cast<std::uint32_t>(cachePolicy) << 25u), static_cast<std::uint32_t>(guestAddress), static_cast<std::uint32_t>(guestAddress >> 32u), static_cast<std::uint32_t>(srcData), static_cast<std::uint32_t>(srcData >> 32u), static_cast<std::uint32_t>(compareData), static_cast<std::uint32_t>(compareData >> 32u), loopInterval}, function);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,6 @@ uint32_t* APS5_VABI sceAgcDcbDrawIndexMultiInstanced(CommandBuffer* buf, uint32_
|
||||
Agc::Command::CheckAddress(geometry, 2, __func__);
|
||||
Agc::Command::Require(object_ids == nullptr, __func__, "per-object id base has no executor contract; expanding to one instanced draw");
|
||||
const auto initiator = Agc::Command::DrawInitiator(modifier, true, __func__);
|
||||
// NUM_INSTANCES then DRAW_INDEX_2 in one reservation: the executor reads instanceCount from queue
|
||||
// state a prior NUM_INSTANCES wrote, so the two must stay adjacent and atomic under a grow callback.
|
||||
auto* packet = Agc::Command::Allocate(buf, 8, __func__);
|
||||
packet[0] = Agc::Command::Header(0x2fu, 2);
|
||||
packet[1] = instance_count;
|
||||
@@ -85,7 +83,7 @@ uint32_t* APS5_VABI sceAgcDcbDrawIndexMultiInstanced(CommandBuffer* buf, uint32_
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexMultiInstancedGetSize(void) {
|
||||
return 32; // NUM_INSTANCES (2 dw) + DRAW_INDEX_2 (6 dw)
|
||||
return 32;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ void* APS5_VABI sceAgcDcbA_zARR5aCmkoY(void) {
|
||||
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbJump(CommandBuffer* buf, uint8_t mode, uint8_t cache_policy, const uint32_t* target, uint32_t size_in_dwords) {
|
||||
// mode 1 chains (the target replaces the rest of this buffer), mode 0 calls and returns after the target.
|
||||
return Agc::Command::WriteJump(buf, mode, cache_policy, target, size_in_dwords, __func__);
|
||||
}
|
||||
|
||||
@@ -40,13 +39,10 @@ uint32_t* APS5_VABI sceAgcDcbRewind(CommandBuffer* buf, uint32_t initial_state)
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbRewindGetSize(void) {
|
||||
return 8; // REWIND: header + 1 dword
|
||||
return 8;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbWaitUntilSafeForRendering(CommandBuffer* buf, uint32_t video_out_handle, uint32_t display_buffer_index) {
|
||||
// Same packet sceAgcDriverWaitUntilSafeForRendering produces; the executor specifically recognizes
|
||||
// AgcDriver::RenderingWaitPacketHeader (see Driver.cpp) and blocks on the display-buffer reuse fence.
|
||||
// A plain NOP with these arguments (upstream's previous stub) is not matched by that check.
|
||||
auto* packet = Agc::Command::Allocate(buf, AgcDriver::RenderingWaitPacketWords, __func__);
|
||||
packet[0] = AgcDriver::RenderingWaitPacketHeader;
|
||||
packet[1] = video_out_handle;
|
||||
|
||||
@@ -25,7 +25,7 @@ std::uint32_t* APS5_VABI sceAgcDcbAcquireMem(CommandBuffer* buf, std::uint8_t en
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbAcquireMemGetSize(void) {
|
||||
return 32; // ACQUIRE_MEM: header + 7 dwords
|
||||
return 32;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -33,7 +33,7 @@ uint32_t* APS5_VABI sceAgcDcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t d
|
||||
}
|
||||
|
||||
std::uint64_t APS5_VABI sceAgcDcbCopyDataGetSize() {
|
||||
return 24; // COPY_DATA: header + 5 dwords
|
||||
return 24;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -41,7 +41,7 @@ std::uint32_t* APS5_VABI sceAgcDcbDmaData(CommandBuffer* buf, std::uint8_t engin
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbDmaDataGetSize() {
|
||||
return 28; // DMA_DATA: header + 6 dwords
|
||||
return 28;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbAtomicMem(CommandBuffer* buf, std::uint8_t atomicOp, std::uint8_t command, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t srcData, std::uint64_t compareData, std::uint16_t loopInterval) {
|
||||
@@ -49,11 +49,11 @@ std::uint32_t* APS5_VABI sceAgcDcbAtomicMem(CommandBuffer* buf, std::uint8_t ato
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbAtomicMemGetSize() {
|
||||
return 36; // ATOMIC_MEM: header + 8 dwords
|
||||
return 36;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbAtomicGdsGetSize() {
|
||||
return 36; // upper bound: ATOMIC_GDS is not emitted by this port (header + 8 dwords reserved)
|
||||
return 36;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -61,7 +61,7 @@ std::uint32_t* APS5_VABI sceAgcDcbWriteData(CommandBuffer* buf, std::uint8_t dst
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbWriteDataGetSize(uint32_t num_dwords) {
|
||||
return 4u * num_dwords + 16u; // WRITE_DATA: header + control + address lo/hi + payload
|
||||
return 4u * num_dwords + 16u;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,12 +14,11 @@ uint32_t* APS5_VABI sceAgcDcbCondExec(CommandBuffer* buf, const volatile uint32_
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
Agc::Command::CheckAddress(guestAddress, 4, __func__);
|
||||
Agc::Command::Require(num_dwords <= 0x3fffu, __func__, "conditional execution range is too large");
|
||||
// COND_EXEC: the CP skips exec_count dwords when the 32-bit value at the address is zero.
|
||||
return Agc::Command::Emit(buf, 0x22u, {static_cast<std::uint32_t>(guestAddress) & ~3u, static_cast<std::uint32_t>(guestAddress >> 32u), 0, num_dwords & 0x3fffu}, __func__);
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbCondExecGetSize(void) {
|
||||
return 20; // COND_EXEC: header + 4 dwords
|
||||
return 20;
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -27,7 +26,6 @@ std::uint32_t* APS5_VABI sceAgcDcbWaitRegMem(CommandBuffer* buf, std::uint8_t si
|
||||
}
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbWaitOnAddressGetSize(uint32_t size) {
|
||||
// WriteWait: bracket (4 + 3 dwords) around a 7 dword WAIT_REG_MEM or a 9 dword WAIT_REG_MEM_64.
|
||||
return size == 0 ? 56 : 64;
|
||||
}
|
||||
|
||||
@@ -54,14 +52,10 @@ std::uint32_t* APS5_VABI sceAgcDcbStallCommandBufferParser(CommandBuffer* buf) {
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbStallCommandBufferParserGetSize() {
|
||||
return 8; // PFP_SYNC_ME: header + 1 dword
|
||||
return 8;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbMemSemaphore(CommandBuffer* buf, std::uint8_t action, std::uint8_t clientCode, const volatile void* address) {
|
||||
// ABI correction: Command::WriteMemSemaphore takes the corrected 4-argument form
|
||||
// (address, waitForMailbox, signalType, operation) -- an earlier revision of this helper used a
|
||||
// different, incompatible argument order. `action` selects signal (0) vs wait (1); the low two
|
||||
// bits of `clientCode` carry the packet's signal-type and mailbox-wait flags.
|
||||
const std::uint8_t operation = action != 0 ? 7u : 6u;
|
||||
const std::uint8_t signalType = clientCode & 1u;
|
||||
const std::uint8_t waitForMailbox = (clientCode >> 1u) & 1u;
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
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) {
|
||||
// SET_PREDICATION turns predication on for the packets that follow it; the range length is a
|
||||
// guest-side bookkeeping hint the single PM4 packet does not carry.
|
||||
(void)count_in_dwords;
|
||||
return Agc::Command::WritePredication(buf, condition, op, wait_op, address, __func__);
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ int APS5_VABI sceAgcGetDataPacketPayloadAddressUnk(uint32_t** addr, uint32_t* cm
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SDK 9 Dcb ABI: (destination, packet). Reads the AGC system-software version stamped into the
|
||||
// first payload dword of an AGC data packet and copies it to the caller's destination.
|
||||
int APS5_VABI sceAgcDcbGetSystemSoftwareVersion(uint32_t* destination, const uint32_t* packet) {
|
||||
Agc::Command::CheckAddress(reinterpret_cast<std::uintptr_t>(destination), alignof(uint32_t), __func__);
|
||||
Agc::Command::CheckAddress(reinterpret_cast<std::uintptr_t>(packet), alignof(uint32_t), __func__);
|
||||
|
||||
@@ -70,10 +70,6 @@ void PlanBuilder::Collect(IrValue* raw, std::uint32_t usePc) {
|
||||
return;
|
||||
}
|
||||
IrValue* offset = inst->Argument(1)->Resolve();
|
||||
// An immediate offset alone is not enough: a Phi that merges a constant on one path with a
|
||||
// per-invocation value on another still reports HasImmediate() for the constant path, but folding
|
||||
// it here would bake a wrong, divergent SRT slot into the plan. Require the runtime validator to
|
||||
// prove the value is actually invariant before treating it as foldable.
|
||||
const auto foldable = offset->HasImmediate() && offset->Type() == IrType::U32 && RuntimeValidator(_program.Resources(), RuntimeValueType::Any).Run(inst);
|
||||
if (!foldable) {
|
||||
if (std::find(_program.Metadata().dynamicReads.begin(), _program.Metadata().dynamicReads.end(), value) == _program.Metadata().dynamicReads.end()) {
|
||||
|
||||
@@ -225,8 +225,6 @@ RdnaInstruction DecodeRdnaMimg(std::uint32_t programCounter, std::span<const std
|
||||
throw std::runtime_error("instruction is not MIMG");
|
||||
}
|
||||
const auto opcode = ((word0 >> 18u) & 0x7Fu) | ((word0 & 1u) << 7u);
|
||||
// Word0 bit 12 is UNORM. It is reserved on every gfx10 image op except the RTIP
|
||||
// ray queries, whose encoding requires it set, so it must not reject 0xE6.
|
||||
const auto reservedWord0 = opcode == 0xe6u ? 0x000340C0u : 0x000350C0u;
|
||||
if ((word0 & reservedWord0) != 0u || (word1 & 0x3C000000u) != 0u) {
|
||||
throw std::runtime_error("unsupported or reserved MIMG control bits");
|
||||
|
||||
@@ -387,12 +387,6 @@ RectListShaders BuildRectListShaders(const RecompileResult& vertex, const Recomp
|
||||
parameters.push_back({input.sourceLocation, input.location, input.flat, !exported});
|
||||
}
|
||||
const auto& limits = *target.tessellation;
|
||||
// The generated stages carry one float4 per fragment parameter plus gl_Position's, and the tightest
|
||||
// of the device's per-vertex bounds turns that into a hard ceiling on how many interpolants a
|
||||
// rect-list pixel shader can have. A rect-list draw is a tile clear: the pixel shader's result comes
|
||||
// from its constants and its render target, so truncating the excess interpolants (rather than
|
||||
// refusing the whole draw) is correct here -- the fragment inputs above the ceiling are simply left
|
||||
// unwritten, which is no worse than the `missing` (unexported) case already handled above.
|
||||
const std::uint32_t perVertexComponents = std::min({limits.maxControlPerVertexInputComponents, limits.maxControlPerVertexOutputComponents, limits.maxEvaluationInputComponents, limits.maxEvaluationOutputComponents});
|
||||
if (const std::size_t capacity = perVertexComponents / 4u > 0u ? perVertexComponents / 4u - 1u : 0u; parameters.size() > capacity) {
|
||||
parameters.resize(capacity);
|
||||
|
||||
@@ -41,8 +41,6 @@ MemoryInfo imageMemoryInfoFromInstruction(const RdnaInstruction& inst) {
|
||||
}
|
||||
|
||||
bool TranslationContext::imageBvhIntersectRay(const RdnaInstruction& inst) {
|
||||
// No BVH exists to traverse yet, so every ray query reports a clean miss instead of faulting on
|
||||
// an unimplemented opcode. 0xFFFFFFFF is the hardware miss encoding for the result dwords.
|
||||
IrValue& miss = ir.Constant(0xffffffffu);
|
||||
for (std::uint32_t i = 0u; i < inst.dataDwordCount; ++i) {
|
||||
writeOperand(offsetOperand(inst.destination, i), &miss);
|
||||
|
||||
Reference in New Issue
Block a user