free(spec_entries);
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .point_coord = true,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
/* We have to lower away local constant initializers right before we
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
}
assert(nir->info.stage == broadcom_shader_stage_to_gl(stage->stage));
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .frag_coord = true,
+ .point_coord = true,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
if (unlikely(V3D_DEBUG & (V3D_DEBUG_NIR |
v3d_debug_flag_for_shader_stage(
broadcom_shader_stage_to_gl(stage->stage))))) {
assert(nir->info.stage == stage);
nir_validate_shader(nir, "after spirv_to_nir");
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .point_coord = true,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
if (unlikely(dev->physical_device->instance->debug_flags & TU_DEBUG_NIR)) {
fprintf(stderr, "translated nir:\n");
nir_print_shader(nir, stderr);
stage, entry, &spirv_options,
ir3_get_compiler_options(compiler));
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .frag_coord = true,
+ .point_coord = true,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
nir_print_shader(nir, stdout);
return nir;
free(spec_entries);
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .frag_coord = true,
+ .point_coord = true,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions);
free(spec_entries);
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .point_coord = true,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
if (INTEL_DEBUG & intel_debug_flag_for_shader_stage(stage)) {
fprintf(stderr, "NIR (from SPIR-V) for %s shader:\n",
gl_shader_stage_name(stage));
nir->info.separate_shader = linked_shader->Program->info.separate_shader;
+ /* Convert some sysvals to input varyings. */
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .frag_coord = !ctx->Const.GLSLFragCoordIsSysVal,
+ .point_coord = !ctx->Const.GLSLPointCoordIsSysVal,
+ .front_face = !ctx->Const.GLSLFrontFacingIsSysVal,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
/* We have to lower away local constant initializers right before we
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
assert(nir->info.stage == stage);
nir_validate_shader(nir, "after spirv_to_nir");
+ const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+ .frag_coord = PAN_ARCH <= 5,
+ .point_coord = PAN_ARCH <= 5,
+ .front_face = PAN_ARCH <= 5,
+ };
+ NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
return nir;
}