vkd3d-shader: Distinguish between resource exhaustion and invalid shaders when returning failure.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2021-05-21 00:32:23 -05:00
committed by Alexandre Julliard
parent ba1cc670e6
commit 6493953516
3 changed files with 11 additions and 10 deletions

View File

@@ -39,7 +39,8 @@ void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc,
vkd3d_shader_verror(ctx->message_context, &loc, error, fmt, args);
va_end(args);
ctx->failed = true;
if (!ctx->result)
ctx->result = VKD3D_ERROR_INVALID_SHADER;
}
void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc,
@@ -1648,10 +1649,10 @@ int hlsl_compile_shader(const struct vkd3d_shader_code *hlsl, const struct vkd3d
return VKD3D_ERROR_OUT_OF_MEMORY;
}
if (ctx.failed)
if (ctx.result)
{
hlsl_ctx_cleanup(&ctx);
return VKD3D_ERROR_INVALID_SHADER;
return ctx.result;
}
if (!(entry_func = hlsl_get_func_decl(&ctx, entry_point)))