[PATCH 0/6] MR402: vkd3d-shader: Minor fixes to clangd warnings (clangd).
Some fixes to valid clangd warnings, since I am using it as linter. Also, I am removing enum hlsl_error_level on 4/6, since it doesn't seem to be meant to be used anywhere after 3/6. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
From: Francisco Casas <fcasas(a)codeweavers.com> --- libs/vkd3d-shader/tpf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index c471d1c58..cd6f3ee13 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -1803,10 +1803,11 @@ static bool shader_sm4_read_param(struct vkd3d_shader_sm4_parser *priv, const ui *modifier = VKD3DSPSM_ABSNEG; break; + case VKD3D_SM4_REGISTER_MODIFIER_NONE: + break; + default: FIXME("Unhandled register modifier %#x.\n", m); - /* fall-through */ - case VKD3D_SM4_REGISTER_MODIFIER_NONE: break; } -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
From: Francisco Casas <fcasas(a)codeweavers.com> --- libs/vkd3d-shader/tpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index cd6f3ee13..876bb8290 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -2729,7 +2729,7 @@ bool hlsl_sm4_usage_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semant const char *name; bool output; enum vkd3d_shader_type shader_type; - D3DDECLUSAGE usage; + D3D_NAME usage; } semantics[] = { -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
From: Francisco Casas <fcasas(a)codeweavers.com> hlsl_note() expects enum vkd3d_shader_log_level values instead. --- libs/vkd3d-shader/hlsl_codegen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 5c816e895..8b5450fc7 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -19,6 +19,7 @@ */ #include "hlsl.h" +#include "vkd3d_shader.h" #include <stdio.h> /* TODO: remove when no longer needed, only used for new_offset_instr_from_deref() */ @@ -249,7 +250,7 @@ static struct hlsl_ir_var *add_semantic_var(struct hlsl_ctx *ctx, struct hlsl_ir { hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC, "Output semantic \"%s%u\" is used multiple times.", semantic->name, index); - hlsl_note(ctx, &ext_var->loc, HLSL_LEVEL_ERROR, + hlsl_note(ctx, &ext_var->loc, VKD3D_SHADER_LOG_ERROR, "First use of \"%s%u\" is here.", semantic->name, index); semantic->reported_duplicated_output_next_index = index + 1; } @@ -262,7 +263,7 @@ static struct hlsl_ir_var *add_semantic_var(struct hlsl_ctx *ctx, struct hlsl_ir hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC, "Input semantic \"%s%u\" is used multiple times with incompatible types.", semantic->name, index); - hlsl_note(ctx, &ext_var->loc, HLSL_LEVEL_ERROR, + hlsl_note(ctx, &ext_var->loc, VKD3D_SHADER_LOG_ERROR, "First declaration of \"%s%u\" is here.", semantic->name, index); semantic->reported_duplicated_input_incompatible_next_index = index + 1; } -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
From: Francisco Casas <fcasas(a)codeweavers.com> It is not used anywhere. --- libs/vkd3d-shader/hlsl.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 59c543c7b..9f1a3fe21 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -864,13 +864,6 @@ struct hlsl_ctx uint32_t found_numthreads : 1; }; -enum hlsl_error_level -{ - HLSL_LEVEL_ERROR = 0, - HLSL_LEVEL_WARNING, - HLSL_LEVEL_NOTE, -}; - struct hlsl_resource_load_params { struct hlsl_type *format; -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
From: Francisco Casas <fcasas(a)codeweavers.com> --- libs/vkd3d-shader/d3dbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index 598b75183..67fa32710 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -2221,7 +2221,7 @@ static void write_sm1_jump(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *b struct sm1_instruction instr = { - .opcode = VKD3D_SM1_OP_TEXKILL, + .opcode = D3DSIO_TEXKILL, .dst.type = D3DSPR_TEMP, .dst.reg = reg->id, -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
From: Francisco Casas <fcasas(a)codeweavers.com> --- libs/vkd3d-shader/spirv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 1c8b52e6d..1b58e98e5 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2466,6 +2466,7 @@ static struct spirv_compiler *spirv_compiler_create(const struct vkd3d_shader_ve default: WARN("Ignoring unrecognised option %#x with value %#x.\n", option->name, option->value); + break; case VKD3D_SHADER_COMPILE_OPTION_API_VERSION: break; -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402
``` Subject: [PATCH 1/6] vkd3d-shader/tpf: Remove unnecessary fallthrough (clangd). ```
What is the issue here exactly? I don't necessarily have an issue with the change, but I wouldn't say it's an improvement purely on its own merits either.
```diff #include "hlsl.h" +#include "vkd3d_shader.h" #include <stdio.h> ```
Is that needed? Doesn't hlsl.h pull in vkd3d_shader_private.h, which pulls in vkd3d_shader.h?
``` Subject: [PATCH 4/6] vkd3d-shader/hlsl: Remove enum hlsl_error_level. ```
We might as well merge that with the preceding patch that removes the last users of these. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/402#note_48383
participants (3)
-
Francisco Casas -
Francisco Casas (@fcasas) -
Henri Verbeet (@hverbeet)