struct brw_fragment_program {
struct gl_fragment_program program;
GLuint id; /**< serial no. to identify frag progs, never re-used */
+ GLboolean isGLSL; /**< really, any IF/LOOP/CONT/BREAK instructions */
};
#include "brw_context.h"
#include "brw_util.h"
+#include "brw_wm.h"
static void brwBindProgram( GLcontext *ctx,
GLenum target,
if (newFP == curFP)
brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
newFP->id = brw->program_id++;
+ newFP->isGLSL = brw_wm_is_glsl(fprog);
}
else if (target == GL_VERTEX_PROGRAM_ARB) {
struct brw_vertex_program *newVP = (struct brw_vertex_program *) prog;
brw_init_compile(brw, &c->func);
+ /* temporary sanity check assertion */
+ ASSERT(fp->isGLSL == brw_wm_is_glsl(&c->fp->program));
+
/*
* Shader which use GLSL features such as flow control are handled
* differently from "simple" shaders.
*/
- if (brw_wm_is_glsl(&c->fp->program)) {
+ if (fp->isGLSL) {
brw_wm_glsl_emit(brw, c);
}
else {
{
GLcontext *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;
memset(key, 0, sizeof(*key));
/* _NEW_COLOR */
key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled;
- key->is_glsl = brw_wm_is_glsl(fp);
+ key->is_glsl = bfp->isGLSL;
+
+ /* temporary sanity check assertion */
+ ASSERT(bfp->isGLSL == brw_wm_is_glsl(fp));
/* XXX: This needs a flag to indicate when it changes. */
key->stats_wm = intel->stats_wm;