nir_variable *input_var_face;
nir_variable *input_var_position;
+ nir_variable *input_var_point;
/**
* Stack of nir_cursors where instructions should be pushed as we pop
bool cap_scalar;
bool cap_face_is_sysval;
bool cap_position_is_sysval;
+ bool cap_point_is_sysval;
bool cap_packed_uniforms;
bool cap_samplers_as_deref;
};
var->data.location = VARYING_SLOT_POS;
}
c->input_var_position = var;
+ } else if (decl->Semantic.Name == TGSI_SEMANTIC_PCOORD) {
+ if (c->cap_point_is_sysval) {
+ var->data.mode = nir_var_system_value;
+ var->data.location = SYSTEM_VALUE_POINT_COORD;
+ } else {
+ var->data.location = VARYING_SLOT_PNTC;
+ }
+ c->input_var_point = var;
} else {
var->data.location =
tgsi_varying_semantic_to_slot(decl->Semantic.Name,
op = nir_intrinsic_load_frag_coord;
load = nir_load_frag_coord(b);
break;
+ case TGSI_SEMANTIC_PCOORD:
+ assert(c->cap_point_is_sysval);
+ op = nir_intrinsic_load_point_coord;
+ load = nir_load_point_coord(b);
+ break;
default:
unreachable("bad system value");
}
c->scan->input_semantic_name[index] == TGSI_SEMANTIC_POSITION) {
assert(!c->cap_position_is_sysval && c->input_var_position);
return nir_src_for_ssa(nir_load_var(&c->build, c->input_var_position));
+ } else if (c->scan->processor == PIPE_SHADER_FRAGMENT &&
+ c->scan->input_semantic_name[index] == TGSI_SEMANTIC_PCOORD) {
+ assert(!c->cap_point_is_sysval && c->input_var_point);
+ return nir_src_for_ssa(nir_load_var(&c->build, c->input_var_point));
} else {
/* Indirection on input arrays isn't supported by TTN. */
assert(!dim);
c->cap_samplers_as_deref = screen->get_param(screen, PIPE_CAP_NIR_SAMPLERS_AS_DEREF);
c->cap_face_is_sysval = screen->get_param(screen, PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL);
c->cap_position_is_sysval = screen->get_param(screen, PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL);
+ c->cap_point_is_sysval = screen->get_param(screen, PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL);
}
/**