static void
wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key)
{
- GLcontext *ctx = &brw->intel.ctx;
+ struct gl_context *ctx = &brw->intel.ctx;
const struct gl_fragment_program *fp = brw->fragment_program;
const struct brw_fragment_program *bfp = (struct brw_fragment_program *) fp;
struct intel_context *intel = &brw->intel;
key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled;
key->is_glsl = bfp->isGLSL;
- /* temporary sanity check assertion */
- ASSERT(bfp->isGLSL == brw_wm_is_glsl(fp));
+ /* If using the fragment shader backend, the program is always
+ * 8-wide.
+ */
+ if (ctx->Shader.CurrentProgram) {
+ struct brw_shader *shader = (struct brw_shader *)
+ ctx->Shader.CurrentProgram->_LinkedShaders[MESA_SHADER_FRAGMENT];
+
+ if (shader != NULL && shader->ir != NULL) {
+ key->is_glsl = GL_TRUE;
+ }
+ }
/* _NEW_DEPTH */
key->stats_wm = intel->stats_wm;
drm_intel_bo_emit_reloc(bo, offsetof(struct brw_wm_unit_state, thread2),
brw->wm.scratch_bo,
wm.thread2.per_thread_scratch_space,
- 0, 0);
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER);
}
/* Emit sampler state relocation */