diff options
author | Laura Ekstrand <laura@jlekstrand.net> | 2014-12-02 16:34:17 -0800 |
---|---|---|
committer | Laura Ekstrand <laura@jlekstrand.net> | 2015-01-07 17:07:41 -0800 |
commit | 17ca12a83cbe45eec06d55f1406ea604025898ec (patch) | |
tree | b0cdaf4a9f7f7c37449d2436a106e1a135144679 | |
parent | 41a07ffe5adadca57f3b1d1cfcbaecad83c1058b (diff) |
arb_direct_state_access: Testing glTextureStorage3DMultisample.
-rw-r--r-- | tests/spec/arb_direct_state_access/texture-storage-multisample.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/spec/arb_direct_state_access/texture-storage-multisample.c b/tests/spec/arb_direct_state_access/texture-storage-multisample.c index f069245b8..f0437d465 100644 --- a/tests/spec/arb_direct_state_access/texture-storage-multisample.c +++ b/tests/spec/arb_direct_state_access/texture-storage-multisample.c @@ -246,6 +246,8 @@ check_non_generated_texture(void) */ glTextureStorage2DMultisample(250, 4, GL_RGBA8, 64, 64, GL_TRUE); pass &= piglit_check_gl_error(GL_INVALID_OPERATION); + glTextureStorage3DMultisample(250, 4, GL_RGBA8, 64, 64, 3, GL_TRUE); + pass &= piglit_check_gl_error(GL_INVALID_OPERATION); piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL, "non-generated texture name"); @@ -383,6 +385,7 @@ draw_multisampled(void) 0, 0, piglit_width, piglit_height, GL_COLOR_BUFFER_BIT, GL_LINEAR); pass &= piglit_check_gl_error(GL_NO_ERROR); + /* TODO: Add a Piglit probe call to check the output */ if (!piglit_automatic) { piglit_present_results(); } @@ -395,6 +398,58 @@ draw_multisampled(void) return pass; } +static bool +trivial_but_should_work(void) +{ + bool pass = true; + GLuint texture; + + /* 2D case */ + glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, &texture); + glTextureStorage2DMultisample(texture, 4, GL_RGBA8, 64, 64, GL_TRUE); + pass &= piglit_check_gl_error(GL_NO_ERROR); + + /* 3D case */ + glDeleteTextures(1, &texture); + glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, &texture); + glTextureStorage3DMultisample(texture, 4, GL_RGBA8, 64, 64, 3, + GL_TRUE); + pass &= piglit_check_gl_error(GL_NO_ERROR); + + piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL, + "trivial, but should work"); + return pass; +} + +static bool +check_improper_effective_target(void) +{ + bool pass = true; + GLuint texture; + + /* 3D case with 2D target */ + glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, &texture); + glTextureStorage3DMultisample(texture, 4, GL_RGBA8, 64, 64, 3, + GL_TRUE); + pass &= piglit_check_gl_error(GL_INVALID_OPERATION); + + /* 2D case with 3D target */ + glDeleteTextures(1, &texture); + glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, &texture); + glTextureStorage2DMultisample(texture, 4, GL_RGBA8, 64, 64, GL_TRUE); + pass &= piglit_check_gl_error(GL_INVALID_OPERATION); + + /* 2D case with non-multisampled target */ + glDeleteTextures(1, &texture); + glCreateTextures(GL_TEXTURE_2D, 1, &texture); + glTextureStorage2DMultisample(texture, 4, GL_RGBA8, 64, 64, GL_TRUE); + pass &= piglit_check_gl_error(GL_INVALID_OPERATION); + + piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL, + "improper effective target"); + return pass; +} + void piglit_init(int argc, char **argv) { @@ -415,6 +470,10 @@ piglit_display(void) result = PIGLIT_FAIL; if (!check_unsized_format()) result = PIGLIT_FAIL; + if (!check_improper_effective_target()) + result = PIGLIT_FAIL; + if (!trivial_but_should_work()) + result = PIGLIT_FAIL; if (!draw_multisampled()) result = PIGLIT_FAIL; |