mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-06 13:30:00 +00:00
Merge pull request #11585 from milescoviello/test/videodec2-compute-queue
test(libSceVideodec2): cover the compute memory query and compute queue allocation
This commit is contained in:
1 file changed
+16
@@ -832,8 +832,24 @@ void testConcurrentOwnership() {
|
||||
|
||||
}
|
||||
|
||||
void testComputeQueues() {
|
||||
SceVideodec2::ComputeMemoryInfo memory{sizeof(SceVideodec2::ComputeMemoryInfo), 0, nullptr};
|
||||
checkThrows([] { sceVideodec2QueryComputeMemoryInfo_nid_postfix(nullptr); });
|
||||
check(sceVideodec2QueryComputeMemoryInfo_nid_postfix(&memory) == 0 && memory.cpuGpuMemorySize == (1u << 20u), "the compute work memory is not 1 MiB");
|
||||
const SceVideodec2::ComputeConfigInfo config{sizeof(SceVideodec2::ComputeConfigInfo), 0, 0, false};
|
||||
std::uint64_t first = 0;
|
||||
std::uint64_t second = 0;
|
||||
checkThrows([&] { sceVideodec2AllocateComputeQueue_nid_postfix(nullptr, &memory, &first); });
|
||||
checkThrows([&] { sceVideodec2AllocateComputeQueue_nid_postfix(&config, nullptr, &first); });
|
||||
checkThrows([&] { sceVideodec2AllocateComputeQueue_nid_postfix(&config, &memory, nullptr); });
|
||||
check(first == 0, "a rejected allocation wrote a queue");
|
||||
check(sceVideodec2AllocateComputeQueue_nid_postfix(&config, &memory, &first) == 0 && first != 0, "the first compute queue was not allocated");
|
||||
check(sceVideodec2AllocateComputeQueue_nid_postfix(&config, &memory, &second) == 0 && second != 0 && second != first, "a second compute queue repeats the first");
|
||||
}
|
||||
|
||||
int main() {
|
||||
try {
|
||||
testComputeQueues();
|
||||
testFailures();
|
||||
testDecode(false);
|
||||
testDecode(true);
|
||||
|
||||
Reference in new issue
Block a user