baldurk
74a6e28f5a
Improve ability to redeclare buffer formats from struct definitions
2025-01-07 16:11:32 +00:00
baldurk
7edcbfbdbc
Fix bitfields not being resolved before structure uses
2025-01-07 15:10:44 +00:00
baldurk
79be74a8ec
Only modify bitfield properties if bitfields are active
2025-01-07 14:43:19 +00:00
baldurk
73b52dafb8
Resolve pending bitfield packing before applying specified field offsets
2025-01-07 13:19:28 +00:00
baldurk
55d939cdd8
Respect bitfield packing when generating format string for struct
2025-01-07 13:19:28 +00:00
baldurk
6261cb42d3
Fix missing indent for declared buffer structures
2025-01-07 13:19:28 +00:00
baldurk
ec7ecf6896
Fix buffer declaration not properly declaring structs
2024-11-05 10:12:16 +00:00
baldurk
b4403b2d8d
Test different whitespacing around pointers
2024-10-31 13:04:25 +00:00
baldurk
89ee55bd0c
Fix matching variable-less buffer formats
...
* It's convenient and we sometimes automatically create formats that are just
'xint' so make sure they parse correctly.
2024-10-31 12:57:12 +00:00
baldurk
f4d579ffaa
Allow specifying tighter alignment than natural for odd buffer cases
2024-10-30 10:33:40 +00:00
baldurk
c2912fb259
32-bit compile fixes
2024-10-19 10:30:28 +01:00
baldurk
6408799b5d
Allow specifying scalar pointers in buffer formatter
2024-10-19 01:21:48 +01:00
baldurk
ac1a680b47
Redeclare bitfields in structs when declaring types
2024-10-19 01:21:47 +01:00
baldurk
c6c5702d74
Fix calculation of offsets with bitfields when aligning for pointers
2024-10-19 01:21:47 +01:00
baldurk
2b40a17f8a
Add packing rule for bitfield packing/straddling a la #pragma pack(1)
2024-06-27 13:54:41 +01:00
baldurk
1194531fc5
Add a descriptor viewer for showing all of a heap, root sig, or set
2024-04-10 18:58:53 +01:00
baldurk
aaf20445b4
Report error in the buffer formatter if a recursive struct is declared
2024-04-01 14:56:14 +01:00
baldurk
9f4f0e6aa1
Update copyright years to 2024
2024-02-12 11:04:52 +00:00
baldurk
9d39b8e1a8
Reformat code for clang-format 15
2023-09-05 11:02:08 +01:00
baldurk
6e0ea69011
Account for arrays of pointers when calculating buffer offsets
2023-07-25 17:47:09 +01:00
jake.turner
958ab08018
Add missing ")" R11G11B10 GetBufferFormatString()
...
"[[packed(r11g11b10]] float3" -> "[[packed(r11g11b10)]] float3"
There was a missing ")"
2023-07-12 18:00:52 +01:00
baldurk
dfed2749c9
Fix detection of scalar packing from only matrix layout. Closes #2918
2023-04-25 13:42:17 +01:00
baldurk
d47e79ae07
Update copyright years to 2023
2023-02-01 12:23:32 +00:00
baldurk
3cbe4a37d1
Sanitise identifier names for types and variables in generating formats
2023-01-05 15:39:14 +00:00
baldurk
b912ab4bac
Fix std140 structs adding extra padding at end of structs
2023-01-05 15:39:14 +00:00
baldurk
835990b052
Ensure texture-generated formats default to scalar packing
...
* On APIs like OpenGL texture formats (like vertex buffer formats) can be
tightly packed even in cases that apparently are otherwise not allowed - e.g.
with fake RGB formats where the stride looks misaligned due to alpha being
hidden.
2022-10-14 11:51:26 +01:00
baldurk
1ede871bd3
Allow C-style sized types in buffer formatter. Closes #2742
2022-10-10 11:39:20 +01:00
baldurk
ea35f0df0c
texture formats that aren't matrices shouldn't be marked row major
2022-08-03 17:44:11 +01:00
baldurk
5d51b524c6
Fix interpreting and declaring buffer formats that include pointers
2022-07-25 10:08:59 +01:00
baldurk
d39197a499
Arrays of float3 with a stride of 12 is only possible in scalar packing
...
* Previously this would be treated as std430 due to being 'tight' array packed,
even though std430 only allows as tight as the base alignment - which for a
float3 is 16-bytes still.
2022-07-11 13:00:18 +01:00
Jake Turner
dd58dd012b
Update expected error message to match code
...
Fixes failing "Buffer format parsing" unit test
2022-06-27 11:03:22 +01:00
baldurk
c77261f0f3
Display struct/enum typenames when available in buffer viewer
2022-05-25 17:18:31 +01:00
baldurk
9bde5324b6
Improve handling of enums in buffer viewer fixed variables
2022-05-25 17:02:10 +01:00
baldurk
694c17d6bf
Fix formatting of buffers with explicit unbounded arrays
2022-05-24 17:59:10 +01:00
baldurk
27aa5e05c3
Work recursively to estimate packing rules of a struct
2022-05-24 16:34:42 +01:00
baldurk
c5a588d2e4
Fix texture-as-buffer view format string generation
2022-05-23 14:43:08 +01:00
baldurk
a1abc95ac2
Remove use of QStringView from newer Qt versions
2022-05-20 16:43:09 +01:00
baldurk
cef5aa857b
Avoid declaring redundant structs for anonymous GL structs
2022-05-20 14:15:31 +01:00
baldurk
07d7bbc1ae
Add tests for buffer format parsing
2022-05-20 14:15:31 +01:00
baldurk
6b133b437c
Account for specified struct padding in final root struct
2022-05-20 14:15:31 +01:00
baldurk
7acde16d1e
Improve parsing of pointers in buffer formats
2022-05-20 14:15:31 +01:00
baldurk
8ab61370a9
Make blank parse result more consistent
2022-05-20 14:15:31 +01:00
baldurk
d2c557a1ae
Pick better packing defaults for APIs where we know what is expected
...
* For vulkan any packing can be legal so we don't pick a default, but at least
for D3D and GL the type of buffer implies a packing.
2022-05-20 14:15:31 +01:00
baldurk
31feedd16d
Remove ShaderConstantDescriptor, inline into ShaderConstantType
...
* This struct was redundant isnce it was only ever used in the type and not
meaningfully accessed directly.
2022-05-20 14:15:31 +01:00
baldurk
2d8687e28e
Show parse errors on the line they occur
2022-05-20 14:15:31 +01:00
baldurk
4bb54d00dd
Show visible offsets and (optionally) padding in buffers. Closes #1664
2022-05-20 14:15:30 +01:00
baldurk
5ac9de0a20
Show truncation in fixed variables explicitly instead of showing 0s
2022-05-20 14:15:30 +01:00
baldurk
43fa3cd94b
Use BufferViewer for viewing constant buffers
...
* Unifying these views means that constant buffers have all the same
reformatting and it avoids having multiple paths for what is now effectively
the same control (a buffer can either have fixed data, repeating data, or
both)
2022-05-20 14:15:30 +01:00
baldurk
a36516c8a5
Explicitly handle unbounded arrays and display declared fixed vars
...
* GL and Vulkan allow buffers to have fixed variables before a trailing AoS
unbounded array. These fixed variables can't be easily displayed in a table
and previously we skipped them. Now we display these in a tree format.
* We also support formats which don't have an unbounded array at all and display
these just with the tree. This will allow the BufferViewer to subsume the
capabilities of the ConstantBufferPreviewer (though it needs to handle opaque
non-buffer-backed variables, and slot-following).
2022-05-20 13:37:26 +01:00
baldurk
d0720fe787
Allow a [[pad]] annotation to specify padding elements
...
* These elements are consumed but not shown, so the offsets of subsequent
elements still act as if they're there. This may be more convenient than
specifying a manual offset on the next element or a struct size.
2022-05-20 13:37:26 +01:00