fs_reg *
fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type);
fs_reg wpos = *reg;
bool flip = !ir->data.origin_upper_left ^ key->render_to_fbo;
assert(stage == MESA_SHADER_FRAGMENT);
brw_wm_prog_data *prog_data = (brw_wm_prog_data*) this->prog_data;
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
unsigned int array_elements;
const glsl_type *type;
void
fs_visitor::compute_sample_position(fs_reg dst, fs_reg int_sample_pos)
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
assert(dst.type == BRW_REGISTER_TYPE_F);
if (key->compute_pos_offset) {
fs_reg *
fs_visitor::emit_sampleid_setup(ir_variable *ir)
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
assert(brw->gen >= 6);
this->current_annotation = "compute sample id";
{
assert(stage == MESA_SHADER_FRAGMENT);
brw_wm_prog_data *prog_data = (brw_wm_prog_data*) this->prog_data;
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
for (unsigned int i = 0; i < VARYING_SLOT_MAX; i++) {
prog_data->urb_setup[i] = -1;
if (stage == MESA_SHADER_FRAGMENT) {
brw_wm_prog_data *prog_data = (brw_wm_prog_data*) this->prog_data;
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
prog_data->uses_pos_offset = key->compute_pos_offset;
/* R31: MSAA position offsets. */
if (prog_data->uses_pos_offset) {
{
assert(stage == MESA_SHADER_FRAGMENT);
brw_wm_prog_data *prog_data = (brw_wm_prog_data*) this->prog_data;
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
uint32_t next_binding_table_offset = 0;
/* If there are no color regions, we still perform an FB write to a null
bool uses_kill =
(stage == MESA_SHADER_FRAGMENT) &&
((brw_wm_prog_data*) this->prog_data)->uses_kill;
- if (uses_kill || key->alpha_test_func) {
+ bool alpha_test_func =
+ (stage == MESA_SHADER_FRAGMENT) &&
+ ((brw_wm_prog_key*) this->key)->alpha_test_func;
+ if (uses_kill || alpha_test_func) {
fs_inst *discard_init = emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS);
discard_init->flag_subreg = 1;
}
emit(FS_OPCODE_PLACEHOLDER_HALT);
- if (key->alpha_test_func)
+ if (alpha_test_func)
emit_alpha_test();
emit_fb_writes();
void visit_atomic_counter_intrinsic(ir_call *ir);
- const struct brw_wm_prog_key *const key;
+ const void *const key;
struct brw_stage_prog_data *prog_data;
unsigned int sanity_param_count;
fs_reg
fs_visitor::get_fp_dst_reg(const prog_dst_register *dst)
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
+
switch (dst->File) {
case PROGRAM_TEMPORARY:
return fp_temp_regs[dst->Index];
this->do_dual_src = true;
} else if (ir->data.location == FRAG_RESULT_COLOR) {
/* Writing gl_FragColor outputs to all color regions. */
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
for (unsigned int i = 0; i < MAX2(key->nr_color_regions, 1); i++) {
this->outputs[i] = *reg;
this->output_components[i] = 4;
*/
no16("interpolate_at_* not yet supported in SIMD16 mode.");
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
+
ir_dereference * deref = ir->operands[0]->as_dereference();
ir_swizzle * swiz = NULL;
if (!deref) {
fs_reg scale_x, scale_y;
const struct brw_sampler_prog_key_data *tex =
(stage == MESA_SHADER_FRAGMENT) ?
- &this->key->tex : NULL;
+ &((brw_wm_prog_key*) this->key)->tex : NULL;
assert(tex);
/* The 965 requires the EU to do the normalization of GL rectangle
{
const struct brw_sampler_prog_key_data *tex =
(stage == MESA_SHADER_FRAGMENT) ?
- &this->key->tex : NULL;
+ &((brw_wm_prog_key*) this->key)->tex : NULL;
assert(tex);
fs_inst *inst = NULL;
{
const struct brw_sampler_prog_key_data *tex =
(stage == MESA_SHADER_FRAGMENT) ?
- &this->key->tex : NULL;
+ &((brw_wm_prog_key*) this->key)->tex : NULL;
assert(tex);
ir_constant *chan = ir->lod_info.component->as_constant();
int swiz = GET_SWZ(tex->swizzles[sampler], chan->value.i[0]);
const struct brw_sampler_prog_key_data *tex =
(stage == MESA_SHADER_FRAGMENT) ?
- &this->key->tex : NULL;
+ &((brw_wm_prog_key*) this->key)->tex : NULL;
assert(tex);
if (ir->type == glsl_type::float_type) {
void
fs_visitor::emit_color_write(int target, int index, int first_color_mrf)
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
int reg_width = dispatch_width / 8;
fs_inst *inst;
fs_reg color = outputs[target];
void
fs_visitor::emit_alpha_test()
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
this->current_annotation = "Alpha test";
fs_inst *cmp;
{
assert(stage == MESA_SHADER_FRAGMENT);
brw_wm_prog_data *prog_data = (brw_wm_prog_data*) this->prog_data;
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
this->current_annotation = "FB write header";
bool header_present = true;
*/
void fs_visitor::setup_payload_gen4()
{
+ assert(stage == MESA_SHADER_FRAGMENT);
+ brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
+ gl_fragment_program *fp = (gl_fragment_program*) prog;
GLuint reg = 2;
bool kill_stats_promoted_workaround = false;
int lookup = key->iz_lookup;
- assert(stage == MESA_SHADER_FRAGMENT);
- gl_fragment_program *fp = (gl_fragment_program*) prog;
bool uses_depth =
(fp->Base.InputsRead & (1 << VARYING_SLOT_POS)) != 0;