AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb
[BUG] PNANOVDB_GRID_TYPE_CAP should be 28 (is 32)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 777
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 34
Description
Environment
Operating System: Windows 11
Version / Commit SHA: v12.1.1 (e3a9b1c1d9c9247c2d0fd85f688cc66bda16e890)
Other: DirectXShaderCompiler 1.8.2403.2 (11e1318)
Describe the bug
When PNanoVDB.h is included in the HLSL shader and the PNANOVDB_HLSL define is set as the only define the DXC compiler reports a bunch of errors related to the fact that PNANOVDB_GRID_TYPE_CAP is set to 32, while it seems it should be 28. Manually editing the file and changing the value to 28 fixes the issue.
data/shader/common/PNanoVDB.h:1153:106: error: too few elements in vector initialization (expected 32 elements, have 28)
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_value_strides_bits[PNANOVDB_GRID_TYPE_CAP] = { 0, 32, 64, 16, 32, 64, 96, 192, 0, 16, 32, 1, 32, 4, 8, 16, 0, 128, 256, 0, 0, 0, 0, 16, 24, 48, 8, 0 };
^
data/shader/common/PNanoVDB.h:1155:106: error: too few elements in vector initialization (expected 32 elements, have 28)
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_table_strides_bits[PNANOVDB_GRID_TYPE_CAP] = { 64, 64, 64, 64, 64, 64, 128, 192, 64, 64, 64, 64, 64, 64, 64, 64, 64, 128, 256, 64, 64, 64, 64, 64, 64, 64, 64, 64 };
^
data/shader/common/PNanoVDB.h:1157:106: error: too few elements in vector initialization (expected 32 elements, have 28)
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_minmax_strides_bits[PNANOVDB_GRID_TYPE_CAP] = { 0, 32, 64, 16, 32, 64, 96, 192, 8, 16, 32, 8, 32, 32, 32, 32, 32, 128, 256, 64, 64, 64, 64, 64, 24, 48, 8, 0 };
^
data/shader/common/PNanoVDB.h:1159:106: error: too few elements in vector initialization (expected 32 elements, have 28)
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_minmax_aligns_bits[PNANOVDB_GRID_TYPE_CAP] = { 0, 32, 64, 16, 32, 64, 32, 64, 8, 16, 32, 8, 32, 32, 32, 32, 32, 32, 64, 64, 64, 64, 64, 64, 8, 16, 8, 0 };
^
data/shader/common/PNanoVDB.h:1161:106: error: too few elements in vector initialization (expected 32 elements, have 28)
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_stat_strides_bits[PNANOVDB_GRID_TYPE_CAP] = { 0, 32, 64, 32, 32, 64, 32, 64, 8, 32, 32, 8, 32, 32, 32, 32, 32, 32, 64, 64, 64, 64, 64, 64, 32, 32, 32, 0 };
^
data/shader/common/PNanoVDB.h:1163:106: error: too few elements in vector initialization (expected 32 elements, have 28)
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_leaf_type[PNANOVDB_GRID_TYPE_CAP] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 2, 2, 2, 2, 0, 0, 3, 3, 4, 4, 5, 0, 0, 0, 0 };
To Reproduce
Steps to reproduce the behavior:
- Build any HLSL shader with DXC compiler that defines
PNANOVDB_HLSLand includes thePNanoVDB.hheader - See error
Expected behavior
No error.
Additional context
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in data/shader/common/PNanoVDB.h around lines 1153-1163 and compare PNANOVDB_GRID_TYPE_CAP with the initializer lengths. Reproduce by compiling an HLSL shader with DXC, PNANOVDB_HLSL, and this header; done when the reported initialization errors are gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100