blob: 32886725fcdd171daf24d39286f4c2a1cdc3f0e7 [file] [log] [blame]
#ifndef _GL4CDIRECTSTATEACCESSTESTS_HPP
#define _GL4CDIRECTSTATEACCESSTESTS_HPP
/*-------------------------------------------------------------------------
* OpenGL Conformance Test Suite
* -----------------------------
*
* Copyright (c) 2015-2016 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/ /*!
* \file
* \brief
*/ /*-------------------------------------------------------------------*/
/**
*/ /*!
* \file gl4cDirectStateAccessTests.hpp
* \brief Conformance tests for the Direct State Access feature functionality.
*/ /*-----------------------------------------------------------------------------*/
/* Includes. */
#include "glcTestCase.hpp"
#include "glwDefs.hpp"
#include "tcuDefs.hpp"
#include <string>
#include <typeinfo>
namespace gl4cts
{
namespace DirectStateAccess
{
/** @class Tests
*
* @brief Direct State Access test group.
*/
class Tests : public deqp::TestCaseGroup
{
public:
/* Public member functions */
Tests(deqp::Context& context);
void init();
private:
/* Private member functions */
Tests(const Tests& other);
Tests& operator=(const Tests& other);
};
/* Tests class */
/* Direct State Access Feature Interfaces */
/* Direct State Access Transform Feedback Tests */
namespace TransformFeedback
{
/** @class CreationTest
*
* @brief Direct State Access Transform Feedback Creation test cases.
*
* Test follows the steps:
*
* Create at least two transform feedback objects names with
* GenTransformFeedbacks function. Check them without binding, using
* IsTransformFeedback function. Expect GL_FALSE.
*
* Create at least two transform feedback objects with
* CreateTransformFeedbacks function. Check them without binding, using
* IsTransformFeedback function. Expect GL_TRUE.
*
* Check that transform feedback binding point is unchanged.
*/
class CreationTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationTest(const CreationTest& other);
CreationTest& operator=(const CreationTest& other);
};
/* CreationTest class */
/** @class DefaultsTest
*
* @brief Direct State Access Transform Feedback Default State test cases.
*
* Test follows the steps:
*
* Create transform feedback object with CreateTransformFeedbacks function.
*
* Query parameters TRANSFORM_FEEDBACK_BUFFER_BINDING using
* GetTransformFeedbacki_v for all available indexed binding points. For
* all queries, expect value equal to 0.
*
* Query parameters:
* - TRANSFORM_FEEDBACK_BUFFER_START and
* - TRANSFORM_FEEDBACK_BUFFER_SIZE
* using GetTransformFeedbacki64_v for all available indexed binding
* points. For all queries, expect value equal to 0.
*
* Query parameters:
* - TRANSFORM_FEEDBACK_PAUSED and
* - TRANSFORM_FEEDBACK_ACTIVE
* using GetTransformFeedbackiv. For all queries, expect value equal to
* FALSE.
*/
class DefaultsTest : public deqp::TestCase
{
public:
/* Public member functions */
DefaultsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DefaultsTest(const DefaultsTest& other);
DefaultsTest& operator=(const DefaultsTest& other);
/* Function pointers type definitions and declarations. */
typedef void(GLW_APIENTRY* GetTransformFeedbackiv_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLint* param);
typedef void(GLW_APIENTRY* GetTransformFeedbacki_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLuint index, glw::GLint* param);
typedef void(GLW_APIENTRY* GetTransformFeedbacki64_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLuint index, glw::GLint64* param);
GetTransformFeedbackiv_ProcAddress m_gl_getTransformFeedbackiv;
GetTransformFeedbacki_v_ProcAddress m_gl_getTransformFeedbacki_v;
GetTransformFeedbacki64_v_ProcAddress m_gl_getTransformFeedbacki64_v;
/* Private member variables */
glw::GLuint m_xfb_dsa;
glw::GLint m_xfb_indexed_binding_points_count;
/* Private member functions. */
void prepare();
bool testBuffersBindingPoints();
bool testBuffersDimensions();
bool testActive();
bool testPaused();
void clean();
};
/* DefaultsTest class */
/** @class BuffersTest
*
* @brief Direct State Access Transform Feedback Buffer Objects binding test cases.
* The test follows the steps:
*
* Create transform feedback object with CreateTransformFeedbacks function.
*
* Create two buffer objects using GenBuffers and BindBuffer functions.
* Allocate storage for them using BufferData.
*
* Bind the first buffer to transform feedback object indexed binding point
* 0 using TransformFeedbackBufferBase function.
*
* Bind a first half of the second buffer to transform feedback object
* indexed binding point 1 using TransformFeedbackBufferRange.
*
* Bind a second half of the second buffer to transform feedback object
* indexed binding point 12 using TransformFeedbackBufferRange.
*
* Query parameter TRANSFORM_FEEDBACK_BUFFER_BINDING using
* GetTransformFeedbacki_v for all 1st, 2nd and 3rd indexed binding point.
* For all queries, expect value equal to the corresponding buffers'
* identifiers.
*
* Query parameters:
* - TRANSFORM_FEEDBACK_BUFFER_START and
* - TRANSFORM_FEEDBACK_BUFFER_SIZE
* using GetTransformFeedbacki64_v for indexed binding points 0, 1 and 2.
* Verify returned values.
*/
class BuffersTest : public deqp::TestCase
{
public:
/* Public member functions */
BuffersTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
BuffersTest(const BuffersTest& other);
BuffersTest& operator=(const BuffersTest& other);
/* Function pointers type definitions and declarations. */
typedef void(GLW_APIENTRY* GetTransformFeedbacki_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLuint index, glw::GLint* param);
typedef void(GLW_APIENTRY* GetTransformFeedbacki64_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLuint index, glw::GLint64* param);
typedef void(GLW_APIENTRY* TransformFeedbackBufferBase_ProcAddress)(glw::GLuint xfb, glw::GLuint index,
glw::GLuint buffer);
typedef void(GLW_APIENTRY* TransformFeedbackBufferRange_ProcAddress)(glw::GLuint xfb, glw::GLuint index,
glw::GLuint buffer, glw::GLintptr offset,
glw::GLsizei size);
GetTransformFeedbacki_v_ProcAddress m_gl_getTransformFeedbacki_v;
GetTransformFeedbacki64_v_ProcAddress m_gl_getTransformFeedbacki64_v;
TransformFeedbackBufferBase_ProcAddress m_gl_TransformFeedbackBufferBase;
TransformFeedbackBufferRange_ProcAddress m_gl_TransformFeedbackBufferRange;
/* Private member variables */
glw::GLuint m_xfb_dsa;
glw::GLuint m_bo_a;
glw::GLuint m_bo_b;
/* Private static variables */
static const glw::GLuint s_bo_size;
/* Private member functions. */
void prepareObjects();
bool prepareTestSetup();
bool testBindingPoint(glw::GLuint const index, glw::GLint const expected_value,
glw::GLchar const* const tested_function_name);
bool testStart(glw::GLuint const index, glw::GLint const expected_value,
glw::GLchar const* const tested_function_name);
bool testSize(glw::GLuint const index, glw::GLint const expected_value,
glw::GLchar const* const tested_function_name);
void clean();
};
/* BuffersTest class */
/** @class ErrorsTest
*
* @brief Direct State Access Transform Feedback Negative test cases.
* The test follows steps:
*
* Check that CreateTransformFeedbacks generates INVALID_VALUE error if
* number of transform feedback objects to create is negative.
*
* Check that GetTransformFeedbackiv, GetTransformFeedbacki_v and
* GetTransformFeedbacki64_v generate INVALID_OPERATION error if xfb is not
* zero or the name of an existing transform feedback object.
*
* Check that GetTransformFeedbackiv generates INVALID_ENUM error if pname
* is not TRANSFORM_FEEDBACK_PAUSED or TRANSFORM_FEEDBACK_ACTIVE.
*
* Check that GetTransformFeedbacki_v generates INVALID_ENUM error if pname
* is not TRANSFORM_FEEDBACK_BUFFER_BINDING.
*
* Check that GetTransformFeedbacki64_v generates INVALID_ENUM error if
* pname is not TRANSFORM_FEEDBACK_BUFFER_START or
* TRANSFORM_FEEDBACK_BUFFER_SIZE.
*
* Check that GetTransformFeedbacki_v and GetTransformFeedbacki64_v
* generate INVALID_VALUE error by GetTransformFeedbacki_v and
* GetTransformFeedbacki64_v if index is greater than or equal to the
* number of binding points for transform feedback (the value of
* MAX_TRANSFORM_FEEDBACK_BUFFERS).
*/
class ErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
ErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ErrorsTest(const ErrorsTest& other);
ErrorsTest& operator=(const ErrorsTest& other);
/* Function pointers type definitions and declarations. */
typedef void(GLW_APIENTRY* GetTransformFeedbackiv_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLint* param);
typedef void(GLW_APIENTRY* GetTransformFeedbacki_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLuint index, glw::GLint* param);
typedef void(GLW_APIENTRY* GetTransformFeedbacki64_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLuint index, glw::GLint64* param);
GetTransformFeedbackiv_ProcAddress m_gl_getTransformFeedbackiv;
GetTransformFeedbacki_v_ProcAddress m_gl_getTransformFeedbacki_v;
GetTransformFeedbacki64_v_ProcAddress m_gl_getTransformFeedbacki64_v;
/* Private member functions. */
void prepareFunctionPointers();
void cleanErrors();
bool testCreateTransformFeedbacksForInvalidNumberOfObjects();
bool testQueriesForInvalidNameOfObject();
bool testGetTransformFeedbackivQueryForInvalidParameterName();
bool testGetTransformFeedbacki_vQueryForInvalidParameterName();
bool testGetTransformFeedbacki64_vQueryForInvalidParameterName();
bool testIndexedQueriesForInvalidBindingPoint();
};
/* BuffersTest class */
/** @class FunctionalTest
*
* @brief Direct State Access Transform Feedback Functional test cases.
*
* @note The test follows steps:
*
* Create transform feedback object with CreateTransformFeedbacks function.
*
* Create buffer object using GenBuffers and BindBuffer functions.
* Allocate storage for it using BufferData.
*
* Bind the buffer to transform feedback object indexed binding point 0
* using TransformFeedbackBufferBase function.
*
* Prepare program with vertex shader which outputs VertexID to transform
* feedback varying.
*
* Create and bind empty vertex array object.
*
* Begin transform feedback environment.
*
* Using the program with discarded rasterizer, draw array of 4 indices
* using POINTS.
*
* Pause transform feedback environment.
*
* Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
* Expect value equal to TRUE.
*
* Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
* Expect value equal to FALSE.
*
* Resume transform feedback environment.
*
* Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
* Expect value equal to FALSE.
*
* Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
* Expect value equal to TRUE.
*
* End Transform feedback environment.
*
* Verify data in the buffer using MapBuffer function.
*/
class FunctionalTest : public deqp::TestCase
{
public:
/* Public member functions */
FunctionalTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
FunctionalTest(const FunctionalTest& other);
FunctionalTest& operator=(const FunctionalTest& other);
/* Function pointers type definitions and declarations. */
typedef void(GLW_APIENTRY* GetTransformFeedbackiv_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
glw::GLint* param);
typedef void(GLW_APIENTRY* TransformFeedbackBufferBase_ProcAddress)(glw::GLuint xfb, glw::GLuint index,
glw::GLuint buffer);
GetTransformFeedbackiv_ProcAddress m_gl_getTransformFeedbackiv;
TransformFeedbackBufferBase_ProcAddress m_gl_TransformFeedbackBufferBase;
/* Private member variables. */
glw::GLuint m_xfb_dsa;
glw::GLuint m_bo;
glw::GLuint m_po;
glw::GLuint m_vao;
/* Private member functions. */
void prepareFunctionPointers();
void prepareTransformFeedback();
void prepareBuffer();
void prepareProgram();
void prepareVertexArrayObject();
bool draw();
bool testTransformFeedbackStatus(glw::GLenum parameter_name, glw::GLint expected_value);
bool verifyBufferContent();
void clean();
/* Private static variables. */
static const glw::GLuint s_bo_size;
static const glw::GLchar s_vertex_shader[];
static const glw::GLchar s_fragment_shader[];
static const glw::GLchar* const s_xfb_varying;
};
/* FunctionalTest class */
} /* xfb namespace */
namespace Samplers
{
/** @class CreationTest
*
* @brief Direct State Access Sampler Objects Creation test cases.
*
* Test follows the steps:
*
* Create at least two Sampler Objects names using GenSamplers function.
* Check them without binding, using IsSampler function. Expect GL_FALSE.
*
* Create at least two Sampler Objects using CreateSamplers function. Check
* them without binding, using IsSampler function. Expect GL_TRUE.
*
* Release objects.
*/
class CreationTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationTest(const CreationTest& other);
CreationTest& operator=(const CreationTest& other);
};
/* CreationTest class */
/** @class DefaultsTest
*
* @brief Direct State Access Sampler Objects Default State test.
*
* Test follows the steps:
*
* Create Sampler Object with CreateSamplers function.
*
* Verify that default value of TEXTURE_BORDER_COLOR queried with function
* GetSamplerParameterfv is 0.0, 0.0, 0.0, 0.0.
*
* Verify that default value of TEXTURE_COMPARE_FUNC queried with function
* GetSamplerParameteriv is LEQUAL.
*
* Verify that default value of TEXTURE_COMPARE_MODE queried with function
* GetSamplerParameteriv is NONE.
*
* Verify that default value of TEXTURE_LOD_BIAS queried with function
* GetSamplerParameterfv is 0.0.
*
* Verify that default value of TEXTURE_MAX_LOD queried with function
* GetSamplerParameterfv is 1000.
*
* Verify that default value of TEXTURE_MAG_FILTER queried with function
* GetSamplerParameteriv is LINEAR.
*
* Verify that default value of TEXTURE_MIN_FILTER queried with function
* GetSamplerParameteriv is NEAREST_MIPMAP_LINEAR.
*
* Verify that default value of TEXTURE_MIN_LOD queried with function
* GetSamplerParameterfv is -1000.
*
* Verify that default value of TEXTURE_WRAP_S queried with function
* GetSamplerParameteriv is REPEAT.
*
* Verify that default value of TEXTURE_WRAP_T queried with function
* GetSamplerParameteriv is REPEAT.
*
* Verify that default value of TEXTURE_WRAP_R queried with function
* GetSamplerParameteriv is REPEAT.
*
* Release objects.
*/
class DefaultsTest : public deqp::TestCase
{
public:
/* Public member functions */
DefaultsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DefaultsTest(const DefaultsTest& other);
DefaultsTest& operator=(const DefaultsTest& other);
/* Private member variables */
glw::GLuint m_sampler_dsa;
/* Private member functions. */
void prepare();
bool testSamplerIntegerParameter(glw::GLenum pname, glw::GLint expected_value);
bool testSamplerFloatParameter(glw::GLenum pname, glw::GLfloat expected_value);
bool testSamplerFloatVectorParameter(glw::GLenum pname, glw::GLfloat expected_value[4]);
void clean();
};
/* DefaultsTest class */
/** @class ErrorsTest
*
* @brief Direct State Access Samplers Negative test.
*
* The test follows steps:
*
* Check that CreateSamplers generates INVALID_VALUE error if
* number of sampler objects to create is negative.
*/
class ErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
ErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ErrorsTest(const ErrorsTest& other);
ErrorsTest& operator=(const ErrorsTest& other);
};
/* ErrorsTest class */
/** @class FunctionalTest
*
* @brief Direct State Access Samplers Functional test cases.
*
* @note The test follows steps:
*
* Create framebuffer with renderbuffer with color attachment and 1x1 pixel
* size. Clean framebuffer content with black color.
*
* Create and bind empty vertex array object.
*
* Build and use simple GLSL program drawing full screen textured quad
* depending on VertexID. Fragment shader shall output texture point at
* (1/3, 1/3).
*
* Create texture 2 x 2 texels in size. Bind it. Upload texture with
* following color data:
* RED, GREEN,
* BLUE, YELLOW.
*
* Create Sampler object using CreateSamplers function and bind it to the
* texture unit. Setup following sampler parameters:
* * TEXTURE_WRAP_S to the value of REPEAT,
* * TEXTURE_WRAP_T to REPEAT,
* * TEXTURE_MIN_FILTER to NEAREST,
* * TEXTURE_MAG_FILTER to NEAREST.
*
* Draw full screen quad.
*
* Fetch framebuffer content with ReadPixels function. Check that,
* framebuffer is filled with red color.
*
* Release objects.
*/
class FunctionalTest : public deqp::TestCase
{
public:
/* Public member functions */
FunctionalTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions. */
FunctionalTest(const FunctionalTest& other);
FunctionalTest& operator=(const FunctionalTest& other);
void prepareFramebuffer();
void prepareVertexArrayObject();
void prepareProgram();
void prepareTexture();
void prepareSampler();
void draw();
bool checkFramebufferContent();
void clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_rbo;
glw::GLuint m_vao;
glw::GLuint m_to;
glw::GLuint m_so;
glw::GLuint m_po;
/* Private static variables. */
static const glw::GLchar s_vertex_shader[];
static const glw::GLchar s_fragment_shader[];
static const glw::GLchar s_uniform_sampler[];
static const glw::GLubyte s_texture_data[];
};
/* FunctionalTest class */
} /* Samplers namespace */
namespace ProgramPipelines
{
/** @class CreationTest
*
* @brief Direct State Access Program Pipeline Objects Creation test cases.
*
* @note Test follows the steps:
*
* Create at least two Program Pipeline Objects names using
* GenProgramPipelines function. Check them without binding, using
* IsProgramPipeline function. Expect GL_FALSE.
*
* Create at least two Program Pipeline Objects using
* CreateProgramPipelines function. Check them without binding, using
* IsProgramPipeline function. Expect GL_TRUE.
*
* Release objects.
*/
class CreationTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationTest(const CreationTest& other);
CreationTest& operator=(const CreationTest& other);
};
/* CreationTest class */
/** @class DefaultsTest
*
* @brief Direct State Access Program Pipeline Objects Default State test.
*
* @note Test follows the steps:
*
* Create Program Pipeline Object with CreateProgramPipelines function.
*
* Verify that default value of ACTIVE_PROGRAM queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of VERTEX_SHADER queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of GEOMETRY_SHADER queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of FRAGMENT_SHADER queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of COMPUTE_SHADER queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of TESS_CONTROL_SHADER queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of TESS_EVALUATION_SHADER queried with
* function GetProgramPipelineiv is 0.
*
* Verify that default value of VALIDATE_STATUS queried with function
* GetProgramPipelineiv is 0.
*
* Verify that default value of info log queried with function
* GetProgramPiplineInfoLog is 0.
*
* Verify that default value of INFO_LOG_LENGTH queried with function
* GetProgramPipelineiv is 0.
*
* Release object.
*/
class DefaultsTest : public deqp::TestCase
{
public:
/* Public member functions */
DefaultsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DefaultsTest(const DefaultsTest& other);
DefaultsTest& operator=(const DefaultsTest& other);
/* Private member variables */
glw::GLuint m_program_pipeline_dsa;
/* Private member functions. */
void prepare();
bool testProgramPipelineParameter(glw::GLenum pname, glw::GLint expected_value);
bool testProgramPipelineInfoLog(glw::GLchar* expected_value);
void clean();
};
/* DefaultsTest class */
/** @class ErrorsTest
*
* @brief Direct State Access Program Pipeline Negative test.
*
* The test follows steps:
*
* Check that CreateProgramPipelines generates INVALID_VALUE error if
* number of program pipeline objects to create is negative.
*/
class ErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
ErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ErrorsTest(const ErrorsTest& other);
ErrorsTest& operator=(const ErrorsTest& other);
};
/* ErrorsTest class */
/** @class FunctionalTest
*
* @brief Direct State Access Program Pipeline Functional test cases.
*
* @note The test follows steps:
*
* Create framebuffer with renderbuffer with color attachment and 1x1 pixel
* size. Clean framebuffer content with black color.
*
* Create and bind empty vertex array object.
*
* Make sure that no GLSL program is being used.
*
* Create two shader programs (with CreateShaderProgramv) - one vertex
* shader and one fragment shader. The vertex shader shall output full
* screen quad depending on VertexID. The fragment shader shall output red
* color.
*
* Create the Program Pipeline Object using CreateProgramPipelines
* function. Bind it using BindProgramPipeline. Setup Program Pipeline
* with the created shader programs using UseProgramStages.
*
* Draw full screen quad.
*
* Fetch framebuffer content with ReadPixels function. Check that,
* framebuffer is filled with red color.
*
* Release objects.
*/
class FunctionalTest : public deqp::TestCase
{
public:
/* Public member functions */
FunctionalTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions. */
FunctionalTest(const FunctionalTest& other);
FunctionalTest& operator=(const FunctionalTest& other);
void prepareFramebuffer();
void prepareVertexArrayObject();
void prepareShaderPrograms();
void preparePipeline();
void draw();
bool checkFramebufferContent();
void clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_rbo;
glw::GLuint m_vao;
glw::GLuint m_spo_v;
glw::GLuint m_spo_f;
glw::GLuint m_ppo;
/* Private static variables. */
static const glw::GLchar* s_vertex_shader;
static const glw::GLchar* s_fragment_shader;
};
/* FunctionalTest class */
} /* ProgramPipelines namespace */
namespace Queries
{
/** @class CreationTest
*
* @brief Direct State Access Queries Creation test cases.
*
* @note Test follows the steps:
*
* Create at least two Query Objects names using GenQueries function.
* Check them without binding, using IsQuery function. Expect GL_FALSE.
*
* Create at least two Query Objects using CreateQueries function. Check
* them without binding, using IsQuery function. Expect GL_TRUE.
*
* Release objects.
*
* Repeat test for all of following supported targets:
* - SAMPLES_PASSED,
* - ANY_SAMPLES_PASSED,
* - ANY_SAMPLES_PASSED_CONSERVATIVE,
* - TIME_ELAPSED,
* - TIMESTAMP,
* - PRIMITIVES_GENERATED and
* - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.
*
* See Ref. OpenGL 4.5 Core Profile, Section 4.2.
*/
class CreationTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationTest(const CreationTest& other);
CreationTest& operator=(const CreationTest& other);
};
/* CreationTest class */
/** @class DefaultsTest
*
* @brief Direct State Access Queries Default State test.
*
* @note Test follows the steps:
*
* Create Query Object with CreateQueries function.
*
* Verify that default value of QUERY_RESULT queried with function
* GetQueryObjectuiv is 0 or FALSE.
*
* Verify that default value of QUERY_RESULT_AVAILABLE queried with
* function GetQueryObjectiv is TRUE.
*
* Release object.
*
* Repeat test for all of following supported targets:
* - SAMPLES_PASSED,
* - ANY_SAMPLES_PASSED,
* - ANY_SAMPLES_PASSED_CONSERVATIVE,
* - TIME_ELAPSED,
* - TIMESTAMP,
* - PRIMITIVES_GENERATED and
* - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.
*
* See Ref. OpenGL 4.5 Core Profile, Section 4.2.
*/
class DefaultsTest : public deqp::TestCase
{
public:
/* Public member functions */
DefaultsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DefaultsTest(const DefaultsTest& other);
DefaultsTest& operator=(const DefaultsTest& other);
/* Private member variables */
glw::GLuint m_query_dsa;
/* Private member functions. */
void prepare(const glw::GLenum target);
bool testQueryParameter(const glw::GLenum pname, const glw::GLuint expected_value, const glw::GLchar* target_name);
void clean();
};
/* DefaultsTest class */
/** @class ErrorsTest
*
* @brief Direct State Access Queries Negative test.
*
* @note The test follows steps:
*
* Check that CreateQueries generates INVALID_VALUE error if number of
* query objects to create is negative.
*
* Check that CreateQueries generates INVALID_ENUM error if target is not
* one of accepted values:
* - SAMPLES_PASSED,
* - ANY_SAMPLES_PASSED,
* - ANY_SAMPLES_PASSED_CONSERVATIVE,
* - TIME_ELAPSED,
* - TIMESTAMP,
* - PRIMITIVES_GENERATED or
* - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.
*
* Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
* GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
* INVALID_OPERATION error if <id> is not the name of a query object, or
* if the query object named by <id> is currently active.
*
* Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
* GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
* INVALID_OPERATION error if <buffer> is not the name of an existing
* buffer object.
*
* Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
* GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
* INVALID_ENUM error if <pname> is not QUERY_RESULT,
* QUERY_RESULT_AVAILABLE, QUERY_RESULT_NO_WAIT or QUERY_TARGET.
*
* Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
* GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
* INVALID_OPERATION error if the query writes to a buffer object, and the
* specified buffer offset would cause data to be written beyond the bounds
* of that buffer object.
*
* Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
* GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
* INVALID_VALUE error if <offset> is negative.
*
* See Ref. OpenGL 4.5 Core Profile, Section 4.2.
*/
class ErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
ErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ErrorsTest(const ErrorsTest& other);
ErrorsTest& operator=(const ErrorsTest& other);
/* Private member functions. */
bool testNegativeNumberOfObjects();
bool testInvalidTarget();
bool testInvalidQueryName();
bool testInvalidBufferName();
bool testInvalidParameterName();
bool testBufferOverflow();
bool testBufferNegativeOffset();
bool isTarget(glw::GLenum maybe_target);
bool isParameterName(glw::GLenum maybe_pname);
/* Function pointers. */
typedef void(GLW_APIENTRY* PFNGLGETQUERYBUFFEROBJECT)(glw::GLuint id, glw::GLuint buffer, glw::GLenum pname,
glw::GLintptr offset);
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectiv;
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectuiv;
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjecti64v;
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectui64v;
/* Private static variables. */
static const glw::GLenum s_targets[];
static const glw::GLchar* s_target_names[];
static const glw::GLuint s_targets_count;
};
/* ErrorsTest class */
/** @class FunctionalTest
*
* @brief Direct State Access Queries Functional test cases.
*
* @note The test follows steps:
*
* Create framebuffer with renderbuffer with color attachment and 1x1 pixel
* size. Clean framebuffer content with black color.
*
* Create and bind empty vertex array object.
*
* Create buffer object. Bind it to TRANFORM_FEEDBACK_BUFFER binding point.
* Bind buffer base to TRANFORM_FEEDBACK_BUFFER binding point with index 0.
* Setup data storage of the buffer with size equal to 6 * sizeof(int).
*
* Build GLSL program consisting of vertex and fragment shader stages.
* Vertex shader shall output full screen quad depending on VertexID. The
* VertexID shall be saved to transform feedback varying. Fragment shader
* shall output red color.
*
* Create query objects with CreateQueries function for following targets:
* - SAMPLES_PASSED,
* - PRIMITIVES_GENERATED,
* - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN,
* - TIME_ELAPSED.
*
* Begin query for every target.
*
* Begin transform feedback for TRIANGLES primitive type.
*
* Draw full screen quad with TRIANGLE_STRIP primitive type.
*
* End transform feedback.
*
* End all queries.
*
* Call Finish function.
*
* Check that framebuffer is filled with red color.
*
* Check that transform feedback buffer contains successive primitive
* vertex ids (0, 1, 2, 2, 1, 3).
*
* For every query objects, using GetQueryBufferObjectiv,
* GetQueryBufferObjectuiv, GetQueryBufferObjecti64v,
* GetQueryBufferObjectui64v functions do following comparisons:
*
* Check that value of parameter QUERY_TARGET is equal to target.
*
* Check that value of parameter QUERY_RESULT_AVAILABLE is TRUE.
*
* Check that value of parameter QUERY_RESULT and QUERY_RESULT_NO_WAIT:
* - is equal to 1 if target is SAMPLES_PASSED; or
* - is equal to 2 if target is PRIMITIVES_GENERATED or
* TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN; or
* - is positive if target is TIME_ELAPSED.
*
* Release objects.
*/
class FunctionalTest : public deqp::TestCase
{
public:
/* Public member functions */
FunctionalTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions. */
FunctionalTest(const FunctionalTest& other);
FunctionalTest& operator=(const FunctionalTest& other);
/* Function pointers. */
typedef void(GLW_APIENTRY* PFNGLGETQUERYBUFFEROBJECT)(glw::GLuint id, glw::GLuint buffer, glw::GLenum pname,
glw::GLintptr offset);
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectiv;
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectuiv;
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjecti64v;
PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectui64v;
/* Private templated functions. */
template <typename T>
static bool equal(T, T);
template <typename T>
static bool less(T, T);
template <typename T>
void GetQueryBufferObject(glw::GLuint id, glw::GLuint buffer, glw::GLenum pname, glw::GLintptr offset);
template <typename T>
bool checkQueryBufferObject(glw::GLuint query, glw::GLenum pname, T expected_value, bool (*comparison)(T, T));
/* Private member functions. */
void prepareView();
void prepareVertexArray();
void prepareBuffers();
void prepareQueries();
void prepareProgram();
void draw();
bool checkView();
bool checkXFB();
void clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_rbo;
glw::GLuint m_vao;
glw::GLuint m_bo_query;
glw::GLuint m_bo_xfb;
glw::GLuint* m_qo;
glw::GLuint m_po;
/* Private static variables. */
static const glw::GLenum s_targets[];
static const glw::GLuint s_targets_count;
static const glw::GLint s_results[];
static const glw::GLchar s_vertex_shader[];
static const glw::GLchar s_fragment_shader[];
static const glw::GLchar* s_xfb_varying_name;
};
/* FunctionalTest class */
} /* Queries namespace */
namespace Buffers
{
/** @class CreationTest
*
* @brief Direct State Access Buffers Creation test cases.
*
* Test follows the steps:
*
* Create at least two buffer objects using GenBuffers function. Check
* them without binding, using IsBuffer function. Expect GL_FALSE.
*
* Create at least two buffer objects using CreateBuffers function. Check
* them without binding, using IsBuffer function. Expect GL_TRUE.
*
* Release objects.
*/
class CreationTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationTest(const CreationTest& other);
CreationTest& operator=(const CreationTest& other);
};
/* CreationTest class */
/** @class DataTest
*
* @brief Direct State Access Buffers Data test cases.
*
* Test follows the steps:
*
* Prepare test case with following steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using given function and reference data.
*
* Bind buffer.
*
* Check buffer content using MapBuffer function.
*
* Release objects.
*
* Repeat the test case with function for data creation:
* - NamedBufferData,
* - NamedBufferData and it with NamedBufferSubData,
* - NamedBufferStorage,
* - CopyNamedBufferSubData from auxiliary buffer.
*
* If NamedBufferData function is used then repeat the test case for
* usage:
* - STREAM_DRAW,
* - STREAM_READ,
* - STREAM_COPY,
* - STATIC_DRAW,
* - STATIC_READ,
* - STATIC_COPY,
* - DYNAMIC_DRAW,
* - DYNAMIC_READ, and
* - DYNAMIC_COPY.
*
* If NamedBufferStorage function is used then repeat the test case using
* flag MAP_READ_BIT and one of following:
* - DYNAMIC_STORAGE_BIT,
* - MAP_WRITE_BIT,
* - MAP_PERSISTENT_BIT,
* - MAP_COHERENT_BIT and
* - CLIENT_STORAGE_BIT.
*/
class DataTest : public deqp::TestCase
{
public:
/* Public member functions */
DataTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DataTest(const DataTest& other);
DataTest& operator=(const DataTest& other);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
const glw::GLvoid* data);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
const glw::GLvoid* data, glw::GLbitfield flags);
typedef void(GLW_APIENTRY* PFNGLCOPYNAMEDBUFFERSUBDATA)(glw::GLuint readBuffer, glw::GLuint writeBuffer,
glw::GLintptr readOffset, glw::GLintptr writeOffset,
glw::GLsizeiptr size);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLNAMEDBUFFERSUBDATA m_pNamedBufferSubData;
PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
PFNGLCOPYNAMEDBUFFERSUBDATA m_pCopyNamedBufferSubData;
bool TestCase(void (DataTest::*UploadDataFunction)(glw::GLuint, glw::GLenum), glw::GLenum parameter);
void UploadUsingNamedBufferData(glw::GLuint id, glw::GLenum parameter);
void UploadUsingNamedBufferSubData(glw::GLuint id, glw::GLenum parameter);
void UploadUsingNamedBufferStorage(glw::GLuint id, glw::GLenum parameter);
void UploadUsingCopyNamedBufferSubData(glw::GLuint id, glw::GLenum parameter);
bool compare(const glw::GLuint* data, const glw::GLuint* reference, const glw::GLsizei count);
void LogFail(void (DataTest::*UploadDataFunction)(glw::GLuint, glw::GLenum), glw::GLenum parameter,
const glw::GLuint* data, const glw::GLuint* reference, const glw::GLsizei count);
void LogError(void (DataTest::*UploadDataFunction)(glw::GLuint, glw::GLenum), glw::GLenum parameter);
static const glw::GLuint s_reference[];
static const glw::GLsizei s_reference_size;
static const glw::GLsizei s_reference_count;
};
/* DataTest class */
/** @class ClearTest
*
* @brief Direct State Access Buffers Clear test cases.
*
* Test follows the steps:
*
* Prepare test case with following steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferData without data
* specification.
*
* Clear buffer content using given function.
*
* Bind buffer.
*
* Check buffer content using MapBuffer function.
*
* Release objects.
*
* Repeat test case for following clear functions:
* - ClearNamedBufferData and
* - ClearNamedBufferSubData.
*
* Repeat test case for following internal formats:
* - GL_R8,
* - GL_R16,
* - GL_R16F,
* - GL_R32F,
* - GL_R8I,
* - GL_R16I,
* - GL_R32I,
* - GL_R8UI,
* - GL_R16UI,
* - GL_R32UI,
* - GL_RG8,
* - GL_RG16,
* - GL_RG16F,
* - GL_RG32F,
* - GL_RG8I,
* - GL_RG16I,
* - GL_RG32I,
* - GL_RG8UI,
* - GL_RG16UI,
* - GL_RG32UI,
* - GL_RGB32F,
* - GL_RGB32I,
* - GL_RGB32UI,
* - GL_RGBA8,
* - GL_RGBA16,
* - GL_RGBA16F,
* - GL_RGBA32F,
* - GL_RGBA8I,
* - GL_RGBA16I,
* - GL_RGBA32I,
* - GL_RGBA8UI,
* - GL_RGBA16UI and
* - GL_RGBA32UI.
*/
class ClearTest : public deqp::TestCase
{
public:
/* Public member functions */
ClearTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ClearTest(const ClearTest& other);
ClearTest& operator=(const ClearTest& other);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLenum internalformat,
glw::GLenum format, glw::GLenum type,
const glw::GLvoid* data);
typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLenum internalformat,
glw::GLintptr offset, glw::GLsizei size,
glw::GLenum format, glw::GLenum type,
const glw::GLvoid* data);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLCLEARNAMEDBUFFERDATA m_pClearNamedBufferData;
PFNGLCLEARNAMEDBUFFERSUBDATA m_pClearNamedBufferSubData;
template <typename T, bool USE_SUB_DATA>
bool TestClearNamedBufferData(glw::GLenum internalformat, glw::GLsizei count, glw::GLenum format, glw::GLenum type,
T* data);
template <bool USE_SUB_DATA>
void ClearNamedBuffer(glw::GLuint buffer, glw::GLenum internalformat, glw::GLsizei size, glw::GLenum format,
glw::GLenum type, glw::GLvoid* data);
template <typename T>
bool Compare(const T* data, const T* reference, const glw::GLsizei count);
template <typename T>
void LogFail(bool use_sub_data, glw::GLenum internalformat, const T* data, const T* reference,
const glw::GLsizei count);
void LogError(bool use_sub_data, glw::GLenum internalformat);
};
/* ClearTest class */
/** @class MapReadOnlyTest
*
* @brief Direct State Access Buffers Map Read Only test cases.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferData function and reference
* data.
*
* Map buffer with MapNamedBuffer function and READ_ONLY access flag.
*
* Compare mapped buffer content with reference data.
*
* Unmap buffer using UnmapNamedBuffer. Test if UnmapNamedBuffer
* returned GL_TRUE.
*
* Release buffer.
*/
class MapReadOnlyTest : public deqp::TestCase
{
public:
/* Public member functions */
MapReadOnlyTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
MapReadOnlyTest(const MapReadOnlyTest& other);
MapReadOnlyTest& operator=(const MapReadOnlyTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
static const glw::GLuint s_reference[]; //<! Reference data.
static const glw::GLsizei s_reference_size; //<! Reference data size.
static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
};
/* MapReadOnlyTest class */
/** @class MapReadWriteTest
*
* @brief Direct State Access Buffers Map Read Write test cases.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferData function and reference
* data.
*
* Map buffer with MapNamedBuffer function and READ_WRITE access flag.
*
* Compare mapped buffer content with reference.
*
* Write to the mapped buffer inverted reference content.
*
* Unmap buffer.
*
* Map buffer with MapNamedBuffer function and READ_WRITE access flag.
*
* Compare mapped buffer content with inverted reference.
*
* Unmap buffer.
*
* Release buffer.
*/
class MapReadWriteTest : public deqp::TestCase
{
public:
/* Public member functions */
MapReadWriteTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
MapReadWriteTest(const MapReadWriteTest& other);
MapReadWriteTest& operator=(const MapReadWriteTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
static const glw::GLuint s_reference[]; //<! Reference data.
static const glw::GLsizei s_reference_size; //<! Reference data size.
static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
};
/* MapReadWriteTest class */
/** @class MapWriteOnlyTest
*
* @brief Direct State Access Buffers Map Write Only test cases.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferData function.
*
* Map buffer with MapNamedBuffer function and WRITE_ONLY access flag.
*
* Write reference data.
*
* Unmap buffer.
*
* Bind buffer to the binding point.
*
* Map buffer with MapBuffer function and READ_ONLY access flag.
*
* Compare mapped buffer content with reference.
*
* Unmap buffer.
*
* Release buffer.
*/
class MapWriteOnlyTest : public deqp::TestCase
{
public:
/* Public member functions */
MapWriteOnlyTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
MapWriteOnlyTest(const MapWriteOnlyTest& other);
MapWriteOnlyTest& operator=(const MapWriteOnlyTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
static const glw::GLuint s_reference[]; //<! Reference data.
static const glw::GLsizei s_reference_size; //<! Reference data size.
static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
};
/* MapReadOnlyTest class */
/** @class MapRangeReadBitTest
*
* @brief Direct State Access Buffers Range Map Read Bit test cases.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferStorage function, reference
* data and MAP_READ_BIT access flag.
*
* Map first half of buffer with MapNamedBufferRange and MAP_READ_BIT
* access flag.
*
* Compare mapped buffer content with reference.
*
* Unmap buffer.
*
* Map second half of buffer with MapNamedBufferRange and MAP_READ_BIT
* access flag.
*
* Compare mapped buffer content with reference.
*
* Unmap buffer.
*
* Release buffer.
*
* Repeat the test with also MAP_PERSISTENT_BIT flag turned on.
*
* Repeat the test with also MAP_PERSISTENT_BIT and MAP_COHERENT_BIT
* flags turned on.
*/
class MapRangeReadBitTest : public deqp::TestCase
{
public:
/* Public member functions */
MapRangeReadBitTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
MapRangeReadBitTest(const MapRangeReadBitTest& other);
MapRangeReadBitTest& operator=(const MapRangeReadBitTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
const glw::GLvoid* data, glw::GLbitfield flags);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
glw::GLbitfield access);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
bool CompareWithReference(glw::GLuint* data, glw::GLintptr offset, glw::GLsizei length);
static const glw::GLuint s_reference[]; //<! Reference data.
static const glw::GLsizei s_reference_size; //<! Reference data size.
static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
};
/* MapRangeReadBitTest class */
/** @class MapRangeWriteBitTest
*
* @brief Direct State Access Buffers Range Map Read Bit test cases.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferStorage function, reference
* data and (MAP_READ_BIT | MAP_WRITE_BIT) access flag.
*
* Map first half of buffer with MapNamedBufferRange and MAP_WRITE_BIT
* access flag.
*
* Write reference data.
*
* Unmap buffer.
*
* Map second half of buffer with MapNamedBufferRange and MAP_WRITE_BIT
* access flag.
*
* Write reference data.
*
* Unmap buffer.
*
* Bind buffer to the binding point.
*
* Map buffer with MapBuffer function and READ_ONLY access flag.
*
* Compare mapped buffer content with reference.
*
* Unmap buffer.
*
* Release buffer.
*
* Repeat the test with also MAP_INVALIDATE_RANGE_BIT flag turned on.
*
* Repeat the test with also MAP_INVALIDATE_BUFFER_BIT flag turned on with
* only the first mapping.
*
* Repeat the test with also MAP_FLUSH_EXPLICIT_BIT flag turned on. Make
* sure that all writes are flushed using FlushNamedMappedBufferRange
* function.
*
* Repeat the test with also MAP_UNSYNCHRONIZED_BIT flag turned on with
* only the second mapping.
*/
class MapRangeWriteBitTest : public deqp::TestCase
{
public:
/* Public member functions */
MapRangeWriteBitTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
MapRangeWriteBitTest(const MapRangeWriteBitTest& other);
MapRangeWriteBitTest& operator=(const MapRangeWriteBitTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
const glw::GLvoid* data, glw::GLbitfield flags);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
glw::GLbitfield access);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
typedef void(GLW_APIENTRY* PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset,
glw::GLsizei length);
PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE m_pFlushMappedNamedBufferRange;
bool CompareWithReference(glw::GLuint buffer, glw::GLbitfield access_flag);
static const glw::GLuint s_reference[]; //<! Reference data.
static const glw::GLsizei s_reference_size; //<! Reference data size.
static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
};
/* MapRangeWriteBitTest class */
/** @class SubDataQueryTest
*
* @brief Direct State Access GetNamedBufferSubData Query test cases.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Create data storage using NamedBufferData function and reference data.
*
* Fetch first half of the buffer using GetNamedBufferSubData function.
*
* Fetch second half of the buffer using GetNamedBufferSubData function.
*
* Compare fetched data with reference values.
*
* Release object.
*/
class SubDataQueryTest : public deqp::TestCase
{
public:
/* Public member functions */
SubDataQueryTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
SubDataQueryTest(const SubDataQueryTest& other);
SubDataQueryTest& operator=(const SubDataQueryTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void*(GLW_APIENTRY* PFNGLGETNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
glw::GLvoid* data);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLGETNAMEDBUFFERSUBDATA m_pGetNamedBufferSubData;
static const glw::GLuint s_reference[]; //<! Reference data.
static const glw::GLsizei s_reference_size; //<! Reference data size.
static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
};
/* SubDataQueryTest class */
/** @class DefaultsTest
*
* @brief Direct State Access Buffer Objects Default Values Test.
*
* Test follows the steps:
*
* Create buffer object using CreateBuffers.
*
* Check that GetNamedBufferParameteriv and GetNamedBufferParameteri64v
* function called with parameter name
* - BUFFER_SIZE returns value equal to 0;
* - BUFFER_USAGE returns value equal to STATIC_DRAW;
* - BUFFER_ACCESS returns value equal to READ_WRITE;
* - BUFFER_ACCESS_FLAGS returns value equal to 0;
* - BUFFER_IMMUTABLE_STORAGE returns value equal to FALSE;
* - BUFFER_MAPPED returns value equal to FALSE;
* - BUFFER_MAP_OFFSET returns value equal to 0;
* - BUFFER_MAP_LENGTH returns value equal to 0;
* - BUFFER_STORAGE_FLAGS returns value equal to 0.
*
* Check that GetNamedBufferPointerv function called with parameter name
* BUFFER_MAP_POINTER returns value equal to NULL;
*/
class DefaultsTest : public deqp::TestCase
{
public:
/* Public member functions */
DefaultsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DefaultsTest(const DefaultsTest& other);
DefaultsTest& operator=(const DefaultsTest& other);
bool CheckParameterError(const glw::GLchar* pname_string, const glw::GLchar* function_string);
template <typename T>
bool CheckValue(const T value, const T reference_value, const glw::GLchar* pname_string,
const glw::GLchar* function_string);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERI64V)(glw::GLuint buffer, glw::GLenum pname,
glw::GLint64* data);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERIV)(glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPOINTERV)(glw::GLuint buffer, glw::GLenum pname,
glw::GLvoid** params);
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLGETNAMEDBUFFERPARAMETERI64V m_pGetNamedBufferParameteri64v;
PFNGLGETNAMEDBUFFERPARAMETERIV m_pGetNamedBufferParameteriv;
PFNGLGETNAMEDBUFFERPOINTERV m_pGetNamedBufferPointerv;
};
/* DefaultsTest class */
/** @class ErrorsTest
*
* @brief Direct State Access Buffer Objects Errors Test.
*
* Test follows the steps:
*
* Check that INVALID_VALUE is generated by CreateBuffers if n is negative.
*
*
* Check that INVALID_OPERATION is generated by NamedBufferStorage if
* buffer is not the name of an existing buffer object.
*
* Check that INVALID_VALUE is generated by NamedBufferStorage if size is
* less than or equal to zero.
*
* Check that INVALID_VALUE is generated by NamedBufferStorage if flags has
* any bits set other than DYNAMIC_STORAGE_BIT, MAP_READ_BIT,
* MAP_WRITE_BIT, MAP_PERSISTENT_BIT, MAP_COHERENT_BIT or
* CLIENT_STORAGE_BIT.
*
* Check that INVALID_VALUE error is generated by NamedBufferStorage if
* flags contains MAP_PERSISTENT_BIT but does not contain at least one of
* MAP_READ_BIT or MAP_WRITE_BIT.
*
* Check that INVALID_VALUE is generated by NamedBufferStorage if flags
* contains MAP_COHERENT_BIT, but does not also contain MAP_PERSISTENT_BIT.
*
* Check that OUT_OF_MEMORY is generated if the GL is unable to create a
* data store with the specified size. Do not set result, if out of memory
* situation was impossible to generate or unable to verify.
*
*
* Check that INVALID_OPERATION is generated by NamedBufferData if buffer
* is not the name of an existing buffer object.
*
* Check that INVALID_ENUM is generated by NamedBufferData if usage is not
* STREAM_DRAW, STREAM_READ, STREAM_COPY, STATIC_DRAW, STATIC_READ,
* STATIC_COPY, DYNAMIC_DRAW, DYNAMIC_READ or DYNAMIC_COPY.
*
* Check that INVALID_VALUE is generated by NamedBufferData if size is
* negative.
*
* Check that INVALID_OPERATION is generated by NamedBufferData if the
* BUFFER_IMMUTABLE_STORAGE flag of the buffer object is TRUE.
*
* Check that OUT_OF_MEMORY is generated if the GL is unable to create a
* data store with the specified size. Do not set result, if out of memory
* situation was impossible to generate or unable to verify.
*
*
* Check that INVALID_OPERATION is generated by NamedBufferSubData if
* buffer is not the name of an existing buffer object.
*
* Check that INVALID_VALUE is generated by NamedBufferSubData if offset or
* size is negative, or if offset+size is greater than the value of
* BUFFER_SIZE for the specified buffer object.
*
* Check that INVALID_OPERATION is generated by NamedBufferSubData if any
* part of the specified range of the buffer object is mapped with
* MapBufferRange or MapBuffer, unless it was mapped with the
* MAP_PERSISTENT_BIT bit set in the MapBufferRange access flags.
*
* Check that INVALID_OPERATION is generated by NamedBufferSubData if the
* value of the BUFFER_IMMUTABLE_STORAGE flag of the buffer object is TRUE
* and the value of BUFFER_STORAGE_FLAGS for the buffer object does not
* have the DYNAMIC_STORAGE_BIT bit set.
*
*
* Check that INVALID_OPERATION is generated by ClearNamedBufferData if
* buffer is not the name of an existing buffer object.
*
* Check that INVALID_ENUM is generated by ClearNamedBufferData if
* internal format is not one of the valid sized internal formats listed in
* the table above.
*
* Check that INVALID_OPERATION is generated by ClearNamedBufferData if
* any part of the specified range of the buffer object is mapped with
* MapBufferRange or MapBuffer, unless it was mapped with the
* MAP_PERSISTENT_BIT bit set in the MapBufferRange access flags.
*
* Check that INVALID_VALUE is generated by ClearNamedBufferData if
* format is not a valid format, or type is not a valid type.
*
*
* Check that INVALID_OPERATION is generated by ClearNamedBufferSubData
* if buffer is not the name of an existing buffer object.
*
* Check that INVALID_ENUM is generated by ClearNamedBufferSubData if
* internal format is not one of the valid sized internal formats listed in
* the table above.
*
* Check that INVALID_VALUE is generated by ClearNamedBufferSubData if
* offset or range are not multiples of the number of basic machine units
* per-element for the internal format specified by internal format. This
* value may be computed by multiplying the number of components for
* internal format from the table by the size of the base type from the
* specification table.
*
* Check that INVALID_VALUE is generated by ClearNamedBufferSubData if
* offset or size is negative, or if offset+size is greater than the value
* of BUFFER_SIZE for the buffer object.
*
* Check that INVALID_OPERATION is generated by ClearNamedBufferSubData
* if any part of the specified range of the buffer object is mapped with
* MapBufferRange or MapBuffer, unless it was mapped with the
* MAP_PERSISTENT_BIT bit set in the MapBufferRange access flags.
*
* Check that INVALID_VALUE is generated by ClearNamedBufferSubData if
* format is not a valid format, or type is not a valid type.
*
*
* Check that INVALID_OPERATION is generated by CopyNamedBufferSubData if
* readBuffer or writeBuffer is not the name of an existing buffer object.
*
* Check that INVALID_VALUE is generated by CopyNamedBufferSubData if any of
* readOffset, writeOffset or size is negative, if readOffset+size is
* greater than the size of the source buffer object (its value of
* BUFFER_SIZE), or if writeOffset+size is greater than the size of the
* destination buffer object.
*
* Check that INVALID_VALUE is generated by CopyNamedBufferSubData if the
* source and destination are the same buffer object, and the ranges
* [readOffset,readOffset+size) and [writeOffset,writeOffset+size) overlap.
*
* Check that INVALID_OPERATION is generated by CopyNamedBufferSubData if
* either the source or destination buffer object is mapped with
* MapBufferRange or MapBuffer, unless they were mapped with the
* MAP_PERSISTENT bit set in the MapBufferRange access flags.
*
*
* Check that INVALID_OPERATION is generated by MapNamedBuffer if buffer is
* not the name of an existing buffer object.
*
* Check that INVALID_ENUM is generated by MapNamedBuffer if access is not
* READ_ONLY, WRITE_ONLY, or READ_WRITE.
*
* Check that INVALID_OPERATION is generated by MapNamedBuffer if the
* buffer object is in a mapped state.
*
*
* Check that INVALID_OPERATION is generated by MapNamedBufferRange if
* buffer is not the name of an existing buffer object.
*
* Check that INVALID_VALUE is generated by MapNamedBufferRange if offset
* or length is negative, if offset+length is greater than the value of
* BUFFER_SIZE for the buffer object, or if access has any bits set other
* than those defined above.
*
* Check that INVALID_OPERATION is generated by MapNamedBufferRange for any
* of the following conditions:
* - length is zero.
* - The buffer object is already in a mapped state.
* - Neither MAP_READ_BIT nor MAP_WRITE_BIT is set.
* - MAP_READ_BIT is set and any of MAP_INVALIDATE_RANGE_BIT,
* MAP_INVALIDATE_BUFFER_BIT or MAP_UNSYNCHRONIZED_BIT is set.
* - MAP_FLUSH_EXPLICIT_BIT is set and MAP_WRITE_BIT is not set.
* - Any of MAP_READ_BIT, MAP_WRITE_BIT, MAP_PERSISTENT_BIT, or
* MAP_COHERENT_BIT are set, but the same bit is not included in the
* buffer's storage flags.
*
*
* Check that INVALID_OPERATION is generated by UnmapNamedBuffer if buffer
* is not the name of an existing buffer object.
*
* Check that INVALID_OPERATION is generated by UnmapNamedBuffer if the
* buffer object is not in a mapped state.
*
*
* Check that INVALID_OPERATION is generated by FlushMappedNamedBufferRange
* if buffer is not the name of an existing buffer object.
*
* Check that INVALID_VALUE is generated by FlushMappedNamedBufferRange if
* offset or length is negative, or if offset + length exceeds the size of
* the mapping.
*
* Check that INVALID_OPERATION is generated by FlushMappedNamedBufferRange
* if the buffer object is not mapped, or is mapped without the
* MAP_FLUSH_EXPLICIT_BIT flag.
*
*
* Check that INVALID_OPERATION is generated by GetNamedBufferParameter* if
* buffer is not the name of an existing buffer object.
*
* Check that INVALID_ENUM is generated by GetNamedBufferParameter* if
* pname is not one of the buffer object parameter names: BUFFER_ACCESS,
* BUFFER_ACCESS_FLAGS, BUFFER_IMMUTABLE_STORAGE, BUFFER_MAPPED,
* BUFFER_MAP_LENGTH, BUFFER_MAP_OFFSET, BUFFER_SIZE, BUFFER_STORAGE_FLAGS,
* BUFFER_USAGE.
*
*
* Check that INVALID_OPERATION is generated by GetNamedBufferPointerv
* if buffer is not the name of an existing buffer object.
*
*
* Check that INVALID_OPERATION is generated by GetNamedBufferSubData if
* buffer is not the name of an existing buffer object.
*
* Check that INVALID_VALUE is generated by GetNamedBufferSubData if offset
* or size is negative, or if offset+size is greater than the value of
* BUFFER_SIZE for the buffer object.
*
* Check that INVALID_OPERATION is generated by GetNamedBufferSubData if
* the buffer object is mapped with MapBufferRange or MapBuffer, unless it
* was mapped with the MAP_PERSISTENT_BIT bit set in the MapBufferRange
* access flags.
*/
class ErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
ErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ErrorsTest(const ErrorsTest& other);
ErrorsTest& operator=(const ErrorsTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLenum internalformat,
glw::GLenum format, glw::GLenum type,
const glw::GLvoid* data);
typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLenum internalformat,
glw::GLintptr offset, glw::GLsizei size,
glw::GLenum format, glw::GLenum type,
const glw::GLvoid* data);
typedef void(GLW_APIENTRY* PFNGLCOPYNAMEDBUFFERSUBDATA)(glw::GLuint readBuffer, glw::GLuint writeBuffer,
glw::GLintptr readOffset, glw::GLintptr writeOffset,
glw::GLsizeiptr size);
typedef void(GLW_APIENTRY* PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset,
glw::GLsizei length);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERI64V)(glw::GLuint buffer, glw::GLenum pname,
glw::GLint64* data);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERIV)(glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPOINTERV)(glw::GLuint buffer, glw::GLenum pname,
glw::GLvoid** params);
typedef void*(GLW_APIENTRY* PFNGLGETNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
glw::GLvoid* data);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
glw::GLbitfield access);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizeiptr size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
const glw::GLvoid* data, glw::GLbitfield flags);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
const glw::GLvoid* data);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
PFNGLCLEARNAMEDBUFFERDATA m_pClearNamedBufferData;
PFNGLCLEARNAMEDBUFFERSUBDATA m_pClearNamedBufferSubData;
PFNGLCOPYNAMEDBUFFERSUBDATA m_pCopyNamedBufferSubData;
PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE m_pFlushMappedNamedBufferRange;
PFNGLGETNAMEDBUFFERPARAMETERI64V m_pGetNamedBufferParameteri64v;
PFNGLGETNAMEDBUFFERPARAMETERIV m_pGetNamedBufferParameteriv;
PFNGLGETNAMEDBUFFERPOINTERV m_pGetNamedBufferPointerv;
PFNGLGETNAMEDBUFFERSUBDATA m_pGetNamedBufferSubData;
PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
PFNGLNAMEDBUFFERSUBDATA m_pNamedBufferSubData;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
/* Private member functions */
bool TestErrorsOfClearNamedBufferData();
bool TestErrorsOfClearNamedBufferSubData();
bool TestErrorsOfCopyNamedBufferSubData();
bool TestErrorsOfCreateBuffers();
bool TestErrorsOfFlushMappedNamedBufferRange();
bool TestErrorsOfGetNamedBufferParameter();
bool TestErrorsOfGetNamedBufferPointerv();
bool TestErrorsOfGetNamedBufferSubData();
bool TestErrorsOfMapNamedBuffer();
bool TestErrorsOfMapNamedBufferRange();
bool TestErrorsOfNamedBufferData();
bool TestErrorsOfNamedBufferStorage();
bool TestErrorsOfNamedBufferSubData();
bool TestErrorsOfUnmapNamedBuffer();
bool ErrorCheckAndLog(const glw::GLchar* function_name, const glw::GLenum expected_error,
const glw::GLchar* when_shall_be_generated);
};
/* ErrorsTest class */
/** @class FunctionalTest
*
* @brief Direct State Access Buffer Objects Functional Test.
*
* This test verifies basic usage in rendering pipeline of the tested
* functions:
* - ClearNamedBufferData,
* - ClearNamedBufferSubData,
* - CopyNamedBufferSubData,
* - FlushMappedNamedBufferRange,
* - GetNamedBufferParameteri64v,
* - GetNamedBufferParameteriv,
* - GetNamedBufferPointerv,
* - GetNamedBufferSubData,
* - MapNamedBuffer,
* - MapNamedBufferRange,
* - NamedBufferData,
* - NamedBufferStorage,
* - NamedBufferSubData and
* - UnmapNamedBuffer.
*
* Test follows the steps:
*
* Prepare program with vertex shader and fragment shader. Fragment shader
* shall be pass-trough. Vertex shader shall have one integer input
* variable. Vertex shader shall output (to transform feedback) square of
* input variable. gl_Position shall be set up to vec4(0.0, 0.0, 0.0, 1.0).
* Build and use the program.
*
* Create and bind empty vertex array object.
*
* Prepare one buffer using CreateBuffers and NamedBufferStorage with size
* of 6 integers and passing pointer to data {1, 2, 3, 4, 5, 5} and dynamic
* storage flag set on. Clear (with 0) the first element with
* ClearNamedBufferSubData. Set second data element to 1 using
* NamedBufferSubData. Set third data element to 2 using MapNamedBuffer
* and UnmapNamedBuffer. Bind it to ARRAY_BUFFER binding point. Copy forth
* element into fifth element using CopyNamedBufferSubData. Set fourth data
* element using MapNamedBufferRange and FlushMappedNamedBuffer to 3.
* During mapping check that GetNamedBufferPointerv called with
* BUFFER_MAP_POINTER returns proper pointer. Unmap it using
* UnmapNamedBuffer function. Setup buffer as an input attribute to GLSL
* program. Consequently, the resulting buffer shall be {0, 1, 2, 3, 4, 5}.
*
* Prepare one buffer using GenBuffers. Bind it to transform feedback.
* Allocate it's storage using NamedBufferData with size of 7 integers and
* passing pointer to data {0, 0, 0, 0, 0, 0, 36}. Set up this buffer as
* transform feedback output.
*
* Begin transform feedback.
*
* Draw six indices using points.
*
* End transform feedback.
*
* Query array buffer's parameter BUFFER_IMMUTABLE_STORAGE with
* GetNamedBufferParameteriv and compare with previous setup.
*
* Query transform feedback buffer size with GetNamedBufferParameteri64v
* and compare with previous setup.
*
* Fetch transform feedback buffer content using GetNamedBufferSubData and
* queried size.
*
* Check that fetched data is equal to {0, 1, 4, 9, 16, 25, 36}.
*
* If any check fails, test shall fail.
*
* If any of the tested functions generates error, test shall fail.
*/
class FunctionalTest : public deqp::TestCase
{
public:
/* Public member functions */
FunctionalTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
FunctionalTest(const FunctionalTest& other);
FunctionalTest& operator=(const FunctionalTest& other);
/* API entry points. */
typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLenum internalformat,
glw::GLenum format, glw::GLenum type,
const glw::GLvoid* data);
typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLenum internalformat,
glw::GLintptr offset, glw::GLsizei size,
glw::GLenum format, glw::GLenum type,
const glw::GLvoid* data);
typedef void(GLW_APIENTRY* PFNGLCOPYNAMEDBUFFERSUBDATA)(glw::GLuint readBuffer, glw::GLuint writeBuffer,
glw::GLintptr readOffset, glw::GLintptr writeOffset,
glw::GLsizeiptr size);
typedef void(GLW_APIENTRY* PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset,
glw::GLsizei length);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERI64V)(glw::GLuint buffer, glw::GLenum pname,
glw::GLint64* data);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERIV)(glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPOINTERV)(glw::GLuint buffer, glw::GLenum pname,
glw::GLvoid** params);
typedef void*(GLW_APIENTRY* PFNGLGETNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
glw::GLvoid* data);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
glw::GLbitfield access);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizeiptr size, const glw::GLvoid* data,
glw::GLenum usage);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
const glw::GLvoid* data, glw::GLbitfield flags);
typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
const glw::GLvoid* data);
typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
PFNGLCLEARNAMEDBUFFERDATA m_pClearNamedBufferData;
PFNGLCLEARNAMEDBUFFERSUBDATA m_pClearNamedBufferSubData;
PFNGLCOPYNAMEDBUFFERSUBDATA m_pCopyNamedBufferSubData;
PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE m_pFlushMappedNamedBufferRange;
PFNGLGETNAMEDBUFFERPARAMETERI64V m_pGetNamedBufferParameteri64v;
PFNGLGETNAMEDBUFFERPARAMETERIV m_pGetNamedBufferParameteriv;
PFNGLGETNAMEDBUFFERPOINTERV m_pGetNamedBufferPointerv;
PFNGLGETNAMEDBUFFERSUBDATA m_pGetNamedBufferSubData;
PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
PFNGLNAMEDBUFFERSUBDATA m_pNamedBufferSubData;
PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
/* Private member variables. */
glw::GLuint m_po;
glw::GLuint m_vao;
glw::GLuint m_bo_in;
glw::GLuint m_bo_out;
glw::GLint m_attrib_location;
/* Private static variables. */
static const glw::GLchar s_vertex_shader[];
static const glw::GLchar s_fragment_shader[];
static const glw::GLchar s_vertex_shader_input_name[];
static const glw::GLchar* s_vertex_shader_output_name;
static const glw::GLint s_initial_data_a[];
static const glw::GLint s_initial_data_b[];
static const glw::GLint s_expected_data[];
/* Private member functions */
void BuildProgram();
void PrepareVertexArrayObject();
bool PrepareInputBuffer();
bool PrepareOutputBuffer();
void Draw();
bool CheckArrayBufferImmutableFlag();
bool CheckTransformFeedbackBufferSize();
bool CheckTransformFeedbackResult();
void Cleanup();
};
/* FunctionalTest class */
} /* Buffers namespace */
namespace Framebuffers
{
/** Framebuffer Creation
*
* Create at least two framebuffer objects using GenFramebuffers function.
* Check them without binding, using IsFramebuffer function. Expect FALSE.
*
* Create at least two framebuffer objects using CreateFramebuffers
* function. Check them without binding, using IsFramebuffer function.
* Expect TRUE.
*
* Release objects.
*/
class CreationTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationTest(const CreationTest& other);
CreationTest& operator=(const CreationTest& other);
};
/* CreationTest class */
/** Framebuffer Renderbuffer Attachment
*
* Create renderbuffer using GenRenderbuffers function. Bind it. Prepare
* its storage using RenderbufferStorage. Unbind it.
*
* Create framebuffer using CreateFramebuffers. Setup renderbuffer storage.
* Attach the renderbuffer to the framebuffer using
* NamedFramebufferRenderbuffer function.
*
* Bind framebuffer and check its status using CheckFramebufferStatus
* function call.
*
* Clear the framebuffer's content with the reference value. Fetch the
* framebuffer's content using ReadPixels and compare it with reference
* values.
*
* Repeat the test for following attachment types:
* - COLOR_ATTACHMENTi for i from 0 to value of MAX_COLOR_ATTACHMENTS
* minus one,
* - DEPTH_ATTACHMENT,
* - STENCIL_ATTACHMENT and
* - DEPTH_STENCIL_ATTACHMENT.
*/
class RenderbufferAttachmentTest : public deqp::TestCase
{
public:
/* Public member functions */
RenderbufferAttachmentTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
RenderbufferAttachmentTest(const RenderbufferAttachmentTest& other);
RenderbufferAttachmentTest& operator=(const RenderbufferAttachmentTest& other);
bool Test(glw::GLenum attachment, glw::GLenum internalformat);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_rbo;
};
/* RenderbufferAttachmentTest class */
/** Named Framebuffer Texture Attachment
*
* Create texture using CreateTexture function. Prepare its storage using
* TexStorage*D*.
*
* Create framebuffer using CreateFramebuffers. Attach the texture to
* the framebuffer using NamedFramebufferTexture function. Repeat
* attachment for all texture levels.
*
* Bind framebuffer and check its status using CheckFramebufferStatus
* function call.
*
* Clear the framebuffer's content with the reference value. Fetch the
* framebuffer's content using ReadPixels and compare it with reference
* values.
*
* Repeat the test for following attachment types:
* - COLOR_ATTACHMENTi for i from 0 to value of MAX_COLOR_ATTACHMENTS
* minus one,
* - DEPTH_ATTACHMENT,
* - STENCIL_ATTACHMENT and
* - DEPTH_STENCIL_ATTACHMENT.
*
* Repeat the test for following texture targets:
* - TEXTURE_RECTANGLE,
* - TEXTURE_2D,
* - TEXTURE_2D_MULTISAMPLE,
* - TEXTURE_CUBE_MAP.
*
* Repeat the test with each possible texture level, that is:
* - 0 for TEXTURE_RECTANGLE and TEXTURE_2D_MULTISAMPLE targets;
* - from zero to value one less than base 2 logarithm of the value of
* MAX_3D_TEXTURE_SIZE for TEXTURE_2D target
* - from zero to value one less than base 2 logarithm of the value of
* MAX_CUBE_MAP_TEXTURE_SIZE for TEXTURE_CUBE_MAP target.
*/
class TextureAttachmentTest : public deqp::TestCase
{
public:
/* Public member functions */
TextureAttachmentTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
TextureAttachmentTest(const TextureAttachmentTest& other);
TextureAttachmentTest& operator=(const TextureAttachmentTest& other);
bool Test(glw::GLenum attachment, bool is_color_attachment, glw::GLenum texture_target, glw::GLenum internalformat,
glw::GLuint levels);
bool SubTestAttachmentError(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level,
glw::GLuint levels);
bool SubTestStatus(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level, glw::GLuint levels);
bool SubTestContent(glw::GLenum attachment, glw::GLenum texture_target, glw::GLenum internalformat,
glw::GLuint level, glw::GLuint levels);
glw::GLuint MaxTextureLevels(glw::GLenum texture_target);
void Clear();
void Clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_to;
/* Static private variables. */
static const glw::GLenum s_targets[];
static const glw::GLuint s_targets_count;
static const glw::GLfloat s_reference_color[4];
static const glw::GLint s_reference_color_integer[4];
static const glw::GLfloat s_reference_depth;
static const glw::GLint s_reference_stencil;
};
/* TextureAttachmentTest class */
/** Named Framebuffer Texture Layer Attachment
*
* Create texture using CreateTexture function. Prepare its storage using
* TexStorage*D*.
*
* Create framebuffer using CreateFramebuffers. Attach the texture to the
* framebuffer using NamedFramebufferTextureLayer function.
*
* Bind framebuffer and check its status using CheckFramebufferStatus
* function call.
*
* For non multisample target, clean the framebuffer's content with the
* reference value. Fetch one pixel from framebuffer's content using
* ReadPixels and compare it with reference values.
*
* Repeat the test for following attachment types:
* - COLOR_ATTACHMENTi for i from 0 to value of MAX_COLOR_ATTACHMENTS
* minus one,
* - DEPTH_ATTACHMENT,
* - STENCIL_ATTACHMENT and
* - DEPTH_STENCIL_ATTACHMENT.
*
* Repeat the test for following texture targets:
* - TEXTURE_2D_MULTISAMPLE_ARRAY,
* - TEXTURE_2D_ARRAY,
* - TEXTURE_CUBE_MAP_ARRAY,
* - TEXTURE_3D.
*
* Repeat the test for texture levels from zero to value one less than base
* 2 logarithm of the value of MAX_3D_TEXTURE_SIZE.
*
* Repeat with texture which has number of layers:
* - 1,
* - 256,
* - value of MAX_CUBE_MAP_TEXTURE_SIZE for TEXTURE_CUBE_ARRAY or value
* of MAX_3D_TEXTURE_SIZE.
* Test only limited set of the layers of the above textures to reduce time
* complexity of the test.
*/
class TextureLayerAttachmentTest : public deqp::TestCase
{
public:
/* Public member functions */
TextureLayerAttachmentTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
TextureLayerAttachmentTest(const TextureLayerAttachmentTest& other);
TextureLayerAttachmentTest& operator=(const TextureLayerAttachmentTest& other);
bool Test(glw::GLenum attachment, bool is_color_attachment, glw::GLenum texture_target, glw::GLenum internalformat,
glw::GLuint levels, glw::GLint layers);
bool SubTestAttachmentError(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level, glw::GLint layer,
glw::GLuint levels, glw::GLint layers);
bool SubTestStatus(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level, glw::GLint layer,
glw::GLuint levels, glw::GLint layers);
bool SubTestContent(glw::GLenum attachment, glw::GLenum texture_target, glw::GLenum internalformat,
glw::GLuint level, glw::GLint layer, glw::GLuint levels, glw::GLint layers);
void Clear();
glw::GLuint MaxTextureLevels(glw::GLenum texture_target);
glw::GLuint MaxTextureLayers(glw::GLenum texture_target);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_to;
/* Static private variables. */
static const glw::GLenum s_targets[];
static const glw::GLuint s_targets_count;
static const glw::GLfloat s_reference_color[4];
static const glw::GLint s_reference_color_integer[4];
static const glw::GLfloat s_reference_depth;
static const glw::GLint s_reference_stencil;
};
/* TextureLayerAttachmentTest class */
/** Named Framebuffer Draw Read Buffer
*
* Create named framebuffer with maximum number of color attachments (use
* named renderbuffer storage).
*
* For each color attachment use NamedFramebufferDrawBuffer to set up it as
* a draw buffer. Clear it with unique color.
*
* For each color attachment use NamedFramebufferReadBuffer to set up it as
* a read buffer. Fetch the pixel data and compare that it contains unique
* color with the attachment was cleared
*
* Check that NamedFramebufferDrawBuffer and NamedFramebufferReadBuffer
* accept GL_NONE as mode without error.
*
* Release all objects.
*/
class DrawReadBufferTest : public deqp::TestCase
{
public:
/* Public member functions */
DrawReadBufferTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DrawReadBufferTest(const DrawReadBufferTest& other);
DrawReadBufferTest& operator=(const DrawReadBufferTest& other);
};
/* DrawReadBufferTest class */
/** Named Framebuffer Draw Buffers
*
* Create named framebuffer with maximum number of color attachments (use
* named renderbuffer storage).
*
* Set up all attachments as a draw buffer using the function
* NamedFramebufferDrawBuffers. Then clear them at once with unique color.
*
* For each color attachment fetch pixel data and compare that contain
* the same unique color.
*
* Release all objects.
*/
class DrawBuffersTest : public deqp::TestCase
{
public:
/* Public member functions */
DrawBuffersTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DrawBuffersTest(const DrawBuffersTest& other);
DrawBuffersTest& operator=(const DrawBuffersTest& other);
/* Private static constants. */
static const glw::GLfloat s_rgba[4];
};
/* DrawReadBuffersTest class */
/** Invalidate Named Framebuffer Data
*
* For default framebuffer try to invalidate each of COLOR, DEPTH, and
* STENCIL attachments. Expect no error.
*
* For default framebuffer try to invalidate all (COLOR, DEPTH, and
* STENCIL) attachments. Expect no error.
*
* Create named framebuffer with maximum number of color attachments (use
* named renderbuffer storage), depth attachment and stencil attachment.
*
* Clear all attachments.
*
* Try to invalidate content of all attachments using
* InvalidateNamedFramebufferData. Expect no error.
*
* Try to invalidate content of each attachment using
* InvalidateNamedFramebufferData. Expect no error.
*
* Release all objects.
*/
class InvalidateDataTest : public deqp::TestCase
{
public:
/* Public member functions */
InvalidateDataTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
InvalidateDataTest(const InvalidateDataTest& other);
InvalidateDataTest& operator=(const InvalidateDataTest& other);
bool CheckErrorAndLog(const glw::GLenum attachment);
bool CheckErrorAndLog(const glw::GLenum attachments[], const glw::GLuint count);
};
/* InvalidateDataTest class */
/** Invalidate Named Framebuffer SubData
*
* For default framebuffer try to invalidate part of each of COLOR, DEPTH,
* and STENCIL attachments. Expect no error.
*
* For default framebuffer try to invalidate part of all (COLOR, DEPTH, and
* STENCIL) attachments. Expect no error.
*
* Create named framebuffer with maximum number of color attachments (use
* named renderbuffer storage), depth attachment and stencil attachment.
*
* Clear all attachments.
*
* Try to invalidate content of part of all attachments using
* InvalidateNamedFramebufferData. Expect no error.
*
* Try to invalidate content of part of each attachment using
* InvalidateNamedFramebufferData. Expect no error.
*
* Release all objects.
*/
class InvalidateSubDataTest : public deqp::TestCase
{
public:
/* Public member functions */
InvalidateSubDataTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
InvalidateSubDataTest(const InvalidateSubDataTest& other);
InvalidateSubDataTest& operator=(const InvalidateSubDataTest& other);
bool CheckErrorAndLog(const glw::GLenum attachment);
bool CheckErrorAndLog(const glw::GLenum attachments[], const glw::GLuint count);
};
/* InvalidateSubDataTest class */
/** Clear Named Framebuffer
*
* Repeat following steps for fixed-point, floating-point, signed integer,
* and unsigned integer color attachments.
*
* Create named framebuffer with maximum number of color attachments
* (use named renderbuffer storage).
*
* Clear each of the color attachment with unique color using proper
* ClearNamedFramebuffer* function.
*
* For each color attachment fetch pixel data and compare that contain
* unique color with which it was cleared.
*
* Release all objects.
*
* Next, do following steps:
*
* Create named framebuffer with depth attachment and stencil
* attachment.
*
* Clear each of the attachments with unique value using proper
* ClearNamedFramebufferfi function.
*
* Fetch pixel data of each attachment and compare that contain unique
* value with which it was cleared.
*
* Release all objects.
*/
class ClearTest : public deqp::TestCase
{
public:
/* Public member functions */
ClearTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ClearTest(const ClearTest& other);
ClearTest& operator=(const ClearTest& other);
void PrepareFramebuffer(glw::GLenum buffer, glw::GLenum internalformat);
template <typename T>
bool TestClearColor(glw::GLenum buffer, glw::GLenum attachment, T value);
template <typename T>
bool ClearColor(glw::GLenum buffer, glw::GLint drawbuffer, T value);
bool TestClearDepthAndStencil(glw::GLfloat depth, glw::GLint stencil);
template <typename T>
glw::GLenum Format();
template <typename T>
glw::GLenum Type();
template <typename T>
bool Compare(const T first, const T second);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint* m_renderbuffers;
glw::GLuint m_renderbuffers_count;
};
/* ClearTest class */
/** Blit Named Framebuffer
*
* Create named framebuffer with color, depth and stencil attachments with
* size 2x2 pixels(use named renderbuffer storage).
*
* Create named framebuffer with color, depth and stencil attachments with
* size 2x3 pixels(use named renderbuffer storage).
*
* Clear the first framebuffer with red color, 0.5 depth and 1 as a stencil
* index.
*
* Blit one pixel of the first framebuffer to the second framebuffer to the
* pixel at (0, 0) position with NEAREST filter.
*
* Clear first the framebuffer with green color, 0.25 depth and 2 as a
* stencil index.
*
* Blit one pixel of the first framebuffer to the second framebuffer to the
* pixel at (1, 0) position with LINEAR filter for color attachment, but
* NEAREST filter for depth and stencil attachments.
*
* Clear the first framebuffer with blue color, 0.125 depth and 3 as a
* stencil index.
*
* Blit the whole first framebuffer to the second framebuffer by shrinking
* it to the single pixel at (2, 0) position.
*
* Clear the first framebuffer with yellow color, 0.0625 depth and 4 as a
* stencil index.
*
* Blit one pixel of the framebuffer to the second framebuffer by expanding
* it to the three pixel constructing horizontal line at (0, 1) position.
*
* Expect no error.
*
* Check that color attachment of the second framebuffer has following
* values:
* red, green, blue,
* yellow, yellow, yellow.
*
* Check that depth attachment of the second framebuffer has following
* values:
* 0.5, 0.25, 0.125
* 0.0625, 0.0625, 0.0625.
*
* Check that stencil attachment of the second framebuffer has following
* values:
* 1, 2, 3
* 4, 4, 4.
*
* Release all objects.
*/
class BlitTest : public deqp::TestCase
{
public:
/* Public member functions */
BlitTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
BlitTest(const BlitTest& other);
BlitTest& operator=(const BlitTest& other);
void PrepareFramebuffers();
bool Test();
void ClearFramebuffer(glw::GLfloat red, glw::GLfloat green, glw::GLfloat blue, glw::GLfloat depth,
glw::GLint stencil);
bool CheckErrorAndLog();
bool CheckColor();
bool CheckDepth();
bool CheckStencil();
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_src;
glw::GLuint m_rbo_color_src;
glw::GLuint m_rbo_depth_stencil_src;
glw::GLuint m_fbo_dst;
glw::GLuint m_rbo_color_dst;
glw::GLuint m_rbo_depth_stencil_dst;
};
/* BlitTest class */
/** Check Named Framebuffer Status
*
* Do following test cases:
*
* Incomplete attachment case
*
* Prepare framebuffer with one incomplete attachment.
*
* Check the framebuffer status using CheckNamedFramebufferStatus.
* Expect FRAMEBUFFER_INCOMPLETE_ATTACHMENT return value.
*
* Release all objects.
*
* Repeat the test case for all possible color, depth and stencil
* attachments.
*
* Missing attachment case
*
* Prepare framebuffer without any attachment.
*
* Check the framebuffer status using CheckNamedFramebufferStatus.
* Expect FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT return value.
*
* Release all objects.
*
* Incomplete multisample renderbuffer case
*
* Prepare framebuffer with two multisampled renderbuffer color
* attachments which have different number of samples.
*
* Check the framebuffer status using CheckNamedFramebufferStatus.
* Expect FRAMEBUFFER_INCOMPLETE_MULTISAMPLE return value. If the
* check fails return TEST_RESULT_COMPATIBILITY_WARNING.
*
* Release all objects.
*
* Incomplete multisample texture case
*
* Prepare framebuffer with two multisampled texture color
* attachments and one multisampled renderbuffer which all have
* different number of sample locations. One of the textures shall
* have fixed sample locations set, one not.
*
* Check the framebuffer status using CheckNamedFramebufferStatus.
* Expect FRAMEBUFFER_INCOMPLETE_MULTISAMPLE return value. If the
* check fails return TEST_RESULT_COMPATIBILITY_WARNING.
*
* Release all objects.
*
* Incomplete layer targets case
*
* Prepare framebuffer with one 3D texture and one 2D texture.
*
* Check the framebuffer status using CheckNamedFramebufferStatus.
* Expect FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS return value. If the
* check fails return TEST_RESULT_COMPATIBILITY_WARNING.
*
* Release all objects.
*
* Note
*
* The specification is not clear about framebuffer completeness. The
* OpenGL 4.5 Core Profile Specification in chapter 9.4.2 says:
*
* "The framebuffer object bound to target is said to be framebuffer
* complete if all the following conditions are true [...]"
*
* It does not say that framebuffer is incomplete when any of the
* conditions are not met. Due to this wording, except for obvious cases
* (incomplete attachment and missing attachments) other tests are optional
* and may result in QP_TEST_RESULT_COMPATIBILITY_WARNING when fail.
*/
class CheckStatusTest : public deqp::TestCase
{
public:
/* Public member functions */
CheckStatusTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CheckStatusTest(const CheckStatusTest& other);
CheckStatusTest& operator=(const CheckStatusTest& other);
bool IncompleteAttachmentTestCase();
bool MissingAttachmentTestCase();
bool IncompleteMultisampleRenderbufferTestCase();
bool IncompleteMultisampleTextureTestCase();
bool IncompleteLayerTargetsTestCase();
};
/* CheckStatusTest class */
/** Get Named Framebuffer Parameters
*
* Prepare framebuffer with read and write buffers and renderbuffer color
* attachment.
*
* Do following checks for the created framebuffer:
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* FRAMEBUFFER_DEFAULT_WIDTH returns the value of
* FRAMEBUFFER_DEFAULT_WIDTH for the framebuffer object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* FRAMEBUFFER_DEFAULT_HEIGHT returns the value of
* FRAMEBUFFER_DEFAULT_HEIGHT for the framebuffer object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* FRAMEBUFFER_DEFAULT_LAYERS returns the value of
* FRAMEBUFFER_DEFAULT_LAYERS for the framebuffer object.
* Check that GetNamedFramebufferParameteriv called with parameter name
* FRAMEBUFFER_DEFAULT_SAMPLES returns the value of
* FRAMEBUFFER_DEFAULT_SAMPLES for the framebuffer object.
* Check that GetNamedFramebufferParameteriv called with parameter name
* FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS returns the boolean value
* of FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS.
*
* Do following checks for the created and default (if available)
* framebuffer:
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* DOUBLEBUFFER returns a boolean value indicating whether double
* buffering is supported for the framebuffer object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* IMPLEMENTATION_COLOR_READ_FORMAT returns a GLenum value indicating
* the preferred pixel data format for the framebuffer object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* IMPLEMENTATION_COLOR_READ_TYPE returns a GLenum value indicating the
* implementation's preferred pixel data type for the framebuffer
* object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* SAMPLES returns an integer value indicating the coverage mask size
* for the framebuffer object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* SAMPLE_BUFFERS returns an integer value indicating the number of
* sample buffers associated with the framebuffer object.
*
* Check that GetNamedFramebufferParameteriv called with parameter name
* STEREO returns a boolean value indicating whether stereo buffers
* (left and right) are supported for the framebuffer object.
*
* Release all objects.
*/
class GetParametersTest : public deqp::TestCase
{
public:
/* Public member functions */
GetParametersTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
GetParametersTest(const GetParametersTest& other);
GetParametersTest& operator=(const GetParametersTest& other);
void PrepareFramebuffer();
bool TestDefaultFramebuffer();
bool TestCustomFramebuffer();
void Clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_rbo;
};
/* GetParametersTest class */
/** Get Named Framebuffer Attachment Parameters
*
* For default framebuffer, for all attachments:
* FRONT_LEFT,
* FRONT_RIGHT,
* BACK_LEFT,
* BACK_RIGHT,
* DEPTH,
* STENCIL
* query FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE using
* GetNamedFramebufferAttachmentParameteriv function. Expect
* FRAMEBUFFER_DEFAULT return value (as queried with non-DSA way).
*
* For any attachments not equal to GL_NONE do following queries using
* GetNamedFramebufferAttachmentParameteriv function:
* FRAMEBUFFER_ATTACHMENT_RED_SIZE,
* FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
* FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
* FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
* FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
* FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE,
* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.
* Expect value equal to framebuffers setup (as queried with non-DSA way).
* Expect no error.
*
* Create 3 framebuffer objects with renderbuffer color attachment, and
* depth or stencil or depth-stencil attachments.
*
* For each of framebuffers, for each of following attachments:
* DEPTH_ATTACHMENT,
* STENCIL_ATTACHMENT,
* DEPTH_STENCIL_ATTACHMENT,
* COLOR_ATTACHMENT0,
* COLOR_ATTACHMENT1
* query FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE using
* GetNamedFramebufferAttachmentParameteriv function. Expect the same
* return value as queried with non-DSA way.
*
* For each of framebuffers, for any attachments not equal to GL_NONE do
* following queries using GetNamedFramebufferAttachmentParameteriv
* function:
* FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
* FRAMEBUFFER_ATTACHMENT_RED_SIZE,
* FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
* FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
* FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
* FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
* FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE,
* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
* Expect value equal to framebuffers setup (as queried with non-DSA way).
* Expect no error.
*
* Release objects.
*
* Create 3 framebuffer objects with texture color attachment, and
* depth or stencil or depth-stencil attachments.
*
* For each of framebuffers, for each of following attachments:
* DEPTH_ATTACHMENT,
* STENCIL_ATTACHMENT,
* DEPTH_STENCIL_ATTACHMENT,
* COLOR_ATTACHMENT0,
* COLOR_ATTACHMENT1
* query FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE using
* GetNamedFramebufferAttachmentParameteriv function. Expect the same
* return value as queried with non-DSA way.
*
* For each of framebuffers, for any attachments not equal to GL_NONE do
* following queries using GetNamedFramebufferAttachmentParameteriv
* function:
* FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
* FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL,
* FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE,
* FRAMEBUFFER_ATTACHMENT_LAYERED,
* FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER,
* FRAMEBUFFER_ATTACHMENT_RED_SIZE,
* FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
* FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
* FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
* FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
* FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE,
* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
* Expect value equal to framebuffers setup (as queried with non-DSA way).
* Expect no error.
*
* Release objects.
*
* Additional conditions:
*
* Do not query DEPTH_STENCIL_ATTACHMENT attachment if the renderbuffer
* or texture is not depth-stencil.
*
* Do not query FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE pname with
* DEPTH_STENCIL_ATTACHMENT attachment.
*/
class GetAttachmentParametersTest : public deqp::TestCase
{
public:
/* Public member functions */
GetAttachmentParametersTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
GetAttachmentParametersTest(const GetAttachmentParametersTest& other);
GetAttachmentParametersTest& operator=(const GetAttachmentParametersTest& other);
void CreateRenderbufferFramebuffer(bool depth, bool stencil);
void CreateTextureFramebuffer(bool depth, bool stencil);
bool TestDefaultFramebuffer();
bool TestRenderbufferFramebuffer(bool depth_stencil);
bool TestTextureFramebuffer(bool depth_stencil);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo;
glw::GLuint m_rbo[2];
glw::GLuint m_to[2];
};
/* GetParametersTest class */
/** Create Named Framebuffers Errors
*
* Check that INVALID_VALUE is generated by CreateFramebuffers if n is
* negative.
*/
class CreationErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
CreationErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CreationErrorsTest(const CreationErrorsTest& other);
CreationErrorsTest& operator=(const CreationErrorsTest& other);
};
/* CreationErrorsTest class */
/** Named Framebuffer Renderbuffer Errors
*
* Check that INVALID_OPERATION is generated by
* NamedFramebufferRenderbuffer if framebuffer is not the name of an
* existing framebuffer object.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferRenderbuffer
* if attachment is COLOR_ATTACHMENTm where m is greater than or equal to
* the value of MAX_COLOR_ATTACHMENTS.
*
* Check that INVALID_ENUM is generated by NamedFramebufferRenderbuffer if
* attachment is not one of the attachments in table 9.2, and attachment is
* not COLOR_ATTACHMENTm where m is greater than or equal to the value of
* MAX_COLOR_ATTACHMENTS.
*
* Check that INVALID_ENUM is generated by NamedFramebufferRenderbuffer if
* renderbuffer target is not RENDERBUFFER.
*
* Check that INVALID_OPERATION is generated by
* NamedFramebufferRenderbuffer if renderbuffer target is not zero or the
* name of an existing renderbuffer object of type RENDERBUFFER.
*/
class RenderbufferAttachmentErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
RenderbufferAttachmentErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
RenderbufferAttachmentErrorsTest(const RenderbufferAttachmentErrorsTest& other);
RenderbufferAttachmentErrorsTest& operator=(const RenderbufferAttachmentErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, bool framebuffer, bool attachment, bool color_attachment,
bool renderbuffertarget, bool renderbuffer);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_rbo_valid;
glw::GLuint m_fbo_invalid;
glw::GLuint m_rbo_invalid;
glw::GLenum m_color_attachment_invalid;
glw::GLenum m_attachment_invalid;
glw::GLenum m_renderbuffer_target_invalid;
};
/* RenderbufferAttachmentErrorsTest class */
/** Named Framebuffer Texture Errors
*
* Check that GL_INVALID_OPERATION is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer
* if framebuffer is not the name of an existing framebuffer object.
*
* Check that INVALID_OPERATION is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer
* if attachment is COLOR_ATTACHMENTm where m is greater than or equal to
* the value of MAX_COLOR_ATTACHMENTS.
*
* Check that INVALID_ENUM is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer if
* attachment is not one of the attachments in table 9.2, and attachment is
* not COLOR_ATTACHMENTm where m is greater than or equal to the value of
* MAX_COLOR_ATTACHMENTS.
*
* Check that INVALID_VALUE is generated by glNamedFramebufferTexture if texture is not zero or the name
* of an existing texture object.
*
* Check that INVALID_OPERATION is generated by glNamedFramebufferTextureLayer if texture is not zero or
* the name of an existing texture object.
*
* Check that INVALID_VALUE is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer if
* texture is not zero and level is not a supported texture level for
* texture.
*
* Check that INVALID_OPERATION is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer
* if texture is a buffer texture.
*
* Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is a three-dimensional
* texture, and layer is larger than the value of MAX_3D_TEXTURE_SIZE minus one.
*
* Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is an array texture,
* and layer is larger than the value of MAX_ARRAY_TEXTURE_LAYERS minus one.
*
* Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is a cube map array texture,
* and (layer / 6) is larger than the value of MAX_CUBE_MAP_TEXTURE_SIZE minus one (see section 9.8).
* Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is non-zero
* and layer is negative.
*
* Check that INVALID_OPERATION error is generated by NamedFramebufferTextureLayer if texture is non-zero
* and is not the name of a three-dimensional, two-dimensional multisample array, one- or two-dimensional array,
* or cube map array texture.
*/
class TextureAttachmentErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
TextureAttachmentErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
TextureAttachmentErrorsTest(const TextureAttachmentErrorsTest& other);
TextureAttachmentErrorsTest& operator=(const TextureAttachmentErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function_name, bool framebuffer, bool attachment,
bool color_attachment, bool texture, bool level, const glw::GLchar* texture_type, bool layer);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_to_valid;
glw::GLuint m_to_3d_valid;
glw::GLuint m_to_array_valid;
glw::GLuint m_to_cubearray_valid;
glw::GLuint m_tbo_valid;
glw::GLuint m_fbo_invalid;
glw::GLuint m_to_invalid;
glw::GLuint m_to_layer_invalid; /* it is valid rectangle texture, but invalid for NamedFramebufferTextureLayer */
glw::GLenum m_color_attachment_invalid;
glw::GLenum m_attachment_invalid;
glw::GLint m_level_invalid;
glw::GLint m_max_3d_texture_size;
glw::GLint m_max_3d_texture_depth;
glw::GLint m_max_array_texture_layers;
glw::GLint m_max_cube_map_texture_size;
};
/* TextureAttachmentErrorsTest class */
/** Named Framebuffer Draw Read Buffers Errors
*
* Check that INVALID_OPERATION error is generated by
* NamedFramebufferDrawBuffer if framebuffer is not zero or the name of an
* existing framebuffer object.
*
* Check that INVALID_ENUM is generated by NamedFramebufferDrawBuffer if
* buf is not an accepted value.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffer
* if the GL is bound to a draw framebuffer object and the ith argument is
* a value other than COLOR_ATTACHMENTi or NONE.
*
* Check that INVALID_OPERATION error is generated by
* NamedFramebufferDrawBuffers if framebuffer is not zero or the name of an
* existing framebuffer object.
*
* Check that INVALID_VALUE is generated by NamedFramebufferDrawBuffers if
* n is less than 0.
*
* Check that INVALID_VALUE is generated by NamedFramebufferDrawBuffers if
* n is greater than MAX_DRAW_BUFFERS.
*
* Check that INVALID_ENUM is generated by NamedFramebufferDrawBuffers if
* one of the values in bufs is not an accepted value.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
* if a symbolic constant other than GL_NONE appears more than once in
* bufs.
*
* Check that INVALID_ENUM error is generated by
* NamedFramebufferDrawBuffers if any value in bufs is FRONT, LEFT, RIGHT,
* or FRONT_AND_BACK. This restriction applies to both the default
* framebuffer and framebuffer objects, and exists because these constants
* may themselves refer to multiple buffers, as shown in table 17.4.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
* if any value in bufs is BACK, and n is not one.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
* if the API call refers to a framebuffer object and one or more of the
* values in bufs is anything other than NONE or one of the
* COLOR_ATTACHMENTn tokens.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
* if the API call refers to the default framebuffer and one or more of the
* values in bufs is one of the COLOR_ATTACHMENTn tokens.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferReadBuffer
* if framebuffer is not zero or the name of an existing framebuffer
* object.
*
* Check that INVALID_ENUM is generated by NamedFramebufferReadBuffer if
* src is not one of the accepted values (tables 17.4 and 17.5 of OpenGL
* 4.5 Core Profile Specification).
*
* Check that INVALID_OPERATION is generated by NamedFramebufferReadBuffer
* if the default framebuffer is affected and src is a value (other than
* NONE) that does not indicate any of the color buffers allocated to the
* default framebuffer.
*
* Check that INVALID_OPERATION is generated by NamedFramebufferReadBuffer
* if a framebuffer object is affected, and src is one of the constants
* from table 17.4 (other than NONE, or COLOR_ATTACHMENTm where m is
* greater than or equal to the value of MAX_COLOR_ATTACHMENTS).
*/
class DrawReadBuffersErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
DrawReadBuffersErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
DrawReadBuffersErrorsTest(const DrawReadBuffersErrorsTest& other);
DrawReadBuffersErrorsTest operator=(const DrawReadBuffersErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_fbo_invalid;
glw::GLenum m_attachment_color;
glw::GLenum m_attachment_back_left;
glw::GLenum m_attachment_right;
glw::GLenum m_attachment_left;
glw::GLenum m_attachment_front;
glw::GLenum m_attachment_front_and_back;
glw::GLenum m_attachment_back;
glw::GLenum m_attachment_invalid;
glw::GLenum m_attachments_invalid[2];
glw::GLenum m_attachments_back_invalid[2];
glw::GLint m_attachments_too_many_count;
glw::GLenum* m_attachments_too_many;
glw::GLint m_max_color_attachments;
};
/* DrawReadBuffersErrorsTest class */
/** Invalidate Framebuffer Data and SubData Errors
Check that INVALID_OPERATION error is generated by
InvalidateNamedFramebufferData if framebuffer is not zero or the name of
an existing framebuffer object.
Check that INVALID_ENUM error is generated by
InvalidateNamedFramebufferData if a framebuffer object is affected, and
any element of of attachments is not one of the values
{COLOR_ATTACHMENTi, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT,
DEPTH_STENCIL_ATTACHMENT}.
Check that INVALID_OPERATION error is generated by
InvalidateNamedFramebufferData if attachments contains COLOR_ATTACHMENTm
where m is greater than or equal to the value of MAX_COLOR_ATTACHMENTS.
Check that INVALID_ENUM error is generated by
InvalidateNamedFramebufferData if the default framebuffer is affected,
and any elements of attachments are not one of:
- FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, and BACK_RIGHT, identifying that
specific buffer,
- COLOR, which is treated as BACK_LEFT for a double-buffered context
and FRONT_LEFT for a single-buffered context,
- DEPTH, identifying the depth buffer,
- STENCIL, identifying the stencil buffer.
Check that INVALID_OPERATION error is generated by
InvalidateNamedSubFramebuffer if framebuffer is not zero or the name of
an existing framebuffer object.
Check that INVALID_VALUE error is generated by
InvalidateNamedSubFramebuffer if numAttachments, width, or height is
negative.
Check that INVALID_ENUM error is generated by
InvalidateNamedSubFramebuffer if a framebuffer object is affected, and
any element of attachments is not one of the values {COLOR_ATTACHMENTi,
DEPTH_ATTACHMENT, STENCIL_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT}.
Check that INVALID_OPERATION error is generated by
InvalidateNamedSubFramebuffer if attachments contains COLOR_ATTACHMENTm
where m is greater than or equal to the value of MAX_COLOR_ATTACHMENTS.
Check that INVALID_ENUM error is generated by
InvalidateNamedSubFramebuffer if the default framebuffer is affected,
and any elements of attachments are not one of:
- FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, and BACK_RIGHT, identifying that
specific buffer,
- COLOR, which is treated as BACK_LEFT for a double-buffered context
and FRONT_LEFT for a single-buffered context,
- DEPTH, identifying the depth buffer,
- STENCIL, identifying the stencil buffer.
*/
class InvalidateDataAndSubDataErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
InvalidateDataAndSubDataErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
InvalidateDataAndSubDataErrorsTest(const InvalidateDataAndSubDataErrorsTest& other);
InvalidateDataAndSubDataErrorsTest operator=(const InvalidateDataAndSubDataErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_rbo;
glw::GLuint m_fbo_invalid;
glw::GLenum m_fbo_attachment_valid;
glw::GLenum m_fbo_attachment_invalid;
glw::GLenum m_color_attachment_invalid;
glw::GLenum m_default_attachment_invalid;
};
/* InvalidateDataAndSubDataErrorsTest class */
/** Clear Named Framebuffer Errors
*
* Check that INVALID_OPERATION is generated by ClearNamedFramebuffer* if
* framebuffer is not zero or the name of an existing framebuffer object.
*
* Check that INVALID_ENUM is generated by ClearNamedFramebufferiv buffer
* is not COLOR or STENCIL.
*
* Check that INVALID_ENUM is generated by ClearNamedFramebufferuiv buffer
* is not COLOR.
*
* Check that INVALID_ENUM is generated by ClearNamedFramebufferfv buffer
* is not COLOR or DEPTH.
*
* Check that INVALID_ENUM is generated by ClearNamedFramebufferfi buffer
* is not DEPTH_STENCIL.
*
* Check that INVALID_VALUE is generated if buffer is COLOR drawbuffer is
* negative, or greater than the value of MAX_DRAW_BUFFERS minus one.
*
* Check that INVALID_VALUE is generated if buffer is DEPTH, STENCIL or
* DEPTH_STENCIL and drawbuffer is not zero.
*/
class ClearNamedFramebufferErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
ClearNamedFramebufferErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
ClearNamedFramebufferErrorsTest(const ClearNamedFramebufferErrorsTest& other);
ClearNamedFramebufferErrorsTest& operator=(const ClearNamedFramebufferErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_rbo_color;
glw::GLuint m_rbo_depth_stencil;
glw::GLuint m_fbo_invalid;
};
/* ClearNamedFramebufferErrorsTest class */
/** Check Named Framebuffer Status Errors
*
* Check that INVALID_ENUM is generated by CheckNamedFramebufferStatus if
* target is not DRAW_FRAMEBUFFER, READ_FRAMEBUFFER or FRAMEBUFFER.
*
* Check that INVALID_OPERATION is generated by CheckNamedFramebufferStatus
* if framebuffer is not zero or the name of an existing framebuffer
* object.
*/
class CheckStatusErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
CheckStatusErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
CheckStatusErrorsTest(const CheckStatusErrorsTest& other);
CheckStatusErrorsTest& operator=(const CheckStatusErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_fbo_invalid;
glw::GLuint m_target_invalid;
};
/* CheckStatusErrorsTest class */
/** Get Named Framebuffer Parameter Errors
*
* Check that INVALID_OPERATION is generated by
* GetNamedFramebufferParameteriv if framebuffer is not zero or the name of
* an existing framebuffer object.
*
* Check that INVALID_ENUM is generated by GetNamedFramebufferParameteriv
* if pname is not one of the accepted parameter names.
*
* Check that INVALID_OPERATION is generated if a default framebuffer is
* queried, and pname is not one of DOUBLEBUFFER,
* IMPLEMENTATION_COLOR_READ_FORMAT, IMPLEMENTATION_COLOR_READ_TYPE,
* SAMPLES, SAMPLE_BUFFERS or STEREO.
*/
class GetParameterErrorsTest : public deqp::TestCase
{
public:
/* Public member functions */
GetParameterErrorsTest(deqp::Context& context);
virtual tcu::TestNode::IterateResult iterate();
private:
/* Private member functions */
GetParameterErrorsTest(const GetParameterErrorsTest& other);
GetParameterErrorsTest& operator=(const GetParameterErrorsTest& other);
void PrepareObjects();
bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
void Clean();
/* Private member variables. */
glw::GLuint m_fbo_valid;
glw::GLuint m_fbo_invalid;
glw::GLuint m_parameter_invalid;
};
/* GetParameterErrorsTest class */
/** Get Named Framebuffer Attachment Parameter Errors
*
* Check that GL_INVALID_OPERATION is generated by
* GetNamedFramebufferAttachmentParameteriv if framebuffer is not zero or
* the name of an existing framebuffer object.
*
* Check that INVALID_ENUM is generated by
* GetNamedFramebufferAttachmentParameteriv if pname is not valid for the
* value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, as described above.
*
* Check that INVALID_ENUM error is generated if a framebuffer object is queried, attachment
* is not one of the attachments in table 9.2 (COLOR_ATTACHMENTi, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT), and attachment is not
* COLOR_ATTACHMENTm where m is greater than or equal to the value of MAX_COLOR_ATTACHMENTS.
*
* Check that INVALID_OPERATION is generated by
* GetNamedFramebufferAttachmentParameteriv if the value of
* FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE and pname is not
* FRAMEBUFFER_ATTACHMENT_OBJECT_NAME or
* FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.
*
* Check that INVALID_OPERATION is gener