mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader: Introduce HLSL allocation helpers.
To automatically put the compilation context in a failed state. 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
3a9f547be3
commit
49726b0e64
@@ -170,7 +170,7 @@ row_major {return KW_ROW_MAJOR; }
|
||||
{IDENTIFIER} {
|
||||
struct hlsl_ctx *ctx = yyget_extra(yyscanner);
|
||||
|
||||
yylval->name = vkd3d_strdup(yytext);
|
||||
yylval->name = hlsl_strdup(ctx, yytext);
|
||||
if (hlsl_get_var(ctx->cur_scope, yytext) || hlsl_get_function(ctx, yytext))
|
||||
return VAR_IDENTIFIER;
|
||||
else if (hlsl_get_type(ctx->cur_scope, yytext, true))
|
||||
@@ -248,7 +248,8 @@ row_major {return KW_ROW_MAJOR; }
|
||||
return PRE_LINE;
|
||||
}
|
||||
<pp_line>{STRING} {
|
||||
char *string = vkd3d_strdup(yytext + 1);
|
||||
struct hlsl_ctx *ctx = yyget_extra(yyscanner);
|
||||
char *string = hlsl_strdup(ctx, yytext + 1);
|
||||
|
||||
BEGIN(pp_ignore);
|
||||
string[strlen(string) - 1] = 0;
|
||||
|
||||
Reference in New Issue
Block a user