summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2016-05-17 09:25:44 -0400
committerJan Vesely <[email protected]>2016-05-17 15:28:04 -0400
commit47b390fe45e5e6f982c60b58985892438959cd8e (patch)
tree61a26199f85287a7e918c6c52db243280b6a3cba /src/gallium/drivers/nouveau
parent322cd2457ccf66a0a88d92f0b0dec1cb3f93eae4 (diff)
Treewide: Remove Elements() macro
Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp2
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp6
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp4
-rw-r--r--src/gallium/drivers/nouveau/nouveau_compiler.c2
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_tex.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index e62ac064d59..cd801f342dd 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -2472,7 +2472,7 @@ MemoryOpt::replaceStFromSt(Instruction *restrict st, Record *rec)
// get non-replaced sources after values covered by st
for (; offR < endR; offR += ri->getSrc(s)->reg.size, ++s)
vals[k++] = ri->getSrc(s);
- assert((unsigned int)k <= Elements(vals));
+ assert((unsigned int)k <= ARRAY_SIZE(vals));
for (s = 0; s < k; ++s)
st->setSrc(s + 1, vals[s]);
st->setSrc(0, ri->getSrc(0));
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
index 7fdbafa8c70..756a4d8ac88 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
@@ -547,16 +547,16 @@ void Instruction::print() const
switch (op) {
case OP_SUREDP:
case OP_ATOM:
- if (subOp < Elements(atomSubOpStr))
+ if (subOp < ARRAY_SIZE(atomSubOpStr))
PRINT("%s ", atomSubOpStr[subOp]);
break;
case OP_LOAD:
case OP_STORE:
- if (subOp < Elements(ldstSubOpStr))
+ if (subOp < ARRAY_SIZE(ldstSubOpStr))
PRINT("%s ", ldstSubOpStr[subOp]);
break;
case OP_SUBFM:
- if (subOp < Elements(subfmOpStr))
+ if (subOp < ARRAY_SIZE(subfmOpStr))
PRINT("%s ", subfmOpStr[subOp]);
break;
default:
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
index b147baf3d62..cc98d325c71 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
@@ -145,8 +145,8 @@ extern Target *getTargetNV50(unsigned int chipset);
Target *Target::create(unsigned int chipset)
{
- STATIC_ASSERT(Elements(operationSrcNr) == OP_LAST + 1);
- STATIC_ASSERT(Elements(operationClass) == OP_LAST + 1);
+ STATIC_ASSERT(ARRAY_SIZE(operationSrcNr) == OP_LAST + 1);
+ STATIC_ASSERT(ARRAY_SIZE(operationClass) == OP_LAST + 1);
switch (chipset & ~0xf) {
case 0x110:
case 0x120:
diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c b/src/gallium/drivers/nouveau/nouveau_compiler.c
index ca73fd17a43..e00ad3fc0b8 100644
--- a/src/gallium/drivers/nouveau/nouveau_compiler.c
+++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
@@ -197,7 +197,7 @@ main(int argc, char *argv[])
return 1;
}
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
_debug_printf("Failed to parse TGSI shader\n");
return 1;
}
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c
index 36c07bc4fc3..953ab8f4364 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c
@@ -449,6 +449,6 @@ void nv50_upload_ms_info(struct nouveau_pushbuf *push)
{
BEGIN_NV04(push, NV50_3D(CB_ADDR), 1);
PUSH_DATA (push, (NV50_CB_AUX_MS_OFFSET << (8 - 2)) | NV50_CB_AUX);
- BEGIN_NI04(push, NV50_3D(CB_DATA(0)), Elements(msaa_sample_xy_offsets));
- PUSH_DATAp(push, msaa_sample_xy_offsets, Elements(msaa_sample_xy_offsets));
+ BEGIN_NI04(push, NV50_3D(CB_DATA(0)), ARRAY_SIZE(msaa_sample_xy_offsets));
+ PUSH_DATAp(push, msaa_sample_xy_offsets, ARRAY_SIZE(msaa_sample_xy_offsets));
}