Commit Graph

690 Commits

Author SHA1 Message Date
baldurk e3bc5bb84b Make sure to specify buffer size large enough for NULL terminator 2014-11-23 15:13:09 +00:00
baldurk 652e875db2 Bugfix - function doesn't take wchar_t* any more! 2014-11-23 15:00:12 +00:00
baldurk 2484bc8bc7 Use UTF-8 everywhere possible and only use wchar_t where required.
* This means that all APIs pass byte string types. ALL strings everywhere
  in the entire codebase must be assumed to be and treated as UTF-8 content
  not ASCII.
* Gets rid of all the horrible %hs specifiers that caused warnings on
  linux! Hooray.
* We convert to wide strings, or use wide characters, only when necessary
  to use the Win32 API. Some windows specific code will stay in wide chars
  just for convenience.
* Files are already serialised as UTF-8 strings for linux/windows binary
  compatibility, so this change doesn't break backwards compatibility.
2014-11-23 14:45:16 +00:00
baldurk 6b9287470d Refactor log printing to use new custom printf. 2014-11-23 13:56:28 +00:00
baldurk 9d164826da Implement custom printf function, use it in favour of OS *printf
* Custom printf supports UTF-8 and in fact assumes it implicitly for all
  strings. This means we can use UTF-8 everywhere, even on windows, without
  widening parameters to printf() style functions like RDCLOG et al.
* It also allows me to add size_t support and binary printing.
* Grisu2 is used for converting doubles to strings. Reference:

Paper: http://florian.loitsch.com/publications/dtoa-pldi2010.pdf
impl: https://github.com/floitsch/double-conversion
impl: https://github.com/night-shift/fpconv
impl: https://github.com/miloyip/dtoa-benchmark
2014-11-23 13:56:28 +00:00
baldurk 3abdff49a7 Catch & ignore InvalidOperationException when scrolling
* Fix for a crash report - this exception can be thrown sometimes if the
  window is really small.
2014-11-22 09:50:19 +00:00
baldurk caa5e06644 Fix for crash report - check that event label is non-null 2014-11-22 09:49:36 +00:00
baldurk 54a8554439 Force texture format to typed one for pixel history. 2014-11-21 18:19:18 +00:00
baldurk dea6b64e0b Reference count FrameCapturers. Closes #108 2014-11-18 21:49:29 +00:00
baldurk ea9a81e44f Implement DisplayRendererPreview in renderdoccmd for linux 2014-11-16 23:17:44 +00:00
baldurk 86dc50c4fb Go directly to real glBindFrameBuffer when binding real backbuffer 2014-11-16 23:06:14 +00:00
baldurk 8ef2505e77 Normalise texture target enum when first set
* E.g. this will change GL_TEXTURE_CUBEMAP_FACE_POSITIVE_X to just
  GL_TEXTURE_CUBEMAP. We do it once on set rather than everywhere we expect
  to use the current type.
2014-11-16 21:45:24 +00:00
baldurk 7c3b74131c Make sure all secondary contexts share with replay context 2014-11-16 21:40:35 +00:00
baldurk 8f133984fe Number of mips is GL_TEXTURE_MAX_LEVEL+1 2014-11-16 21:40:20 +00:00
baldurk 5ae3c0fd29 Don't memset to 0 a variable that contains an stl string! 2014-11-16 21:39:33 +00:00
baldurk 9440327dec Default values to GL_FILL in case driver refuses to return any 2014-11-16 21:39:22 +00:00
baldurk 6afe7b7cd1 Speculative change to prevent infinite loop of renderdoccmd.exe
* There was a report of renderdoccmd.exe doing --cap32for64 in an infinite
  loop on itself (each process trying to inject the previous). I'm not sure
  how this could get started, but assuming this was happening automatically
  for 'hook into children', try to break the infinite loop by refusing to
  inject into our own exes.
2014-11-16 16:38:48 +00:00
baldurk 643447f521 Fix for hook fetching/populating on capture and replay 2014-11-16 12:34:55 +00:00
baldurk c7462dc69d With some regret, add hack on AMD to not use VERTEX_BINDING_BUFFER
* AMD drivers (at least on linux, haven't tested windows) don't recognise
  VERTEX_BINDING_BUFFER, so instead we create a dummy VAO with each attrib
  bound to the corresponding buffer and then use
  VERTEX_ATTRIB_ARRAY_BUFFER_BINDING to query the buffer out.
2014-11-16 12:34:33 +00:00
baldurk bb4cbdf097 Check for version > 4.4 or GL_ARB_enhanced_layouts 2014-11-16 12:24:40 +00:00
baldurk 172a9bb9ff Globally store the GL core version and list of extensions
* For now we just store the highest core version and only re-fetch the
  extensions when we see a context of a higher version that before. This is
  just working off the assumption that there might be a low-version context
  (especially on windows where it's necessary before getting a 3.2+ core
  context), but otherwise all contexts will be the same level.
2014-11-16 12:24:10 +00:00
baldurk aaf525d254 Respect the maximum number of bindings for indexed buffer binds 2014-11-16 12:22:47 +00:00
baldurk 9ce6c242b2 Only set GL_DEPTH_STENCIL_TEXTURE_MODE if it has a valid value 2014-11-16 12:22:02 +00:00
baldurk 3c95803566 # mips should be calculated as GL_TEXTURE_MAX_LEVEL + 1 2014-11-16 12:18:34 +00:00
baldurk c5f383bc65 Use sanitised texture target 2014-11-16 12:17:59 +00:00
baldurk 250570d90c Add function to go from binding or cube face to texture target 2014-11-16 12:15:47 +00:00
baldurk 201a25f459 Use correct serialised target enum for replay-side 2014-11-16 12:15:01 +00:00
baldurk 4a34f5961b GLSL compile fix, compare dot() result against scalar 2014-11-16 12:14:19 +00:00
baldurk 04b108efa0 Fix typo in serialise of glTexBuffer* 2014-11-15 14:34:28 +00:00
baldurk c44fca55a3 Suppress performance GL debug messages by default 2014-11-15 14:24:43 +00:00
baldurk b00cffddbd return GL_*_INTEGER base format for unnormalised integer types 2014-11-15 14:21:02 +00:00
baldurk c6378619d8 When a texture is bound to a framebuffer, consider it dirty 2014-11-15 14:04:14 +00:00
baldurk 5be7a4eef3 Save texture state parameters with initial state
* If the user code calls glTexParameter many times (defined as > 12) then
  we treat that texture as dirty and stop saving those chunks.
2014-11-15 14:01:02 +00:00
baldurk 5acc53bae0 Add EXT_DSA glGetTextureParameter functions 2014-11-15 13:58:52 +00:00
baldurk 65df5a9192 Check file hasn't been removed out from under us before saving 2014-11-15 12:21:27 +00:00
baldurk 5b2a754196 Serialise a few more state change functions 2014-11-15 12:03:16 +00:00
baldurk b41b5e1f9a Handling for old style unsized texture internal formats 2014-11-15 11:03:08 +00:00
baldurk 0b888f2609 Serialise out whether data is provided to glTexImage* functions 2014-11-15 10:41:28 +00:00
baldurk 92d77e32b3 Add missing \s 2014-11-15 00:33:11 +00:00
baldurk 29b4c65162 Work around issue where application 'exports' gl symbols
* This is a bit complex. If an application has a global symbol e.g.
  GLENABLE glEnable; as their function pointers that they fill out from
  glXGetProcAddress, then OUR glEnable global function gets replaced with
  that symbol. It's weird. But it means crashes if we try and return the
  address of that symbol as a function pointer.
* However it's also possible to get the reverse problem - if an application
  has a shared library that has those symbols expecting them to be function
  pointers, those symbols will get overridden with our global functions
  and it will mean an instant crash when they try to assign to those func
  ptrs.
* I'm not sure if there is an ideal fix to this Catch-22, as we also need
  to export these bare functions in case someone just plain links against
  libGL and expects them to be there, with no GetProcAddress/dlsym funny
  business.
2014-11-15 00:13:44 +00:00
baldurk 0f34fbd29a Check that for each new context we populate hooks to get func ptrs 2014-11-14 23:26:18 +00:00
baldurk c5e53f7473 pick up libGL dlsym handle when dlopen() is called 2014-11-14 23:25:15 +00:00
baldurk 9c0b89baae StringFormat::Fmt was re-using va-list incorrectly on linux 2014-11-14 23:22:50 +00:00
baldurk fd9d11bc6d Fix linux GetEmbeddedResource not using address of file start/end 2014-11-14 23:22:36 +00:00
baldurk ac89399c60 linux compile fixes 2014-11-14 14:16:05 +00:00
baldurk ecbd919d05 Try to preserve horizontal scroll between events on mesh view 2014-11-13 22:21:09 +00:00
baldurk 551b0372c8 Allow fully flexible display of position&other component on meshes
* You can choose which component will be used as 'position' when rendering
  vertex inputs. Helpful if a position component isn't auto-detected, or
  if you want to render UV co-ordinates onto the screen.
* Instead of fixed TEXCOORD0/Color options for solid shading onto the mesh
  you can choose a secondary column yourself.
* Also the solid shading options are available on vertex output meshes as
  well as inputs.
2014-11-13 18:37:58 +00:00
baldurk ef65ad65f1 Fix highlighting VS output verts with index buffers 2014-11-13 18:24:08 +00:00
baldurk 5abeee554f Generate generic input layout from correct VS bytecode 2014-11-13 13:49:13 +00:00
baldurk b255f5bc36 Protect against ArgumentException in Timeline Bar paint
* Crash report was submitted indicating a crash here, which is either
  memory issues or momentarily crazy-large window. We can catch the
  exception and just clear to black.
2014-11-12 23:38:40 +00:00