vkd3d-common: Introduce VKD3D_BITMAP_SIZE.

This commit is contained in:
Henri Verbeet
2024-04-17 13:12:13 +02:00
committed by Alexandre Julliard
parent aa35b2cecb
commit 46fca3f9f4
Notes: Alexandre Julliard 2024-04-23 22:59:18 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/824
5 changed files with 6 additions and 5 deletions

View File

@ -216,7 +216,7 @@ struct vkd3d_shader_sm1_parser
struct vkd3d_shader_parser p;
#define MAX_CONSTANT_COUNT 8192
uint32_t constant_def_mask[3][MAX_CONSTANT_COUNT / 32];
uint32_t constant_def_mask[3][VKD3D_BITMAP_SIZE(MAX_CONSTANT_COUNT)];
};
/* This table is not order or position dependent. */

View File

@ -805,7 +805,7 @@ struct sm6_parser
struct vkd3d_shader_dst_param *output_params;
struct vkd3d_shader_dst_param *input_params;
struct vkd3d_shader_dst_param *patch_constant_params;
uint32_t io_regs_declared[(VKD3DSPR_COUNT + 0x1f) / 0x20];
uint32_t io_regs_declared[VKD3D_BITMAP_SIZE(VKD3DSPR_COUNT)];
struct sm6_function *functions;
size_t function_count;

View File

@ -2917,8 +2917,7 @@ static enum vkd3d_result vsir_block_init(struct vsir_block *block, unsigned int
if (block_count > SIZE_MAX - (sizeof(*block->dominates) * CHAR_BIT - 1))
return VKD3D_ERROR_OUT_OF_MEMORY;
block_count = align(block_count, sizeof(*block->dominates) * CHAR_BIT);
byte_count = block_count / CHAR_BIT;
byte_count = VKD3D_BITMAP_SIZE(block_count) * sizeof(*block->dominates);
assert(label);
memset(block, 0, sizeof(*block));