diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 07c78528..e99ca782 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -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. */