MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / test_renderbuffer_read

Function test_renderbuffer_read

test_conformance/gl/test_renderbuffer.cpp:181–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181int test_renderbuffer_read(cl_device_id device, cl_context context,
182 cl_command_queue queue, int numElements)
183{
184 GLenum attachments[] = { GL_COLOR_ATTACHMENT0_EXT };
185
186 struct
187 {
188 GLenum internal;
189 GLenum format;
190 GLenum datatype;
191 ExplicitType type;
192
193 } formats[] = {
194 { GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, kUChar },
195 { GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, kUChar },
196 { GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, kUChar },
197 { GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, kUShort },
198
199 // Renderbuffers with integer formats do not seem to work reliably across
200 // platforms/implementations. Disabling this in version 1.0 of CL
201 // conformance tests.
202
203#ifdef TEST_INTEGER_FORMATS
204
205 { GL_RGBA8I_EXT, GL_RGBA_INTEGER_EXT, GL_BYTE, kChar },
206 { GL_RGBA16I_EXT, GL_RGBA_INTEGER_EXT, GL_SHORT, kShort },
207 { GL_RGBA32I_EXT, GL_RGBA_INTEGER_EXT, GL_INT, kInt },
208 { GL_RGBA8UI_EXT, GL_RGBA_INTEGER_EXT, GL_UNSIGNED_BYTE, kUChar },
209 { GL_RGBA16UI_EXT, GL_RGBA_INTEGER_EXT, GL_UNSIGNED_SHORT, kUShort },
210 { GL_RGBA32UI_EXT, GL_RGBA_INTEGER_EXT, GL_UNSIGNED_INT, kUInt },
211#endif
212 { GL_RGBA32F_ARB, GL_RGBA, GL_FLOAT, kFloat },
213 { GL_RGBA16F_ARB, GL_RGBA, GL_HALF_FLOAT, kHalf }
214 };
215
216 size_t fmtIdx, attIdx;
217 int error = 0;
218#ifdef DEBUG
219 size_t iter = 1;
220#else
221 size_t iter = 6;
222#endif
223 RandomSeed seed(gRandomSeed);
224
225 // Check if images are supported
226 if (checkForImageSupport(device))
227 {
228 log_info("Device does not support images. Skipping test.\n");
229 return 0;
230 }
231
232 if (!gluCheckExtension((const GLubyte *)"GL_EXT_framebuffer_object",
233 glGetString(GL_EXTENSIONS)))
234 {
235 log_info("Renderbuffers are not supported by this OpenGL "
236 "implementation; skipping test\n");
237 return 0;
238 }

Callers

nothing calls this directly

Calls 8

checkForImageSupportFunction · 0.85
random_in_rangeFunction · 0.85
gluCheckExtensionFunction · 0.70
GetGLAttachmentNameFunction · 0.50
GetGLFormatNameFunction · 0.50
GetGLBaseFormatNameFunction · 0.50
GetGLTypeNameFunction · 0.50

Tested by

no test coverage detected