r300g: fix typo in r300_reg.h to prevent the RS unit from doing random things
And reorder fragment shader inputs so that the colors are before texcoords, as is allocated by the shader compiler. This commit makes VS->FS attribute routing work on R500.
This commit is contained in:
committed by
Corbin Simpson
parent
4e1236e602
commit
624a0cd9c1
@@ -1293,7 +1293,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
# define R500_RS_INST_TEX_ID(x) ((x) << 0)
|
||||
#define R500_RS_INST_TEX_CN_WRITE (1 << 4)
|
||||
#define R500_RS_INST_TEX_ADDR_SHIFT 5
|
||||
# define R500_RS_INST_TEX_ADDR(x) ((x) << 0)
|
||||
# define R500_RS_INST_TEX_ADDR(x) ((x) << 5)
|
||||
#define R500_RS_INST_COL_ID_SHIFT 12
|
||||
# define R500_RS_INST_COL_ID(x) ((x) << 12)
|
||||
#define R500_RS_INST_COL_CN_NO_WRITE (0 << 16)
|
||||
|
||||
@@ -381,17 +381,18 @@ static void r300_update_rs_block(struct r300_context* r300,
|
||||
col_count++;
|
||||
}
|
||||
|
||||
for (i = 0; i < col_count; i++) {
|
||||
rs->inst[i] |= R500_RS_INST_COL_ID(i) |
|
||||
R500_RS_INST_COL_CN_WRITE | R500_RS_INST_COL_ADDR(fp_offset);
|
||||
fp_offset++;
|
||||
}
|
||||
|
||||
for (i = 0; i < tex_count; i++) {
|
||||
rs->inst[i] |= R500_RS_INST_TEX_ID(i) |
|
||||
R500_RS_INST_TEX_CN_WRITE | R500_RS_INST_TEX_ADDR(fp_offset);
|
||||
fp_offset++;
|
||||
}
|
||||
|
||||
for (i = 0; i < col_count; i++) {
|
||||
rs->inst[i] |= R500_RS_INST_COL_ID(i) |
|
||||
R500_RS_INST_COL_CN_WRITE | R500_RS_INST_COL_ADDR(fp_offset);
|
||||
fp_offset++;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < info->num_inputs; i++) {
|
||||
switch (info->input_semantic_name[i]) {
|
||||
@@ -416,8 +417,10 @@ static void r300_update_rs_block(struct r300_context* r300,
|
||||
}
|
||||
}
|
||||
|
||||
/* Rasterize at least one color, or bad things happen. */
|
||||
if (col_count == 0) {
|
||||
rs->ip[0] |= R300_RS_COL_FMT(R300_RS_COL_FMT_0001);
|
||||
col_count++;
|
||||
}
|
||||
|
||||
if (tex_count == 0) {
|
||||
@@ -428,9 +431,10 @@ static void r300_update_rs_block(struct r300_context* r300,
|
||||
R300_RS_SEL_Q(R300_RS_SEL_K1);
|
||||
}
|
||||
|
||||
/* Rasterize at least one color, or bad things happen. */
|
||||
if ((col_count == 0) && (tex_count == 0)) {
|
||||
col_count++;
|
||||
for (i = 0; i < col_count; i++) {
|
||||
rs->inst[i] |= R300_RS_INST_COL_ID(i) |
|
||||
R300_RS_INST_COL_CN_WRITE | R300_RS_INST_COL_ADDR(fp_offset);
|
||||
fp_offset++;
|
||||
}
|
||||
|
||||
for (i = 0; i < tex_count; i++) {
|
||||
@@ -438,12 +442,6 @@ static void r300_update_rs_block(struct r300_context* r300,
|
||||
R300_RS_INST_TEX_CN_WRITE | R300_RS_INST_TEX_ADDR(fp_offset);
|
||||
fp_offset++;
|
||||
}
|
||||
|
||||
for (i = 0; i < col_count; i++) {
|
||||
rs->inst[i] |= R300_RS_INST_COL_ID(i) |
|
||||
R300_RS_INST_COL_CN_WRITE | R300_RS_INST_COL_ADDR(fp_offset);
|
||||
fp_offset++;
|
||||
}
|
||||
}
|
||||
|
||||
rs->count = (rs_tex_comp) | (col_count << R300_IC_COUNT_SHIFT) |
|
||||
|
||||
Reference in New Issue
Block a user