*/
static const char *
reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
- GLboolean relAddr, const struct gl_program *prog)
+ GLboolean relAddr, const struct gl_program *prog,
+ GLboolean hasIndex2D, GLboolean relAddr2D, GLint index2D)
{
static char str[100];
const char *addr = relAddr ? "ADDR+" : "";
switch (mode) {
case PROG_PRINT_DEBUG:
sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index);
+ if (hasIndex2D) {
+ int offset = strlen(str);
+ const char *addr2D = relAddr2D ? "ADDR+" : "";
+ sprintf(str+offset, "[%s%d]", addr2D, index2D);
+ }
break;
case PROG_PRINT_ARB:
{
fprintf(f, "%s%s",
reg_string((gl_register_file) dstReg->File,
- dstReg->Index, mode, dstReg->RelAddr, prog),
+ dstReg->Index, mode, dstReg->RelAddr, prog,
+ GL_FALSE, GL_FALSE, 0),
_mesa_writemask_string(dstReg->WriteMask));
if (dstReg->CondMask != COND_TR) {
fprintf(f, "%s%s%s%s",
abs,
reg_string((gl_register_file) srcReg->File,
- srcReg->Index, mode, srcReg->RelAddr, prog),
+ srcReg->Index, mode, srcReg->RelAddr, prog,
+ srcReg->HasIndex2D, srcReg->RelAddr2D, srcReg->Index2D),
_mesa_swizzle_string(srcReg->Swizzle,
srcReg->Negate, GL_FALSE),
abs);