summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2017-10-27 20:57:14 +0200
committerAlejandro Piñeiro <apinheiro@igalia.com>2018-01-30 08:43:11 +0100
commit58c0e877eb323d4d3876b73ddbcf2ef14ff626eb (patch)
tree7a18895204511a70d3ed51f4f852ec4366fcd6f9
parenta0b0c0e09f44f3e08e7b6a800e33385e44bb326e (diff)
arb_internalformat_query2: some formats are not compatible with TBOs
On those cases, the resource is not supported, so we should expect the unsupported outcome. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--tests/spec/arb_internalformat_query2/image-texture.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/tests/spec/arb_internalformat_query2/image-texture.c b/tests/spec/arb_internalformat_query2/image-texture.c
index 735f7e1a4..8bf6429b3 100644
--- a/tests/spec/arb_internalformat_query2/image-texture.c
+++ b/tests/spec/arb_internalformat_query2/image-texture.c
@@ -107,6 +107,58 @@ static const struct imagetexture imagetexture_table[] = {
{GL_R8_SNORM, 8, GL_RED, GL_BYTE, GL_IMAGE_CLASS_1_X_8},
};
+/*
+ * From OpenGL 4.5 spec, table 8.16, Internal formats for buffer
+ * textures
+ */
+static const GLenum table_8_16[] = {
+ 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,
+ GL_RGBA32UI
+};
+
+static bool
+check_tbo_compatible(const GLenum target,
+ const GLenum format)
+{
+ if (target != GL_TEXTURE_BUFFER)
+ return true;
+
+ return value_on_set((const GLint*)table_8_16,
+ ARRAY_SIZE(table_8_16),
+ format);
+}
+
static bool
try(const GLenum *targets, unsigned num_targets,
const GLenum pname, test_data *data)
@@ -124,7 +176,8 @@ try(const GLenum *targets, unsigned num_targets,
supported = check_query2_dependencies(pname, targets[i])
&& test_data_check_supported(data, targets[i],
imagetexture_table[j].format)
- && (targets[i] != GL_RENDERBUFFER);
+ && (targets[i] != GL_RENDERBUFFER)
+ && (check_tbo_compatible(targets[i], imagetexture_table[j].format));
test_data_execute(data, targets[i],
imagetexture_table[j].format,