bullshit3

This commit is contained in:
lizzie 2026-01-30 05:03:40 +00:00 committed by crueter
parent 402fa3ae93
commit 0a8c413708
2 changed files with 25 additions and 29 deletions

View file

@ -90,7 +90,7 @@ if ("${GLSLANGVALIDATOR}" STREQUAL "GLSLANGVALIDATOR-NOTFOUND")
message(FATAL_ERROR "Required program `glslangValidator` not found.") message(FATAL_ERROR "Required program `glslangValidator` not found.")
endif() endif()
set(GLSL_FLAGS "") set(GLSL_FLAGS "-Os")
set(SPIR_V_VERSION "spirv1.3") set(SPIR_V_VERSION "spirv1.3")
set(QUIET_FLAG "--quiet") set(QUIET_FLAG "--quiet")

View file

@ -784,34 +784,30 @@ bool IsError(uint mode) {
} }
int FindLayout(uint mode) { int FindLayout(uint mode) {
if ((mode & 3) != 0) { // Possible (Relevant), x = dont care, (in hex)
if ((mode & 8) != 0) { // Before shift: 02x, 08x, 10x, 00x, 0Ax, 12x, 18x, 1Ax
if ((mode & 4) != 0) { // After shift: 01, 04, 08, 00, 05, 09, 0c, 0d
if ((mode & 0x100) != 0) { // Reassemble and remove middle 0x040 (stupid fucking table)
return 4; // 0000 -> 0 0020 -> 1 0040 -> 0 0060 -> 1
} // 0080 -> 2 00a0 -> 3 00c0 -> 2 00e0 -> 3
return 3; // 0100 -> 4 0120 -> 5 0140 -> 4 0160 -> 5
} // 0180 -> 6 01a0 -> 7 01c0 -> 6 01e0 -> 7
return 2; // Key ranges: 01a0 -> 7, 0180 -> 6, 0100 -> 4, 0080 -> 2
} // 8>>2 = 2, 4>>2 = 1 :: () = 0, (4) = 1, (8) = 2, (8,4) = 3
if ((mode & 4) != 0) { const uint mask = 0 - uint((mode & 3) != 0);
return 1; const uint sh3_mode = (mode >> 2) & 3;
} const uint sh0_mode = ((mode >> 6) & 6) | ((mode >> 5) & 1);
return 0; const uint fl_const_table = 0
} | ((1) << (2 * 3)) //0080 -> 2, 1 + 5 = 6
if ((mode & 0x100) != 0) { | ((1) << (3 * 3))
if ((mode & 0x80) != 0) { | ((4) << (4 * 3)) //0100 -> 4, 4 + 5 = 9
if ((mode & 0x20) != 0) { | ((4) << (5 * 3))
return 8; | ((2) << (6 * 3)) //0180 -> 6, 2 + 5 = 7
} | ((3) << (7 * 3)) //01a0 -> 7, 3 + 5 = 8
return 7; ;
} const uint if_mode3_t = sh3_mode + uint((mode & 0x10c) == 0x10c);
return 9; const uint if_mode3_f = 5 + ((fl_const_table >> (sh0_mode * 3)) & 7);
} return int((if_mode3_t & mask) | (if_mode3_f & ~mask));
if ((mode & 0x80) != 0) {
return 6;
}
return 5;
} }
uvec2 DecodeBlockSize(uint mode_layout, uint mode) { uvec2 DecodeBlockSize(uint mode_layout, uint mode) {