Skip to content
Snippets Groups Projects
Commit aab98860 authored by Francisco Casas's avatar Francisco Casas Committed by Alexandre Julliard
Browse files

vkd3d-shader/hlsl: Allow uninitialized static objects.

validate_static_object_references() validates that uninitialized static
objects are not referenced in the shader.

In case a static variable contains both numeric and object types, the
"Static variables cannot have both numeric and resource components."
error should preempt uninitialized numeric values to reach further
compilation steps.
parent 17d6a441
No related branches found
No related tags found
1 merge request!54vkd3d-shader/hlsl: Initialize static variables to 0 by default.
......@@ -2184,7 +2184,6 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
if (type_has_object_components(var->data_type, false))
{
hlsl_fixme(ctx, &var->loc, "Uninitialized static objects.");
vkd3d_free(v);
continue;
}
......
......@@ -65,7 +65,7 @@ size (1, 1)
1.0 2.0 3.0 4.0
[pixel shader fail todo]
[pixel shader fail]
static Texture2D tex;
sampler sam;
......@@ -75,7 +75,7 @@ float4 main() : sv_target
}
[pixel shader todo]
[pixel shader]
// This is allowed in 10.0.10011.16384 but not in 9.29.952.3111
static Texture2D tex;
......@@ -113,7 +113,7 @@ float4 main() : sv_target
}
[pixel shader fail todo]
[pixel shader fail]
static Texture2D tex1;
sampler sam;
......@@ -124,7 +124,7 @@ float4 main() : sv_target
}
[pixel shader fail todo]
[pixel shader fail]
static Texture2D tex1;
sampler sam;
......@@ -150,7 +150,7 @@ draw quad
probe all rgba (1, 2, 3, 4)
[pixel shader todo]
[pixel shader]
Texture2D real_tex;
static Texture2D tex;
sampler sam;
......@@ -162,8 +162,8 @@ float4 main() : sv_target
}
[test]
todo draw quad
todo probe all rgba (1, 2, 3, 4)
draw quad
probe all rgba (1, 2, 3, 4)
[require]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment