glsl: fix max varyings count for ARB_enhanced_layouts

Since this extension allows more than one varying to share a single
location we can't just count the number of slots a varying takes and
add it to the total.

Instead we now reuse the reserved varyings bitfield to determine how
many slots are reserved for explicit locations instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Timothy Arceri
2016-06-09 13:43:23 +10:00
parent 0fb85ac08d
commit ad3def919e
3 changed files with 43 additions and 20 deletions

View File

@@ -320,16 +320,22 @@ assign_varying_locations(struct gl_context *ctx,
struct gl_shader_program *prog,
gl_shader *producer, gl_shader *consumer,
unsigned num_tfeedback_decls,
tfeedback_decl *tfeedback_decls);
tfeedback_decl *tfeedback_decls,
const uint64_t reserved_slots);
uint64_t
reserved_varying_slot(struct gl_shader *stage, ir_variable_mode io_mode);
bool
check_against_output_limit(struct gl_context *ctx,
struct gl_shader_program *prog,
gl_shader *producer);
gl_shader *producer,
unsigned num_explicit_locations);
bool
check_against_input_limit(struct gl_context *ctx,
struct gl_shader_program *prog,
gl_shader *consumer);
gl_shader *consumer,
unsigned num_explicit_locations);
#endif /* GLSL_LINK_VARYINGS_H */