vkd3d-shader/fx: Write depth stencil view object variables.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-05-06 23:29:15 +02:00 committed by Alexandre Julliard
parent c2eb563e50
commit a879ac5536
Notes: Alexandre Julliard 2024-05-08 22:49:51 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/802

View File

@ -87,6 +87,7 @@ struct fx_write_context
uint32_t shared_object_count;
uint32_t shader_variable_count;
uint32_t parameter_count;
uint32_t dsv_count;
int status;
bool child_effect;
@ -1032,6 +1033,10 @@ static void write_fx_4_object_variable(struct hlsl_ir_var *var, struct fx_write_
++fx->shader_variable_count;
break;
case HLSL_CLASS_DEPTH_STENCIL_VIEW:
fx->dsv_count += elements_count;
break;
default:
hlsl_fixme(ctx, &ctx->location, "Writing initializer for object type %u is not implemented.",
type->e.numeric.type);
@ -1117,6 +1122,7 @@ static bool is_object_variable(const struct hlsl_ir_var *var)
switch (type->class)
{
case HLSL_CLASS_DEPTH_STENCIL_VIEW:
case HLSL_CLASS_PIXEL_SHADER:
case HLSL_CLASS_RENDER_TARGET_VIEW:
case HLSL_CLASS_SAMPLER:
@ -1182,7 +1188,7 @@ static int hlsl_fx_4_write(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
put_u32(&buffer, 0); /* Rasterizer state count. */
put_u32(&buffer, 0); /* Sampler state count. */
put_u32(&buffer, 0); /* Rendertarget view count. */
put_u32(&buffer, 0); /* Depth stencil view count. */
put_u32(&buffer, fx.dsv_count);
put_u32(&buffer, fx.shader_variable_count); /* Shader count. */
put_u32(&buffer, 0); /* Inline shader count. */
@ -1240,7 +1246,7 @@ static int hlsl_fx_5_write(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
put_u32(&buffer, 0); /* Rasterizer state count. */
put_u32(&buffer, 0); /* Sampler state count. */
put_u32(&buffer, 0); /* Rendertarget view count. */
put_u32(&buffer, 0); /* Depth stencil view count. */
put_u32(&buffer, fx.dsv_count);
put_u32(&buffer, fx.shader_variable_count); /* Shader count. */
put_u32(&buffer, 0); /* Inline shader count. */
put_u32(&buffer, fx.group_count); /* Group count. */