Fix attempt for intel mesa
This commit is contained in:
parent
42db6d2bba
commit
84235b6491
@ -529,12 +529,12 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h) :
|
|||||||
assert(result == GL_FRAMEBUFFER_COMPLETE_EXT);
|
assert(result == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w, size_t h) :
|
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w, size_t h, bool layered) :
|
||||||
DepthTexture(DS), RenderTargets(RTTs), width(w), height(h)
|
DepthTexture(DS), RenderTargets(RTTs), width(w), height(h)
|
||||||
{
|
{
|
||||||
glGenFramebuffers(1, &fbo);
|
glGenFramebuffers(1, &fbo);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||||
if (irr_driver->getGLSLVersion() >= 330)
|
if (layered)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < RTTs.size(); i++)
|
for (unsigned i = 0; i < RTTs.size(); i++)
|
||||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, RTTs[i], 0);
|
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, RTTs[i], 0);
|
||||||
|
@ -191,7 +191,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
FrameBuffer();
|
FrameBuffer();
|
||||||
FrameBuffer(const std::vector <GLuint> &RTTs, size_t w, size_t h);
|
FrameBuffer(const std::vector <GLuint> &RTTs, size_t w, size_t h);
|
||||||
FrameBuffer(const std::vector <GLuint> &RTTs, GLuint DS, size_t w, size_t h);
|
FrameBuffer(const std::vector <GLuint> &RTTs, GLuint DS, size_t w, size_t h, bool layered = false);
|
||||||
~FrameBuffer();
|
~FrameBuffer();
|
||||||
void Bind();
|
void Bind();
|
||||||
std::vector<GLuint> &getRTT() { return RenderTargets; }
|
std::vector<GLuint> &getRTT() { return RenderTargets; }
|
||||||
|
@ -197,7 +197,7 @@ RTT::RTT(size_t width, size_t height)
|
|||||||
|
|
||||||
somevector.clear();
|
somevector.clear();
|
||||||
somevector.push_back(shadowColorTex);
|
somevector.push_back(shadowColorTex);
|
||||||
shadowFBO = new FrameBuffer(somevector, shadowDepthTex, 1024, 1024);
|
shadowFBO = new FrameBuffer(somevector, shadowDepthTex, 1024, 1024, true);
|
||||||
}
|
}
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user