};
-struct brw_shader_info {
- int nr_regs[8]; /* TGSI_FILE_* */
-};
-
-
-
struct brw_vertex_program {
struct pipe_shader_state program;
struct tgsi_shader_info info;
- struct brw_shader_info info2; /* XXX get rid of this */
int id;
};
-
struct brw_fragment_program {
struct pipe_shader_state program;
struct tgsi_shader_info info;
- struct brw_shader_info info2; /* XXX get rid of this */
- boolean UsesDepth;
+ boolean UsesDepth; /* XXX add this to tgsi_shader_info? */
int id;
};
-
-
struct pipe_setup_linkage {
struct {
unsigned vp_output:5;
tgsi_scan_shader(shader->tokens, &brw_fp->info);
+#if 0
brw_shader_info(shader->tokens,
&brw_fp->info2);
+#endif
tgsi_dump(shader->tokens, 0);
tgsi_scan_shader(shader->tokens, &brw_vp->info);
+#if 0
brw_shader_info(shader->tokens,
&brw_vp->info2);
-
+#endif
tgsi_dump(shader->tokens, 0);
return (void *)brw_vp;
/* Then a copy of our part of the CURBE entry:
*/
{
- int nr_constants = c->fp->info2.nr_regs[TGSI_FILE_CONSTANT];
+ int nr_constants = c->fp->info.file_max[TGSI_FILE_CONSTANT] + 1;
int index = 0;
+ /* XXX number of constants, or highest numbered constant? */
+ assert(nr_constants == c->fp->info.file_count[TGSI_FILE_CONSTANT]);
+
c->prog_data.max_const = 4*nr_constants;
for (i = 0; i < nr_constants; i++) {
for (j = 0; j < 4; j++, index++)
/* Next we receive the plane coefficients for parameter
* interpolation:
*/
- for (i = 0; i < c->fp->info2.nr_regs[TGSI_FILE_INPUT]; i++) {
+ assert(c->fp->info.file_max[TGSI_FILE_INPUT] == c->fp->info.num_inputs);
+ for (i = 0; i < c->fp->info.file_max[TGSI_FILE_INPUT] + 1; i++) {
c->payload_coef[i] = brw_vec8_grf(c->reg_index, 0);
c->reg_index += 2;
}
/* Now allocate room for the interpolated inputs and staging
* registers for the outputs:
*/
- for (i = 0; i < c->fp->info2.nr_regs[TGSI_FILE_INPUT]; i++)
+ /* XXX do we want to loop over the _number_ of inputs/outputs or loop
+ * to the highest input/output index that's used?
+ * Probably the same, actually.
+ */
+ assert(c->fp->info.file_max[TGSI_FILE_INPUT] + 1 == c->fp->info.num_inputs);
+ assert(c->fp->info.file_max[TGSI_FILE_OUTPUT] + 1 == c->fp->info.num_outputs);
+ for (i = 0; i < c->fp->info.file_max[TGSI_FILE_INPUT] + 1; i++)
for (j = 0; j < 4; j++)
c->wm_regs[TGSI_FILE_INPUT][i][j] = brw_vec8_grf( c->reg_index++, 0 );
- for (i = 0; i < c->fp->info2.nr_regs[TGSI_FILE_OUTPUT]; i++)
+ for (i = 0; i < c->fp->info.file_max[TGSI_FILE_OUTPUT] + 1; i++)
for (j = 0; j < 4; j++)
c->wm_regs[TGSI_FILE_OUTPUT][i][j] = brw_vec8_grf( c->reg_index++, 0 );