/* General color output. */
for (unsigned int i = 0; i < MAX2(1, ir->type->length); i++) {
int output = ir->data.location - FRAG_RESULT_DATA0 + i;
/* General color output. */
for (unsigned int i = 0; i < MAX2(1, ir->type->length); i++) {
int output = ir->data.location - FRAG_RESULT_DATA0 + i;
for (unsigned int i = 0; i < struct_type->length; i++) {
if (strcmp(struct_type->fields.structure[i].name, ir->field) == 0)
break;
for (unsigned int i = 0; i < struct_type->length; i++) {
if (strcmp(struct_type->fields.structure[i].name, ir->field) == 0)
break;
} else {
/* Variable index array dereference. We attach the variable index
* component to the reg as a pointer to a register containing the
} else {
/* Variable index array dereference. We attach the variable index
* component to the reg as a pointer to a register containing the
/* 1. collect interpolation factors */
fs_reg dst_x = fs_reg(this, glsl_type::get_instance(ir->type->base_type, 2, 1));
/* 1. collect interpolation factors */
fs_reg dst_x = fs_reg(this, glsl_type::get_instance(ir->type->base_type, 2, 1));
/* for most messages, we need one reg of ignored data; the hardware requires mlen==1
* even when there is no payload. in the per-slot offset case, we'll replace this with
/* for most messages, we need one reg of ignored data; the hardware requires mlen==1
* even when there is no payload. in the per-slot offset case, we'll replace this with
fs_inst *inst = emit(BRW_OPCODE_SEL, src2, src2, fs_reg(7));
inst->conditional_mod = BRW_CONDITIONAL_L; /* min(src2, 7) */
fs_inst *inst = emit(BRW_OPCODE_SEL, src2, src2, fs_reg(7));
inst->conditional_mod = BRW_CONDITIONAL_L; /* min(src2, 7) */
emit(FS_OPCODE_LINTERP, res,
dst_x, dst_y,
fs_reg(interp_reg(var->data.location, ch)));
emit(FS_OPCODE_LINTERP, res,
dst_x, dst_y,
fs_reg(interp_reg(var->data.location, ch)));
if (ir->type->base_type == GLSL_TYPE_BOOL)
emit(CMP(result, result, fs_reg(0), BRW_CONDITIONAL_NZ));
if (ir->type->base_type == GLSL_TYPE_BOOL)
emit(CMP(result, result, fs_reg(0), BRW_CONDITIONAL_NZ));
}
} else {
emit_assignment_writes(l, r, ir->lhs->type, ir->condition != NULL);
}
} else {
emit_assignment_writes(l, r, ir->lhs->type, ir->condition != NULL);
if (shadow_c.file != BAD_FILE) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
if (shadow_c.file != BAD_FILE) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
} else if (ir->op == ir_tex) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
} else if (ir->op == ir_tex) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
}
/* the slots for u and v are always present, but r is optional */
mlen += MAX2(ir->coordinate->type->vector_elements, 2);
}
/* the slots for u and v are always present, but r is optional */
mlen += MAX2(ir->coordinate->type->vector_elements, 2);
*/
for (int i = 0; i < ir->lod_info.grad.dPdx->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), dPdx));
*/
for (int i = 0; i < ir->lod_info.grad.dPdx->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), dPdx));
}
mlen += MAX2(ir->lod_info.grad.dPdx->type->vector_elements, 2);
for (int i = 0; i < ir->lod_info.grad.dPdy->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), dPdy));
}
mlen += MAX2(ir->lod_info.grad.dPdx->type->vector_elements, 2);
for (int i = 0; i < ir->lod_info.grad.dPdy->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), dPdy));
}
mlen += MAX2(ir->lod_info.grad.dPdy->type->vector_elements, 2);
} else if (ir->op == ir_txs) {
}
mlen += MAX2(ir->lod_info.grad.dPdy->type->vector_elements, 2);
} else if (ir->op == ir_txs) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i * 2, coordinate.type),
coordinate));
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i * 2, coordinate.type),
coordinate));
if (simd16) {
for (int i = 0; i < 4; i++) {
emit(MOV(orig_dst, dst));
if (simd16) {
for (int i = 0; i < 4; i++) {
emit(MOV(orig_dst, dst));
for (int i = 0; i < vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
coordinate));
for (int i = 0; i < vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
coordinate));
*/
for (int i = 0; i < ir->lod_info.grad.dPdx->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
*/
for (int i = 0; i < ir->lod_info.grad.dPdx->type->vector_elements; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
*/
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(sources[length], coordinate));
*/
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(sources[length], coordinate));
length++;
/* For cube map array, the coordinate is (u,v,r,ai) but there are
length++;
/* For cube map array, the coordinate is (u,v,r,ai) but there are
*/
if (i < ir->lod_info.grad.dPdx->type->vector_elements) {
emit(MOV(sources[length], lod));
*/
if (i < ir->lod_info.grad.dPdx->type->vector_elements) {
emit(MOV(sources[length], lod));
case ir_txf:
/* Unfortunately, the parameters for LD are intermixed: u, lod, v, r. */
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
case ir_txf:
/* Unfortunately, the parameters for LD are intermixed: u, lod, v, r. */
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
for (int i = 1; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
for (int i = 1; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
*/
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
*/
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
for (int i = 0; i < 2; i++) { /* u, v */
emit(MOV(sources[length], coordinate));
for (int i = 0; i < 2; i++) { /* u, v */
emit(MOV(sources[length], coordinate));
length++;
}
for (int i = 0; i < 2; i++) { /* offu, offv */
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), offset_value));
length++;
}
for (int i = 0; i < 2; i++) { /* offu, offv */
emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), offset_value));
length++;
}
if (ir->coordinate->type->vector_elements == 3) { /* r if present */
emit(MOV(sources[length], coordinate));
length++;
}
if (ir->coordinate->type->vector_elements == 3) { /* r if present */
emit(MOV(sources[length], coordinate));
if (ir->coordinate && !coordinate_done) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(sources[length], coordinate));
if (ir->coordinate && !coordinate_done) {
for (int i = 0; i < ir->coordinate->type->vector_elements; i++) {
emit(MOV(sources[length], coordinate));
emit(MUL(dst, src, scale_y));
} else if (is_rect) {
/* On gen6+, the sampler handles the rectangle coordinates
emit(MUL(dst, src, scale_y));
} else if (is_rect) {
/* On gen6+, the sampler handles the rectangle coordinates
for (int i = 0; i < 2; i++) {
if (tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
for (int i = 0; i < 2; i++) {
if (tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
inst = emit(BRW_OPCODE_SEL, chan, chan, fs_reg(0.0f));
inst->conditional_mod = BRW_CONDITIONAL_G;
inst = emit(BRW_OPCODE_SEL, chan, chan, fs_reg(0.0f));
inst->conditional_mod = BRW_CONDITIONAL_G;
i < MIN2(ir->coordinate->type->vector_elements, 3); i++) {
if (tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
i < MIN2(ir->coordinate->type->vector_elements, 3); i++) {
if (tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
for (int i = 0; i < length; i++) {
sources[i] = fs_reg(this, glsl_type::float_type);
emit(MOV(retype(sources[i], BRW_REGISTER_TYPE_D), coordinate));
for (int i = 0; i < length; i++) {
sources[i] = fs_reg(this, glsl_type::float_type);
emit(MOV(retype(sources[i], BRW_REGISTER_TYPE_D), coordinate));
for (int i=0; i<4; i++) {
emit(MOV(res, fs_reg(swiz == SWIZZLE_ZERO ? 0.0f : 1.0f)));
for (int i=0; i<4; i++) {
emit(MOV(res, fs_reg(swiz == SWIZZLE_ZERO ? 0.0f : 1.0f)));
glsl_type const *type = ir->sampler->type;
if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE &&
type->sampler_array) {
glsl_type const *type = ir->sampler->type;
if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE &&
type->sampler_array) {
fs_reg fixed_depth = fs_reg(this, glsl_type::int_type);
emit_math(SHADER_OPCODE_INT_QUOTIENT, fixed_depth, depth, fs_reg(6));
fs_reg *fixed_payload = ralloc_array(mem_ctx, fs_reg, inst->regs_written);
fs_reg fixed_depth = fs_reg(this, glsl_type::int_type);
emit_math(SHADER_OPCODE_INT_QUOTIENT, fixed_depth, depth, fs_reg(6));
fs_reg *fixed_payload = ralloc_array(mem_ctx, fs_reg, inst->regs_written);
for (int i = 0; i < 4; i++) {
int swiz = GET_SWZ(tex->swizzles[sampler], i);
fs_reg l = swizzled_result;
for (int i = 0; i < 4; i++) {
int swiz = GET_SWZ(tex->swizzles[sampler], i);
fs_reg l = swizzled_result;
if (swiz == SWIZZLE_ZERO) {
emit(MOV(l, fs_reg(0.0f)));
} else if (swiz == SWIZZLE_ONE) {
emit(MOV(l, fs_reg(1.0f)));
} else {
if (swiz == SWIZZLE_ZERO) {
emit(MOV(l, fs_reg(0.0f)));
} else if (swiz == SWIZZLE_ONE) {
emit(MOV(l, fs_reg(1.0f)));
} else {
- fs_reg r = orig_val;
- r.reg_offset += GET_SWZ(tex->swizzles[sampler], i);
- emit(MOV(l, r));
+ emit(MOV(l, offset(orig_val,
+ GET_SWZ(tex->swizzles[sampler], i))));
- channel.reg_offset += swiz;
- emit(MOV(result, channel));
- result.reg_offset++;
+ emit(MOV(result, offset(channel, swiz)));
+ result = offset(result, 1);
dst_reg.type = src_reg.type;
for (unsigned j = 0; j < size; j++) {
emit(MOV(dst_reg, src_reg));
dst_reg.type = src_reg.type;
for (unsigned j = 0; j < size; j++) {
emit(MOV(dst_reg, src_reg));
dst_reg.type = src_reg.type;
for (unsigned j = 0; j < size; j++) {
emit(MOV(dst_reg, src_reg));
dst_reg.type = src_reg.type;
for (unsigned j = 0; j < size; j++) {
emit(MOV(dst_reg, src_reg));
this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC] =
fs_reg(this, glsl_type::vec2_type);
this->delta_y[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC] =
this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC] =
fs_reg(this, glsl_type::vec2_type);
this->delta_y[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC] =
} else {
this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC] =
fs_reg(this, glsl_type::float_type);
} else {
this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC] =
fs_reg(this, glsl_type::float_type);
/* f0.1 &= func(color, ref) */
cmp = emit(CMP(reg_null_f, color, fs_reg(key->alpha_test_ref),
/* f0.1 &= func(color, ref) */
cmp = emit(CMP(reg_null_f, color, fs_reg(key->alpha_test_ref),
"FB write src0");
for (int i = 0; i < 4; i++) {
fs_inst *inst = emit(MOV(fs_reg(MRF, color_mrf + i, src0.type), src0));
"FB write src0");
for (int i = 0; i < 4; i++) {
fs_inst *inst = emit(MOV(fs_reg(MRF, color_mrf + i, src0.type), src0));
for (int i = 0; i < 4; i++) {
fs_inst *inst = emit(MOV(fs_reg(MRF, color_mrf + 4 + i, src1.type),
src1));
for (int i = 0; i < 4; i++) {
fs_inst *inst = emit(MOV(fs_reg(MRF, color_mrf + 4 + i, src1.type),
src1));
inst = emit(MOV(fs_reg(MRF, write_color_mrf, color.type),
color));
inst = emit(MOV(fs_reg(MRF, write_color_mrf, color.type),
color));