mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader: Replace "parse_status" with a boolean variable.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
8313225cc6
commit
193218f54e
@@ -35,14 +35,12 @@ void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, co
|
|||||||
{
|
{
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
set_parse_status(&ctx->status, PARSE_ERR);
|
ctx->failed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, const char *fmt, ...)
|
void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
set_parse_status(&ctx->status, PARSE_WARN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var)
|
bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var)
|
||||||
|
@@ -23,13 +23,6 @@
|
|||||||
#include "vkd3d_shader_private.h"
|
#include "vkd3d_shader_private.h"
|
||||||
#include "rbtree.h"
|
#include "rbtree.h"
|
||||||
|
|
||||||
enum parse_status
|
|
||||||
{
|
|
||||||
PARSE_SUCCESS = 0,
|
|
||||||
PARSE_WARN = 1,
|
|
||||||
PARSE_ERR = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The general IR structure is inspired by Mesa GLSL hir, even though the code
|
/* The general IR structure is inspired by Mesa GLSL hir, even though the code
|
||||||
* ends up being quite different in practice. Anyway, here comes the relevant
|
* ends up being quite different in practice. Anyway, here comes the relevant
|
||||||
* licensing information.
|
* licensing information.
|
||||||
@@ -396,8 +389,8 @@ struct hlsl_ctx
|
|||||||
const char **source_files;
|
const char **source_files;
|
||||||
unsigned int source_files_count;
|
unsigned int source_files_count;
|
||||||
struct vkd3d_shader_location location;
|
struct vkd3d_shader_location location;
|
||||||
enum parse_status status;
|
|
||||||
struct vkd3d_shader_message_context *message_context;
|
struct vkd3d_shader_message_context *message_context;
|
||||||
|
bool failed;
|
||||||
|
|
||||||
void *scanner;
|
void *scanner;
|
||||||
|
|
||||||
@@ -501,14 +494,6 @@ static inline void hlsl_src_remove(struct hlsl_src *src)
|
|||||||
src->node = NULL;
|
src->node = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void set_parse_status(enum parse_status *current, enum parse_status update)
|
|
||||||
{
|
|
||||||
if (update == PARSE_ERR)
|
|
||||||
*current = PARSE_ERR;
|
|
||||||
else if (update == PARSE_WARN && *current == PARSE_SUCCESS)
|
|
||||||
*current = PARSE_WARN;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *hlsl_base_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN;
|
const char *hlsl_base_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN;
|
||||||
const char *debug_hlsl_type(const struct hlsl_type *type) DECLSPEC_HIDDEN;
|
const char *debug_hlsl_type(const struct hlsl_type *type) DECLSPEC_HIDDEN;
|
||||||
const char *hlsl_debug_modifiers(DWORD modifiers) DECLSPEC_HIDDEN;
|
const char *hlsl_debug_modifiers(DWORD modifiers) DECLSPEC_HIDDEN;
|
||||||
|
@@ -2006,7 +2006,7 @@ param_list:
|
|||||||
if (!add_func_parameter(ctx, $$, &$1, @1))
|
if (!add_func_parameter(ctx, $$, &$1, @1))
|
||||||
{
|
{
|
||||||
ERR("Error adding function parameter %s.\n", $1.name);
|
ERR("Error adding function parameter %s.\n", $1.name);
|
||||||
set_parse_status(&ctx->status, PARSE_ERR);
|
ctx->failed = true;
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3111,7 +3111,7 @@ int hlsl_parser_compile(struct hlsl_ctx *ctx, const char *entrypoint)
|
|||||||
|
|
||||||
yyparse(ctx->scanner, ctx);
|
yyparse(ctx->scanner, ctx);
|
||||||
|
|
||||||
if (ctx->status == PARSE_ERR)
|
if (ctx->failed)
|
||||||
return VKD3D_ERROR_INVALID_SHADER;
|
return VKD3D_ERROR_INVALID_SHADER;
|
||||||
|
|
||||||
if (!(entry_func = get_func_entry(ctx, entrypoint)))
|
if (!(entry_func = get_func_entry(ctx, entrypoint)))
|
||||||
@@ -3140,7 +3140,7 @@ int hlsl_parser_compile(struct hlsl_ctx *ctx, const char *entrypoint)
|
|||||||
|
|
||||||
compute_liveness(ctx, entry_func);
|
compute_liveness(ctx, entry_func);
|
||||||
|
|
||||||
if (ctx->status == PARSE_ERR)
|
if (ctx->failed)
|
||||||
return VKD3D_ERROR_INVALID_SHADER;
|
return VKD3D_ERROR_INVALID_SHADER;
|
||||||
return VKD3D_ERROR_NOT_IMPLEMENTED;
|
return VKD3D_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user