Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-28 Thread Tapani Pälli
On 08/28/2014 01:50 AM, Micael wrote: I am getting another error regarding explicit locations, which I believe has a one-line fix. If I only have a single uniform in my shader, and that uniform is explicitely given location 1 (or anything above zero), my program will crash if I attempt to give

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-27 Thread Micael
I am getting another error regarding explicit locations, which I believe has a one-line fix. If I only have a single uniform in my shader, and that uniform is explicitely given location 1 (or anything above zero), my program will crash if I attempt to give the unnassigned locs a value with

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-26 Thread Ian Romanick
On 08/23/2014 07:51 AM, Micael wrote: On second thought, the glsl_type::uniform_locations() method comment in the header file says: /** * Calculate the number of unique values from glGetUniformLocation for the * elements of the type. */ Which makes me believe that maybe we should

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-23 Thread Micael
On Fri, Aug 22, 2014 at 9:23 PM, Ian Romanick i...@freedesktop.org wrote: I'm not sure this is correct, and I think we need a more complex fix. As Dave points out, bindless will make it even more complex. In a non-bindless, static-sampler-array-indexing world, applications assume that

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-23 Thread Micael
On second thought, the glsl_type::uniform_locations() method comment in the header file says: /** * Calculate the number of unique values from glGetUniformLocation for the * elements of the type. */ Which makes me believe that maybe we should return at least 1 for every case because this is

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-22 Thread Tapani Pälli
On 08/22/2014 08:31 AM, Tapani Pälli wrote: On 08/22/2014 02:25 AM, Micael Dias wrote: --- If samplers occupy zero locations we can run into a lot of issues. See #82921. I briefly tested this with my own code (which was previously crashing and misbehaving) and also ran other apps and

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-22 Thread Dave Airlie
In the future for ARB_bindless_texture we might want this to be 2, I'm not sure if we should just do that now. Dave. On 22 August 2014 09:25, Micael Dias kam1k...@gmail.com wrote: --- If samplers occupy zero locations we can run into a lot of issues. See #82921. I briefly tested this with my

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-22 Thread Micael
Is this because of the 64 bit handles? If so, I think I agree with you. According to the ARB_bindless_texture spec changes: When used as shader inputs, outputs, uniform block members, or temporaries, the value of the sampler is a 64-bit unsigned integer handle and never refers to a texture image

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-22 Thread Ian Romanick
I'm not sure this is correct, and I think we need a more complex fix. As Dave points out, bindless will make it even more complex. In a non-bindless, static-sampler-array-indexing world, applications assume that samplers will use zero uniform locations. The sampler information is baked into the

[Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-21 Thread Micael Dias
--- If samplers occupy zero locations we can run into a lot of issues. See #82921. I briefly tested this with my own code (which was previously crashing and misbehaving) and also ran other apps and everything seems to work fine. I'm not used to contributing code in this fashion, so please forgive

Re: [Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

2014-08-21 Thread Tapani Pälli
On 08/22/2014 02:25 AM, Micael Dias wrote: --- If samplers occupy zero locations we can run into a lot of issues. See #82921. I briefly tested this with my own code (which was previously crashing and misbehaving) and also ran other apps and everything seems to work fine. I'm not used to