[PATCH vkd3d 5/5] vkd3d-shader/hlsl: Write SM4 sample instructions.

Zebediah Figura zfigura at codeweavers.com
Tue Nov 9 10:15:59 CST 2021


On 11/9/21 9:01 AM, Matteo Bruni wrote:
> On Tue, Nov 9, 2021 at 4:56 AM Zebediah Figura <zfigura at codeweavers.com> wrote:
>>
>> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
>> ---
>>   libs/vkd3d-shader/hlsl_sm4.c | 56 ++++++++++++++++++++++++++++++++++--
>>   1 file changed, 54 insertions(+), 2 deletions(-)
>>
>> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
>> index e597425ae..da31d5ae2 100644
>> --- a/libs/vkd3d-shader/hlsl_sm4.c
>> +++ b/libs/vkd3d-shader/hlsl_sm4.c
> 
>> @@ -1227,6 +1236,32 @@ static void write_sm4_ld(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buf
>>       write_sm4_instruction(buffer, &instr);
>>   }
>>
>> +static void write_sm4_sample(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer,
>> +        const struct hlsl_type *resource_type, const struct hlsl_ir_node *dst,
>> +        const struct hlsl_deref *resource, const struct hlsl_deref *sampler, const struct hlsl_ir_node *coords)
> 
> Just for my own curiosity: any particular reason for
> write_sm4_sample() (and write_sm4_ld()) to take an explicit
> resource_type argument?
> 

Shader model 5 or so encodes the resource type into the sample 
instruction as a modifier, for no apparent reason. Not sure now if I 
ever did that in a patch.



More information about the wine-devel mailing list