mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Implement tex2Dbias().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56701 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Henri Verbeet
parent
f0cd35b40d
commit
ccbe36fb8d
Notes:
Henri Verbeet
2024-06-11 17:09:30 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/876
@@ -4168,11 +4168,15 @@ static bool intrinsic_tex(struct hlsl_ctx *ctx, const struct parse_initializer *
|
||||
hlsl_release_string_buffer(ctx, string);
|
||||
}
|
||||
|
||||
if (!strcmp(name, "tex2Dlod"))
|
||||
if (!strcmp(name, "tex2Dbias")
|
||||
|| !strcmp(name, "tex2Dlod"))
|
||||
{
|
||||
struct hlsl_ir_node *lod, *c;
|
||||
|
||||
load_params.type = HLSL_RESOURCE_SAMPLE_LOD;
|
||||
if (!strcmp(name, "tex2Dlod"))
|
||||
load_params.type = HLSL_RESOURCE_SAMPLE_LOD;
|
||||
else
|
||||
load_params.type = HLSL_RESOURCE_SAMPLE_LOD_BIAS;
|
||||
|
||||
if (!(c = hlsl_new_swizzle(ctx, HLSL_SWIZZLE(X, Y, Z, W), hlsl_sampler_dim_count(dim), params->args[1], loc)))
|
||||
return false;
|
||||
@@ -4294,6 +4298,12 @@ static bool intrinsic_tex2D(struct hlsl_ctx *ctx,
|
||||
return intrinsic_tex(ctx, params, loc, "tex2D", HLSL_SAMPLER_DIM_2D);
|
||||
}
|
||||
|
||||
static bool intrinsic_tex2Dbias(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
return intrinsic_tex(ctx, params, loc, "tex2Dbias", HLSL_SAMPLER_DIM_2D);
|
||||
}
|
||||
|
||||
static bool intrinsic_tex2Dlod(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
@@ -4514,6 +4524,7 @@ intrinsic_functions[] =
|
||||
{"tanh", 1, true, intrinsic_tanh},
|
||||
{"tex1D", -1, false, intrinsic_tex1D},
|
||||
{"tex2D", -1, false, intrinsic_tex2D},
|
||||
{"tex2Dbias", 2, false, intrinsic_tex2Dbias},
|
||||
{"tex2Dlod", 2, false, intrinsic_tex2Dlod},
|
||||
{"tex2Dproj", 2, false, intrinsic_tex2Dproj},
|
||||
{"tex3D", -1, false, intrinsic_tex3D},
|
||||
|
Reference in New Issue
Block a user