Commit bedac4f0 by Shahbaz Youssefi Committed by Commit Bot

Move EXT_external_objects validation to validationESEXT.cpp

Bug: angleproject:4912 Bug: fuchsia:52759 Change-Id: I8883d65ecac763cf46d792cc69bce98dc53121d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2340174Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent e8789a53
...@@ -223,9 +223,9 @@ Samplers) ...@@ -223,9 +223,9 @@ Samplers)
storage of the texture based on <createFlags> and <usageFlags> as the storage of the texture based on <createFlags> and <usageFlags> as the
corresonding VK_IMAGE_CREATE_* and VK_IMAGE_USAGE_* flags would have on corresonding VK_IMAGE_CREATE_* and VK_IMAGE_USAGE_* flags would have on
a Vulkan image respectively. See tables 8.17 and 8.18 for the mapping a Vulkan image respectively. See tables 8.17 and 8.18 for the mapping
between the GL and Vulkan flags. It is undefined behavior if the between the GL and Vulkan flags. It is undefined behavior if the
application provides create and usage flags that are not identical to application provides create and usage flags that are not identical to
those used to create the Vulkan image." those used to create the Vulkan image."
Table 8.17: Create flags and corresponding Vulkan Image Create Flags Table 8.17: Create flags and corresponding Vulkan Image Create Flags
...@@ -298,7 +298,7 @@ Issues ...@@ -298,7 +298,7 @@ Issues
RESOLVED: No. The application has already created an image with these RESOLVED: No. The application has already created an image with these
flags in Vulkan, so the GL implementation can assume they are valid. flags in Vulkan, so the GL implementation can assume they are valid.
Validating this is expensive and unnecessary in almost all applications. Validating this is expensive and unnecessary in almost all applications.
Revision History Revision History
......
...@@ -993,27 +993,6 @@ bool ValidDstBlendFunc(const Context *context, GLenum val) ...@@ -993,27 +993,6 @@ bool ValidDstBlendFunc(const Context *context, GLenum val)
return false; return false;
} }
bool IsValidImageLayout(ImageLayout layout)
{
switch (layout)
{
case ImageLayout::Undefined:
case ImageLayout::General:
case ImageLayout::ColorAttachment:
case ImageLayout::DepthStencilAttachment:
case ImageLayout::DepthStencilReadOnlyAttachment:
case ImageLayout::ShaderReadOnly:
case ImageLayout::TransferSrc:
case ImageLayout::TransferDst:
case ImageLayout::DepthReadOnlyStencilAttachment:
case ImageLayout::DepthAttachmentStencilReadOnly:
return true;
default:
return false;
}
}
bool ValidateES2TexImageParameters(const Context *context, bool ValidateES2TexImageParameters(const Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -1041,18 +1020,6 @@ bool ValidateES2TexImageParameters(const Context *context, ...@@ -1041,18 +1020,6 @@ bool ValidateES2TexImageParameters(const Context *context,
format, type, imageSize, pixels); format, type, imageSize, pixels);
} }
bool IsValidMemoryObjectParamater(const Context *context, GLenum pname)
{
switch (pname)
{
case GL_DEDICATED_MEMORY_OBJECT_EXT:
return true;
default:
return false;
}
}
} // anonymous namespace } // anonymous namespace
bool ValidateES2TexImageParametersBase(const Context *context, bool ValidateES2TexImageParametersBase(const Context *context,
...@@ -1766,12 +1733,12 @@ bool ValidateES2TexImageParametersBase(const Context *context, ...@@ -1766,12 +1733,12 @@ bool ValidateES2TexImageParametersBase(const Context *context,
imageSize); imageSize);
} }
bool ValidateES2TexStorageParameters(const Context *context, bool ValidateES2TexStorageParametersBase(const Context *context,
TextureType target, TextureType target,
GLsizei levels, GLsizei levels,
GLenum internalformat, GLenum internalformat,
GLsizei width, GLsizei width,
GLsizei height) GLsizei height)
{ {
if (target != TextureType::_2D && target != TextureType::CubeMap && if (target != TextureType::_2D && target != TextureType::CubeMap &&
target != TextureType::Rectangle) target != TextureType::Rectangle)
...@@ -3236,400 +3203,6 @@ bool ValidateMapBufferRangeEXT(const Context *context, ...@@ -3236,400 +3203,6 @@ bool ValidateMapBufferRangeEXT(const Context *context,
return ValidateMapBufferRangeBase(context, target, offset, length, access); return ValidateMapBufferRangeBase(context, target, offset, length, access);
} }
bool ValidateBufferStorageMemEXT(const Context *context,
TextureType target,
GLsizeiptr size,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateCreateMemoryObjectsEXT(const Context *context,
GLsizei n,
const MemoryObjectID *memoryObjects)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateDeleteMemoryObjectsEXT(const Context *context,
GLsizei n,
const MemoryObjectID *memoryObjects)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateGetMemoryObjectParameterivEXT(const Context *context,
MemoryObjectID memoryObject,
GLenum pname,
const GLint *params)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
const MemoryObject *memory = context->getMemoryObject(memoryObject);
if (memory == nullptr)
{
context->validationError(GL_INVALID_VALUE, kInvalidMemoryObject);
}
if (!IsValidMemoryObjectParamater(context, pname))
{
context->validationError(GL_INVALID_ENUM, kInvalidMemoryObjectParameter);
return false;
}
return true;
}
bool ValidateGetUnsignedBytevEXT(const Context *context, GLenum pname, const GLubyte *data)
{
if (!context->getExtensions().memoryObject && !context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateGetUnsignedBytei_vEXT(const Context *context,
GLenum target,
GLuint index,
const GLubyte *data)
{
if (!context->getExtensions().memoryObject && !context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateIsMemoryObjectEXT(const Context *context, MemoryObjectID memoryObject)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return true;
}
bool ValidateMemoryObjectParameterivEXT(const Context *context,
MemoryObjectID memoryObject,
GLenum pname,
const GLint *params)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
const MemoryObject *memory = context->getMemoryObject(memoryObject);
if (memory == nullptr)
{
context->validationError(GL_INVALID_VALUE, kInvalidMemoryObject);
return false;
}
if (memory->isImmutable())
{
context->validationError(GL_INVALID_OPERATION, kImmutableMemoryObject);
return false;
}
if (!IsValidMemoryObjectParamater(context, pname))
{
context->validationError(GL_INVALID_ENUM, kInvalidMemoryObjectParameter);
return false;
}
return true;
}
bool ValidateTexStorageMem2DEXT(const Context *context,
TextureType target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
if (context->getClientMajorVersion() < 3)
{
return ValidateES2TexStorageParameters(context, target, levels, internalFormat, width,
height);
}
ASSERT(context->getClientMajorVersion() >= 3);
return ValidateES3TexStorage2DParameters(context, target, levels, internalFormat, width, height,
1);
}
bool ValidateTexStorageMem3DEXT(const Context *context,
TextureType target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateImportMemoryFdEXT(const Context *context,
MemoryObjectID memory,
GLuint64 size,
HandleType handleType,
GLint fd)
{
if (!context->getExtensions().memoryObjectFd)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::OpaqueFd:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateImportMemoryZirconHandleANGLE(const Context *context,
MemoryObjectID memory,
GLuint64 size,
HandleType handleType,
GLuint handle)
{
if (!context->getExtensions().memoryObjectFuchsiaANGLE)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::ZirconVmo:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateDeleteSemaphoresEXT(const Context *context, GLsizei n, const SemaphoreID *semaphores)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateGenSemaphoresEXT(const Context *context, GLsizei n, const SemaphoreID *semaphores)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateGetSemaphoreParameterui64vEXT(const Context *context,
SemaphoreID semaphore,
GLenum pname,
const GLuint64 *params)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateIsSemaphoreEXT(const Context *context, SemaphoreID semaphore)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return true;
}
bool ValidateSemaphoreParameterui64vEXT(const Context *context,
SemaphoreID semaphore,
GLenum pname,
const GLuint64 *params)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateSignalSemaphoreEXT(const Context *context,
SemaphoreID semaphore,
GLuint numBufferBarriers,
const BufferID *buffers,
GLuint numTextureBarriers,
const TextureID *textures,
const GLenum *dstLayouts)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
for (GLuint i = 0; i < numTextureBarriers; ++i)
{
if (!IsValidImageLayout(FromGLenum<ImageLayout>(dstLayouts[i])))
{
context->validationError(GL_INVALID_ENUM, kInvalidImageLayout);
return false;
}
}
return true;
}
bool ValidateWaitSemaphoreEXT(const Context *context,
SemaphoreID semaphore,
GLuint numBufferBarriers,
const BufferID *buffers,
GLuint numTextureBarriers,
const TextureID *textures,
const GLenum *srcLayouts)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
for (GLuint i = 0; i < numTextureBarriers; ++i)
{
if (!IsValidImageLayout(FromGLenum<ImageLayout>(srcLayouts[i])))
{
context->validationError(GL_INVALID_ENUM, kInvalidImageLayout);
return false;
}
}
return true;
}
bool ValidateImportSemaphoreFdEXT(const Context *context,
SemaphoreID semaphore,
HandleType handleType,
GLint fd)
{
if (!context->getExtensions().semaphoreFd)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::OpaqueFd:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateImportSemaphoreZirconHandleANGLE(const Context *context,
SemaphoreID semaphore,
HandleType handleType,
GLuint handle)
{
if (!context->getExtensions().semaphoreFuchsiaANGLE)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::ZirconEvent:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateMapBufferBase(const Context *context, BufferBinding target) bool ValidateMapBufferBase(const Context *context, BufferBinding target)
{ {
Buffer *buffer = context->getState().getTargetBuffer(target); Buffer *buffer = context->getState().getTargetBuffer(target);
...@@ -6471,8 +6044,8 @@ bool ValidateTexStorage2DEXT(const Context *context, ...@@ -6471,8 +6044,8 @@ bool ValidateTexStorage2DEXT(const Context *context,
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
return ValidateES2TexStorageParameters(context, type, levels, internalformat, width, return ValidateES2TexStorageParametersBase(context, type, levels, internalformat, width,
height); height);
} }
ASSERT(context->getClientMajorVersion() >= 3); ASSERT(context->getClientMajorVersion() >= 3);
......
...@@ -174,6 +174,14 @@ bool ValidateES2TexImageParametersBase(const Context *context, ...@@ -174,6 +174,14 @@ bool ValidateES2TexImageParametersBase(const Context *context,
GLsizei imageSize, GLsizei imageSize,
const void *pixels); const void *pixels);
// Validation of TexStorage*2DEXT
bool ValidateES2TexStorageParametersBase(const Context *context,
TextureType target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height);
} // namespace gl } // namespace gl
#endif // LIBANGLE_VALIDATION_ES2_H_ #endif // LIBANGLE_VALIDATION_ES2_H_
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/ErrorStrings.h" #include "libANGLE/ErrorStrings.h"
#include "libANGLE/MemoryObject.h"
#include "libANGLE/validationES.h" #include "libANGLE/validationES.h"
#include "libANGLE/validationES2.h"
#include "libANGLE/validationES32.h" #include "libANGLE/validationES32.h"
namespace gl namespace gl
...@@ -40,6 +42,39 @@ bool ValidateGetImageFormatAndType(const Context *context, ObjectT *obj, GLenum ...@@ -40,6 +42,39 @@ bool ValidateGetImageFormatAndType(const Context *context, ObjectT *obj, GLenum
return true; return true;
} }
bool IsValidImageLayout(ImageLayout layout)
{
switch (layout)
{
case ImageLayout::Undefined:
case ImageLayout::General:
case ImageLayout::ColorAttachment:
case ImageLayout::DepthStencilAttachment:
case ImageLayout::DepthStencilReadOnlyAttachment:
case ImageLayout::ShaderReadOnly:
case ImageLayout::TransferSrc:
case ImageLayout::TransferDst:
case ImageLayout::DepthReadOnlyStencilAttachment:
case ImageLayout::DepthAttachmentStencilReadOnly:
return true;
default:
return false;
}
}
bool IsValidMemoryObjectParamater(const Context *context, GLenum pname)
{
switch (pname)
{
case GL_DEDICATED_MEMORY_OBJECT_EXT:
return true;
default:
return false;
}
}
} // namespace } // namespace
bool ValidateGetTexImageANGLE(const Context *context, bool ValidateGetTexImageANGLE(const Context *context,
...@@ -516,6 +551,400 @@ bool ValidateGetInteger64vEXT(const Context *context, GLenum pname, const GLint6 ...@@ -516,6 +551,400 @@ bool ValidateGetInteger64vEXT(const Context *context, GLenum pname, const GLint6
return true; return true;
} }
bool ValidateBufferStorageMemEXT(const Context *context,
TextureType target,
GLsizeiptr size,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateCreateMemoryObjectsEXT(const Context *context,
GLsizei n,
const MemoryObjectID *memoryObjects)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateDeleteMemoryObjectsEXT(const Context *context,
GLsizei n,
const MemoryObjectID *memoryObjects)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateGetMemoryObjectParameterivEXT(const Context *context,
MemoryObjectID memoryObject,
GLenum pname,
const GLint *params)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
const MemoryObject *memory = context->getMemoryObject(memoryObject);
if (memory == nullptr)
{
context->validationError(GL_INVALID_VALUE, kInvalidMemoryObject);
}
if (!IsValidMemoryObjectParamater(context, pname))
{
context->validationError(GL_INVALID_ENUM, kInvalidMemoryObjectParameter);
return false;
}
return true;
}
bool ValidateGetUnsignedBytevEXT(const Context *context, GLenum pname, const GLubyte *data)
{
if (!context->getExtensions().memoryObject && !context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateGetUnsignedBytei_vEXT(const Context *context,
GLenum target,
GLuint index,
const GLubyte *data)
{
if (!context->getExtensions().memoryObject && !context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateIsMemoryObjectEXT(const Context *context, MemoryObjectID memoryObject)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return true;
}
bool ValidateMemoryObjectParameterivEXT(const Context *context,
MemoryObjectID memoryObject,
GLenum pname,
const GLint *params)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
const MemoryObject *memory = context->getMemoryObject(memoryObject);
if (memory == nullptr)
{
context->validationError(GL_INVALID_VALUE, kInvalidMemoryObject);
return false;
}
if (memory->isImmutable())
{
context->validationError(GL_INVALID_OPERATION, kImmutableMemoryObject);
return false;
}
if (!IsValidMemoryObjectParamater(context, pname))
{
context->validationError(GL_INVALID_ENUM, kInvalidMemoryObjectParameter);
return false;
}
return true;
}
bool ValidateTexStorageMem2DEXT(const Context *context,
TextureType target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
if (context->getClientMajorVersion() < 3)
{
return ValidateES2TexStorageParametersBase(context, target, levels, internalFormat, width,
height);
}
ASSERT(context->getClientMajorVersion() >= 3);
return ValidateES3TexStorage2DParameters(context, target, levels, internalFormat, width, height,
1);
}
bool ValidateTexStorageMem3DEXT(const Context *context,
TextureType target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateImportMemoryFdEXT(const Context *context,
MemoryObjectID memory,
GLuint64 size,
HandleType handleType,
GLint fd)
{
if (!context->getExtensions().memoryObjectFd)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::OpaqueFd:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateImportMemoryZirconHandleANGLE(const Context *context,
MemoryObjectID memory,
GLuint64 size,
HandleType handleType,
GLuint handle)
{
if (!context->getExtensions().memoryObjectFuchsiaANGLE)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::ZirconVmo:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateDeleteSemaphoresEXT(const Context *context, GLsizei n, const SemaphoreID *semaphores)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateGenSemaphoresEXT(const Context *context, GLsizei n, const SemaphoreID *semaphores)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
bool ValidateGetSemaphoreParameterui64vEXT(const Context *context,
SemaphoreID semaphore,
GLenum pname,
const GLuint64 *params)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateIsSemaphoreEXT(const Context *context, SemaphoreID semaphore)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
return true;
}
bool ValidateSemaphoreParameterui64vEXT(const Context *context,
SemaphoreID semaphore,
GLenum pname,
const GLuint64 *params)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
UNIMPLEMENTED();
return false;
}
bool ValidateSignalSemaphoreEXT(const Context *context,
SemaphoreID semaphore,
GLuint numBufferBarriers,
const BufferID *buffers,
GLuint numTextureBarriers,
const TextureID *textures,
const GLenum *dstLayouts)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
for (GLuint i = 0; i < numTextureBarriers; ++i)
{
if (!IsValidImageLayout(FromGLenum<ImageLayout>(dstLayouts[i])))
{
context->validationError(GL_INVALID_ENUM, kInvalidImageLayout);
return false;
}
}
return true;
}
bool ValidateWaitSemaphoreEXT(const Context *context,
SemaphoreID semaphore,
GLuint numBufferBarriers,
const BufferID *buffers,
GLuint numTextureBarriers,
const TextureID *textures,
const GLenum *srcLayouts)
{
if (!context->getExtensions().semaphore)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
for (GLuint i = 0; i < numTextureBarriers; ++i)
{
if (!IsValidImageLayout(FromGLenum<ImageLayout>(srcLayouts[i])))
{
context->validationError(GL_INVALID_ENUM, kInvalidImageLayout);
return false;
}
}
return true;
}
bool ValidateImportSemaphoreFdEXT(const Context *context,
SemaphoreID semaphore,
HandleType handleType,
GLint fd)
{
if (!context->getExtensions().semaphoreFd)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::OpaqueFd:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateImportSemaphoreZirconHandleANGLE(const Context *context,
SemaphoreID semaphore,
HandleType handleType,
GLuint handle)
{
if (!context->getExtensions().semaphoreFuchsiaANGLE)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
switch (handleType)
{
case HandleType::ZirconEvent:
break;
default:
context->validationError(GL_INVALID_ENUM, kInvalidHandleType);
return false;
}
return true;
}
bool ValidateTexStorageMemFlags2DANGLE(const Context *context, bool ValidateTexStorageMemFlags2DANGLE(const Context *context,
TextureType targetPacked, TextureType targetPacked,
GLsizei levels, GLsizei levels,
......
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