From 74963469a169b49d61196e3a3b33a903ea8bfede Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 12 Jul 2017 11:07:45 -0700 Subject: 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. --- tests/reflection/sample-rate-input.glsl.expected | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/reflection/sample-rate-input.glsl.expected (limited to 'tests/reflection/sample-rate-input.glsl.expected') diff --git a/tests/reflection/sample-rate-input.glsl.expected b/tests/reflection/sample-rate-input.glsl.expected new file mode 100644 index 000000000..5800a3630 --- /dev/null +++ b/tests/reflection/sample-rate-input.glsl.expected @@ -0,0 +1,55 @@ +result code = 0 +standard error = { +} +standard output = { +{ + "parameters": [ + { + "name": "t", + "binding": {"kind": "descriptorTableSlot", "index": 0}, + "type": { + "kind": "resource", + "baseShape": "texture2D" + } + }, + { + "name": "s", + "binding": {"kind": "descriptorTableSlot", "index": 1}, + "type": { + "kind": "samplerState" + } + }, + { + "name": "uv", + "binding": {"kind": "vertexInput", "index": 0}, + "type": { + "kind": "vector", + "elementCount": 2, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + } + }, + { + "name": "c", + "binding": {"kind": "fragmentOutput", "index": 0}, + "type": { + "kind": "vector", + "elementCount": 4, + "elementType": { + "kind": "scalar", + "scalarType": "float32" + } + } + } + ], + "entryPoints": [ + { + "name": "main", + "stage:": "fragment", + "usesAnySampleRateInput": true + } + ] +} +} -- cgit v1.2.3