vkd3d-shader/hlsl: Store RASTERIZER_SAMPLE_COUNT in the vsir program.

Also, the profile check for GetRenderTargetSampleCount() is moved to
parse time.
This commit is contained in:
Francisco Casas
2024-11-04 20:21:17 -03:00
committed by Henri Verbeet
parent ab60f4e082
commit 950c381728
Notes: Henri Verbeet 2024-11-05 20:06:02 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1246
3 changed files with 40 additions and 31 deletions

View File

@@ -5175,6 +5175,10 @@ static bool intrinsic_GetRenderTargetSampleCount(struct hlsl_ctx *ctx,
struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS] = {0};
struct hlsl_ir_node *expr;
if (ctx->profile->type != VKD3D_SHADER_TYPE_PIXEL || hlsl_version_lt(ctx, 4, 1))
hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INCOMPATIBLE_PROFILE,
"GetRenderTargetSampleCount() can only be used from a pixel shader using version 4.1 or higher.");
if (!(expr = hlsl_new_expr(ctx, HLSL_OP0_RASTERIZER_SAMPLE_COUNT,
operands, hlsl_get_scalar_type(ctx, HLSL_TYPE_UINT), loc)))
return false;