#define IR3_MAX_SO_OUTPUTS 64
#define IR3_MAX_UBO_PUSH_RANGES 32
+/* mirrors SYSTEM_VALUE_BARYCENTRIC_ but starting from 0 */
+enum ir3_bary {
+ IJ_PERSP_PIXEL,
+ IJ_PERSP_SAMPLE,
+ IJ_PERSP_CENTROID,
+ IJ_PERSP_SIZE,
+ IJ_LINEAR_PIXEL,
+ IJ_LINEAR_CENTROID,
+ IJ_LINEAR_SAMPLE,
+ IJ_COUNT,
+};
+
/**
* Description of a lowered UBO.
*/
uint32_t off[IR3_MAX_SHADER_IMAGES];
} image_dims;
- unsigned immediate_idx;
unsigned immediates_count;
unsigned immediates_size;
- struct {
- uint32_t val[4];
- } *immediates;
+ uint32_t *immediates;
/* State of ubo access lowered to push consts: */
struct ir3_ubo_analysis_state ubo_state;
* the limit:
*/
unsigned safe_constlen : 1;
+
+ /* Whether gl_Layer must be forced to 0 because it isn't written. */
+ unsigned layer_zero : 1;
};
uint32_t global;
};
if (last_key->rasterflat != key->rasterflat)
return true;
+ if (last_key->layer_zero != key->layer_zero)
+ return true;
+
if (last_key->ucp_enables != key->ucp_enables)
return true;
uint8_t regid;
bool half : 1;
} outputs[32 + 2]; /* +POSITION +PSIZE */
- bool writes_pos, writes_smask, writes_psize;
+ bool writes_pos, writes_smask, writes_psize, writes_stencilref;
/* Size in dwords of all outputs for VS, size of entire patch for HS. */
uint32_t output_size;
unsigned num_reserved_user_consts;
+ bool nir_finalized;
struct nir_shader *nir;
struct ir3_stream_output_info stream_output;
/* location for fixed-function gl_PrimitiveID passthrough */
uint8_t primid_loc;
+
+ /* location for fixed-function gl_ViewIndex passthrough */
+ uint8_t viewid_loc;
};
static inline void
int j = -1, k;
l->primid_loc = 0xff;
+ l->viewid_loc = 0xff;
while (l->cnt < ARRAY_SIZE(l->var)) {
j = ir3_next_varying(fs, j);
l->primid_loc = fs->inputs[j].inloc;
}
+ if (fs->inputs[j].slot == VARYING_SLOT_VIEW_INDEX) {
+ assert(k < 0);
+ l->viewid_loc = fs->inputs[j].inloc;
+ }
+
ir3_link_add(l, k >= 0 ? vs->outputs[k].regid : default_regid,
fs->inputs[j].compmask, fs->inputs[j].inloc);
}