}
}
-glu::ProgramSources genShaders(glu::GLSLVersion version)
+glu::ProgramSources genShaders(glu::GLSLVersion version, bool isPoint)
{
- const string vtxSource = "${VERSION}\n"
- "${IN} highp vec4 a_position;\n"
- "void main(){\n"
- " gl_Position = a_position;\n"
- "}\n";
+ string vtxSource;
+
+ if (isPoint)
+ {
+ vtxSource = "${VERSION}\n"
+ "${IN} highp vec4 a_position;\n"
+ "void main(){\n"
+ " gl_Position = a_position;\n"
+ " gl_PointSize = 1.0;\n"
+ "}\n";
+ }
+ else
+ {
+ vtxSource = "${VERSION}\n"
+ "${IN} highp vec4 a_position;\n"
+ "void main(){\n"
+ " gl_Position = a_position;\n"
+ "}\n";
+ }
const string frgSource = "${VERSION}\n"
"${OUT_DECL}"
protected:
virtual void render (GLuint program, const IVec4& viewport) const = 0;
+ // Initialize gl_PointSize to 1.0f when drawing points, or the point size is undefined according to spec.
+ virtual bool isPoint (void) const = 0;
+
glu::RenderContext& m_renderCtx;
const Vec4 m_scissorArea;
};
1u << de::max(0, 8 - renderFormat.greenBits),
1u << de::max(0, 8 - renderFormat.blueBits),
1u << de::max(0, 8 - renderFormat.alphaBits)).asFloat();
- const glu::ShaderProgram shader (m_renderCtx, genShaders(glu::getContextTypeGLSLVersion(m_renderCtx.getType())));
+ const glu::ShaderProgram shader (m_renderCtx, genShaders(glu::getContextTypeGLSLVersion(m_renderCtx.getType()), isPoint()));
const RandomViewport viewport (m_renderCtx.getRenderTarget(), 256, 256, deStringHash(getName()));
const IVec4 relScissorArea (int(m_scissorArea.x() * (float)viewport.width),
protected:
virtual void render (GLuint program, const IVec4& viewport) const;
+ virtual bool isPoint (void) const;
private:
const Vec4 m_renderArea;
{
}
+bool ScissorPrimitiveCase::isPoint (void) const
+{
+ return (m_primitiveType == POINT);
+}
+
void ScissorPrimitiveCase::render (GLuint program, const IVec4&) const
{
const glw::Functions& gl = m_renderCtx.getFunctions();
protected:
virtual void render (GLuint program, const IVec4& viewport) const;
+ virtual bool isPoint (void) const;
private:
const deUint32 m_clearMode; //!< Combination of the flags accepted by glClear
throw tcu::NotSupportedError("Cannot clear stencil; no stencil buffer present", "", __FILE__, __LINE__);
}
+bool ScissorClearCase::isPoint (void) const
+{
+ return false;
+}
+
void ScissorClearCase::render (GLuint program, const IVec4&) const
{
const glw::Functions& gl = m_renderCtx.getFunctions();
enum {SIZE = 64};
virtual void render (GLuint program, const IVec4& viewport) const;
+ virtual bool isPoint (void) const;
FramebufferP m_fbo;
};
m_fbo.clear();
}
+bool FramebufferBlitCase::isPoint (void) const
+{
+ return false;
+}
+
void FramebufferBlitCase::render(GLuint program, const IVec4& viewport) const
{
const glw::Functions& gl = m_renderCtx.getFunctions();
static BufferFmtDesc getBufferFormat (ClearType type);
virtual void render (GLuint program) const;
+ virtual bool isPoint (void) const;
glu::RenderContext& m_renderCtx;
const ClearType m_clearType;
{
TestLog& log = m_testCtx.getLog();
const glw::Functions& gl = m_renderCtx.getFunctions();
- const glu::ShaderProgram shader (m_renderCtx, genShaders(glu::getContextTypeGLSLVersion(m_renderCtx.getType())));
+ const glu::ShaderProgram shader (m_renderCtx, genShaders(glu::getContextTypeGLSLVersion(m_renderCtx.getType()), isPoint()));
const glu::Framebuffer fbo (gl);
const glu::Renderbuffer colorbuf (gl);
}
}
+bool FramebufferClearCase::isPoint (void) const
+{
+ return false;
+}
+
} // Anonymous
namespace ScissorTestInternal