Lines Matching refs:gl

96 	const glw::Functions&	gl					= m_context.getRenderContext().getFunctions();  in init()  local
113 gl.getInternalformativ(GL_TEXTURE_2D_MULTISAMPLE, GL_RGBA8, GL_SAMPLES, 1, &maxTextureSamples); in init()
123 gl.getInternalformativ(GL_RENDERBUFFER, GL_RGBA8, GL_SAMPLES, 1, &maxRboSamples); in init()
137 gl.genBuffers(1, &m_buffer); in init()
138 GLU_EXPECT_NO_ERROR(gl.getError(), "gen buf"); in init()
141 GLU_EXPECT_NO_ERROR(gl.getError(), "setup data"); in init()
143 gl.genVertexArrays(1, &m_renderVao); in init()
144 GLU_EXPECT_NO_ERROR(gl.getError(), "gen vao"); in init()
156 gl.genBuffers(1, &m_resolveBuffer); in init()
157 gl.bindBuffer(GL_ARRAY_BUFFER, m_resolveBuffer); in init()
158 gl.bufferData(GL_ARRAY_BUFFER, (int)sizeof(fullscreenQuad), fullscreenQuad, GL_STATIC_DRAW); in init()
159 GLU_EXPECT_NO_ERROR(gl.getError(), "setup data"); in init()
169 gl.genVertexArrays(1, &m_resolveVao); in init()
170 GLU_EXPECT_NO_ERROR(gl.getError(), "gen vao"); in init()
172 gl.genTextures(1, &m_fboTexture); in init()
173 gl.bindTexture(textureTarget, m_fboTexture); in init()
176 gl.texStorage2D(textureTarget, 1, GL_RGBA8, m_renderSize, m_renderSize); in init()
177 gl.texParameteri(textureTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in init()
178 gl.texParameteri(textureTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in init()
181gl.texStorage2DMultisample(textureTarget, m_numRequestedSamples, GL_RGBA8, m_renderSize, m_renderS… in init()
182 GLU_EXPECT_NO_ERROR(gl.getError(), "gen tex"); in init()
184 gl.genFramebuffers(1, &m_fbo); in init()
185 gl.bindFramebuffer(GL_FRAMEBUFFER, m_fbo); in init()
186 gl.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureTarget, m_fboTexture, 0); in init()
187 GLU_EXPECT_NO_ERROR(gl.getError(), "gen fbo"); in init()
189 if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) in init()
195 gl.getTexLevelParameteriv(GL_TEXTURE_2D_MULTISAMPLE, 0, GL_TEXTURE_SAMPLES, &queriedSampleCount); in init()
215 gl.genRenderbuffers(1, &m_fboRbo); in init()
216 gl.bindRenderbuffer(GL_RENDERBUFFER, m_fboRbo); in init()
217gl.renderbufferStorageMultisample(GL_RENDERBUFFER, m_numRequestedSamples, GL_RGBA8, m_renderSize, … in init()
218 GLU_EXPECT_NO_ERROR(gl.getError(), "gen rbo"); in init()
220 gl.genFramebuffers(1, &m_fbo); in init()
221 gl.bindFramebuffer(GL_FRAMEBUFFER, m_fbo); in init()
222 gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_fboRbo); in init()
223 GLU_EXPECT_NO_ERROR(gl.getError(), "gen fbo"); in init()
225 if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) in init()
229 gl.getRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &queriedSampleCount); in init()
240 gl.genTextures(1, &m_resolveFboTexture); in init()
241 gl.bindTexture(GL_TEXTURE_2D, m_resolveFboTexture); in init()
242 gl.texStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, m_renderSize, m_renderSize); in init()
243 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in init()
244 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in init()
245 GLU_EXPECT_NO_ERROR(gl.getError(), "gen tex"); in init()
247 gl.genFramebuffers(1, &m_resolveFbo); in init()
248 gl.bindFramebuffer(GL_FRAMEBUFFER, m_resolveFbo); in init()
249gl.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_resolveFboTexture, … in init()
250 GLU_EXPECT_NO_ERROR(gl.getError(), "gen fbo"); in init()
252 if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) in init()
443 const glw::Functions& gl = m_context.getRenderContext().getFunctions(); in drawOneIteration() local
464 gl.bindFramebuffer(GL_FRAMEBUFFER, m_fbo); in drawOneIteration()
465 GLU_EXPECT_NO_ERROR(gl.getError(), "bind fbo"); in drawOneIteration()
472 gl.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in drawOneIteration()
473 gl.clear(GL_COLOR_BUFFER_BIT); in drawOneIteration()
474 gl.viewport(0, 0, m_renderSize, m_renderSize); in drawOneIteration()
475 GLU_EXPECT_NO_ERROR(gl.getError(), "clear"); in drawOneIteration()
477 gl.bindVertexArray(m_renderVao); in drawOneIteration()
478 gl.bindBuffer(GL_ARRAY_BUFFER, m_buffer); in drawOneIteration()
484 const deInt32 location = gl.getAttribLocation(m_program->getProgram(), it->first.c_str()); in drawOneIteration()
488gl.vertexAttribPointer(location, 4, GL_FLOAT, GL_FALSE, it->second.stride, (deUint8*)DE_NULL + it-… in drawOneIteration()
489 gl.enableVertexAttribArray(location); in drawOneIteration()
492 GLU_EXPECT_NO_ERROR(gl.getError(), "set attrib"); in drawOneIteration()
494 gl.useProgram(m_program->getProgram()); in drawOneIteration()
496 gl.drawArrays(m_renderMode, 0, m_renderCount); in drawOneIteration()
498 gl.useProgram(0); in drawOneIteration()
499 gl.bindVertexArray(0); in drawOneIteration()
500 GLU_EXPECT_NO_ERROR(gl.getError(), "draw"); in drawOneIteration()
503 gl.bindFramebuffer(GL_FRAMEBUFFER, 0); in drawOneIteration()
516 GLU_EXPECT_NO_ERROR(gl.getError(), "read pixels"); in drawOneIteration()
529 gl.bindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo); in drawOneIteration()
530 gl.bindFramebuffer(GL_DRAW_FRAMEBUFFER, m_resolveFbo); in drawOneIteration()
531gl.blitFramebuffer(0, 0, m_renderSize, m_renderSize, 0, 0, m_renderSize, m_renderSize, GL_COLOR_BU… in drawOneIteration()
532 GLU_EXPECT_NO_ERROR(gl.getError(), "blit resolve"); in drawOneIteration()
536 gl.bindFramebuffer(GL_READ_FRAMEBUFFER, m_resolveFbo); in drawOneIteration()
538 GLU_EXPECT_NO_ERROR(gl.getError(), "read pixels"); in drawOneIteration()
540 gl.bindFramebuffer(GL_FRAMEBUFFER, 0); in drawOneIteration()
547 …const deInt32 posLocation = gl.getAttribLocation(m_textureSamplerProgram->getProgram(), "a_positi… in drawOneIteration()
548 …const deInt32 samplerLocation = gl.getUniformLocation(m_textureSamplerProgram->getProgram(), "u_sa… in drawOneIteration()
561 gl.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in drawOneIteration()
562 gl.clear(GL_COLOR_BUFFER_BIT); in drawOneIteration()
563 gl.viewport(0, 0, m_renderSize, m_renderSize); in drawOneIteration()
564 GLU_EXPECT_NO_ERROR(gl.getError(), "clear"); in drawOneIteration()
566 gl.bindVertexArray(m_resolveVao); in drawOneIteration()
567 gl.bindBuffer(GL_ARRAY_BUFFER, m_resolveBuffer); in drawOneIteration()
568 gl.vertexAttribPointer(posLocation, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL); in drawOneIteration()
569 gl.enableVertexAttribArray(posLocation); in drawOneIteration()
570 GLU_EXPECT_NO_ERROR(gl.getError(), "set attrib"); in drawOneIteration()
572 gl.activeTexture(GL_TEXTURE0); in drawOneIteration()
573 gl.bindTexture(textureTarget, m_fboTexture); in drawOneIteration()
574 GLU_EXPECT_NO_ERROR(gl.getError(), "bind tex"); in drawOneIteration()
576 gl.useProgram(m_textureSamplerProgram->getProgram()); in drawOneIteration()
577 gl.uniform1i(samplerLocation, 0); in drawOneIteration()
579 gl.bindFramebuffer(GL_FRAMEBUFFER, m_resolveFbo); in drawOneIteration()
580 gl.drawArrays(GL_TRIANGLE_STRIP, 0, 4); in drawOneIteration()
582 gl.useProgram(0); in drawOneIteration()
583 gl.bindVertexArray(0); in drawOneIteration()
584 GLU_EXPECT_NO_ERROR(gl.getError(), "draw"); in drawOneIteration()
589 GLU_EXPECT_NO_ERROR(gl.getError(), "read pixels"); in drawOneIteration()
591 gl.bindFramebuffer(GL_FRAMEBUFFER, 0); in drawOneIteration()
598 …const deInt32 posLocation = gl.getAttribLocation(m_textureSamplerProgram->getProgram(), "a_pos… in drawOneIteration()
599 …const deInt32 samplerLocation = gl.getUniformLocation(m_textureSamplerProgram->getProgram(), "u… in drawOneIteration()
600 …const deInt32 sampleLocation = gl.getUniformLocation(m_textureSamplerProgram->getProgram(), "u_… in drawOneIteration()
618 gl.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in drawOneIteration()
619 gl.clear(GL_COLOR_BUFFER_BIT); in drawOneIteration()
620 gl.viewport(0, 0, m_renderSize, m_renderSize); in drawOneIteration()
621 GLU_EXPECT_NO_ERROR(gl.getError(), "clear"); in drawOneIteration()
623 gl.bindVertexArray(m_resolveVao); in drawOneIteration()
624 gl.bindBuffer(GL_ARRAY_BUFFER, m_resolveBuffer); in drawOneIteration()
625 gl.vertexAttribPointer(posLocation, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL); in drawOneIteration()
626 gl.enableVertexAttribArray(posLocation); in drawOneIteration()
627 GLU_EXPECT_NO_ERROR(gl.getError(), "set attrib"); in drawOneIteration()
629 gl.activeTexture(GL_TEXTURE0); in drawOneIteration()
630 gl.bindTexture(textureTarget, m_fboTexture); in drawOneIteration()
631 GLU_EXPECT_NO_ERROR(gl.getError(), "bind tex"); in drawOneIteration()
633 gl.bindFramebuffer(GL_FRAMEBUFFER, m_resolveFbo); in drawOneIteration()
634 gl.useProgram(m_textureSamplerProgram->getProgram()); in drawOneIteration()
635 gl.uniform1i(samplerLocation, 0); in drawOneIteration()
641 gl.uniform1i(sampleLocation, sampleNdx); in drawOneIteration()
642 gl.drawArrays(GL_TRIANGLE_STRIP, 0, 4); in drawOneIteration()
643 GLU_EXPECT_NO_ERROR(gl.getError(), "draw"); in drawOneIteration()
646 GLU_EXPECT_NO_ERROR(gl.getError(), "read pixels"); in drawOneIteration()
649 gl.useProgram(0); in drawOneIteration()
650 gl.bindVertexArray(0); in drawOneIteration()
651 gl.bindFramebuffer(GL_FRAMEBUFFER, 0); in drawOneIteration()
749 const glw::Functions& gl = m_context.getRenderContext().getFunctions(); in setupRenderData() local
758 gl.bindBuffer(GL_ARRAY_BUFFER, m_buffer); in setupRenderData()
759 gl.bufferData(GL_ARRAY_BUFFER, (int)sizeof(fullscreenQuad), fullscreenQuad, GL_STATIC_DRAW); in setupRenderData()