- Start work on drawlist

- Fix issue in texloader
- add ivec2 to tecloader / screen
- add draw func for iron
- add bufCfg in 3 variants to c3d
- add poc for c3d_permutation
This commit is contained in:
2025-11-24 14:25:35 +01:00
parent f0117e07d4
commit a9eed546b9
14 changed files with 212 additions and 20 deletions

3
poc/CMakeLists.txt Normal file
View File

@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.22)
add_subdirectory(c3d_permutation)

3
poc/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Proof of concepts
This folder contains some proof of concept tests.

View File

@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.22)
project(c3d-permutation)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)
add_executable(c3d-permutation source/main.cpp)

View File

@@ -0,0 +1,10 @@
# Citro3D Shader Buf info Permutation calculation
```cpp
// Why do
BufInfo_Add(buf, data, sizeof(data[0]), 3, 0x210);
BufInfo_Add(buf, data, sizeof(data[0]), 4, 0x3210);
// if we can do
BufInfo_Add(buf, data, sizeof(data[0]), 3, permutation(3));
BufInfo_Add(buf, data, sizeof(data[0]), 3, permutation(4));
```

View File

@@ -0,0 +1,30 @@
#include <format>
#include <iostream>
#include <stdexcept>
using u64 = unsigned long long;
constexpr u64 permutation(int ac) {
u64 ret = 0;
if (ac < 1 || ac > 15) {
throw std::runtime_error("[amy] " + std::to_string(ac) +
" is out of range (1...15)!");
}
for (int i = 0; i < ac; i++) {
ret = (ret << 4) | (ac - 1 - i);
}
return ret;
}
int main(int argc, char** argv) {
int v = 3;
if (argc == 2) {
v = std::stoi(argv[1]);
} else {
std::cout << "No input provided! using example..." << std::endl;
}
std::cout << std::format("{} -> {:#x} ({})", v, permutation(v),
permutation(v))
<< std::endl;
return 0;
}