vkd3d-shader/hlsl: Use proper dimensions on SampleLevel method offset parameter.

This commit is contained in:
Francisco Casas 2022-04-27 15:44:09 -04:00 committed by Alexandre Julliard
parent c4be4a4ebf
commit 15b19b15c0
Notes: Alexandre Julliard 2022-10-18 00:13:00 +02:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/9

View File

@ -2741,6 +2741,7 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
&& object_type->sampler_dim != HLSL_SAMPLER_DIM_2DMSARRAY)
{
const unsigned int sampler_dim = hlsl_sampler_dim_count(object_type->sampler_dim);
const unsigned int offset_dim = hlsl_offset_dim_count(object_type->sampler_dim);
const struct hlsl_type *sampler_type;
struct hlsl_ir_resource_load *load;
struct hlsl_ir_node *offset = NULL;
@ -2781,7 +2782,7 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
if (params->args_count == 4)
{
if (!(offset = add_implicit_conversion(ctx, instrs, params->args[3],
hlsl_get_vector_type(ctx, HLSL_TYPE_INT, sampler_dim), loc)))
hlsl_get_vector_type(ctx, HLSL_TYPE_INT, offset_dim), loc)))
return false;
}