i965: Drop the degenerate brw_sampler_default_color structure.

It's just an array of four floats, and we have an array of four floats,
so this is literally just a memcpy...but with custom structs and strange
macros to give the appearance of doing something more.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Kenneth Graunke 2014-05-06 22:35:27 -07:00
parent c8e2549785
commit 9a1a8cb84d
3 changed files with 8 additions and 16 deletions

View File

@ -197,12 +197,9 @@ upload_default_color(struct brw_context *brw,
sdc->f[2] = color[2];
sdc->f[3] = color[3];
} else {
struct brw_sampler_default_color *sdc;
sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
sizeof(*sdc), 32, sdc_offset);
COPY_4V(sdc->color, color);
float *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
4 * 4, 32, sdc_offset);
memcpy(sdc, color, 4 * 4);
}
}

View File

@ -243,12 +243,11 @@ dump_sdc(struct brw_context *brw, uint32_t offset)
batch_out(brw, name, offset, 10, "s16 ba\n");
batch_out(brw, name, offset, 11, "s8 rgba\n");
} else {
struct brw_sampler_default_color *sdc = (brw->batch.bo->virtual +
offset);
batch_out(brw, name, offset, 0, "r %f\n", sdc->color[0]);
batch_out(brw, name, offset, 1, "g %f\n", sdc->color[1]);
batch_out(brw, name, offset, 2, "b %f\n", sdc->color[2]);
batch_out(brw, name, offset, 3, "a %f\n", sdc->color[3]);
float *sdc = brw->batch.bo->virtual + offset;
batch_out(brw, name, offset, 0, "r %f\n", sdc[0]);
batch_out(brw, name, offset, 1, "g %f\n", sdc[1]);
batch_out(brw, name, offset, 2, "b %f\n", sdc[2]);
batch_out(brw, name, offset, 3, "a %f\n", sdc[3]);
}
}

View File

@ -589,10 +589,6 @@ struct brw_wm_unit_state
} wm10;
};
struct brw_sampler_default_color {
float color[4];
};
struct gen5_sampler_default_color {
uint8_t ub[4];
float f[4];