diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index 49802e2c9..dd13757bf 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -1685,7 +1685,7 @@ static const struct vkd3d_sm1_opcode_info *shader_sm1_get_opcode_info_from_vsir_ if (ins->dst_count != info->dst_count) { vkd3d_shader_error(d3dbc->message_context, &ins->location, VKD3D_SHADER_ERROR_D3DBC_INVALID_REGISTER_COUNT, - "Invalid destination parameter count %u for instruction \"%s\" (%#x); expected %u.", + "Invalid destination parameter count %zu for instruction \"%s\" (%#x); expected %u.", ins->dst_count, vsir_opcode_get_name(ins->opcode, ""), ins->opcode, info->dst_count); d3dbc->failed = true; return NULL; @@ -1693,7 +1693,7 @@ static const struct vkd3d_sm1_opcode_info *shader_sm1_get_opcode_info_from_vsir_ if (ins->src_count != info->src_count) { vkd3d_shader_error(d3dbc->message_context, &ins->location, VKD3D_SHADER_ERROR_D3DBC_INVALID_REGISTER_COUNT, - "Invalid source parameter count %u for instruction \"%s\" (%#x); expected %u.", + "Invalid source parameter count %zu for instruction \"%s\" (%#x); expected %u.", ins->src_count, vsir_opcode_get_name(ins->opcode, ""), ins->opcode, info->src_count); d3dbc->failed = true; return NULL; diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index b696ac8ad..d1c1b196c 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1180,7 +1180,7 @@ static enum vkd3d_result vsir_program_lower_udiv(struct vsir_program *program, { vkd3d_shader_error(ctx->message_context, &udiv->location, VKD3D_SHADER_ERROR_VSIR_INVALID_DEST_COUNT, - "Internal compiler error: invalid destination count %u for UDIV.", + "Internal compiler error: invalid destination count %zu for UDIV.", udiv->dst_count); return VKD3D_ERROR; } @@ -1321,7 +1321,7 @@ static enum vkd3d_result vsir_program_lower_sm4_sincos(struct vsir_program *prog { vkd3d_shader_error(ctx->message_context, &sincos->location, VKD3D_SHADER_ERROR_VSIR_INVALID_DEST_COUNT, - "Internal compiler error: invalid destination count %u for SINCOS.", + "Internal compiler error: invalid destination count %zu for SINCOS.", sincos->dst_count); return VKD3D_ERROR; } @@ -10020,7 +10020,7 @@ static void vsir_validate_dst_count(struct validation_context *ctx, { if (instruction->dst_count != count) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DEST_COUNT, - "Invalid destination parameter count %u for instruction \"%s\" (%#x); expected %u.", + "Invalid destination parameter count %zu for instruction \"%s\" (%#x); expected %u.", instruction->dst_count, vsir_opcode_get_name(instruction->opcode, ""), instruction->opcode, count); } @@ -10030,7 +10030,7 @@ static void vsir_validate_src_count(struct validation_context *ctx, { if (instruction->src_count != count) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SOURCE_COUNT, - "Invalid source parameter count %u for instruction \"%s\" (%#x); expected %u.", + "Invalid source parameter count %zu for instruction \"%s\" (%#x); expected %u.", instruction->src_count, vsir_opcode_get_name(instruction->opcode, ""), instruction->opcode, count); } @@ -10041,7 +10041,7 @@ static bool vsir_validate_src_min_count(struct validation_context *ctx, if (instruction->src_count < count) { validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SOURCE_COUNT, - "Invalid source parameter count %u for instruction \"%s\" (%#x); expected at least %u.", + "Invalid source parameter count %zu for instruction \"%s\" (%#x); expected at least %u.", instruction->src_count, vsir_opcode_get_name(instruction->opcode, ""), instruction->opcode, count); return false; @@ -10056,7 +10056,7 @@ static bool vsir_validate_src_max_count(struct validation_context *ctx, if (instruction->src_count > count) { validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SOURCE_COUNT, - "Invalid source parameter count %u for instruction \"%s\" (%#x); expected at most %u.", + "Invalid source parameter count %zu for instruction \"%s\" (%#x); expected at most %u.", instruction->src_count, vsir_opcode_get_name(instruction->opcode, ""), instruction->opcode, count); return false; @@ -11421,7 +11421,7 @@ static void vsir_validate_phi(struct validation_context *ctx, const struct vkd3d if (instruction->src_count % 2 != 0) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SOURCE_COUNT, - "Invalid source count %u for a PHI instruction, it must be an even number.", + "Invalid source count %zu for a PHI instruction, it must be an even number.", instruction->src_count); incoming_count = instruction->src_count / 2; @@ -11503,7 +11503,7 @@ static void vsir_validate_switch_monolithic(struct validation_context *ctx, if (instruction->src_count % 2 != 1) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SOURCE_COUNT, - "Invalid source count %u for a monolithic SWITCH instruction, it must be an odd number.", + "Invalid source count %zu for a monolithic SWITCH instruction, it must be an odd number.", instruction->src_count); if (!vsir_register_is_label(&instruction->src[1].reg)) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 67fdc1591..6eabf7fca 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -8652,7 +8652,7 @@ static void spirv_compiler_emit_branch(struct spirv_compiler *compiler, if (instruction->src_count == 3) spirv_compiler_emit_merge(compiler, src[1].reg.idx[0].offset, src[2].reg.idx[0].offset); else - ERR("Invalid branch with %u sources.\n", instruction->src_count); + ERR("Invalid branch with %zu sources.\n", instruction->src_count); } vkd3d_spirv_build_op_branch(builder, spirv_compiler_get_label_id(compiler, src[0].reg.idx[0].offset)); return; @@ -8674,7 +8674,7 @@ static void spirv_compiler_emit_branch(struct spirv_compiler *compiler, spirv_compiler_emit_merge(compiler, src[3].reg.idx[0].offset, (instruction->src_count > 4) ? src[4].reg.idx[0].offset : 0); else - ERR("Invalid branch with %u sources.\n", instruction->src_count); + ERR("Invalid branch with %zu sources.\n", instruction->src_count); vkd3d_spirv_build_op_branch_conditional(builder, condition_id, spirv_compiler_get_label_id(compiler, src[1].reg.idx[0].offset), spirv_compiler_get_label_id(compiler, src[2].reg.idx[0].offset)); diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index 8acd7bc0d..ad54a559c 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -4087,14 +4087,14 @@ static void tpf_simple_instruction(struct tpf_compiler *tpf, const struct vkd3d_ if (ins->dst_count != dst_count) { - ERR("Invalid destination count %u for vsir instruction %#x (expected %u).\n", + ERR("Invalid destination count %zu for vsir instruction %#x (expected %u).\n", ins->dst_count, ins->opcode, dst_count); tpf->result = VKD3D_ERROR_INVALID_SHADER; return; } if (ins->src_count != src_count) { - ERR("Invalid source count %u for vsir instruction %#x (expected %u).\n", + ERR("Invalid source count %zu for vsir instruction %#x (expected %u).\n", ins->src_count, ins->opcode, src_count); tpf->result = VKD3D_ERROR_INVALID_SHADER; return; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 874a6281e..a6b748402 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -2187,7 +2187,7 @@ static struct vkd3d_shader_param_node *shader_param_allocator_node_create( } static void shader_param_allocator_init(struct vkd3d_shader_param_allocator *allocator, - unsigned int count, unsigned int stride) + size_t count, size_t stride) { allocator->count = max(count, MAX_REG_OUTPUT); allocator->stride = stride; @@ -2208,7 +2208,7 @@ static void shader_param_allocator_destroy(struct vkd3d_shader_param_allocator * } } -void *shader_param_allocator_get(struct vkd3d_shader_param_allocator *allocator, unsigned int count) +void *shader_param_allocator_get(struct vkd3d_shader_param_allocator *allocator, size_t count) { void *params; @@ -2285,7 +2285,7 @@ bool shader_instruction_array_add_icb(struct vkd3d_shader_instruction_array *ins static struct vkd3d_shader_src_param *shader_instruction_array_clone_src_params( struct vkd3d_shader_instruction_array *instructions, const struct vkd3d_shader_src_param *params, - unsigned int count); + size_t count); static bool shader_register_clone_relative_addresses(struct vkd3d_shader_register *reg, struct vkd3d_shader_instruction_array *instructions) @@ -2306,10 +2306,10 @@ static bool shader_register_clone_relative_addresses(struct vkd3d_shader_registe static struct vkd3d_shader_dst_param *shader_instruction_array_clone_dst_params( struct vkd3d_shader_instruction_array *instructions, const struct vkd3d_shader_dst_param *params, - unsigned int count) + size_t count) { struct vkd3d_shader_dst_param *dst_params; - unsigned int i; + size_t i; if (!(dst_params = shader_dst_param_allocator_get(&instructions->dst_params, count))) return NULL; @@ -2326,10 +2326,10 @@ static struct vkd3d_shader_dst_param *shader_instruction_array_clone_dst_params( static struct vkd3d_shader_src_param *shader_instruction_array_clone_src_params( struct vkd3d_shader_instruction_array *instructions, const struct vkd3d_shader_src_param *params, - unsigned int count) + size_t count) { struct vkd3d_shader_src_param *src_params; - unsigned int i; + size_t i; if (!(src_params = shader_src_param_allocator_get(&instructions->src_params, count))) return NULL; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 90166ec64..1c72f09ea 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -1281,8 +1281,8 @@ struct vkd3d_shader_instruction struct vkd3d_shader_location location; enum vkd3d_shader_opcode opcode; uint32_t flags; - unsigned int dst_count; - unsigned int src_count; + size_t dst_count; + size_t src_count; struct vkd3d_shader_dst_param *dst; struct vkd3d_shader_src_param *src; struct vkd3d_shader_texel_offset texel_offset; @@ -1377,22 +1377,22 @@ struct vkd3d_shader_param_allocator { struct vkd3d_shader_param_node *head; struct vkd3d_shader_param_node *current; - unsigned int count; - unsigned int stride; - unsigned int index; + size_t count; + size_t stride; + size_t index; }; -void *shader_param_allocator_get(struct vkd3d_shader_param_allocator *allocator, unsigned int count); +void *shader_param_allocator_get(struct vkd3d_shader_param_allocator *allocator, size_t count); static inline struct vkd3d_shader_src_param *shader_src_param_allocator_get( - struct vkd3d_shader_param_allocator *allocator, unsigned int count) + struct vkd3d_shader_param_allocator *allocator, size_t count) { VKD3D_ASSERT(allocator->stride == sizeof(struct vkd3d_shader_src_param)); return shader_param_allocator_get(allocator, count); } static inline struct vkd3d_shader_dst_param *shader_dst_param_allocator_get( - struct vkd3d_shader_param_allocator *allocator, unsigned int count) + struct vkd3d_shader_param_allocator *allocator, size_t count) { VKD3D_ASSERT(allocator->stride == sizeof(struct vkd3d_shader_dst_param)); return shader_param_allocator_get(allocator, count);