From: Sam Moore Date: Thu, 23 Oct 2014 11:49:35 +0000 (+0800) Subject: Merge branch terrible and branch awful X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=commitdiff_plain;h=f0b6c9b6b95fde134927c395afbfbbbc057868e6 Merge branch terrible and branch awful scr.Present was in wrong place Merging sucks Everything sucks GPUs suck fglrx sucks professionalism sucks I hope no one looking to hire me ever reads these. Conflicts: src/main.h --- f0b6c9b6b95fde134927c395afbfbbbc057868e6 diff --cc src/debugscript.cpp index 2784406,dd6a5df..6d4ba7f --- a/src/debugscript.cpp +++ b/src/debugscript.cpp @@@ -398,9 -418,14 +418,14 @@@ bool DebugScript::Execute(View *view, S } case AT_PrintBounds: { - printf("%s\t%s\t%s\t%s\n", Str(view->GetBounds().x).c_str(), Str(view->GetBounds().y).c_str(), Str(view->GetBounds().w).c_str(), Str(view->GetBounds().h).c_str()); + printf("%s\t%s\t%s\t%s\t%s\t%s\n", Str(view->GetBounds().x).c_str(), Str(view->GetBounds().y).c_str(), Str(view->GetBounds().w).c_str(), Str(view->GetBounds().h).c_str(), Str(Log10(view->GetBounds().w)).c_str(), Str(Log10(view->GetBounds().h)).c_str()); break; } + case AT_ProfileDisplay: + { + g_profiler.Enable(currentAction.iz); + break; + } default: Fatal("Unknown script command in queue."); } diff --cc src/debugscript.h index 916425c,25fee58..8d34bc7 --- a/src/debugscript.h +++ b/src/debugscript.h @@@ -43,8 -43,9 +43,9 @@@ private AT_SetBounds, AT_QueryGPUBounds, // query bounds of Beziers when transformed to GPU AT_ScreenShot, // take screenshot - AT_PrintFPS, // Print FPS statistics about the frames + AT_PrintSPF, // Print FPS statistics about the frames AT_PrintBounds, // Print bounds + AT_ProfileDisplay, AT_Quit }; diff --cc src/main.cpp index 46ea73b,cdb2d0a..c9d2362 --- a/src/main.cpp +++ b/src/main.cpp @@@ -36,18 -34,12 +36,18 @@@ int main(int argc, char ** argv #endif // We want to crash if we ever get a NaN. -- // AH, so *this* is where that got enabled, I was looking for compiler flags ++ // Not any more #ifndef __MINGW32__ - feenableexcept(FE_DIVBYZERO | FE_INVALID); // | FE_OVERFLOW); - feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); ++ //feenableexcept(FE_DIVBYZERO | FE_INVALID); // | FE_OVERFLOW); #endif #if REALTYPE == REAL_MPFRCPP - mpfr_set_default_prec(6); + + #ifdef MPFR_PRECISION + mpfr_set_default_prec(MPFR_PRECISION); + #else + mpfr_set_default_prec(23); + #endif + #endif DebugRealInfo(); diff --cc src/main.h index d5ad7a9,75c4b18..a96e933 --- a/src/main.h +++ b/src/main.h @@@ -209,15 -210,10 +214,21 @@@ void MainLoop(Document & doc, Screen & scr.DebugFontPrint("Doing rendering using CPU.\n"); } #endif // 0 - + - scr.Present(); - + if (make_movie) + { + std::stringstream s; + s << "frame" << frames << ".bmp"; + scr.ScreenShot(s.str().c_str()); - } ++ } ++ ++ + + g_profiler.BeginZone("scr.Present()"); + scr.Present(); + g_profiler.EndZone(); + g_profiler.EndFrame(); ++ ++ } } diff --cc src/screen.cpp index 628a11a,16a3ab8..0dbc4bc --- a/src/screen.cpp +++ b/src/screen.cpp @@@ -45,11 -45,11 +45,12 @@@ Screen::Screen(bool visible } SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); -- ++ //SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); m_gl_context = SDL_GL_CreateContext(m_window); ++ //SDL_GL_SetSwapInterval(1); ogl_LoadFunctions(); diff --cc src/turtles_all_the_way_down.script index ad2647d,45fb1e5..236d3f6 --- a/src/turtles_all_the_way_down.script +++ b/src/turtles_all_the_way_down.script @@@ -1,12 -1,10 +1,12 @@@ -# BECAUSE I CAN +# Script for the turtles video gpu lazy -profileon --#debugfont off + +# Wait to start video - loop 1000 wait ++# loop 1000 wait + +#Load first turtle... loadsvg svg-tests/turtle.svg loop 50 pxzoom 430 170 1 loadsvg svg-tests/turtle.svg diff --cc src/view.cpp index af5f53e,007b9e0..c660a7e --- a/src/view.cpp +++ b/src/view.cpp @@@ -525,9 -541,10 +545,10 @@@ void View::RenderRange(int width, int h void View::UpdateObjBoundsVBO(unsigned first_obj, unsigned last_obj) { + PROFILE_SCOPE("View::UpdateObjBoundsVBO"); if (m_query_gpu_bounds_on_next_frame != NULL) { - fprintf(m_query_gpu_bounds_on_next_frame,"# View: %s\t%s\t%s\t%s", Str(m_bounds.x).c_str(), Str(m_bounds.y).c_str(), Str(m_bounds.w).c_str(), Str(m_bounds.h).c_str()); + fprintf(m_query_gpu_bounds_on_next_frame,"# View: %s\t%s\t%s\t%s\n", Str(m_bounds.x).c_str(), Str(m_bounds.y).c_str(), Str(m_bounds.w).c_str(), Str(m_bounds.h).c_str()); } //m_objbounds_vbo.Invalidate();