Commit 6eafb04c by Jiajia Qin Committed by Commit Bot

ES31: Add GL_ATOMIC_COUNTER_BUFFER_BINDING binding point

BUG=angleproject:1729 TEST=dEQP-GLES31.functional.state_query.integer.atomic_counter* dEQP-GLES31.functional.state_query.indexed.atomic_counter* angle_end2end_tests:AtomicCounterBufferTest Change-Id: I059c4e22e04cedec9134ec9f631de33f77b1fbe2 Reviewed-on: https://chromium-review.googlesource.com/430959Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent a02315b0
......@@ -308,6 +308,12 @@ Context::Context(rx::EGLImplFactory *implFactory,
Texture *zeroTexture2DMultisample =
new Texture(mImplementation.get(), 0, GL_TEXTURE_2D_MULTISAMPLE);
mZeroTextures[GL_TEXTURE_2D_MULTISAMPLE].set(zeroTexture2DMultisample);
bindGenericAtomicCounterBuffer(0);
for (unsigned int i = 0; i < mCaps.maxAtomicCounterBufferBindings; i++)
{
bindIndexedAtomicCounterBuffer(0, i, 0, 0);
}
}
if (mExtensions.eglImageExternal || mExtensions.eglStreamConsumerExternal)
......@@ -1059,6 +1065,21 @@ void Context::bindIndexedTransformFeedbackBuffer(GLuint bufferHandle,
mGLState.getCurrentTransformFeedback()->bindIndexedBuffer(index, buffer, offset, size);
}
void Context::bindGenericAtomicCounterBuffer(GLuint bufferHandle)
{
Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
mGLState.setGenericAtomicCounterBufferBinding(buffer);
}
void Context::bindIndexedAtomicCounterBuffer(GLuint bufferHandle,
GLuint index,
GLintptr offset,
GLsizeiptr size)
{
Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
mGLState.setIndexedAtomicCounterBufferBinding(index, buffer, offset, size);
}
void Context::bindCopyReadBuffer(GLuint bufferHandle)
{
Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
......@@ -3703,11 +3724,7 @@ void Context::bindBuffer(GLenum target, GLuint buffer)
bindGenericTransformFeedbackBuffer(buffer);
break;
case GL_ATOMIC_COUNTER_BUFFER:
if (buffer != 0)
{
// Binding buffers to this binding point is not implemented yet.
UNIMPLEMENTED();
}
bindGenericAtomicCounterBuffer(buffer);
break;
case GL_SHADER_STORAGE_BUFFER:
if (buffer != 0)
......@@ -3733,6 +3750,44 @@ void Context::bindBuffer(GLenum target, GLuint buffer)
}
}
void Context::bindBufferBase(GLenum target, GLuint index, GLuint buffer)
{
bindBufferRange(target, index, buffer, 0, 0);
}
void Context::bindBufferRange(GLenum target,
GLuint index,
GLuint buffer,
GLintptr offset,
GLsizeiptr size)
{
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
bindIndexedTransformFeedbackBuffer(buffer, index, offset, size);
bindGenericTransformFeedbackBuffer(buffer);
break;
case GL_UNIFORM_BUFFER:
bindIndexedUniformBuffer(buffer, index, offset, size);
bindGenericUniformBuffer(buffer);
break;
case GL_ATOMIC_COUNTER_BUFFER:
bindIndexedAtomicCounterBuffer(buffer, index, offset, size);
bindGenericAtomicCounterBuffer(buffer);
break;
case GL_SHADER_STORAGE_BUFFER:
if (buffer != 0)
{
// Binding buffers to this binding point is not implemented yet.
UNIMPLEMENTED();
}
break;
default:
UNREACHABLE();
break;
}
}
void Context::bindFramebuffer(GLenum target, GLuint framebuffer)
{
if (target == GL_READ_FRAMEBUFFER || target == GL_FRAMEBUFFER)
......
......@@ -139,6 +139,11 @@ class Context final : public ValidationContext
GLuint index,
GLintptr offset,
GLsizeiptr size);
void bindGenericAtomicCounterBuffer(GLuint bufferHandle);
void bindIndexedAtomicCounterBuffer(GLuint bufferHandle,
GLuint index,
GLintptr offset,
GLsizeiptr size);
void bindCopyReadBuffer(GLuint bufferHandle);
void bindCopyWriteBuffer(GLuint bufferHandle);
void bindPixelPackBuffer(GLuint bufferHandle);
......@@ -592,6 +597,12 @@ class Context final : public ValidationContext
void attachShader(GLuint program, GLuint shader);
void bindAttribLocation(GLuint program, GLuint index, const GLchar *name);
void bindBuffer(GLenum target, GLuint buffer);
void bindBufferBase(GLenum target, GLuint index, GLuint buffer);
void bindBufferRange(GLenum target,
GLuint index,
GLuint buffer,
GLintptr offset,
GLsizeiptr size);
void bindFramebuffer(GLenum target, GLuint framebuffer);
void bindRenderbuffer(GLenum target, GLuint renderbuffer);
......
......@@ -581,6 +581,7 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
switch (pname)
{
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
case GL_DRAW_INDIRECT_BUFFER_BINDING:
case GL_MAX_FRAMEBUFFER_WIDTH:
case GL_MAX_FRAMEBUFFER_HEIGHT:
......@@ -673,11 +674,19 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target,
{
case GL_MAX_COMPUTE_WORK_GROUP_COUNT:
case GL_MAX_COMPUTE_WORK_GROUP_SIZE:
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
{
*type = GL_INT;
*numParams = 1;
return true;
}
case GL_ATOMIC_COUNTER_BUFFER_START:
case GL_ATOMIC_COUNTER_BUFFER_SIZE:
{
*type = GL_INT_64_ANGLEX;
*numParams = 1;
return true;
}
}
return false;
......
......@@ -175,6 +175,8 @@ void State::initialize(const Caps &caps,
if (clientVersion >= Version(3, 1))
{
mSamplerTextures[GL_TEXTURE_2D_MULTISAMPLE].resize(caps.maxCombinedTextureImageUnits);
mAtomicCounterBuffers.resize(caps.maxAtomicCounterBufferBindings);
}
if (extensions.eglImageExternal || extensions.eglStreamConsumerExternal)
{
......@@ -258,6 +260,12 @@ void State::reset(const Context *context)
mPack.pixelBuffer.set(NULL);
mUnpack.pixelBuffer.set(NULL);
mGenericAtomicCounterBuffer.set(nullptr);
for (auto &buf : mAtomicCounterBuffers)
{
buf.set(nullptr);
}
mProgram = NULL;
angle::Matrix<GLfloat>::setToIdentity(mPathMatrixProj);
......@@ -1157,6 +1165,26 @@ const OffsetBindingPointer<Buffer> &State::getIndexedUniformBuffer(size_t index)
return mUniformBuffers[index];
}
void State::setGenericAtomicCounterBufferBinding(Buffer *buffer)
{
mGenericAtomicCounterBuffer.set(buffer);
}
void State::setIndexedAtomicCounterBufferBinding(GLuint index,
Buffer *buffer,
GLintptr offset,
GLsizeiptr size)
{
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
mAtomicCounterBuffers[index].set(buffer, offset, size);
}
const OffsetBindingPointer<Buffer> &State::getIndexedAtomicCounterBuffer(size_t index) const
{
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
return mAtomicCounterBuffers[index];
}
void State::setCopyReadBufferBinding(Buffer *buffer)
{
mCopyReadBuffer.set(buffer);
......@@ -1192,8 +1220,7 @@ Buffer *State::getTargetBuffer(GLenum target) const
case GL_TRANSFORM_FEEDBACK_BUFFER: return mTransformFeedback->getGenericBuffer().get();
case GL_UNIFORM_BUFFER: return mGenericUniformBuffer.get();
case GL_ATOMIC_COUNTER_BUFFER:
UNIMPLEMENTED();
return nullptr;
return mGenericAtomicCounterBuffer.get();
case GL_SHADER_STORAGE_BUFFER:
UNIMPLEMENTED();
return nullptr;
......@@ -1205,9 +1232,10 @@ Buffer *State::getTargetBuffer(GLenum target) const
void State::detachBuffer(GLuint bufferName)
{
BindingPointer<Buffer> *buffers[] = {
&mArrayBuffer, &mCopyReadBuffer, &mCopyWriteBuffer, &mDrawIndirectBuffer,
&mPack.pixelBuffer, &mUnpack.pixelBuffer, &mGenericUniformBuffer};
BindingPointer<Buffer> *buffers[] = {&mArrayBuffer, &mGenericAtomicCounterBuffer,
&mCopyReadBuffer, &mCopyWriteBuffer,
&mDrawIndirectBuffer, &mPack.pixelBuffer,
&mUnpack.pixelBuffer, &mGenericUniformBuffer};
for (auto buffer : buffers)
{
if (buffer->id() == bufferName)
......@@ -1858,6 +1886,9 @@ void State::getIntegerv(const ContextState &data, GLenum pname, GLint *params)
case GL_COVERAGE_MODULATION_CHROMIUM:
*params = static_cast<GLint>(mCoverageModulation);
break;
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
*params = mGenericAtomicCounterBuffer.id();
break;
default:
UNREACHABLE();
break;
......@@ -1885,17 +1916,17 @@ void State::getIntegeri_v(GLenum target, GLuint index, GLint *data)
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
if (static_cast<size_t>(index) < mTransformFeedback->getIndexedBufferCount())
{
*data = mTransformFeedback->getIndexedBuffer(index).id();
}
break;
ASSERT(static_cast<size_t>(index) < mTransformFeedback->getIndexedBufferCount());
*data = mTransformFeedback->getIndexedBuffer(index).id();
break;
case GL_UNIFORM_BUFFER_BINDING:
if (static_cast<size_t>(index) < mUniformBuffers.size())
{
*data = mUniformBuffers[index].id();
}
break;
ASSERT(static_cast<size_t>(index) < mUniformBuffers.size());
*data = mUniformBuffers[index].id();
break;
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
*data = mAtomicCounterBuffers[index].id();
break;
default:
UNREACHABLE();
break;
......@@ -1907,29 +1938,29 @@ void State::getInteger64i_v(GLenum target, GLuint index, GLint64 *data)
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
if (static_cast<size_t>(index) < mTransformFeedback->getIndexedBufferCount())
{
*data = mTransformFeedback->getIndexedBuffer(index).getOffset();
}
break;
ASSERT(static_cast<size_t>(index) < mTransformFeedback->getIndexedBufferCount());
*data = mTransformFeedback->getIndexedBuffer(index).getOffset();
break;
case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
if (static_cast<size_t>(index) < mTransformFeedback->getIndexedBufferCount())
{
*data = mTransformFeedback->getIndexedBuffer(index).getSize();
}
break;
ASSERT(static_cast<size_t>(index) < mTransformFeedback->getIndexedBufferCount());
*data = mTransformFeedback->getIndexedBuffer(index).getSize();
break;
case GL_UNIFORM_BUFFER_START:
if (static_cast<size_t>(index) < mUniformBuffers.size())
{
*data = mUniformBuffers[index].getOffset();
}
break;
ASSERT(static_cast<size_t>(index) < mUniformBuffers.size());
*data = mUniformBuffers[index].getOffset();
break;
case GL_UNIFORM_BUFFER_SIZE:
if (static_cast<size_t>(index) < mUniformBuffers.size())
{
*data = mUniformBuffers[index].getSize();
}
break;
ASSERT(static_cast<size_t>(index) < mUniformBuffers.size());
*data = mUniformBuffers[index].getSize();
break;
case GL_ATOMIC_COUNTER_BUFFER_START:
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
*data = mAtomicCounterBuffers[index].getOffset();
break;
case GL_ATOMIC_COUNTER_BUFFER_SIZE:
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
*data = mAtomicCounterBuffers[index].getSize();
break;
default:
UNREACHABLE();
break;
......
......@@ -227,6 +227,14 @@ class State : angle::NonCopyable
void setIndexedUniformBufferBinding(GLuint index, Buffer *buffer, GLintptr offset, GLsizeiptr size);
const OffsetBindingPointer<Buffer> &getIndexedUniformBuffer(size_t index) const;
// GL_ATOMIC_COUNTER_BUFFER - Both indexed and generic targets
void setGenericAtomicCounterBufferBinding(Buffer *buffer);
void setIndexedAtomicCounterBufferBinding(GLuint index,
Buffer *buffer,
GLintptr offset,
GLsizeiptr size);
const OffsetBindingPointer<Buffer> &getIndexedAtomicCounterBuffer(size_t index) const;
// GL_COPY_[READ/WRITE]_BUFFER
void setCopyReadBufferBinding(Buffer *buffer);
void setCopyWriteBufferBinding(Buffer *buffer);
......@@ -473,6 +481,9 @@ class State : angle::NonCopyable
BindingPointer<TransformFeedback> mTransformFeedback;
BindingPointer<Buffer> mGenericAtomicCounterBuffer;
BufferVector mAtomicCounterBuffers;
BindingPointer<Buffer> mCopyReadBuffer;
BindingPointer<Buffer> mCopyWriteBuffer;
......
......@@ -1230,6 +1230,142 @@ bool ValidateIsVertexArray(Context *context)
return true;
}
static bool ValidateBindBufferCommon(Context *context,
GLenum target,
GLuint index,
GLuint buffer,
GLintptr offset,
GLsizeiptr size)
{
if (context->getClientMajorVersion() < 3)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
if (buffer != 0 && offset < 0)
{
context->handleError(Error(GL_INVALID_VALUE, "buffer is non-zero and offset is negative."));
return false;
}
if (!context->getGLState().isBindGeneratesResourceEnabled() &&
!context->isBufferGenerated(buffer))
{
context->handleError(Error(GL_INVALID_OPERATION, "Buffer was not generated."));
return false;
}
const Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
{
if (index >= caps.maxTransformFeedbackSeparateAttributes)
{
context->handleError(Error(GL_INVALID_VALUE,
"index is greater than or equal to the number of "
"TRANSFORM_FEEDBACK_BUFFER indexed binding points."));
return false;
}
if (buffer != 0 && ((offset % 4) != 0 || (size % 4) != 0))
{
context->handleError(
Error(GL_INVALID_VALUE, "offset and size must be multiple of 4."));
return false;
}
TransformFeedback *curTransformFeedback =
context->getGLState().getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive())
{
context->handleError(Error(GL_INVALID_OPERATION,
"target is TRANSFORM_FEEDBACK_BUFFER and transform "
"feedback is currently active."));
return false;
}
break;
}
case GL_UNIFORM_BUFFER:
{
if (index >= caps.maxUniformBufferBindings)
{
context->handleError(Error(GL_INVALID_VALUE,
"index is greater than or equal to the number of "
"UNIFORM_BUFFER indexed binding points."));
return false;
}
if (buffer != 0 && (offset % caps.uniformBufferOffsetAlignment) != 0)
{
context->handleError(
Error(GL_INVALID_VALUE,
"offset must be multiple of value of UNIFORM_BUFFER_OFFSET_ALIGNMENT."));
return false;
}
break;
}
case GL_ATOMIC_COUNTER_BUFFER:
{
if (context->getClientVersion() < ES_3_1)
{
context->handleError(
Error(GL_INVALID_ENUM, "ATOMIC_COUNTER_BUFFER is not supported in GLES3."));
return false;
}
if (index >= caps.maxAtomicCounterBufferBindings)
{
context->handleError(Error(GL_INVALID_VALUE,
"index is greater than or equal to the number of "
"ATOMIC_COUNTER_BUFFER indexed binding points."));
return false;
}
if (buffer != 0 && (offset % 4) != 0)
{
context->handleError(Error(GL_INVALID_VALUE, "offset must be a multiple of 4."));
return false;
}
break;
}
case GL_SHADER_STORAGE_BUFFER:
{
if (context->getClientVersion() < ES_3_1)
{
context->handleError(
Error(GL_INVALID_ENUM, "ATOMIC_COUNTER_BUFFER is not supported in GLES3."));
return false;
}
break;
}
default:
context->handleError(Error(GL_INVALID_ENUM, "the target is not supported."));
return false;
}
return true;
}
bool ValidateBindBufferBase(Context *context, GLenum target, GLuint index, GLuint buffer)
{
return ValidateBindBufferCommon(context, target, index, buffer, 0, 0);
}
bool ValidateBindBufferRange(Context *context,
GLenum target,
GLuint index,
GLuint buffer,
GLintptr offset,
GLsizeiptr size)
{
if (buffer != 0 && size <= 0)
{
context->handleError(
Error(GL_INVALID_VALUE, "buffer is non-zero and size is less than or equal to zero."));
return false;
}
return ValidateBindBufferCommon(context, target, index, buffer, offset, size);
}
bool ValidateProgramBinary(Context *context,
GLuint program,
GLenum binaryFormat,
......@@ -1842,6 +1978,24 @@ bool ValidateIndexedStateQuery(ValidationContext *context,
return false;
}
break;
case GL_ATOMIC_COUNTER_BUFFER_START:
case GL_ATOMIC_COUNTER_BUFFER_SIZE:
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
if (context->getClientVersion() < ES_3_1)
{
context->handleError(
Error(GL_INVALID_ENUM,
"Atomic Counter buffers are not supported in this version of GL"));
return false;
}
if (index >= caps.maxAtomicCounterBufferBindings)
{
context->handleError(
Error(GL_INVALID_VALUE,
"index is outside the valid range for GL_ATOMIC_COUNTER_BUFFER_BINDING"));
return false;
}
break;
default:
context->handleError(Error(GL_INVALID_ENUM));
return false;
......
......@@ -188,6 +188,14 @@ bool ValidateCompressedTexImage3D(Context *context,
bool ValidateBindVertexArray(Context *context, GLuint array);
bool ValidateIsVertexArray(Context *context);
bool ValidateBindBufferBase(Context *context, GLenum target, GLuint index, GLuint buffer);
bool ValidateBindBufferRange(Context *context,
GLenum target,
GLuint index,
GLuint buffer,
GLintptr offset,
GLsizeiptr size);
bool ValidateProgramBinary(Context *context,
GLuint program,
GLenum binaryFormat,
......
......@@ -704,90 +704,12 @@ void GL_APIENTRY BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLi
Context *context = GetValidGlobalContext();
if (context)
{
if (context->getClientMajorVersion() < 3)
{
context->handleError(Error(GL_INVALID_OPERATION));
return;
}
const Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
if (index >= caps.maxTransformFeedbackSeparateAttributes)
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
break;
case GL_UNIFORM_BUFFER:
if (index >= caps.maxUniformBufferBindings)
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
break;
default:
context->handleError(Error(GL_INVALID_ENUM));
return;
}
if (buffer != 0 && size <= 0)
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
if (!context->getGLState().isBindGeneratesResourceEnabled() &&
!context->isBufferGenerated(buffer))
if (!context->skipValidation() &&
!ValidateBindBufferRange(context, target, index, buffer, offset, size))
{
context->handleError(Error(GL_INVALID_OPERATION, "Buffer was not generated"));
return;
}
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
{
// size and offset must be a multiple of 4
if (buffer != 0 && ((offset % 4) != 0 || (size % 4) != 0))
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
// Cannot bind a transform feedback buffer if the current transform feedback is active (3.0.4 pg 91 section 2.15.2)
TransformFeedback *curTransformFeedback =
context->getGLState().getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive())
{
context->handleError(Error(GL_INVALID_OPERATION));
return;
}
context->bindIndexedTransformFeedbackBuffer(buffer, index, offset, size);
context->bindGenericTransformFeedbackBuffer(buffer);
break;
}
case GL_UNIFORM_BUFFER:
// it is an error to bind an offset not a multiple of the alignment
if (buffer != 0 && (offset % caps.uniformBufferOffsetAlignment) != 0)
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
context->bindIndexedUniformBuffer(buffer, index, offset, size);
context->bindGenericUniformBuffer(buffer);
break;
default:
UNREACHABLE();
}
context->bindBufferRange(target, index, buffer, offset, size);
}
}
......@@ -799,104 +721,11 @@ void GL_APIENTRY BindBufferBase(GLenum target, GLuint index, GLuint buffer)
Context *context = GetValidGlobalContext();
if (context)
{
if (context->getClientMajorVersion() < 3)
{
context->handleError(Error(GL_INVALID_OPERATION));
return;
}
const Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
if (index >= caps.maxTransformFeedbackSeparateAttributes)
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
break;
case GL_UNIFORM_BUFFER:
if (index >= caps.maxUniformBufferBindings)
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
break;
case GL_ATOMIC_COUNTER_BUFFER:
if (index >= caps.maxAtomicCounterBufferBindings)
{
context->handleError(Error(
GL_INVALID_VALUE,
"Binding index must be less than GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS."));
return;
}
break;
case GL_SHADER_STORAGE_BUFFER:
if (index >= caps.maxShaderStorageBufferBindings)
{
context->handleError(Error(
GL_INVALID_VALUE,
"Binding index must be less than GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS."));
return;
}
break;
default:
context->handleError(Error(GL_INVALID_ENUM));
return;
}
if (!context->getGLState().isBindGeneratesResourceEnabled() &&
!context->isBufferGenerated(buffer))
if (!context->skipValidation() && !ValidateBindBufferBase(context, target, index, buffer))
{
context->handleError(Error(GL_INVALID_OPERATION, "Buffer was not generated"));
return;
}
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
{
// Cannot bind a transform feedback buffer if the current transform feedback is active (3.0.4 pg 91 section 2.15.2)
TransformFeedback *curTransformFeedback =
context->getGLState().getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive())
{
context->handleError(Error(GL_INVALID_OPERATION));
return;
}
context->bindIndexedTransformFeedbackBuffer(buffer, index, 0, 0);
context->bindGenericTransformFeedbackBuffer(buffer);
break;
}
case GL_UNIFORM_BUFFER:
context->bindIndexedUniformBuffer(buffer, index, 0, 0);
context->bindGenericUniformBuffer(buffer);
break;
case GL_ATOMIC_COUNTER_BUFFER:
if (buffer != 0)
{
// Binding buffers to this binding point is not implemented yet.
UNIMPLEMENTED();
}
break;
case GL_SHADER_STORAGE_BUFFER:
if (buffer != 0)
{
// Binding buffers to this binding point is not implemented yet.
UNIMPLEMENTED();
}
break;
default:
UNREACHABLE();
}
context->bindBufferBase(target, index, buffer);
}
}
......
......@@ -15,6 +15,7 @@
{
'angle_end2end_tests_sources':
[
'<(angle_path)/src/tests/gl_tests/AtomicCounterBufferTest.cpp',
'<(angle_path)/src/tests/gl_tests/BindGeneratesResourceTest.cpp',
'<(angle_path)/src/tests/gl_tests/BindUniformLocationTest.cpp',
'<(angle_path)/src/tests/gl_tests/BlendMinMaxTest.cpp',
......
......@@ -144,6 +144,7 @@
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_compute_work_group_size_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.indexed.max_compute_work_group_count_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.indexed.max_compute_work_group_size_* = FAIL
1729 D3D11 : dEQP-GLES31.functional.state_query.indexed.atomic_counter_buffer_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* = FAIL
1679 D3D11 : dEQP-GLES31.functional.state_query.texture_level.texture_2d_multisample.* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.* = FAIL
......@@ -1329,12 +1330,10 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.texture.gather.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.boolean.sample_mask_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.texture_binding_2d_multisample_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.atomic_counter_buffer_binding_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.shader_storage_buffer_binding_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.dispatch_indirect_buffer_binding_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.program_pipeline_binding_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.indexed.sample_mask_value_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.indexed.atomic_counter_buffer_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.indexed.image_binding* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.indexed.shader_storage_buffer_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_2d.depth_stencil_mode_* = FAIL
......
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// AtomicCounterBufferTest:
// Various tests related for atomic counter buffers.
//
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
using namespace angle;
namespace
{
class AtomicCounterBufferTest : public ANGLETest
{
protected:
AtomicCounterBufferTest()
{
setWindowWidth(128);
setWindowHeight(128);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
}
};
// Test GL_ATOMIC_COUNTER_BUFFER is not supported with version lower than ES31.
TEST_P(AtomicCounterBufferTest, AtomicCounterBufferBindings)
{
ASSERT_EQ(3, getClientMajorVersion());
GLBuffer atomicCounterBuffer;
glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, 1, atomicCounterBuffer.get());
if (getClientMinorVersion() < 1)
{
EXPECT_GL_ERROR(GL_INVALID_ENUM);
}
else
{
EXPECT_GL_NO_ERROR();
}
}
ANGLE_INSTANTIATE_TEST(AtomicCounterBufferTest,
ES3_OPENGL(),
ES3_OPENGLES(),
ES31_OPENGL(),
ES31_OPENGLES());
} // namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment