[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2017-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

Timothy Arceri  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #19 from Timothy Arceri  ---
The error should now be flagged as of:

commit d682f8aa8e0edd166166f87fcd774dd2d57b4180
Author: Timothy Arceri 
Date:   Fri Apr 21 17:04:10 2017 +1000

mesa: validate sampler type across the whole program

Currently we were only making sure types were the same within a
single stage. This looks to have regressed with 953a0af8e3f73.

Fixes: 953a0af8e3f73 ("mesa: validate sampler uniforms during gluniform
calls")

Reviewed-by: Nicolai Hähnle 
Reviewed-by: Tapani Pälli 
https://bugs.freedesktop.org/show_bug.cgi?id=97524

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2017-04-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #18 from Timothy Arceri  ---
Fix tested and sent to list:

https://patchwork.freedesktop.org/patch/150080/

New piglit test:

https://patchwork.freedesktop.org/patch/150079/

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-12-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #17 from Timothy Arceri  ---
Created attachment 128306
  --> https://bugs.freedesktop.org/attachment.cgi?id=128306&action=edit
Validate sampler types across the whole program

It's untested but this patch should do the trick.

Note it applies on top of my recent refactors to sampler in this series:
https://patchwork.freedesktop.org/series/15613/ so it doesn't apply cleanly to
master.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-11-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #16 from Marek Olšák  ---
Workaround for radeonsi:

CI-VI:
If the resource type and instruction mismatch (e.g. a buffer constant with an
image instruction, or an image resource with a buffer instruction), the
instruction will be ignored (reads return nothing and writes do not alter
memory).
Solution: Move the buffer descriptor to dwords [0:3] or [8:11] of the sampler
slot (the image or fmask portion, respectively).
Note that on Southern Islands, this condition causes a hang.

SI:
Move the buffer descriptor to dwords [8:11] of the sampler slot. This will only
cause a hang when a buffer is used as sampler2DMS* and vice versa, because
dwords[8:11] are unused by other texture types.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-10-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #15 from Timothy Arceri  ---
(In reply to Nicolai Hähnle from comment #10)
> I can reproduce this now. It really seems like this should be fixed in Mesa
> main, though: there is already code that checks for this condition when it
> affects a single program stage (in _mesa_update_shader_textures_used) and
> when it affects a SSO pipeline (in
> _mesa_sampler_uniforms_pipeline_are_valid). This code needs to be hooked
> into the non-SSO case as well.

It looks like its hooked up ok the _mesa_update_shader_textures_used() function
just doesn't do what it should.

It needs to be looping over the other stages attached to the gl_shader_program
each time it is called and setting SamplersValidated accordingly.

In its current form we could fail to throw an error when two shaders have a
different types at the same texture unit as in the attached program and I
believe also when the Vertex shader has two conflicting types but the fragment
shader is ok, since the SamplersValidated flag will be overwritten before we
check it.

We obviously need some more piglit tests for this. Looking at the history this
may have regressed somewhat with 953a0af8e3f73

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-10-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #14 from Matias N. Goldberg  ---
Dang it! You're right.

I forgot GL allows (requires?) changing sampler values after the shader is
compiled.

As for glValidateProgram, our actual software (not this sample) would often
warn about sampler collisions due to a bug in our code where all the samplers
would initially be set to 0, but we later correct it and thus still works fine
afterwards.

https://www.khronos.org/opengles/sdk/docs/man/xhtml/glValidateProgram.xml

I know the docs isn't the spec, but this is relevant nonetheless:
"The error GL_INVALID_OPERATION will be generated by glDrawArrays or
glDrawElements if any two active samplers in the current program object are of
different types, but refer to the same texture image unit."

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-10-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #13 from Roland Scheidegger  ---
(In reply to Matias N. Goldberg from comment #12)
> I believe the error should happen in either glLinkProgram or glUseProgram,
> and then every time glDraw* is called.
This is impossible, since the values of the (sampler) uniforms are not part of
the state which can be considered with these steps (you link/use and then set
the sampler uniforms).

> If I recall correctly AMD's Windows driver raised the error every time
> glDrawArrays was called; but I don't remember what was raised during
> glLink/UseProgram (if anything was raised at all).
Sounds correct, glValidateProgram validates if the program would be valid to
execute with all current gl state - essentially the same as what should be
validated at draw time (the docs on glValidateProgram even mention sampler
mismatch specifically). I'm not sure if draw calls actually need to return an
error too (but possibly yes).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-10-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #12 from Matias N. Goldberg  ---
I believe the error should happen in either glLinkProgram or glUseProgram, and
then every time glDraw* is called.

If I recall correctly AMD's Windows driver raised the error every time
glDrawArrays was called; but I don't remember what was raised during
glLink/UseProgram (if anything was raised at all).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-10-24 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

--- Comment #11 from Tapani Pälli  ---
> All other GPU drivers I tested with handle this gracefully by raising a
> GL_INVALID_OPERATION error and continuing rendering the rest normally.

For which command in the sample program should GL_INVALID_OPERATION happen? I
remember the check for sampler conflict is done for glValidateProgram but TBH
I'm not quite sure where this error should happen in the supplied case.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97524] Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION

2016-10-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97524

Nicolai Hähnle  changed:

   What|Removed |Added

Summary|Invalid sampler settings|Samplers referring to the
   |cause full GPU reset|same texture unit with
   ||different types should
   ||raise GL_INVALID_OPERATION

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev