[Piglit] [PATCH 16/20] msaa: Allow format of the color buffer used in the MSAA fbos to be configured.
Paul Berry
stereotype441 at gmail.com
Tue Jun 5 17:03:26 PDT 2012
This will make it possible to test proper operation of MSAA with
various color buffer formats. For tests that don't need to vary the
color buffer format, a default format of GL_RGBA is used.
---
tests/spec/ext_framebuffer_multisample/common.cpp | 8 +++++---
tests/spec/ext_framebuffer_multisample/common.h | 6 ++++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp b/tests/spec/ext_framebuffer_multisample/common.cpp
index 647151a..ce0552e 100644
--- a/tests/spec/ext_framebuffer_multisample/common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/common.cpp
@@ -115,7 +115,8 @@ FboConfig::FboConfig(int num_samples, int width, int height)
width(width),
height(height),
combine_depth_stencil(true),
- attach_texture(false)
+ attach_texture(false),
+ color_internalformat(GL_RGBA)
{
}
@@ -163,7 +164,8 @@ Fbo::setup(const FboConfig &new_config)
glBindRenderbuffer(GL_RENDERBUFFER, color_rb);
glRenderbufferStorageMultisample(GL_RENDERBUFFER,
config.num_samples,
- GL_RGBA, config.width,
+ config.color_internalformat,
+ config.width,
config.height);
glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
@@ -176,7 +178,7 @@ Fbo::setup(const FboConfig &new_config)
GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D,
0 /* level */,
- GL_RGBA /* internalformat */,
+ config.color_internalformat,
config.width,
config.height,
0 /* border */,
diff --git a/tests/spec/ext_framebuffer_multisample/common.h b/tests/spec/ext_framebuffer_multisample/common.h
index b27c9de..3caf8a0 100644
--- a/tests/spec/ext_framebuffer_multisample/common.h
+++ b/tests/spec/ext_framebuffer_multisample/common.h
@@ -63,6 +63,12 @@ public:
* be used. Defaults to false.
*/
bool attach_texture;
+
+ /**
+ * Internalformat that should be used for the color buffer.
+ * Defaults to GL_RGBA.
+ */
+ GLenum color_internalformat;
};
/**
--
1.7.7.6
More information about the Piglit
mailing list