Commit fe8b5989 by Jamie Madill Committed by Commit Bot

Program: Fixed unreferenced Samplers.

The calculation for unreferenced was incorrect - it checked the 'used' flag of the uniform location, but if samplers started at index zero, all the unused uniforms were to be considered valid samplers. Instead, initialize the uniform index to INVALID_INDEX. This bug was uncovered after doing work on the Texture dirty bits. BUG=angleproject:1387 Change-Id: I5e404e367caed38368bcc0e581699ae2c911bcc9 Reviewed-on: https://chromium-review.googlesource.com/655930Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e98e16ea
...@@ -266,7 +266,8 @@ void InfoLog::reset() ...@@ -266,7 +266,8 @@ void InfoLog::reset()
{ {
} }
VariableLocation::VariableLocation() : name(), element(0), index(0), used(false), ignored(false) VariableLocation::VariableLocation()
: name(), element(0), index(GL_INVALID_INDEX), used(false), ignored(false)
{ {
} }
......
...@@ -142,7 +142,9 @@ struct VariableLocation ...@@ -142,7 +142,9 @@ struct VariableLocation
unsigned int element; unsigned int element;
unsigned int index; unsigned int index;
// If this is a valid uniform location // If used is false, it means this location is only used to fill an empty space in an array,
// and there is no corresponding uniform variable for this location. It can also mean the
// uniform was optimized out by the implementation.
bool used; bool used;
// If this location was bound to an unreferenced uniform. Setting data on this uniform is a // If this location was bound to an unreferenced uniform. Setting data on this uniform is a
......
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