1 #ifndef _ES31FMULTISAMPLESHADERRENDERCASE_HPP
2 #define _ES31FMULTISAMPLESHADERRENDERCASE_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program OpenGL ES 3.1 Module
5 * -------------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Multisample shader render case
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "tes31TestCase.hpp"
48 namespace MultisampleShaderRenderUtil
51 class QualityWarning : public tcu::Exception
54 QualityWarning (const std::string& message);
57 class MultisampleRenderCase : public TestCase
70 FLAG_PER_ITERATION_SHADER = 1,
71 FLAG_VERIFY_MSAA_TEXTURE_SAMPLE_BUFFERS = 2, // !< flag set: each sample layer is verified by verifySampleBuffer
74 MultisampleRenderCase (Context& context, const char* name, const char* desc, int numSamples, RenderTarget target, int renderSize, int flags = 0);
75 virtual ~MultisampleRenderCase (void);
77 virtual void init (void);
78 virtual void deinit (void);
79 IterateResult iterate (void);
82 virtual void preDraw (void);
83 virtual void postDraw (void);
84 virtual void preTest (void);
85 virtual void postTest (void);
86 virtual std::string getIterationDescription (int iteration) const;
88 void drawOneIteration (void);
89 void verifyResultImageAndSetResult (const tcu::Surface& resultImage);
90 void verifyResultBuffersAndSetResult (const std::vector<tcu::Surface>& resultBuffers);
91 virtual std::string genVertexSource (int numTargetSamples) const;
92 virtual std::string genFragmentSource (int numTargetSamples) const = 0;
93 std::string genMSSamplerSource (int numTargetSamples) const;
94 std::string genMSTextureResolverSource (int numTargetSamples) const;
95 std::string genMSTextureLayerFetchSource (int numTargetSamples) const;
96 virtual bool verifyImage (const tcu::Surface& resultImage) = 0;
97 virtual bool verifySampleBuffers (const std::vector<tcu::Surface>& resultBuffers);
98 virtual void setupRenderData (void);
107 const int m_numRequestedSamples;
108 const RenderTarget m_renderTarget;
109 const int m_renderSize;
110 const bool m_perIterationShader;
111 const bool m_verifyTextureSampleBuffers;
112 deInt32 m_numTargetSamples;
115 deUint32 m_resolveBuffer;
116 glu::ShaderProgram* m_program;
118 deUint32 m_fboTexture;
119 glu::ShaderProgram* m_textureSamplerProgram;
121 deUint32 m_resolveFbo;
122 deUint32 m_resolveFboTexture;
125 deUint32 m_renderMode;
126 deInt32 m_renderCount;
127 deUint32 m_renderVao;
128 deUint32 m_resolveVao;
130 std::string m_renderSceneDescription;
131 std::map<std::string, Attrib> m_renderAttribs;
134 } // MultisampleShaderRenderUtil
139 #endif // _ES31FMULTISAMPLESHADERRENDERCASE_HPP