Re: [Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Matt Turner
On Thu, Dec 4, 2014 at 7:54 PM, Carl Worth wrote: > On Thu, Dec 04 2014, Carl Worth wrote: >> So I think I'll follow up with a separate patch to clean these up. > > Before I do that, I noticed the following in util/macros.h: > > /** > * Unreachable macro. Useful for suppressing "c

Re: [Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Carl Worth
On Thu, Dec 04 2014, Carl Worth wrote: > So I think I'll follow up with a separate patch to clean these up. Before I do that, I noticed the following in util/macros.h: /** * Unreachable macro. Useful for suppressing "control reaches end of non-void * function" warnings.

Re: [Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Carl Worth
On Thu, Dec 04 2014, Matt Turner wrote: > On Thu, Dec 4, 2014 at 2:00 PM, Carl Worth wrote: >> + assert(!"Should not get here."); >> + return error_type; > > Let's just use unreachable("not reached") here. That's a good idea. I copied this line from the surrounding code in the same file, (the

Re: [Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Carl Worth
On Thu, Dec 04 2014, Ian Romanick wrote: > Shouldn't type be glsl_base_type instead of unsigned? Yes, thanks for the catch. Fixed. >> + if (shadow) >> +return (array ? sampler2DArrayShadow_type : sampler2DShadow_type >> +); > > It's weird that the closing paren ended up here.

Re: [Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Matt Turner
On Thu, Dec 4, 2014 at 2:00 PM, Carl Worth wrote: > + assert(!"Should not get here."); > + return error_type; Let's just use unreachable("not reached") here. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailm

Re: [Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Ian Romanick
On 12/04/2014 02:00 PM, Carl Worth wrote: > This is similar to the existing functions get_instance, get_array_instance, > etc. for getting a type singleton. The new get_sampler_instance() function > will be used by the upcoming shader cache. > --- > src/glsl/glsl_types.cpp | 111 > +++

[Mesa-dev] [PATCH 1/3] glsl: Add convenience function get_sampler_instance

2014-12-04 Thread Carl Worth
This is similar to the existing functions get_instance, get_array_instance, etc. for getting a type singleton. The new get_sampler_instance() function will be used by the upcoming shader cache. --- src/glsl/glsl_types.cpp | 111 src/glsl/glsl_types.