ES prohibits this, but GL appears to allow it. We at least need this
much, or else we'll crash as there's no source to read from.
This fixed crashes in the ES tests before I realized I needed to
prohibit stencil instead.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
if (_mesa_get_format_bits(texFormat, GL_DEPTH_BITS) > 0) {
/* reading from depth/stencil buffer */
return ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- }
- else {
+ } else if (_mesa_get_format_bits(texFormat, GL_STENCIL_BITS) > 0) {
+ return ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ } else {
/* copying from color buffer */
return ctx->ReadBuffer->_ColorReadBuffer;
}