if (!src->Indirect && !src->Absolute && !src->Negate) {
unsigned swizzle = tgsi_util_get_src_register_swizzle(src, chan);
if (src->File == TGSI_FILE_TEMPORARY) {
- if (src->Index < Elements(ctx->temp)) {
+ if (src->Index < ARRAY_SIZE(ctx->temp)) {
*chan_info = ctx->temp[src->Index][swizzle];
}
} else {
chan_info->file = src->File;
if (src->File == TGSI_FILE_IMMEDIATE) {
- assert(src->Index < Elements(ctx->imm));
- if (src->Index < Elements(ctx->imm)) {
+ assert(src->Index < ARRAY_SIZE(ctx->imm));
+ if (src->Index < ARRAY_SIZE(ctx->imm)) {
chan_info->u.value = ctx->imm[src->Index][swizzle];
}
} else {
struct lp_tgsi_info *info = ctx->info;
unsigned chan;
- if (info->num_texs < Elements(info->tex)) {
+ if (info->num_texs < ARRAY_SIZE(info->tex)) {
struct lp_tgsi_texture_info *tex_info = &info->tex[info->num_texs];
boolean indirect = FALSE;
unsigned readmask = 0;
struct lp_tgsi_info *info = ctx->info;
unsigned chan;
- if (info->num_texs < Elements(info->tex)) {
+ if (info->num_texs < ARRAY_SIZE(info->tex)) {
struct lp_tgsi_texture_info *tex_info = &info->tex[info->num_texs];
unsigned target = ctx->sample_target[inst->Src[1].Register.Index];
boolean indirect = FALSE;
if (dst->File == TGSI_FILE_TEMPORARY) {
regs = ctx->temp;
- max_regs = Elements(ctx->temp);
+ max_regs = ARRAY_SIZE(ctx->temp);
} else if (dst->File == TGSI_FILE_OUTPUT) {
regs = info->output;
- max_regs = Elements(info->output);
- } else if (dst->File == TGSI_FILE_ADDRESS ||
- dst->File == TGSI_FILE_PREDICATE) {
+ max_regs = ARRAY_SIZE(info->output);
+ } else if (dst->File == TGSI_FILE_ADDRESS) {
+ continue;
+ } else if (dst->File == TGSI_FILE_BUFFER) {
+ continue;
+ } else if (dst->File == TGSI_FILE_IMAGE) {
+ continue;
+ } else if (dst->File == TGSI_FILE_MEMORY) {
continue;
} else {
assert(0);
memset(res, 0, sizeof res);
- if (!inst->Instruction.Predicate &&
- !inst->Instruction.Saturate) {
+ if (!inst->Instruction.Saturate) {
for (chan = 0; chan < 4; ++chan) {
if (dst->WriteMask & (1 << chan)) {
if (inst->Instruction.Opcode == TGSI_OPCODE_MOV) {
case TGSI_OPCODE_ENDIF:
case TGSI_OPCODE_BGNLOOP:
case TGSI_OPCODE_BRK:
- case TGSI_OPCODE_BREAKC:
case TGSI_OPCODE_CONT:
case TGSI_OPCODE_ENDLOOP:
- case TGSI_OPCODE_CALLNZ:
case TGSI_OPCODE_CAL:
case TGSI_OPCODE_BGNSUB:
case TGSI_OPCODE_ENDSUB:
const unsigned size =
parse.FullToken.FullImmediate.Immediate.NrTokens - 1;
assert(size <= 4);
- if (ctx->num_imms < Elements(ctx->imm)) {
+ if (ctx->num_imms < ARRAY_SIZE(ctx->imm)) {
for (chan = 0; chan < size; ++chan) {
float value = parse.FullToken.FullImmediate.u[chan].Float;
ctx->imm[ctx->num_imms][chan] = value;
*/
for (index = 0; index < PIPE_MAX_COLOR_BUFS; ++index) {
- const struct lp_tgsi_channel_info null_output[4];
+ static const struct lp_tgsi_channel_info null_output[4];
info->cbuf[index] = null_output;
}