summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2010-12-14 13:02:47 +0000
committerNeil Roberts <neil@linux.intel.com>2010-12-14 13:12:28 +0000
commit885942aec08a85a19ed3bb372d44e8d77c407b33 (patch)
tree961c9a52cd55d3bbcdc3ff0782711c240c0829fd
parent9aea72fab5a0b030c320dbc2efd905764b9af3ce (diff)
downloadcogl-885942aec08a85a19ed3bb372d44e8d77c407b33.tar.gz
cogl-pipeline-fragend-arbfp: Generate ARBfp if user vertex shader
The ARBfp fragend was bypassing generating a shader if the pipeline contains a user program. However it shouldn't do this if the pipeline only contains a vertex shader. This was breaking test-cogl-just-vertex-shader.
-rw-r--r--cogl/cogl-pipeline-fragend-arbfp.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/cogl/cogl-pipeline-fragend-arbfp.c b/cogl/cogl-pipeline-fragend-arbfp.c
index ff784166..976f3173 100644
--- a/cogl/cogl-pipeline-fragend-arbfp.c
+++ b/cogl/cogl-pipeline-fragend-arbfp.c
@@ -200,10 +200,19 @@ _cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline,
return FALSE;
user_program = cogl_pipeline_get_user_program (pipeline);
- if (user_program != COGL_INVALID_HANDLE &&
- _cogl_program_has_fragment_shader (user_program) &&
- _cogl_program_get_language (user_program) != COGL_SHADER_LANGUAGE_ARBFP)
- return FALSE;
+ if (user_program != COGL_INVALID_HANDLE)
+ {
+ /* If the program doesn't have a fragment shader then some other
+ vertend will handle the vertex shader state and we still need
+ to generate a fragment program */
+ if (!_cogl_program_has_fragment_shader (user_program))
+ user_program = COGL_INVALID_HANDLE;
+ /* If the user program does have a fragment shader then we can
+ only handle it if it's in ARBfp */
+ else if (_cogl_program_get_language (user_program) !=
+ COGL_SHADER_LANGUAGE_ARBFP)
+ return FALSE;
+ }
/* Now lookup our ARBfp backend private state (allocating if
* necessary) */