diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-12 11:07:45 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-12 11:07:45 -0700 |
| commit | 74963469a169b49d61196e3a3b33a903ea8bfede (patch) | |
| tree | a3d8f4f8873946f58111ae5e7f5034b071c1e824 /tests/reflection/multi-file-extra.hlsl | |
| parent | 2c6c501b36db9e7991c3f7999451b70f12329ecc (diff) | |
Add basic reflection query for checking if entry point is "sample-rate"
- This really just checks two basic things:
1. Was there any global variable declared with `in` and `sample`?
2. Did any code encountered during lowering referenece `gl_SampleIndex`?
- This doesn't cover what HLSL could need, nor what we would need for cross-compilation. Consider it GLSL-specific for now.
- In order to generate the information with even a reasonable chance of being accurate (not giving a ton of false positives) I tried to integrate the checks into the lowering process (so they only see code that is referenced, one hopes).
- For this to work with my testing setup, I needed to make sure that lowering is always performed, prior to emitting reflection info
- This change broke several reflection tests, because they had been using code that wouldn't actually pass the downstream compiler. I checked in fixes for those.
Diffstat (limited to 'tests/reflection/multi-file-extra.hlsl')
| -rw-r--r-- | tests/reflection/multi-file-extra.hlsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/reflection/multi-file-extra.hlsl b/tests/reflection/multi-file-extra.hlsl index 569ec2ce9..a5da70635 100644 --- a/tests/reflection/multi-file-extra.hlsl +++ b/tests/reflection/multi-file-extra.hlsl @@ -18,7 +18,7 @@ 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) { return t.Sample(s, 0.0); } +float4 use(Texture2D t, SamplerState s) { return t.SampleLevel(s, 0.0, 0.0); } // Start with some parameters that will appear in both shaders Texture2D sharedT; @@ -51,7 +51,7 @@ Texture2D sharedTV; Texture2D sharedTF; -float4 main() : SV_Target +float4 mainVS() : SV_Position { // Go ahead and use everything here, just to make sure things got placed correctly return use(sharedT, sharedS) |
