summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2010-07-13 21:49:53 -0400
committerZack Rusin <[email protected]>2010-07-13 21:49:53 -0400
commit1491c6aa2de17760ab157a3fe71e45006e4eecf6 (patch)
tree5b9cc35d0c268439529fe26c12549ccbbf9f9e20 /src/mesa/program
parent79b643dd02ac4e19f24c9cd88843719746f8ec69 (diff)
mesa: add comments and change Index2D to just Index2
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/prog_instruction.h16
-rw-r--r--src/mesa/program/prog_print.c10
2 files changed, 18 insertions, 8 deletions
diff --git a/src/mesa/program/prog_instruction.h b/src/mesa/program/prog_instruction.h
index cb5beb9b00d..dacbc33704b 100644
--- a/src/mesa/program/prog_instruction.h
+++ b/src/mesa/program/prog_instruction.h
@@ -272,9 +272,19 @@ struct prog_src_register
*/
GLuint Negate:4;
- GLuint HasIndex2D:1;
- GLuint RelAddr2D:1;
- GLint Index2D:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
+ /**
+ * Is the register two-dimensional.
+ * Two dimensional registers are of the
+ * REGISTER[index][index2] format.
+ * They are used by the geometry shaders where
+ * the first index is the index within an array
+ * and the second index is the semantic of the
+ * array, e.g. gl_PositionIn[index] would become
+ * INPUT[index][gl_PositionIn]
+ */
+ GLuint HasIndex2:1;
+ GLuint RelAddr2:1;
+ GLint Index2:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
* May be negative for relative
* addressing. */
};
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index 876b2d46186..6ab199aa02b 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -266,7 +266,7 @@ arb_output_attrib_string(GLint index, GLenum progType)
static const char *
reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
GLboolean relAddr, const struct gl_program *prog,
- GLboolean hasIndex2D, GLboolean relAddr2D, GLint index2D)
+ GLboolean hasIndex2, GLboolean relAddr2, GLint index2)
{
static char str[100];
const char *addr = relAddr ? "ADDR+" : "";
@@ -276,10 +276,10 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
switch (mode) {
case PROG_PRINT_DEBUG:
sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index);
- if (hasIndex2D) {
+ if (hasIndex2) {
int offset = strlen(str);
- const char *addr2D = relAddr2D ? "ADDR+" : "";
- sprintf(str+offset, "[%s%d]", addr2D, index2D);
+ const char *addr2 = relAddr2 ? "ADDR+" : "";
+ sprintf(str+offset, "[%s%d]", addr2, index2);
}
break;
@@ -516,7 +516,7 @@ fprint_src_reg(FILE *f,
abs,
reg_string((gl_register_file) srcReg->File,
srcReg->Index, mode, srcReg->RelAddr, prog,
- srcReg->HasIndex2D, srcReg->RelAddr2D, srcReg->Index2D),
+ srcReg->HasIndex2, srcReg->RelAddr2, srcReg->Index2),
_mesa_swizzle_string(srcReg->Swizzle,
srcReg->Negate, GL_FALSE),
abs);