mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 13:40:16 +01:00
linker: Refactor parameters to cross_validate_uniforms
This commit is contained in:
parent
f36460e1a7
commit
ed1fe3db3b
1 changed files with 4 additions and 6 deletions
10
linker.cpp
10
linker.cpp
|
|
@ -250,15 +250,14 @@ validate_fragment_shader_executable(struct glsl_program *prog,
|
||||||
* Perform validation of uniforms used across multiple shader stages
|
* Perform validation of uniforms used across multiple shader stages
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
cross_validate_uniforms(struct glsl_program *prog,
|
cross_validate_uniforms(struct glsl_program *prog)
|
||||||
struct glsl_shader **shaders, unsigned num_shaders)
|
|
||||||
{
|
{
|
||||||
/* Examine all of the uniforms in all of the shaders and cross validate
|
/* Examine all of the uniforms in all of the shaders and cross validate
|
||||||
* them.
|
* them.
|
||||||
*/
|
*/
|
||||||
glsl_symbol_table uniforms;
|
glsl_symbol_table uniforms;
|
||||||
for (unsigned i = 0; i < num_shaders; i++) {
|
for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) {
|
||||||
foreach_list(node, &shaders[i]->ir) {
|
foreach_list(node, &prog->_LinkedShaders[i]->ir) {
|
||||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
||||||
|
|
||||||
if ((var == NULL) || (var->mode != ir_var_uniform))
|
if ((var == NULL) || (var->mode != ir_var_uniform))
|
||||||
|
|
@ -829,8 +828,7 @@ link_shaders(struct glsl_program *prog)
|
||||||
prog->_NumLinkedShaders++;
|
prog->_NumLinkedShaders++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cross_validate_uniforms(prog, prog->_LinkedShaders,
|
if (cross_validate_uniforms(prog)) {
|
||||||
prog->_NumLinkedShaders)) {
|
|
||||||
/* Validate the inputs of each stage with the output of the preceeding
|
/* Validate the inputs of each stage with the output of the preceeding
|
||||||
* stage.
|
* stage.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue