GLint active_texture = GL_TEXTURE0;
glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture);
- snprintf(label, sizeof label, "%s, %s, %s, %d level",
- enumToString(active_texture), enumToString(target), enumToString(format), level);
+ snprintf(label, sizeof label, "%s, %s, level = %d",
+ enumToString(active_texture), enumToString(target), level);
json.beginMember(label);
json.writeNumberMember("__height__", height);
json.writeNumberMember("__depth__", depth);
+ json.writeStringMember("__format__", enumToString(format));
+
// Hardcoded for now, but we could chose types more adequate to the
// texture internal format
json.writeStringMember("__type__", "uint8");
* Dump the image of the currently bound read buffer.
*/
static inline void
-dumpReadBufferImage(JSONWriter &json, GLint width, GLint height, GLenum format)
+dumpReadBufferImage(JSONWriter &json, GLint width, GLint height, GLenum format,
+ GLint internalFormat = GL_NONE)
{
GLint channels = __gl_format_channels(format);
json.writeNumberMember("__height__", height);
json.writeNumberMember("__depth__", 1);
+ json.writeStringMember("__format__", enumToString(internalFormat));
+
// Hardcoded for now, but we could chose types more adequate to the
// texture internal format
json.writeStringMember("__type__", "uint8");
}
GLint internalFormat = getFramebufferAttachmentFormat(target, attachment);
- std::stringstream ss;
- ss << enumToString(attachment);
- if (internalFormat != GL_NONE) {
- ss << ", ";
- ss << enumToString(internalFormat);
- }
- json.beginMember(ss.str());
- dumpReadBufferImage(json, width, height, format);
+ json.beginMember(enumToString(attachment));
+ dumpReadBufferImage(json, width, height, format, internalFormat);
json.endMember();
}