Re: [Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-03-01 Thread Karol Herbst
On Wed, Feb 28, 2018 at 10:59 PM, Rob Clark wrote: > hmm, I haven't tried passing a struct (rather than a pointer to a > struct) as a parameter, but if there were 8/16 bit fields in the > struct it would calculate the size incorrectly. > > (otoh the more important question is

Re: [Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-02-28 Thread Rob Clark
hmm, I haven't tried passing a struct (rather than a pointer to a struct) as a parameter, but if there were 8/16 bit fields in the struct it would calculate the size incorrectly. (otoh the more important question is whether this agrees with how clover lays out the input buffer, as far as where

Re: [Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-02-28 Thread Jason Ekstrand
I thought OpenCL used a different set of alignment rules for structs, unions, etc. In particular, I thought it was very close to standard C. If that's true, then std430 is not what you want. On Wed, Feb 28, 2018 at 1:44 PM, Karol Herbst wrote: > it isn't yet. But you would

Re: [Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-02-28 Thread Rob Clark
I needed it in ir3, since nir->ir3 is .c code, and I need it to map load_param offset to offset in constant registers. Sorry, I didn't think the ir3 patches were interesting to others so I didn't include them in the patchset. Tbh if we used uniforms to pass params, I might not need these in ir3

Re: [Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-02-28 Thread Karol Herbst
it isn't yet. But you would use it in your driver when calculating your memory offsets for kernel arguments. In OpenCL things are aligned in memory by the size of the type and we would use those functions to calculate those. On Wed, Feb 28, 2018 at 10:39 PM, Jason Ekstrand

Re: [Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-02-28 Thread Jason Ekstrand
Looking through commit titles, I don't see any obvious place where this would get used. On Wed, Feb 28, 2018 at 11:51 AM, Rob Clark wrote: > Signed-off-by: Rob Clark > --- > src/compiler/nir_types.cpp | 12 > src/compiler/nir_types.h |

[Mesa-dev] [PATCH 05/13] nir: expose 'C' wrappers for std430 size/alignment

2018-02-28 Thread Rob Clark
Signed-off-by: Rob Clark --- src/compiler/nir_types.cpp | 12 src/compiler/nir_types.h | 4 2 files changed, 16 insertions(+) diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index cbdd452dc81..0085a19248a 100644 ---