Created attachment 121154 [details] Fragment shader to reproduce bug glGetActiveAtomicCounterBufferiv returns strange values for every <pname> I tested so far. Using the attached fragment shader, I get the following outputs (The atomic counter buffers have the ids 0 and 1, queried with glGetProgramiv): glGetActiveAtomicCounterBufferiv(program, 0, GL_ATOMIC_COUNTER_BUFFER_BINDING, &binding) -> binding is 1 (should be 0) glGetActiveAtomicCounterBufferiv(program, 1, GL_ATOMIC_COUNTER_BUFFER_BINDING, &binding) -> binding is 1 (correct) glGetActiveAtomicCounterBufferiv(program, 0, GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE, &size) -> size is 1 (correct I think) glGetActiveAtomicCounterBufferiv(program, 1, GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE, &size) -> size is 4294967297 (obviously not correct, should be 1) glGetActiveAtomicCounterBufferiv(program, 0, ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS, &no_uniforms) -> no_uniforms is 1 (correct) glGetActiveAtomicCounterBufferiv(program, 1, ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS, &no_uniforms) -> no_uniforms is 4294967297 (obviously not correct, should be 1) I'm using latest git mesa, dmesg does not output anything.
This was broken by the following commit: commit 34df5ebd778fd3027db0f380eab71a95cfa298c0 Author: Tapani Pälli <tapani.palli@intel.com> Date: Thu Mar 12 07:58:48 2015 +0200 mesa: mesa_bufferiv utility function for buffer objects Patch adds new function 'mesa_bufferiv' and refactors existing GetActiveUniformBlockiv and GetActiveAtomicCounterBufferiv to use it. corresponding Piglit tests: arb_uniform_buffer_object* arb_shader_atomic_counters* (Many tests hit the corresponding queries.) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Would it be possible to attach the test application? > (The atomic counter buffers have the ids 0 and 1, queried with glGetProgramiv) Can you paste how do you query the indices of the counters?
(In reply to Tapani Pälli from comment #2) > Would it be possible to attach the test application? > > > (The atomic counter buffers have the ids 0 and 1, queried with glGetProgramiv) > > Can you paste how do you query the indices of the counters? Forget about this question, I see now that you only query properties of buffers, not the counters. I'd still like the testapp as we have quite extensive one already in Piglit (arb_shader_atomic_counters-active-counters) that makes these same calls and has several buffers in use, this test is currently passing fine. My guess is that there is some particular difference between these your app and Piglit one which could be used to debug this.
I made a small app that compiles your shader and makes the same queries as in comment 1, test results for queries are following: binding 0: 0 binding 1: 1 data size 0 : 4 data size 1: 4 counters 0: 1 counters 1: 1 I'm changing status to NEEDINFO based on this.
Hmm, seems I didn't read the code properly when I pointed out what I thought was the offending commit. On second look it does look like it *should* work.
Created attachment 121167 [details] [review] piglit test Attaching here a patch to Piglit that exercises these queries. Nicolas, please also attach information about your system. I'm testing this on HSW myself.
Hey guys, thanks for the replies. I just triple checked my program and figured out I made a really big mistake somewhere else in the program (basically, the results of the openGL output where overwritten). Turns out glGetActiveAtomicCounterBufferiv is working as intended and this bug can be closed. Sorry for the inconvenience this caused.
No problem, good to hear that you found the issue.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.