<p dir="ltr"><br>
On Feb 3, 2015 10:39 PM, "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
><br>
><br>
><br>
> On Tue, Feb 3, 2015 at 1:08 PM, Erik Faye-Lund <<a href="mailto:kusmabite@gmail.com">kusmabite@gmail.com</a>> wrote:<br>
>><br>
>> On Tue, Feb 3, 2015 at 9:43 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
>> > ---<br>
>> >  src/glsl/nir/nir_validate.c | 8 ++++++++<br>
>> >  1 file changed, 8 insertions(+)<br>
>> ><br>
>> > diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c<br>
>> > index 7c801b2..89dfdf8 100644<br>
>> > --- a/src/glsl/nir/nir_validate.c<br>
>> > +++ b/src/glsl/nir/nir_validate.c<br>
>> > @@ -239,6 +239,14 @@ validate_alu_dest(nir_alu_dest *dest, validate_state *state)<br>
>> >      * register/SSA value<br>
>> >      */<br>
>> >     assert(is_packed || !(dest->write_mask & ~((1 << dest_size) - 1)));<br>
>> > +<br>
>> > +   /* validate that saturate is only ever used on instructions with<br>
>> > +    * destinations of type float<br>
>> > +    */<br>
>> > +   nir_alu_instr *alu = nir_instr_as_alu(state->instr);<br>
>> > +   assert(nir_op_infos[alu->op].output_type == nir_type_float ||<br>
>> > +          !dest->saturate);<br>
>><br>
>> I think this can end up generating a warning on builds with asserts<br>
>> disabled due to "alu" being written but never read. Perhaps just do<br>
>> "nir_instr_as_alu(state->instr)->op" directly in the expression? It's<br>
>> a tad less readable, though :/<br>
><br>
><br>
> It doesn't even get compiled if we have no asserts.  There's a giant #ifdef DEBUG surrounding the entire file.</p>
<p dir="ltr">Right, my bad. <br>
</p>