summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-30 15:50:09 -0700
committerCorbin Simpson <[email protected]>2009-03-30 15:50:09 -0700
commita56020fe17b3d26ea0ea933dd4e8286e5029996f (patch)
treefb1aaac19c7fdcd8cfe918eb8309e87166f097b3 /src/gallium
parent7620b3943b5f9d6ab7156e245aade3bf2a5358a2 (diff)
r300-gallium: Fix hardlock when no colors or textures are present.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index d761a0302f0..0e7a2b6726f 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -211,7 +211,6 @@ static void r300_update_rs_block(struct r300_context* r300)
rs->ip[0] |= R500_RS_COL_FMT(R300_RS_COL_FMT_0001);
}
- /* Set up at least one texture pointer or RS will not be happy. */
if (tex_count == 0) {
rs->ip[0] |=
R500_RS_SEL_S(R500_RS_IP_PTR_K0) |
@@ -220,15 +219,20 @@ static void r300_update_rs_block(struct r300_context* r300)
R500_RS_SEL_Q(R500_RS_IP_PTR_K1);
}
+ /* Rasterize at least one color, or bad things happen. */
+ if ((col_count == 0) && (tex_count == 0)) {
+ col_count++;
+ }
+
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);
+ 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);
+ 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 {
@@ -268,15 +272,20 @@ 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 < tex_count; i++) {
- rs->inst[i] |= R300_RS_INST_TEX_ID(i) | R300_RS_INST_TEX_CN_WRITE |
- R300_RS_INST_TEX_ADDR(fp_offset);
+ rs->inst[i] |= R300_RS_INST_TEX_ID(i) |
+ 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);
+ rs->inst[i] |= R300_RS_INST_COL_ID(i) |
+ R300_RS_INST_COL_CN_WRITE | R300_RS_INST_COL_ADDR(fp_offset);
fp_offset++;
}
}