OSDN Git Service

Fixed a uniform buffer regression
authorAlexis Hetu <sugoi@google.com>
Wed, 21 Sep 2016 13:11:44 +0000 (09:11 -0400)
committerAlexis Hétu <sugoi@google.com>
Wed, 21 Sep 2016 14:55:39 +0000 (14:55 +0000)
commit20c0f6566c16febaed4421dc4c00cad0a0d0902e
tree256141cb7f3fa637a94373b87f36088d4a185ad5
parent2d04d666e2ef47164bf1109dcf3680aa2fdfaaa4
Fixed a uniform buffer regression

The following cl had broken all fragment uniform buffers:
https://swiftshader-review.googlesource.com/6950

Since the null pointer check was only made on the vertex
uniform buffer, it was preventing the fragment uniform
buffer from being set, which was causing a crash when this
happened.

There was a second issue  with this cl, which was allowing
'uniformBuffers[-1].get()' to be called, which should not
have been allowed.

Also, it is safer to call VertexProcessor::setUniformBuffer
and PixelProcessor::setUniformBuffer unconditionally in order
to set the null pointers correctly when no buffers are set.

Change-Id: I275b0bca6173ee3df4e0e369926ed0a94500e1ba
Reviewed-on: https://swiftshader-review.googlesource.com/7216
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/libGLESv2/Program.cpp