Fix test_gl error reporting (#764)

* Fix test_gl error reporting

Overwriting 'error' variable after check for Msaa/Depth support was clearing
the error counter incremented after failure in test_image_format_write. In
effect the test might return 0 even if there were errors.

* Fix variable name

* Fix formatting

* Fix formatting
This commit is contained in:
DziubanMaciejIntel
2020-05-22 14:25:43 +02:00
committed by GitHub
parent cfe4e41d96
commit ee2d0921dc

View File

@@ -763,16 +763,16 @@ int test_images_write_common(cl_device_id device, cl_context context,
get_base_gl_target(targets[ tidx ]) == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
{
bool supports_msaa;
error = supportsMsaa(context, &supports_msaa);
if( error != 0 ) return error;
int errorInGetInfo = supportsMsaa(context, &supports_msaa);
if (errorInGetInfo != 0) return errorInGetInfo;
if (!supports_msaa) return 0;
}
if (formats[ fidx ].formattype == GL_DEPTH_COMPONENT ||
formats[ fidx ].formattype == GL_DEPTH_STENCIL)
{
bool supports_depth;
error = supportsDepth(context, &supports_depth);
if( error != 0 ) return error;
int errorInGetInfo = supportsDepth(context, &supports_depth);
if (errorInGetInfo != 0) return errorInGetInfo;
if (!supports_depth) return 0;
}
#endif