Repository navigation
Expand file tree
/
Copy pathContextState.cpp
More file actions
79 lines (69 loc) · 2.02 KB
/
Copy pathContextState.cpp
File metadata and controls
79 lines (69 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#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) {
Agc::Command::Require(operation <= 3, __func__, "invalid context state operation");
if (operation == 0) {
return 5 * sizeof(std::uint32_t);
}
if (operation == 3) {
return 32 * sizeof(std::uint32_t);
}
return 27 * sizeof(std::uint32_t);
}
uint32_t* APS5_VABI sceAgcDcbContextStateOp_0100(CommandBuffer* buf, uint32_t operation) {
Agc::Command::Require(buf != nullptr, __func__, "null command buffer");
Agc::Command::Require(operation <= 3, __func__, "invalid context state operation");
const auto* function = __func__;
std::uint32_t* first = nullptr;
const auto append = [&](std::uint32_t count) {
auto* packet = Agc::Command::WriteNop(buf, count, function);
if (first == nullptr) {
first = packet;
packet[0] = Agc::Command::Header(0x10u, count, 0x68u);
packet[1] = operation;
}
};
if (operation == 0) {
append(5);
return first;
}
if (operation == 2) {
append(3);
}
Agc::Command::Reserve(buf, 22, function);
append(5);
append(8);
append(9);
if (operation != 2) {
append(3);
}
append(2);
if (operation == 3) {
append(5);
}
return first;
}
std::uint32_t APS5_VABI sceAgcDcbSetBaseDispatchIndirectArgsGetSize() {
return 16;
}
std::uint32_t APS5_VABI sceAgcDcbSetBaseDrawIndirectArgsGetSize() {
return 16;
}
std::uint32_t APS5_VABI sceAgcDcbQueueEndOfShaderActionGetSize() {
return 32;
}
std::uint32_t APS5_VABI sceAgcDcbGetLodStatsGetSize() {
return 20;
}
}