You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tests/DiligentCoreTest/assets/shaders/SPIRV/PushConstants.psh
+4-37Lines changed: 4 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -8,49 +8,16 @@ struct PushConstants_t
8
8
uint g_Padding;
9
9
};
10
10
11
-
/*
12
-
Note that glslang allows following declaration:
13
-
14
-
[[vk::push_constant]]
15
-
cbuffer PushConstants
16
-
{
17
-
PushConstants_t g_PushConstants;
18
-
};
19
-
20
-
to generate a push constant resource: "Push Constants 'PushConstants'".
21
-
22
-
but DXC does not allow it.
23
-
24
-
Glslang converts "[[vk::push_constant]] PushConstants_t g_PushConstants;" into an unnamed resource:
25
-
"Uniform Buffer '$Global'" instead of what we expected: "Push Constants 'PushConstants'",
26
-
27
-
Thus we have to use "[[vk::push_constant]] cbuffer PushConstants" under glslang while "[[vk::push_constant]] PushConstants_t g_PushConstants;" under DXC.
28
-
*/
29
-
30
-
#if DXC
31
-
32
-
#define g_PushConstants PushConstants
33
-
34
-
[[vk::push_constant]]
35
-
PushConstants_t g_PushConstants;
36
-
37
-
#else
38
-
39
-
[[vk::push_constant]]
40
-
cbuffer PushConstants
41
-
{
42
-
PushConstants_t g_PushConstants;
43
-
};
44
-
45
-
#endif
11
+
//note that cbuffer PushConstants is not allowed in DXC, but ConstantBuffer<PushConstants_t> is allowed
0 commit comments