nir: gather info whether a shader uses demote_to_helper
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4047>
This commit is contained in:

committed by
Marge Bot

parent
66bb314cb4
commit
5adcfa68a9
@@ -200,6 +200,8 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
|
|||||||
switch (instr->intrinsic) {
|
switch (instr->intrinsic) {
|
||||||
case nir_intrinsic_demote:
|
case nir_intrinsic_demote:
|
||||||
case nir_intrinsic_demote_if:
|
case nir_intrinsic_demote_if:
|
||||||
|
shader->info.fs.uses_demote = true;
|
||||||
|
/* fallthrough: quads with helper lanes only might be discarded entirely */
|
||||||
case nir_intrinsic_discard:
|
case nir_intrinsic_discard:
|
||||||
case nir_intrinsic_discard_if:
|
case nir_intrinsic_discard_if:
|
||||||
assert(shader->info.stage == MESA_SHADER_FRAGMENT);
|
assert(shader->info.stage == MESA_SHADER_FRAGMENT);
|
||||||
@@ -389,6 +391,7 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
|
|||||||
if (shader->info.stage == MESA_SHADER_FRAGMENT) {
|
if (shader->info.stage == MESA_SHADER_FRAGMENT) {
|
||||||
shader->info.fs.uses_sample_qualifier = false;
|
shader->info.fs.uses_sample_qualifier = false;
|
||||||
shader->info.fs.uses_discard = false;
|
shader->info.fs.uses_discard = false;
|
||||||
|
shader->info.fs.uses_demote = false;
|
||||||
shader->info.fs.needs_helper_invocations = false;
|
shader->info.fs.needs_helper_invocations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -217,6 +217,7 @@ typedef struct shader_info {
|
|||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool uses_discard:1;
|
bool uses_discard:1;
|
||||||
|
bool uses_demote:1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if this fragment shader requires helper invocations. This
|
* True if this fragment shader requires helper invocations. This
|
||||||
|
Reference in New Issue
Block a user