microsoft/clc: Several fixes for CL kernels with images/samplers
We had 3 bugs, likely regressions from when CL kernel args were switched to uniforms during our upstreaming discussions:
nir_var_uniformmemory was overwriting our computed
driver_location. In theory this should produce the same values that we pre-computed, except that the lowering pass took place after manipulating the variable list for image lowering, and messing up the app-provided argument order. Moving this pass for this memory type to before the image lowering resolves that.
- Similar to above, if the kernel had inline samplers, these would be
uniformvariables in the list before the app-provided kernel args, which would also throw off the offset computation. Move them to the end of the variable list to avoid that.
- Wrap types for inline samplers used on integer textures were not being assigned correctly.
The last patch somewhat negates the need for fixes for 1 and 2, by making the metadata provided to the CLOn12 runtime come from the variable
nir_lower_vars_to_explicit_types, however I'd still like to include them, so that the kernel arg layout matches the kernel function signature.