vkd3d-shader/hlsl: Lower separate SampleGrad() for SM1.

This commit is contained in:
Francisco Casas 2025-01-08 18:48:30 -03:00 committed by Henri Verbeet
parent 00b79cd781
commit 0a5955372a
Notes: Henri Verbeet 2025-01-14 18:03:19 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1335
2 changed files with 7 additions and 5 deletions

View File

@ -2881,6 +2881,7 @@ static bool lower_separate_samples(struct hlsl_ctx *ctx, struct hlsl_ir_node *in
load = hlsl_ir_resource_load(instr);
if (load->load_type != HLSL_RESOURCE_SAMPLE
&& load->load_type != HLSL_RESOURCE_SAMPLE_GRAD
&& load->load_type != HLSL_RESOURCE_SAMPLE_LOD
&& load->load_type != HLSL_RESOURCE_SAMPLE_LOD_BIAS)
return false;
@ -6977,7 +6978,8 @@ static void sm1_generate_vsir_sampler_dcls(struct hlsl_ctx *ctx,
break;
case HLSL_SAMPLER_DIM_GENERIC:
/* These can appear in sm4-style combined sample instructions. */
/* These can appear in sm4-style separate sample
* instructions that haven't been lowered. */
hlsl_fixme(ctx, &var->loc, "Generic samplers need to be lowered.");
continue;

View File

@ -58,7 +58,7 @@ probe (0,0) rgba (0.0, 0.0, 1.0, 0.0)
[require]
shader model >= 3.0
[pixel shader todo(sm<4)]
[pixel shader]
sampler s;
Texture2D t;
uniform float4 grad;
@ -70,11 +70,11 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo(msl | sm<4) draw quad
todo(msl) draw quad
probe (0, 0) rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 1.0 1.0 1.0
todo(msl | sm<4) draw quad
todo(msl) draw quad
probe (0, 0) rgba (0.0, 0.0, 1.0, 0.0)
uniform 0 float4 2.0 2.0 2.0 2.0
todo(msl | sm<4) draw quad
todo(msl) draw quad
probe (0, 0) rgba (0.0, 0.0, 1.0, 0.0)