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();
}
image[QLatin1String("__channels__")].toInt();
int depth =
image[QLatin1String("__depth__")].toInt();
+ QString formatName =
+ image[QLatin1String("__format__")].toString();
Q_ASSERT(type == QLatin1String("uint8"));
Q_ASSERT(normalized == true);
ApiTexture tex;
tex.setSize(size);
tex.setDepth(depth);
+ tex.setFormatName(formatName);
tex.setNumChannels(numChannels);
tex.setLabel(itr.key());
tex.contentsFromBase64(dataArray);
bool normalized = buffer[QLatin1String("__normalized__")].toBool();
int numChannels = buffer[QLatin1String("__channels__")].toInt();
int depth = buffer[QLatin1String("__depth__")].toInt();
+ QString formatName = buffer[QLatin1String("__format__")].toString();
Q_ASSERT(type == QLatin1String("uint8"));
Q_ASSERT(normalized == true);
ApiFramebuffer fbo;
fbo.setSize(size);
fbo.setDepth(depth);
+ fbo.setFormatName(formatName);
fbo.setNumChannels(numChannels);
fbo.setType(itr.key());
fbo.contentsFromBase64(dataArray);