GLSL shadow() sampler calls are properly propogated down to the driver now.
The glean glsl1 shadow() tests work (except for the alpha channel).
GLuint writemask:4;
GLuint tex_unit:4; /* texture unit for TEX, TXD, TXP instructions */
GLuint tex_idx:3; /* TEXTURE_1D,2D,3D,CUBE,RECT_INDEX source target */
+ GLuint tex_shadow:1; /* do shadow comparison? */
GLuint eot:1; /* End of thread indicator for FB_WRITE*/
GLuint target:10; /* target binding table index for FB_WRITE*/
};
{
struct brw_compile *p = &c->func;
GLuint msgLength, responseLength;
- GLboolean shadow = (c->key.shadowtex_mask & (1<<inst->tex_unit)) ? 1 : 0;
GLuint i, nr;
GLuint emit;
break;
}
- if (shadow) {
+ if (inst->tex_shadow) {
nr = 4;
emit |= WRITEMASK_W;
}
inst->tex_unit + MAX_DRAW_BUFFERS, /* surface */
inst->tex_unit, /* sampler */
inst->writemask,
- (shadow ?
+ (inst->tex_shadow ?
BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE :
BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE),
responseLength,
GLuint saturate,
GLuint tex_src_unit,
GLuint tex_src_target,
+ GLuint tex_shadow,
struct prog_src_register src0,
struct prog_src_register src1,
struct prog_src_register src2 )
inst->SaturateMode = saturate;
inst->TexSrcUnit = tex_src_unit;
inst->TexSrcTarget = tex_src_target;
+ inst->TexShadow = tex_shadow;
inst->SrcReg[0] = src0;
inst->SrcReg[1] = src1;
inst->SrcReg[2] = src2;
struct prog_src_register src2 )
{
return emit_tex_op(c, op, dest, saturate,
- 0, 0, /* tex unit, target */
+ 0, 0, 0, /* tex unit, target, shadow */
src0, src1, src2);
}
inst->SaturateMode,
unit,
inst->TexSrcTarget,
+ inst->TexShadow,
coord,
src_undef(),
src_undef());
inst->SaturateMode,
unit,
inst->TexSrcTarget,
+ inst->TexShadow,
coord,
src_undef(),
src_undef());
out->saturate = (inst->SaturateMode != SATURATE_OFF);
out->tex_unit = inst->TexSrcUnit;
out->tex_idx = inst->TexSrcTarget;
+ out->tex_shadow = inst->TexShadow;
out->eot = inst->Sampler & 1;
out->target = inst->Sampler>>1;
break;
case OPCODE_TEX:
+ case OPCODE_TXP:
read0 = get_texcoord_mask(inst->tex_idx);
- if (c->key.shadowtex_mask & (1<<inst->tex_unit))
+ if (inst->tex_shadow)
read0 |= WRITEMASK_Z;
break;
break;
case OPCODE_DST:
- case OPCODE_TXP:
default:
break;
}