diff mbox

arb_shader_atomic_counters: add error output if uniform not found

Message ID 1443919926-16815-1-git-send-email-t_arceri@yahoo.com.au
State New
Headers show

Commit Message

'Timothy Arceri' via Patchwork Forward Oct. 4, 2015, 12:52 a.m. UTC
Cc: Francisco Jerez <currojerez@riseup.net>
---
 For some reason the lookup of this uniform is the only test that is failing
 with my intra-stage atomic index Mesa patches. I haven't looked into why yet
 but this will help debugging any problems in future.

 tests/spec/arb_shader_atomic_counters/array-indexing.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Francisco Jerez Oct. 4, 2015, 11:40 a.m. UTC | #1
Timothy Arceri <t_arceri@yahoo.com.au> writes:

> Cc: Francisco Jerez <currojerez@riseup.net>
> ---
>  For some reason the lookup of this uniform is the only test that is failing
>  with my intra-stage atomic index Mesa patches. I haven't looked into why yet
>  but this will help debugging any problems in future.
>
>  tests/spec/arb_shader_atomic_counters/array-indexing.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/arb_shader_atomic_counters/array-indexing.c b/tests/spec/arb_shader_atomic_counters/array-indexing.c
> index 030ab58..354a432 100644
> --- a/tests/spec/arb_shader_atomic_counters/array-indexing.c
> +++ b/tests/spec/arb_shader_atomic_counters/array-indexing.c
> @@ -19,7 +19,7 @@
>   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>   * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
>   * IN THE SOFTWARE.
> - */
> + /
>  
>  /** @file array-indexing.c
>   *
> @@ -48,8 +48,11 @@ set_uniform_int(GLuint prog, const char *name, int value)
>          glUseProgram(prog);
>  
>          loc = glGetUniformLocation(prog, name);
> -        if (loc < 0)
> +        if (loc < 0) {
> +                fprintf(stderr, "Failed to get location for uniform '%s'.\n",
> +                name);

The indentation here looks odd, can you align the 'name' argument to the
first argument on the previous line?  With that fixed:

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

>                  return false;
> +        }
>  
>          glUniform1i(loc, value);
>  
> -- 
> 2.4.3
diff mbox

Patch

diff --git a/tests/spec/arb_shader_atomic_counters/array-indexing.c b/tests/spec/arb_shader_atomic_counters/array-indexing.c
index 030ab58..354a432 100644
--- a/tests/spec/arb_shader_atomic_counters/array-indexing.c
+++ b/tests/spec/arb_shader_atomic_counters/array-indexing.c
@@ -19,7 +19,7 @@ 
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
- */
+ /
 
 /** @file array-indexing.c
  *
@@ -48,8 +48,11 @@  set_uniform_int(GLuint prog, const char *name, int value)
         glUseProgram(prog);
 
         loc = glGetUniformLocation(prog, name);
-        if (loc < 0)
+        if (loc < 0) {
+                fprintf(stderr, "Failed to get location for uniform '%s'.\n",
+                name);
                 return false;
+        }
 
         glUniform1i(loc, value);