diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 22cf57ca..b1997490 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -511,9 +511,9 @@ static const enum vkd3d_data_type data_type_table[] = /* VKD3D_SM4_DATA_FLOAT */ VKD3D_DATA_FLOAT, }; -static BOOL shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, +static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param); -static BOOL shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, +static bool shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param); static void shader_sm4_read_conditional_op(struct vkd3d_shader_instruction *ins, @@ -1345,7 +1345,7 @@ void shader_sm4_read_header(void *data, const DWORD **ptr, struct vkd3d_shader_v *shader_version = priv->shader_version; } -static BOOL shader_sm4_read_reg_idx(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, +static bool shader_sm4_read_reg_idx(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, DWORD addressing, struct vkd3d_shader_register_index *reg_idx) { if (addressing & VKD3D_SM4_ADDRESSING_RELATIVE) @@ -1355,7 +1355,7 @@ static BOOL shader_sm4_read_reg_idx(struct vkd3d_sm4_data *priv, const DWORD **p if (!(reg_idx->rel_addr = rel_addr)) { ERR("Failed to get src param for relative addressing.\n"); - return FALSE; + return false; } if (addressing & VKD3D_SM4_ADDRESSING_OFFSET) @@ -1370,10 +1370,10 @@ static BOOL shader_sm4_read_reg_idx(struct vkd3d_sm4_data *priv, const DWORD **p reg_idx->offset = *(*ptr)++; } - return TRUE; + return true; } -static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, +static bool shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum vkd3d_data_type data_type, struct vkd3d_shader_register *param, enum vkd3d_shader_src_modifier *modifier) { @@ -1383,7 +1383,7 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr if (*ptr >= end) { WARN("Invalid ptr %p >= end %p.\n", *ptr, end); - return FALSE; + return false; } token = *(*ptr)++; @@ -1407,7 +1407,7 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr if (*ptr >= end) { WARN("Invalid ptr %p >= end %p.\n", *ptr, end); - return FALSE; + return false; } m = *(*ptr)++; @@ -1449,7 +1449,7 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr if (!(shader_sm4_read_reg_idx(priv, ptr, end, addressing, ¶m->idx[0]))) { ERR("Failed to read register index.\n"); - return FALSE; + return false; } } @@ -1464,7 +1464,7 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr if (!(shader_sm4_read_reg_idx(priv, ptr, end, addressing, ¶m->idx[1]))) { ERR("Failed to read register index.\n"); - return FALSE; + return false; } } @@ -1483,7 +1483,7 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr if (end - *ptr < 1) { WARN("Invalid ptr %p, end %p.\n", *ptr, end); - return FALSE; + return false; } memcpy(param->u.immconst_uint, *ptr, 1 * sizeof(DWORD)); *ptr += 1; @@ -1494,7 +1494,7 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr if (end - *ptr < VKD3D_VEC4_SIZE) { WARN("Invalid ptr %p, end %p.\n", *ptr, end); - return FALSE; + return false; } memcpy(param->u.immconst_uint, *ptr, VKD3D_VEC4_SIZE * sizeof(DWORD)); *ptr += 4; @@ -1508,10 +1508,10 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr map_register(priv, param); - return TRUE; + return true; } -static BOOL shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, +static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param) { DWORD token; @@ -1519,14 +1519,14 @@ static BOOL shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD * if (*ptr >= end) { WARN("Invalid ptr %p >= end %p.\n", *ptr, end); - return FALSE; + return false; } token = **ptr; if (!shader_sm4_read_param(priv, ptr, end, data_type, &src_param->reg, &src_param->modifiers)) { ERR("Failed to read parameter.\n"); - return FALSE; + return false; } if (src_param->reg.type == VKD3DSPR_IMMCONST) @@ -1559,7 +1559,7 @@ static BOOL shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD * } } - return TRUE; + return true; } static bool shader_sm4_is_scalar_register(const struct vkd3d_shader_register *reg) @@ -1579,7 +1579,7 @@ static bool shader_sm4_is_scalar_register(const struct vkd3d_shader_register *re } } -static BOOL shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, +static bool shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param) { enum vkd3d_shader_src_modifier modifier; @@ -1588,20 +1588,20 @@ static BOOL shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD * if (*ptr >= end) { WARN("Invalid ptr %p >= end %p.\n", *ptr, end); - return FALSE; + return false; } token = **ptr; if (!shader_sm4_read_param(priv, ptr, end, data_type, &dst_param->reg, &modifier)) { ERR("Failed to read parameter.\n"); - return FALSE; + return false; } if (modifier != VKD3DSPSM_NONE) { ERR("Invalid source modifier %#x on destination register.\n", modifier); - return FALSE; + return false; } dst_param->write_mask = (token & VKD3D_SM4_WRITEMASK_MASK) >> VKD3D_SM4_WRITEMASK_SHIFT; @@ -1611,7 +1611,7 @@ static BOOL shader_sm4_read_dst_param(struct vkd3d_sm4_data *priv, const DWORD * dst_param->modifiers = 0; dst_param->shift = 0; - return TRUE; + return true; } static void shader_sm4_read_instruction_modifier(DWORD modifier, struct vkd3d_shader_instruction *ins) @@ -1756,7 +1756,7 @@ fail: return; } -BOOL shader_sm4_is_end(void *data, const DWORD **ptr) +bool shader_sm4_is_end(void *data, const DWORD **ptr) { struct vkd3d_sm4_data *priv = data; return *ptr == priv->end; @@ -1775,7 +1775,7 @@ BOOL shader_sm4_is_end(void *data, const DWORD **ptr) #define TAG_AON9 MAKE_TAG('A', 'o', 'n', '9') #define TAG_RTS0 MAKE_TAG('R', 'T', 'S', '0') -static BOOL require_space(size_t offset, size_t count, size_t size, size_t data_size) +static bool require_space(size_t offset, size_t count, size_t size, size_t data_size) { return !count || (data_size - offset) / count >= size; } diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index e0cb5bab..8769513d 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -313,17 +313,17 @@ static void string_buffer_clear(struct vkd3d_string_buffer *buffer) buffer->content_size = 0; } -static BOOL string_buffer_init(struct vkd3d_string_buffer *buffer) +static bool string_buffer_init(struct vkd3d_string_buffer *buffer) { buffer->buffer_size = 32; if (!(buffer->buffer = vkd3d_malloc(buffer->buffer_size))) { ERR("Failed to allocate shader buffer memory.\n"); - return FALSE; + return false; } string_buffer_clear(buffer); - return TRUE; + return true; } static void string_buffer_free(struct vkd3d_string_buffer *buffer) @@ -331,7 +331,7 @@ static void string_buffer_free(struct vkd3d_string_buffer *buffer) vkd3d_free(buffer->buffer); } -static BOOL string_buffer_resize(struct vkd3d_string_buffer *buffer, int rc) +static bool string_buffer_resize(struct vkd3d_string_buffer *buffer, int rc) { unsigned int new_buffer_size = buffer->buffer_size * 2; char *new_buffer; @@ -342,11 +342,11 @@ static BOOL string_buffer_resize(struct vkd3d_string_buffer *buffer, int rc) { ERR("Failed to grow buffer.\n"); buffer->buffer[buffer->content_size] = '\0'; - return FALSE; + return false; } buffer->buffer = new_buffer; buffer->buffer_size = new_buffer_size; - return TRUE; + return true; } static int shader_vaddline(struct vkd3d_string_buffer *buffer, const char *format, va_list args) diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index da17e361..cf6e9f50 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -774,7 +774,7 @@ struct vkd3d_shader_instruction } declaration; }; -static inline BOOL vkd3d_shader_instruction_has_texel_offset(const struct vkd3d_shader_instruction *ins) +static inline bool vkd3d_shader_instruction_has_texel_offset(const struct vkd3d_shader_instruction *ins) { return ins->texel_offset.u || ins->texel_offset.v || ins->texel_offset.w; } @@ -793,7 +793,7 @@ void shader_sm4_read_header(void *data, const DWORD **ptr, struct vkd3d_shader_version *shader_version) DECLSPEC_HIDDEN; void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct vkd3d_shader_instruction *ins) DECLSPEC_HIDDEN; -BOOL shader_sm4_is_end(void *data, const DWORD **ptr) DECLSPEC_HIDDEN; +bool shader_sm4_is_end(void *data, const DWORD **ptr) DECLSPEC_HIDDEN; int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length, struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN;