Commit f7f9e22f authored by Kenneth Graunke's avatar Kenneth Graunke

run: Mark shaders with only one stage as separable.

There are a couple cases where a single shader might happen:

- compute shaders
  (only one stage, no inputs and outputs; separable shouldn't matter)
- vertex shaders with transform feedback
  (we want to retain outputs, but transform feedback varyings are
   specified via the API, not the shader - setting SSO fixes this)
- old shader_test files captured before we started adding "SSO ENABLED".

In any case, it seems harmless or beneficial to enable SSO for all
.shader_test files containing a single shader.

Based on a patch by Marek.

v2: Ignore VP/FP shaders.
Acked-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
Acked-by: default avatarTimothy Arceri <timothy.arceri@collabora.com>
parent aa14141c
......@@ -633,6 +633,12 @@ main(int argc, char **argv)
}
ctx_is_core = type == TYPE_CORE;
/* If there's only one GLSL shader, mark it separable so
* inputs and outputs aren't eliminated.
*/
if (num_shaders == 1 && type != TYPE_VP && type != TYPE_FP)
use_separate_shader_objects = true;
if (use_separate_shader_objects) {
for (unsigned i = 0; i < num_shaders; i++) {
glCreateShaderProgramv(shader[i].type, 1, &shader[i].text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment