[Mesa-dev] [PATCH 06/17] nir/info: Add a few bits of info for fragment shaders

Jason Ekstrand jason at jlekstrand.net
Fri Oct 9 06:07:08 PDT 2015


On Fri, Oct 9, 2015 at 6:04 AM, Pohjolainen, Topi
<topi.pohjolainen at intel.com> wrote:
> On Fri, Oct 09, 2015 at 05:58:41AM -0700, Jason Ekstrand wrote:
>> On Fri, Oct 9, 2015 at 12:15 AM, Pohjolainen, Topi
>> <topi.pohjolainen at intel.com> wrote:
>> > On Thu, Oct 08, 2015 at 05:22:38PM -0700, Jason Ekstrand wrote:
>> >> ---
>> >>  src/glsl/nir/glsl_to_nir.cpp   |  9 +++++++++
>> >>  src/glsl/nir/nir.h             | 13 +++++++++++++
>> >>  src/mesa/program/prog_to_nir.c |  6 ++++++
>> >>  3 files changed, 28 insertions(+)
>> >>
>> >> diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
>> >> index e4aa709..ddacb4e 100644
>> >> --- a/src/glsl/nir/glsl_to_nir.cpp
>> >> +++ b/src/glsl/nir/glsl_to_nir.cpp
>> >> @@ -173,6 +173,15 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
>> >>        shader->info.gs.invocations = sh->Geom.Invocations;
>> >>        break;
>> >>
>> >> +   case MESA_SHADER_FRAGMENT: {
>> >> +      struct gl_fragment_program *fp =
>> >> +         (struct gl_fragment_program *)sh->Program;
>> >> +
>> >> +      shader->info.fs.uses_discard = fp->UsesKill;
>> >> +      shader->info.fs.early_fragment_tests = sh->EarlyFragmentTests;
>> >> +      shader->info.fs.depth_layout = fp->FragDepthLayout;
>> >
>> > This series replaces in patch 15 the expression:
>> >
>> > fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)
>> >
>> > with this, right? If that is the case, it would be nice to say something in
>> > one of the commits (or perhaps even use a separate patch changing the logic
>> > itself).
>>
>> Not quite.  I believe that's replaced with
>>
>> shader->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_DEPTH)
>>
>> It is used in patch 15 but it's used by the updated compute_depth_mode function.
>
> You are perfectly right, my bad. Sorry for the noise.

That's ok.  I'm glad you're going through it carefully enough to
notice these things.  You already caught one nasty bug!


More information about the mesa-dev mailing list