summaryrefslogtreecommitdiffstats
path: root/src/mesa/slang
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-07-13 21:49:53 -0400
committerZack Rusin <zackr@vmware.com>2010-07-13 21:49:53 -0400
commit1491c6aa2de17760ab157a3fe71e45006e4eecf6 (patch)
tree5b9cc35d0c268439529fe26c12549ccbbf9f9e20 /src/mesa/slang
parent79b643dd02ac4e19f24c9cd88843719746f8ec69 (diff)
mesa: add comments and change Index2D to just Index2
Diffstat (limited to 'src/mesa/slang')
-rw-r--r--src/mesa/slang/slang_emit.c6
-rw-r--r--src/mesa/slang/slang_ir.c14
-rw-r--r--src/mesa/slang/slang_ir.h4
-rw-r--r--src/mesa/slang/slang_link.c6
4 files changed, 16 insertions, 14 deletions
diff --git a/src/mesa/slang/slang_emit.c b/src/mesa/slang/slang_emit.c
index 15d75eb8fb8..a9aa6fe1c3a 100644
--- a/src/mesa/slang/slang_emit.c
+++ b/src/mesa/slang/slang_emit.c
@@ -379,8 +379,8 @@ storage_to_src_reg(struct prog_src_register *src, const slang_ir_storage *st)
assert(GET_SWZ(swizzle, 3) <= SWIZZLE_W);
src->Swizzle = swizzle;
- src->HasIndex2D = st->Is2D;
- src->Index2D = st->Index2D;
+ src->HasIndex2 = st->Is2D;
+ src->Index2 = st->Index2;
src->RelAddr = relAddr;
}
@@ -2324,7 +2324,7 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n)
* index */
if (emitInfo->prog->Target == MESA_GEOMETRY_PROGRAM &&
n->Store->Is2D) {
- emitInfo->prog->InputsRead |= (1 << n->Store->Index2D);
+ emitInfo->prog->InputsRead |= (1 << n->Store->Index2);
} else
emitInfo->prog->InputsRead |= (1 << n->Store->Index);
}
diff --git a/src/mesa/slang/slang_ir.c b/src/mesa/slang/slang_ir.c
index 131093d2a7e..078c9369a89 100644
--- a/src/mesa/slang/slang_ir.c
+++ b/src/mesa/slang/slang_ir.c
@@ -134,7 +134,7 @@ _slang_init_ir_storage(slang_ir_storage *st,
st->Parent = NULL;
st->IsIndirect = GL_FALSE;
st->Is2D = GL_FALSE;
- st->Index2D = 0;
+ st->Index2 = 0;
}
@@ -154,7 +154,7 @@ _slang_new_ir_storage(gl_register_file file, GLint index, GLint size)
st->Parent = NULL;
st->IsIndirect = GL_FALSE;
st->Is2D = GL_FALSE;
- st->Index2D = 0;
+ st->Index2 = 0;
}
return st;
}
@@ -177,7 +177,7 @@ _slang_new_ir_storage_swz(gl_register_file file, GLint index, GLint size,
st->Parent = NULL;
st->IsIndirect = GL_FALSE;
st->Is2D = GL_FALSE;
- st->Index2D = 0;
+ st->Index2 = 0;
}
return st;
}
@@ -187,7 +187,7 @@ _slang_new_ir_storage_swz(gl_register_file file, GLint index, GLint size,
*/
slang_ir_storage *
_slang_new_ir_storage_2d(gl_register_file file,
- GLint index, GLint index2d,
+ GLint index, GLint index2,
GLint size, GLuint swizzle)
{
slang_ir_storage *st;
@@ -200,7 +200,7 @@ _slang_new_ir_storage_2d(gl_register_file file,
st->Parent = NULL;
st->IsIndirect = GL_FALSE;
st->Is2D = GL_TRUE;
- st->Index2D = index2d;
+ st->Index2 = index2;
}
return st;
}
@@ -224,7 +224,7 @@ _slang_new_ir_storage_relative(GLint index, GLint size,
st->Parent = parent;
st->IsIndirect = GL_FALSE;
st->Is2D = GL_FALSE;
- st->Index2D = 0;
+ st->Index2 = 0;
}
return st;
}
@@ -250,7 +250,7 @@ _slang_new_ir_storage_indirect(gl_register_file file,
st->IndirectIndex = indirectIndex;
st->IndirectSwizzle = indirectSwizzle;
st->Is2D = GL_FALSE;
- st->Index2D = 0;
+ st->Index2 = 0;
}
return st;
}
diff --git a/src/mesa/slang/slang_ir.h b/src/mesa/slang/slang_ir.h
index 543cf0acc78..b7a373746b4 100644
--- a/src/mesa/slang/slang_ir.h
+++ b/src/mesa/slang/slang_ir.h
@@ -189,8 +189,10 @@ struct slang_ir_storage_
GLuint IndirectSwizzle;
GLuint TexTarget; /**< If File==PROGRAM_SAMPLER, one of TEXTURE_x_INDEX */
+ /* Is the register two-dimensional and
+ * if so what's the second index */
GLboolean Is2D;
- GLint Index2D;
+ GLint Index2;
/** If Parent is non-null, Index is relative to parent.
* The other fields are ignored.
diff --git a/src/mesa/slang/slang_link.c b/src/mesa/slang/slang_link.c
index 8d5a9e96ad9..955ee79ed86 100644
--- a/src/mesa/slang/slang_link.c
+++ b/src/mesa/slang/slang_link.c
@@ -762,10 +762,10 @@ _slang_update_inputs_outputs(struct gl_program *prog)
for (j = 0; j < numSrc; j++) {
if (inst->SrcReg[j].File == PROGRAM_INPUT) {
if (prog->Target == MESA_GEOMETRY_PROGRAM &&
- inst->SrcReg[j].HasIndex2D)
+ inst->SrcReg[j].HasIndex2)
prog->InputsRead |= get_inputs_read_mask(prog->Target,
- inst->SrcReg[j].Index2D,
- inst->SrcReg[j].RelAddr2D);
+ inst->SrcReg[j].Index2,
+ inst->SrcReg[j].RelAddr2);
else
prog->InputsRead |= get_inputs_read_mask(prog->Target,
inst->SrcReg[j].Index,