r300: implement proper IsProgramNative check for vertex programs
This commit is contained in:
@@ -673,7 +673,6 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
|
||||
__DRIcontextPrivate * driContextPriv,
|
||||
void *sharedContextPrivate);
|
||||
|
||||
extern void r300SelectVertexShader(r300ContextPtr r300);
|
||||
extern void r300InitShaderFuncs(struct dd_function_table *functions);
|
||||
|
||||
extern void r300InitShaderFunctions(r300ContextPtr r300);
|
||||
|
||||
@@ -128,8 +128,13 @@ r300IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog)
|
||||
r300TranslateFragmentShader(ctx, fp);
|
||||
|
||||
return !fp->error;
|
||||
} else
|
||||
return GL_TRUE;
|
||||
} else {
|
||||
struct r300_vertex_program *vp = r300SelectVertexShader(ctx);
|
||||
if (!vp->translated)
|
||||
r300TranslateVertexShader(vp);
|
||||
|
||||
return !vp->error;
|
||||
}
|
||||
}
|
||||
|
||||
void r300InitShaderFuncs(struct dd_function_table *functions)
|
||||
|
||||
@@ -2045,6 +2045,7 @@ void r300UpdateShaders(r300ContextPtr rmesa)
|
||||
}
|
||||
|
||||
if (rmesa->radeon.NewGLState && rmesa->options.hw_tcl_enabled) {
|
||||
struct r300_vertex_program *vp;
|
||||
int i;
|
||||
for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
|
||||
rmesa->temp_attrib[i] =
|
||||
@@ -2060,8 +2061,11 @@ void r300UpdateShaders(r300ContextPtr rmesa)
|
||||
rmesa->temp_attrib[i];
|
||||
}
|
||||
|
||||
r300SelectVertexShader(rmesa);
|
||||
r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, rmesa->selected_vp->error);
|
||||
vp = r300SelectVertexShader(ctx);
|
||||
if (!vp->translated)
|
||||
r300TranslateVertexShader(vp);
|
||||
|
||||
r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, vp->error);
|
||||
}
|
||||
|
||||
fp = r300SelectFragmentShader(ctx);
|
||||
|
||||
@@ -1027,7 +1027,7 @@ static void t_inputs_outputs(struct r300_vertex_program *vp)
|
||||
}
|
||||
}
|
||||
|
||||
static void r300TranslateVertexShader(struct r300_vertex_program *vp)
|
||||
void r300TranslateVertexShader(struct r300_vertex_program *vp)
|
||||
{
|
||||
struct prog_instruction *vpi = vp->Base->Base.Instructions;
|
||||
int i;
|
||||
@@ -1524,7 +1524,6 @@ static struct r300_vertex_program *build_program(GLcontext *ctx,
|
||||
|
||||
assert(prog->NumInstructions);
|
||||
vp->num_temporaries = prog->NumTemporaries;
|
||||
r300TranslateVertexShader(vp);
|
||||
|
||||
return vp;
|
||||
}
|
||||
@@ -1538,9 +1537,9 @@ static void add_outputs(struct r300_vertex_program_key *key, GLint vert)
|
||||
key->OutputsAdded |= 1 << vert;
|
||||
}
|
||||
|
||||
void r300SelectVertexShader(r300ContextPtr r300)
|
||||
struct r300_vertex_program * r300SelectVertexShader(GLcontext *ctx)
|
||||
{
|
||||
GLcontext *ctx = ctx = r300->radeon.glCtx;
|
||||
r300ContextPtr r300 = R300_CONTEXT(ctx);
|
||||
GLuint InputsRead;
|
||||
struct r300_vertex_program_key wanted_key = { 0 };
|
||||
GLint i;
|
||||
@@ -1596,14 +1595,14 @@ void r300SelectVertexShader(r300ContextPtr r300)
|
||||
for (vp = vpc->progs; vp; vp = vp->next)
|
||||
if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key))
|
||||
== 0) {
|
||||
r300->selected_vp = vp;
|
||||
return;
|
||||
return r300->selected_vp = vp;
|
||||
}
|
||||
|
||||
vp = build_program(ctx, &wanted_key, &vpc->mesa_program, wpos_idx);
|
||||
vp->next = vpc->progs;
|
||||
vpc->progs = vp;
|
||||
r300->selected_vp = vp;
|
||||
|
||||
return r300->selected_vp = vp;
|
||||
}
|
||||
|
||||
#define bump_vpu_count(ptr, new_count) do { \
|
||||
|
||||
@@ -34,4 +34,8 @@
|
||||
|
||||
void r300SetupVertexProgram(r300ContextPtr rmesa);
|
||||
|
||||
struct r300_vertex_program * r300SelectVertexShader(GLcontext *ctx);
|
||||
|
||||
void r300TranslateVertexShader(struct r300_vertex_program *vp);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user