mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/tpf: Add support for emitting sample_l instructions.
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
This commit is contained in:
parent
6835e8176f
commit
ea7d8c65bd
Notes:
Alexandre Julliard
2023-05-24 22:34:11 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/188
@ -4108,6 +4108,10 @@ static void write_sm4_sample(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer
|
||||
instr.opcode = VKD3D_SM4_OP_SAMPLE;
|
||||
break;
|
||||
|
||||
case HLSL_RESOURCE_SAMPLE_LOD:
|
||||
instr.opcode = VKD3D_SM4_OP_SAMPLE_LOD;
|
||||
break;
|
||||
|
||||
case HLSL_RESOURCE_SAMPLE_LOD_BIAS:
|
||||
instr.opcode = VKD3D_SM4_OP_SAMPLE_B;
|
||||
break;
|
||||
@ -4138,7 +4142,8 @@ static void write_sm4_sample(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer
|
||||
sm4_src_from_deref(ctx, &instr.srcs[2], sampler, sampler->var->data_type, VKD3DSP_WRITEMASK_ALL);
|
||||
instr.src_count = 3;
|
||||
|
||||
if (load->load_type == HLSL_RESOURCE_SAMPLE_LOD_BIAS)
|
||||
if (load->load_type == HLSL_RESOURCE_SAMPLE_LOD
|
||||
|| load->load_type == HLSL_RESOURCE_SAMPLE_LOD_BIAS)
|
||||
{
|
||||
sm4_src_from_node(&instr.srcs[3], load->lod.node, VKD3DSP_WRITEMASK_ALL);
|
||||
++instr.src_count;
|
||||
@ -4947,6 +4952,7 @@ static void write_sm4_resource_load(struct hlsl_ctx *ctx,
|
||||
break;
|
||||
|
||||
case HLSL_RESOURCE_SAMPLE:
|
||||
case HLSL_RESOURCE_SAMPLE_LOD:
|
||||
case HLSL_RESOURCE_SAMPLE_LOD_BIAS:
|
||||
case HLSL_RESOURCE_SAMPLE_GRAD:
|
||||
if (!load->sampler.var)
|
||||
@ -4976,10 +4982,6 @@ static void write_sm4_resource_load(struct hlsl_ctx *ctx,
|
||||
write_sm4_gather(ctx, buffer, resource_type, &load->node, &load->resource,
|
||||
&load->sampler, coords, HLSL_SWIZZLE(W, W, W, W), texel_offset);
|
||||
break;
|
||||
|
||||
case HLSL_RESOURCE_SAMPLE_LOD:
|
||||
hlsl_fixme(ctx, &load->node.loc, "SM4 sample-LOD expression.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ levels 2
|
||||
|
||||
0.0 0.0 1.0 0.0
|
||||
|
||||
[pixel shader todo]
|
||||
[pixel shader]
|
||||
sampler s;
|
||||
Texture2D t;
|
||||
uniform float level;
|
||||
@ -26,11 +26,11 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 0.0 0.0 0.0 0.0
|
||||
todo draw quad
|
||||
draw quad
|
||||
probe all rgba (1.0, 0.0, 1.0, 0.0)
|
||||
uniform 0 float4 0.5 0.0 0.0 0.0
|
||||
todo draw quad
|
||||
draw quad
|
||||
probe all rgba (0.5, 0.0, 1.0, 0.0)
|
||||
uniform 0 float4 1.0 0.0 0.0 0.0
|
||||
todo draw quad
|
||||
draw quad
|
||||
probe all rgba (0.0, 0.0, 1.0, 0.0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user