summaryrefslogtreecommitdiffstats
path: root/tests/reflection/multi-file.hlsl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reflection/multi-file.hlsl')
-rw-r--r--tests/reflection/multi-file.hlsl68
1 files changed, 24 insertions, 44 deletions
diff --git a/tests/reflection/multi-file.hlsl b/tests/reflection/multi-file.hlsl
index 4a9cf9a86..fd9235ab5 100644
--- a/tests/reflection/multi-file.hlsl
+++ b/tests/reflection/multi-file.hlsl
@@ -1,56 +1,36 @@
-//TEST:REFLECTION:-entry mainFS -profile ps_4_0 -target hlsl tests/reflection/multi-file-extra.hlsl -entry mainVS -profile vs_4_0
+//TEST:REFLECTION:-D__SLANG__ -entry mainVS -profile vs_4_0 -target hlsl tests/reflection/multi-file-extra.hlsl -entry mainFS -profile ps_4_0
// Here we are testing the case where multiple translation units are provided
// at once, so that we want combined reflection information for the resulting
// program. The other part of this program is in `multi-file-extra.hlsl`.
-float4 use(float val) { return val; };
-float4 use(float2 val) { return float4(val,0.0,0.0); };
-float4 use(float3 val) { return float4(val,0.0); };
-float4 use(float4 val) { return val; };
-float4 use(Texture2D t, SamplerState s)
-{
- // This is the vertex shader, so we can't do implicit-gradient sampling
- return t.SampleGrad(s, 0.0, 0.0, 0.0);
-}
+#include "multi-file-defines.h"
-// Start with some parameters that will appear in both shaders
-Texture2D sharedT;
-SamplerState sharedS;
-cbuffer sharedC
-{
- float3 sharedCA;
- float sharedCB;
- float3 sharedCC;
- float2 sharedCD;
-}
+#ifdef __SLANG__
+import multi_file_shared;
+#else
+#include "multi-file-shared.slang"
+#endif
-// Then some parameters specific to this shader
-// (these will get placed before the ones in the `extra` file,
-// based on how they get named on the command-line)
+Texture2D vertexT R(: register(t0));
+SamplerState vertexS R(: register(s0));
-Texture2D vertexT;
-SamplerState vertexS;
-cbuffer vertexC
+BEGIN_CBUFFER(vertexC)
{
- float3 vertexCA;
- float vertexCB;
- float3 vertexCC;
- float2 vertexCD;
+ float3 vertexCA;
+ float vertexCB;
+ float3 vertexCC;
+ float2 vertexCD;
}
+END_CBUFFER(vertexC, register(b0))
-// And end with some shared parameters again
-Texture2D sharedTV;
-Texture2D sharedTF;
-
-
-float4 mainFS() : SV_Target
+float4 mainVS() : SV_POSITION
{
- // Go ahead and use everything here, just to make sure things got placed correctly
- return use(sharedT, sharedS)
- + use(sharedCD)
- + use(vertexT, vertexS)
- + use(vertexCD)
- + use(sharedTV, vertexS)
- ;
-} \ No newline at end of file
+ // Go ahead and use everything here, just to make sure things got placed correctly
+ return use(sharedT, sharedS)
+ + use(CBUFFER_REF(sharedC, sharedCD))
+ + use(vertexT, vertexS)
+ + use(CBUFFER_REF(vertexC, vertexCD))
+ + use(sharedTV, vertexS)
+ ;
+}