Repository navigation
Expand file tree
/
Copy pathExport.cpp
More file actions
728 lines (594 loc) · 21.5 KB
/
Copy pathExport.cpp
File metadata and controls
728 lines (594 loc) · 21.5 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
#include <cstdint>
#include <algorithm>
#include <cstddef>
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"
#include "prx/libSceGnmDriverForNeoMode/include/InitSequences.hpp"
namespace {
constexpr std::uint32_t InitPacketWords = 0x100;
template <std::size_t Words>
int WriteHardwareState(std::uint32_t* cmdbuf, std::uint32_t size, const std::array<std::uint32_t, Words>& state) {
if (size < InitPacketWords) return 0;
auto* at = std::copy(GnmNeo::ClearState.begin(), GnmNeo::ClearState.end(), cmdbuf);
at = std::copy(state.begin(), state.end(), at);
const auto padding = static_cast<std::uint32_t>(cmdbuf + InitPacketWords - at - 1);
at[0] = 0xc0001000u | ((padding - 1) << 16);
at[1] = 0;
return InitPacketWords;
}
template <std::size_t Words>
int WriteContextState(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t packetWords, const std::array<std::uint32_t, Words>& state) {
if (size != packetWords) return 0;
std::copy(state.begin(), state.end(), cmdbuf);
return static_cast<int>(packetWords);
}
constexpr int Failure = static_cast<int>(0x8EEE00FFu);
constexpr int NoInterface = static_cast<int>(0x80000000u);
constexpr int ValidationNotEnabled = static_cast<int>(0x80D13FFFu);
constexpr int CommandFailed = -1;
constexpr std::uint32_t OpNop = 0x10;
constexpr std::uint32_t NeoDrawFlags = 0xe0000000u;
constexpr std::uint32_t AutoIndex = 2;
constexpr std::uint32_t Header(std::uint32_t opcode, std::uint32_t bodyWords, bool compute = false, bool predicated = false) {
return 0xc0000000u | ((bodyWords - 1) << 16) | (opcode << 8) | (compute ? 2u : 0u) | (predicated ? 1u : 0u);
}
std::uint32_t* Nop(std::uint32_t* at, std::uint32_t bodyWords) {
at[0] = Header(OpNop, bodyWords);
at[1] = 0;
return at + 1 + bodyWords;
}
constexpr std::uint32_t ShaderStageCount = 7;
constexpr std::uint32_t StageVs = 2;
constexpr std::uint32_t StageEs = 4;
constexpr std::uint32_t StageLs = 6;
constexpr std::uint32_t IndirectSgprBase[ShaderStageCount] = {0, 0, 0x4c, 0, 0xcc, 0, 0x14c};
constexpr std::uint32_t DrawIndirectArgsBytes = 0x10;
constexpr std::uint32_t DrawIndexedIndirectArgsBytes = 0x14;
std::uint32_t IndirectSgpr(std::uint32_t stage, std::uint32_t offset) {
return offset == 0 ? 0 : (offset & 0xffffu) + IndirectSgprBase[stage];
}
bool ValidIndirect(std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr) {
return stage < ShaderStageCount && vertexSgpr < 0x10 && instanceSgpr < 0x10;
}
bool IndexedIndirectStage(std::uint32_t stage) {
return stage == StageVs || stage == StageEs || stage == StageLs;
}
constexpr std::uint32_t OpSetUconfigReg = 0x79;
constexpr std::uint32_t IaMultiVgtParam = 0x40000258u;
} // namespace
extern "C" {
int APS5_VABI sceGnmBeginWorkload(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmComputeWaitOnAddress(std::uint32_t* cmdbuf, std::uint32_t size, std::uint64_t address, std::uint32_t mask, std::uint32_t compare, std::uint32_t reference) {
if (!cmdbuf || size != 14) return CommandFailed;
auto* at = Nop(cmdbuf, 3);
const bool memory = address > 0xffff;
at[0] = Header(0x3c, 6);
at[1] = (memory ? 1u << 4 : 0u) | (compare & 7);
at[2] = static_cast<std::uint32_t>(address & (memory ? 0xfffffffcu : 0xffffu));
at[3] = static_cast<std::uint32_t>(address >> 32);
at[4] = reference;
at[5] = mask;
at[6] = 10;
Nop(at + 7, 2);
return 0;
}
int APS5_VABI sceGnmComputeWaitSemaphore(std::uint32_t* cmdbuf, std::uint32_t size, std::uint64_t semaphoreAddress, std::uint32_t flags) {
if (!cmdbuf || size != 10) return CommandFailed;
auto* at = Nop(cmdbuf, 3);
at[0] = Header(0x39, 2);
at[1] = static_cast<std::uint32_t>(semaphoreAddress);
at[2] = (flags == 1 ? 0x100000u : 0u) - 0x20000000u + static_cast<std::uint32_t>(semaphoreAddress >> 32);
Nop(at + 3, 2);
return 0;
}
int APS5_VABI sceGnmCreateWorkloadStream(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDebugModuleReset(void) {
return Failure;
}
int APS5_VABI sceGnmDebugReset(void) {
return Failure;
}
int APS5_VABI sceGnmDestroyWorkloadStream(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDingDongForWorkload(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDispatchDirect(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t threadsX, std::uint32_t threadsY, std::uint32_t threadsZ, std::uint32_t flags) {
if (!cmdbuf || size != 9 || static_cast<std::int32_t>(threadsX | threadsY | threadsZ) < 0) return CommandFailed;
cmdbuf[0] = Header(0x15, 4, true, flags & 1);
cmdbuf[1] = threadsX;
cmdbuf[2] = threadsY;
cmdbuf[3] = threadsZ;
cmdbuf[4] = (flags & 0x18) + 1;
Nop(cmdbuf + 5, 3);
return 0;
}
int APS5_VABI sceGnmDispatchIndirect(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t flags) {
if (!cmdbuf || size != 7) return CommandFailed;
cmdbuf[0] = Header(0x16, 2, true, flags & 1);
cmdbuf[1] = dataOffset;
cmdbuf[2] = (flags & 0x18) + 1;
Nop(cmdbuf + 3, 3);
return 0;
}
int APS5_VABI sceGnmDispatchIndirectOnMec(std::uint32_t* cmdbuf, std::uint32_t size, std::uint64_t args, std::uint32_t modifier) {
if (!cmdbuf || size != 8 || args == 0 || (args & 3) != 0) return CommandFailed;
cmdbuf[0] = Header(0x16, 3, true, modifier & 1);
cmdbuf[1] = static_cast<std::uint32_t>(args);
cmdbuf[2] = static_cast<std::uint32_t>(args >> 32);
cmdbuf[3] = (modifier & 0x18) | 1;
cmdbuf[4] = Header(OpNop, 3);
cmdbuf[5] = 0;
return 0;
}
int APS5_VABI sceGnmDrawIndex(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t indexCount, std::uint64_t indexAddress, std::uint32_t flags, std::uint32_t) {
if (!cmdbuf || size != 10 || indexAddress == 0 || (indexAddress & 1) != 0 || (flags & 0x1ffffffeu) != 0) return CommandFailed;
cmdbuf[0] = Header(0x27, 5);
cmdbuf[1] = indexCount;
cmdbuf[2] = static_cast<std::uint32_t>(indexAddress);
cmdbuf[3] = static_cast<std::uint32_t>(indexAddress >> 32);
cmdbuf[4] = indexCount;
cmdbuf[5] = flags & NeoDrawFlags;
Nop(cmdbuf + 6, 3);
return 0;
}
int APS5_VABI sceGnmDrawIndexAuto(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t indexCount, std::uint32_t flags) {
if (!cmdbuf || size != 7 || (flags & 0x1ffffffeu) != 0) return CommandFailed;
cmdbuf[0] = Header(0x2d, 2);
cmdbuf[1] = indexCount;
cmdbuf[2] = (flags & NeoDrawFlags) | AutoIndex;
Nop(cmdbuf + 3, 3);
return 0;
}
int APS5_VABI sceGnmDrawIndexIndirect(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr, std::uint32_t flags) {
if (!cmdbuf || size != 9 || !ValidIndirect(stage, vertexSgpr, instanceSgpr)) return CommandFailed;
cmdbuf[0] = Header(0x25, 4, false, flags & 1);
cmdbuf[1] = dataOffset;
cmdbuf[2] = IndirectSgpr(stage, vertexSgpr);
cmdbuf[3] = IndirectSgpr(stage, instanceSgpr);
cmdbuf[4] = flags & NeoDrawFlags;
Nop(cmdbuf + 5, 3);
return 0;
}
int APS5_VABI sceGnmDrawIndexIndirectCountMulti(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t maxCount, std::uint64_t countAddress, std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr, std::uint32_t flags) {
if (!cmdbuf || size != 0x10 || vertexSgpr >= 0x10 || instanceSgpr >= 0x10 || !IndexedIndirectStage(stage)) return CommandFailed;
auto* at = Nop(cmdbuf, 2);
at[0] = Header(0x9d, 9, false, flags & 1);
at[1] = dataOffset;
at[2] = IndirectSgpr(stage, vertexSgpr);
at[3] = IndirectSgpr(stage, instanceSgpr);
at[4] = countAddress != 0 ? 1u << 30 : 0;
at[5] = maxCount;
at[6] = static_cast<std::uint32_t>(countAddress);
at[7] = static_cast<std::uint32_t>(countAddress >> 32);
at[8] = DrawIndexedIndirectArgsBytes;
at[9] = flags & NeoDrawFlags;
Nop(at + 10, 2);
return 0;
}
int APS5_VABI sceGnmDrawIndexIndirectMulti(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t maxCount, std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr, std::uint32_t flags) {
if (!cmdbuf || size != 11 || vertexSgpr >= 0x10 || instanceSgpr >= 0x10 || !IndexedIndirectStage(stage)) return CommandFailed;
cmdbuf[0] = Header(0x38, 6, false, flags & 1);
cmdbuf[1] = dataOffset;
cmdbuf[2] = IndirectSgpr(stage, vertexSgpr);
cmdbuf[3] = IndirectSgpr(stage, instanceSgpr);
cmdbuf[4] = maxCount;
cmdbuf[5] = DrawIndexedIndirectArgsBytes;
cmdbuf[6] = flags & NeoDrawFlags;
Nop(cmdbuf + 7, 3);
return 0;
}
int APS5_VABI sceGnmDrawIndexMultiInstanced(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDrawIndexOffset(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t indexOffset, std::uint32_t indexCount, std::uint32_t flags) {
if (!cmdbuf || size != 9) return CommandFailed;
cmdbuf[0] = Header(0x35, 4, false, flags & 1);
cmdbuf[1] = indexCount;
cmdbuf[2] = indexOffset;
cmdbuf[3] = indexCount;
cmdbuf[4] = flags & NeoDrawFlags;
Nop(cmdbuf + 5, 3);
return 0;
}
int APS5_VABI sceGnmDrawIndirect(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr, std::uint32_t flags) {
if (!cmdbuf || size != 9 || !ValidIndirect(stage, vertexSgpr, instanceSgpr)) return CommandFailed;
cmdbuf[0] = Header(0x24, 4, false, flags & 1);
cmdbuf[1] = dataOffset;
cmdbuf[2] = IndirectSgpr(stage, vertexSgpr);
cmdbuf[3] = IndirectSgpr(stage, instanceSgpr);
cmdbuf[4] = (flags & NeoDrawFlags) | AutoIndex;
Nop(cmdbuf + 5, 3);
return 0;
}
int APS5_VABI sceGnmDrawIndirectCountMulti(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t maxCount, std::uint64_t countAddress, std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr, std::uint32_t flags) {
if (!cmdbuf || size != 0x10 || !ValidIndirect(stage, vertexSgpr, instanceSgpr)) return CommandFailed;
auto* at = Nop(cmdbuf, 2);
at[0] = Header(0x9c, 9, false, flags & 1);
at[1] = dataOffset;
at[2] = IndirectSgpr(stage, vertexSgpr);
at[3] = IndirectSgpr(stage, instanceSgpr);
at[4] = countAddress != 0 ? 1u << 30 : 0;
at[5] = maxCount;
at[6] = static_cast<std::uint32_t>(countAddress);
at[7] = static_cast<std::uint32_t>(countAddress >> 32);
at[8] = DrawIndirectArgsBytes;
at[9] = (flags & NeoDrawFlags) | AutoIndex;
Nop(at + 10, 2);
return 0;
}
int APS5_VABI sceGnmDrawIndirectMulti(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t dataOffset, std::uint32_t maxCount, std::uint32_t stage, std::uint32_t vertexSgpr, std::uint32_t instanceSgpr, std::uint32_t flags) {
if (!cmdbuf || size != 11 || !ValidIndirect(stage, vertexSgpr, instanceSgpr)) return CommandFailed;
cmdbuf[0] = Header(0x2c, 6, false, flags & 1);
cmdbuf[1] = dataOffset;
cmdbuf[2] = IndirectSgpr(stage, vertexSgpr);
cmdbuf[3] = IndirectSgpr(stage, instanceSgpr);
cmdbuf[4] = maxCount;
cmdbuf[5] = DrawIndirectArgsBytes;
cmdbuf[6] = (flags & NeoDrawFlags) | AutoIndex;
Nop(cmdbuf + 7, 3);
return 0;
}
int APS5_VABI sceGnmDrawInitDefaultHardwareState(std::uint32_t* cmdbuf, std::uint32_t size) {
return WriteHardwareState(cmdbuf, size, GnmNeo::HardwareState);
}
int APS5_VABI sceGnmDrawInitDefaultHardwareState200(std::uint32_t* cmdbuf, std::uint32_t size) {
return WriteHardwareState(cmdbuf, size, GnmNeo::HardwareState200);
}
int APS5_VABI sceGnmDrawInitDefaultHardwareState350(std::uint32_t* cmdbuf, std::uint32_t size) {
return WriteHardwareState(cmdbuf, size, GnmNeo::HardwareState350);
}
int APS5_VABI sceGnmDrawInitToDefaultContextState(std::uint32_t* cmdbuf, std::uint32_t size) {
return WriteContextState(cmdbuf, size, 0x20, GnmNeo::ContextState);
}
int APS5_VABI sceGnmDrawInitToDefaultContextState400(std::uint32_t* cmdbuf, std::uint32_t size) {
return WriteContextState(cmdbuf, size, 0x100, GnmNeo::ContextState400);
}
int APS5_VABI sceGnmDrawInitToDefaultContextStateInternalCommand(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDrawInitToDefaultContextStateInternalSize(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDrawOpaqueAuto(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDriverInternalRetrieveGnmInterface(void) {
return NoInterface;
}
int APS5_VABI sceGnmDriverInternalRetrieveGnmInterfaceForGpuDebugger(void) {
return NoInterface;
}
int APS5_VABI sceGnmDriverInternalRetrieveGnmInterfaceForReplay(void) {
return NoInterface;
}
int APS5_VABI sceGnmDriverInternalRetrieveGnmInterfaceForResourceRegistration(void) {
return NoInterface;
}
int APS5_VABI sceGnmDriverInternalRetrieveGnmInterfaceForValidation(void) {
return NoInterface;
}
int APS5_VABI sceGnmDriverInternalVirtualQuery(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmDriverTraceInProgress(void) {
return 0;
}
int APS5_VABI sceGnmEndWorkload(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmFindResources(void) {
return Failure;
}
int APS5_VABI sceGnmFindResourcesPublic(void) {
return Failure;
}
int APS5_VABI sceGnmGetCoredumpAddress(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetCoredumpMode(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetCoredumpProtectionFaultTimestamp(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetDbgGcHandle(void) {
return -1;
}
int APS5_VABI sceGnmGetGpuBlockStatus(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetGpuCoreClockFrequency(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetGpuInfoStatus(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetLastWaitedAddress(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetNumTcaUnits(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetOffChipTessellationBufferSize(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetOwnerName(void) {
return Failure;
}
int APS5_VABI sceGnmGetPhysicalCounterFromVirtualized(void) {
return Failure;
}
int APS5_VABI sceGnmGetProtectionFaultTimeStamp(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetResourceBaseAddressAndSizeInBytes(void) {
return Failure;
}
int APS5_VABI sceGnmGetResourceName(void) {
return Failure;
}
int APS5_VABI sceGnmGetResourceRegistrationBuffers(void) {
return Failure;
}
int APS5_VABI sceGnmGetResourceShaderGuid(void) {
return Failure;
}
int APS5_VABI sceGnmGetResourceType(void) {
return Failure;
}
int APS5_VABI sceGnmGetResourceUserData(void) {
return Failure;
}
int APS5_VABI sceGnmGetShaderProgramBaseAddress(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGetShaderStatus(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGpuPaDebugEnter(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmGpuPaDebugLeave(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmInsertDingDongMarker(std::uint32_t* cmdbuf, std::uint32_t size) {
if (!cmdbuf || size != 4) return CommandFailed;
cmdbuf[0] = Header(OpNop, 3);
cmdbuf[1] = 0;
cmdbuf[2] = 0;
cmdbuf[3] = 0;
return 0;
}
int APS5_VABI sceGnmInsertThreadTraceMarker(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmIsCoredumpValid(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmLogicalTcaUnitToPhysical(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmMapComputeQueueWithPriority(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmPaDisableFlipCallbacks(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmPaEnableFlipCallbacks(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmPaHeartbeat(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmQueryResourceRegistrationUserMemoryRequirements(void) {
return Failure;
}
int APS5_VABI sceGnmRaiseUserExceptionEvent(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmRegisterGdsResource(void) {
return Failure;
}
int APS5_VABI sceGnmRegisterGnmLiveCallbackConfig(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmRegisterOwner(void) {
return Failure;
}
int APS5_VABI sceGnmRegisterOwnerForSystem(void) {
return Failure;
}
int APS5_VABI sceGnmRegisterResource(void) {
return Failure;
}
int APS5_VABI sceGnmRequestFlipAndSubmitDoneForWorkload(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmResetVgtControl(std::uint32_t* cmdbuf, std::uint32_t size) {
if (!cmdbuf || size != 3) return CommandFailed;
cmdbuf[0] = Header(OpSetUconfigReg, 2);
cmdbuf[1] = IaMultiVgtParam;
cmdbuf[2] = 0x6d007fu;
return 0;
}
int APS5_VABI sceGnmSdmaClose(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaConstFill(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaCopyLinear(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaCopyTiled(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaCopyWindow(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaFlush(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaGetMinCmdSize(void) {
return Failure;
}
int APS5_VABI sceGnmSdmaOpen(void) {
return Failure;
}
int APS5_VABI sceGnmSetCsShaderWithModifier(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSetEmbeddedPsShader(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSetEmbeddedVsShader(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSetPsShader350(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSetResourceRegistrationUserMemory(void) {
return Failure;
}
int APS5_VABI sceGnmSetResourceUserData(void) {
return Failure;
}
int APS5_VABI sceGnmSetSpiEnableSqCounters(void) {
return Failure;
}
int APS5_VABI sceGnmSetSpiEnableSqCountersForUnitInstance(void) {
return Failure;
}
int APS5_VABI sceGnmSetVgtControl(std::uint32_t* cmdbuf, std::uint32_t size, std::uint32_t primGroupSizeMinusOne, std::uint32_t partialVsWaveMode, std::uint32_t switchOnlyOnEop) {
if (!cmdbuf || size != 3 || primGroupSizeMinusOne >= 0x100 || (switchOnlyOnEop | partialVsWaveMode) >= 2) return CommandFailed;
const std::uint32_t switchOnEop = static_cast<std::uint32_t>(switchOnlyOnEop != 0) << 20;
const std::uint32_t switchOnEoi = static_cast<std::uint32_t>(switchOnlyOnEop == 0) << 19;
const std::uint32_t value = switchOnlyOnEop != 0
? ((partialVsWaveMode & 1) << 16) | primGroupSizeMinusOne | switchOnEop | switchOnEoi | 0x40000u
: (primGroupSizeMinusOne & 0x1cffffu) | switchOnEop | switchOnEoi | 0x50000u;
cmdbuf[0] = Header(OpSetUconfigReg, 2);
cmdbuf[1] = IaMultiVgtParam;
cmdbuf[2] = value | 0x600000u;
return 0;
}
int APS5_VABI sceGnmSetWaveLimitMultiplier(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSetWaveLimitMultipliers(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSubmitAndFlipCommandBuffersForWorkload(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmSubmitCommandBuffersForWorkload(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmUnregisterAllResourcesForOwner(void) {
return Failure;
}
int APS5_VABI sceGnmUnregisterOwnerAndResources(void) {
return Failure;
}
int APS5_VABI sceGnmUnregisterResource(void) {
return Failure;
}
int APS5_VABI sceGnmUpdateGsShader(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmUpdateHsShader(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmUpdatePsShader(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmUpdatePsShader350(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmUpdateVsShader(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmValidateDisableDiagnostics(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidateDisableDiagnostics2(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidateDispatchCommandBuffers(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidateDrawCommandBuffers(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidateGetDiagnosticInfo(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidateGetDiagnostics(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidateGetVersion(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceGnmValidateOnSubmitEnabled(void) {
return 0;
}
int APS5_VABI sceGnmValidateResetState(void) {
return ValidationNotEnabled;
}
int APS5_VABI sceGnmValidationRegisterMemoryCheckCallback(void) {
return ValidationNotEnabled;
}
}