On Sat, Jan 6, 2018 at 1:34 AM, Kenneth Graunke <[email protected]> wrote: > On Thursday, January 4, 2018 11:56:44 AM PST Jason Ekstrand wrote: >> On January 4, 2018 12:51:15 Karol Herbst <[email protected]> wrote: >> >> > On Thu, Jan 4, 2018 at 7:06 PM, Ilia Mirkin <[email protected]> wrote: >> >> On Thu, Jan 4, 2018 at 10:01 AM, Karol Herbst <[email protected]> wrote: >> >>> significant changes to last series: >> >>> * arb_gpu_shader5 interpolateat* (those nir ops don't map well to nvir) >> >>> no good plan on how to properly implement those >> >> >> >> What's the issue? They should map as well as the TGSI ones. (Since the >> >> TGSI ones are just the GLSL ones.) >> >> >> > >> > it is a bit ugly, because usually all inputs vars are lowered away, so >> > that they are inputs. So they need special handling; >> > >> > lowered (input is centroid): >> > vec1 32 ssa_25 = intrinsic load_input (ssa_24) () (0, 0) /* base=0 */ >> > /* component=0 */ /* packed:centroid_qualified */ >> > vec1 32 ssa_27 = intrinsic load_input (ssa_26) () (0, 1) /* base=0 */ >> > /* component=1 */ /* packed:centroid_qualified */ >> > >> > not lowered: >> > decl_var INTERP_MODE_NONE vec2 in@unqualified-temp >> > vec2 32 ssa_11 = intrinsic interp_var_at_centroid () (in@unqualified-temp) >> > () >> > >> > I kind of wished I could have a load_input intrinsic with a flag or >> > load_input_at_centroid, so that I end up with the same code in the >> > end. >> >> In i965, we use the NIR explicit input interpolation intrinsics. I'm on my >> phone so I can't give more details easily. > > Setting nir_shader_compiler_options::use_interpolated_input_intrinsics > will eliminate the need to look at variables. Instead, you'll get these > intrinsics: > > - load_input (for flat shaded inputs) > - load_interpolated_input (for non-flat shaded inputs) > - load_barycentric_pixel > - load_barycentric_centroid > - load_barycentric_sample > - load_barycentric_at_sample (+ sample ID source) > - load_barycentric_at_offset (+ offset.xy source) > > The load_interpolated_input intrinsic takes an extra source, which > should always be one of the load_barycentric_* intrinsics. That way, > from the intrinsic, you can see exactly how to interpolate it. > > I highly recommend using these. They're much nicer to work with.
well I already implemented looking at the variables and this is no issue really. What I am more concerned about are local variables used in interp_var_at_* intrinsics and those didn't get converted with use_interpolated_input_intrinsics. I will take a deeper look, maybe there is some weird condition to actually convert those as well. _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
