diff options
author | Jason Ekstrand <[email protected]> | 2016-05-09 17:15:21 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-14 13:33:52 -0700 |
commit | a2f50d87b6e9d07c6974ef309cc99acf56b2dc09 (patch) | |
tree | 5891e884fa731b051ea1b47caf399dc61ffacd28 /src/compiler/nir | |
parent | 59156b2e96315910f1e929c14c5b25ce88f75911 (diff) |
nir: Add an info bit for uses_sample_qualifier
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/glsl_to_nir.cpp | 1 | ||||
-rw-r--r-- | src/compiler/nir/nir.h | 5 | ||||
-rw-r--r-- | src/compiler/nir/nir_gather_info.c | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp index fb1d4218e33..8a256506f8f 100644 --- a/src/compiler/nir/glsl_to_nir.cpp +++ b/src/compiler/nir/glsl_to_nir.cpp @@ -182,6 +182,7 @@ glsl_to_nir(const struct gl_shader_program *shader_prog, (struct gl_fragment_program *)sh->Program; shader->info.fs.uses_discard = fp->UsesKill; + shader->info.fs.uses_sample_qualifier = fp->IsSample != 0; shader->info.fs.early_fragment_tests = sh->EarlyFragmentTests; shader->info.fs.depth_layout = fp->FragDepthLayout; break; diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 20927a26abf..d3934fb7916 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1744,6 +1744,11 @@ typedef struct nir_shader_info { bool uses_discard; /** + * Whether any inputs are declared with the "sample" qualifier. + */ + bool uses_sample_qualifier; + + /** * Whether early fragment tests are enabled as defined by * ARB_shader_image_load_store. */ diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index d45b1a2fec0..89a6302d4fc 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -125,9 +125,15 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint) shader->stage == MESA_SHADER_FRAGMENT || shader->stage == MESA_SHADER_COMPUTE); + bool uses_sample_qualifier = false; shader->info.inputs_read = 0; - foreach_list_typed(nir_variable, var, node, &shader->inputs) + foreach_list_typed(nir_variable, var, node, &shader->inputs) { shader->info.inputs_read |= get_io_mask(var, shader->stage); + uses_sample_qualifier |= var->data.sample; + } + + if (shader->stage == MESA_SHADER_FRAGMENT) + shader->info.fs.uses_sample_qualifier = uses_sample_qualifier; /* TODO: Some day we may need to add stream support to NIR */ shader->info.outputs_written = 0; |