void dumpDevice(std::ostream &os, ID3D11DeviceContext *pDeviceContext) { JSONWriter json(os); dumpParameters(json, pDeviceContext); dumpShaders(json, pDeviceContext); // TODO: dump constant buffers json.beginMember("uniforms"); json.beginObject(); json.endObject(); json.endMember(); // uniforms // TODO: dump stream-out buffer, vertex buffer json.beginMember("buffers"); json.beginObject(); json.endObject(); json.endMember(); // buffers dumpTextures(json, pDeviceContext); dumpFramebuffer(json, pDeviceContext); }
void dumpCurrentContext(std::ostream &os) { JSONWriter json(os); #ifndef NDEBUG GLint old_bindings[NUM_BINDINGS]; for (unsigned i = 0; i < NUM_BINDINGS; ++i) { old_bindings[i] = 0; glGetIntegerv(bindings[i], &old_bindings[i]); } #endif dumpParameters(json); dumpShaders(json); dumpTextures(json); dumpFramebuffer(json); #ifndef NDEBUG for (unsigned i = 0; i < NUM_BINDINGS; ++i) { GLint new_binding = 0; glGetIntegerv(bindings[i], &new_binding); if (new_binding != old_bindings[i]) { std::cerr << "warning: " << enumToString(bindings[i]) << " was clobbered\n"; } } #endif }
void dumpDevice(StateWriter &writer, ID3D10Device *pDevice) { dumpParameters(writer, pDevice); dumpShaders(writer, pDevice); dumpTextures(writer, pDevice); dumpFramebuffer(writer, pDevice); }
void dumpCurrentContext(std::ostream &os) { JSONWriter json(os); #ifndef NDEBUG GLint old_bindings[NUM_BINDINGS]; for (unsigned i = 0; i < NUM_BINDINGS; ++i) { old_bindings[i] = 0; glGetIntegerv(bindings[i], &old_bindings[i]); } #endif Context context; /* Temporarily disable messages, as dumpParameters blindlessly tries to * get state, regardless the respective extension is supported or not. */ GLDEBUGPROC prevDebugCallbackFunction = 0; void *prevDebugCallbackUserParam = 0; if (context.KHR_debug) { glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION, (GLvoid **) &prevDebugCallbackFunction); glGetPointerv(GL_DEBUG_CALLBACK_USER_PARAM, &prevDebugCallbackUserParam); glDebugMessageCallback(NULL, NULL); } dumpParameters(json, context); // Use our own debug-message callback. if (context.KHR_debug) { glDebugMessageCallback(debugMessageCallback, NULL); } dumpShadersUniforms(json, context); dumpTextures(json, context); dumpFramebuffer(json, context); #ifndef NDEBUG for (unsigned i = 0; i < NUM_BINDINGS; ++i) { GLint new_binding = 0; glGetIntegerv(bindings[i], &new_binding); if (new_binding != old_bindings[i]) { std::cerr << "warning: " << enumToString(bindings[i]) << " was clobbered\n"; } } #endif // Restore debug message callback if (context.KHR_debug) { glDebugMessageCallback(prevDebugCallbackFunction, prevDebugCallbackUserParam); } }
void dumpDevice(std::ostream &os, IDirect3DDevice9 *pDevice) { JSONWriter json(os); /* TODO */ json.beginMember("parameters"); json.beginObject(); json.endObject(); json.endMember(); // parameters dumpShaders(json, pDevice); dumpTextures(json, pDevice); dumpFramebuffer(json, pDevice); }