Commit Graph

1274 Commits

Author SHA1 Message Date
baldurk f06964ea23 Clean up folder structure a bit, move .NET 3rdparty under renderdocui/ 2015-04-13 12:46:30 +01:00
baldurk b41b5242d1 Support switching between multiple APIs in the same program. Closes #124
* The core class is now responsible for tracking the active window and
  cycling through, so it can cycle through multiple APIs.
* For GL we only set up associations for capturable windows, and only
  those that present (since helper windows are often created). Since
  GL doesn't really have a 'this window is done rendering' call, we just
  decay old windows that haven't presented in >5 seconds.
* Also on GL, legacy/uncapturable windows aren't associated so they will
  not cycle to at all.
* The embedding API now expects a device pointer and window handle to
  set active window or start/end a capture. You can still pass NULLs if
  there is only one API active.
2015-04-13 11:31:30 +01:00
baldurk d91f36281b Make sure only to delete GL objects that were created in the first place 2015-04-13 10:57:05 +01:00
baldurk 7a1cc84f41 Keep temporary log around to be able to save multiple times. Closes #130
* Previously if a temporary log was saved once, it would be moved there,
  so the user could in theory delete it and lose the only copy of the
  log.
* Now the temporary log is held until it's closed in the UI, to be able
  to be saved again. If the user saves the log though, this will stop
  any "unsaved log" prompts in the main UI window, so there is nothing
  stopping the user from saving the log, deleting that copy, then
  closing and they'll lose the log without prompt.
2015-04-12 18:37:16 +01:00
baldurk 54b2ba86a3 Change function to take const ref instead of copying whole vector 2015-04-11 17:52:08 +01:00
baldurk a5cc19ccc6 Implement replay-side resource tracking for OpenGL
* This means that the timeline bar will show use as read/write/clear etc
  and that right clicking on textures in the texture viewer will show
  the events where that texture is used for rendering, for reading, and
  so on.
2015-04-11 11:03:19 +01:00
baldurk e0e345abd7 Bump GL file serialise version for previous commit 2015-04-11 01:09:28 +01:00
baldurk 3ca65bd632 Allow glDrawElements and friends to pass indices as memory. Closes #127
* This is a concession towards non-core capturing, as it's fairly easy
  to support this fallback case without having a negative effect on the
  proper path.
* We serialise out whether an index buffer was bound, and if it wasn't
  we serialise the array passed as a parameter, and upload it into a
  temporary index buffer we generate (so that the replay is correct at
  least).
* I think technically the indirect parameter for glDrawElementsIndirect
  can point to client memory, and the elements array-of-arrays in
  glMultiDrawElements can definitely point to client memory, but I'm
  assuming that no-one would do that. I certainly hope they wouldn't!
2015-04-10 19:05:21 +01:00
baldurk 95f4011bcb Add option to favour monospaced font for all data. Refs #118
* The option will enable monospaced fonts for all data displays, like
  the list of events, API calls, etc as well as pipeline displays, entry
  of filename/directory in the capture window and many other places.
  Pure UI labelling etc mostly still stays as a serif font.
* A few sizes of controls were tweaked (like headers in the pipeline
  windows) so that they didn't just barely overflow with the larger
  font.
* While looking at this, it became obvious that buffer viewers and
  constant bufferviewers should always display in monospaced regardless,
  so that has been changed.
2015-04-09 21:49:03 +01:00
baldurk 35fa1ce2bf Refuse to capture on old contexts, warn on compat profiles. Closes #125
* If CreateContextAttribs is not used to create the context, the overlay
  will run in super-duper old mode using immediate mode calls and fixed
  function pipeline. This way it should display on (in theory) any GL
  app. Capturing will be prevented.
* Compatibility profile contexts are still allowed, but a warning is
  displayed in the overlay.
* If CreateContextAttribs is used to create a < 3.2 version context, we
  go down the same path as for legacy contexts, except with an accurate
  overlay message (just that the version isn't supported).
2015-04-08 21:43:04 +01:00
baldurk 6fa7d47097 Use CPP variable in makefiles so it can be overridden, rather than g++ 2015-04-08 21:43:03 +01:00
Baldur Karlsson af13f1236e Minor update to COMPILE.md to mention VS2015 working
* At the same time, update the linux compile requirements slightly.
2015-04-07 00:17:07 +01:00
baldurk d8bc653edb Fix infinite loop toggling breakpoint
* Also we don't set the custom assembly context menu when there is no
  trace to debug.
2015-04-06 15:16:53 +01:00
baldurk 3d6c992465 Add a custom right-click menu for disassembly scintilla. Refs #128
* This lets us add custom right-click options like run to cursor, toggle
  breakpoint and toggling between integer and float register display.
2015-04-06 15:10:30 +01:00
baldurk a4c705288c Return a wrapped ID3D11Debug interface when requested
* This prevents the app requesting an ID3D11Debug, getting the *real*
  one, and then escaping our little jail of QueryInterface interfaces.
  In particular, an app is likely to ask for ID3D11Debug then ask for
  ID3D11InfoQueue and we want to control use of that ourselves,
  particularly when we're tracking debug device messages.
2015-04-05 17:33:24 +01:00
baldurk 741d061985 Make sure texture is mipmap complete for min/max and histogram fetch
* If the app hasn't set max level appropriately, we will need to, to be
  sure that filtering doesn't come back just with black.
2015-04-02 17:40:26 +01:00
baldurk 8e7d5382c4 Linux compile fix 2015-04-02 09:41:35 +01:00
baldurk 4f8544e7c6 Handle matrices as shader outputs in GL
* We handle them mostly as a series of rows, adding only the first row
  as a varying name, but incrementing the stride for each to account for
  the space taken up by a matrix.
2015-04-02 00:05:37 +01:00
baldurk c049c37b86 Fix run to instruction checking instruction number vs. trace count
* The trace count could be less than the number of instructions if flow
  control causes some instructions to be skipped (and higher if some
  were repeated!). There's no need to validate this value anyway, RunTo
  will bail when it hits the end of the trace if the number is too high.
2015-04-01 23:43:08 +01:00
baldurk 05dc259656 Make sure popups don't appear outside the controls. Refs #128 2015-04-01 23:42:49 +01:00
baldurk eed377c23d Make sure adding both gl_in and gl_out redeclares to same string works
* For everything but vertex shaders to make a separable program we need
  to redeclare gl_in and gl_out. If both of these end up in the same
  string the second insertion was trampling the first one - now they
  will both go in properly.
2015-04-01 23:26:31 +01:00
baldurk 9d74612079 Error check that printed string is a valid length, check for Map failure 2015-04-01 18:02:34 +01:00
baldurk 6a09446acb Fix crash if ctrl-c is pressed in event browser with no log loaded 2015-03-30 20:06:19 +01:00
baldurk c31cf39236 Include hex in tooltip, and show for register windows. Refs #128 2015-03-29 21:06:26 +01:00
baldurk 8b9caa6cc2 When executing python scripts temporarily catch exceptions in renderer
* Errors like syntax and runtime errors in python are thrown as
  exceptions. So for when we invoke onto the renderer thread to do some
  work, we need to be able to catch those exceptions otherwise the whole
  program dies. So over the execute, temporarily switch the thread into
  a catching-exception mode, which then gets rethrown on the invoker's
  thread.
* Note that BeginInvoke shouldn't be used by python since the callback
  might happen after the execution has finished (there's no way to wait
  at the moment).
2015-03-29 19:59:40 +01:00
baldurk c0be5552e8 Extract command line #defines to fxc, roll them in when editing shaders 2015-03-29 18:29:20 +01:00
baldurk 37c1cbffd9 Fix nested #includes not being replaced 2015-03-29 18:12:13 +01:00
baldurk 8abb2f19cc Fix crash editing shader if #include is the first line in the source 2015-03-29 18:11:12 +01:00
baldurk 9273a5bdb3 Make sure assignments into scalar destinations are correct. Refs #123
* SetDst called into a scalar destination operand expect the source to
  be in .x of the parameter, regardless of mask. So in a couple of cases
  where we're assigning from a vector we need to do the mask apply
  by hand. Bit messy, but there are only a couple of exceptions
2015-03-29 17:43:05 +01:00
baldurk 68bf87d68f Make sure to match to right declaration type when looking for stride
* ld_structured was just looking for UAVs before, but this opcode is
  also used for SRVs and we need to find the right declaration to get
  the stride correctly (otherwise we'll either get 0 if there are no
  UAVs, or pick a UAV incorrectly!)
2015-03-27 01:15:15 +00:00
baldurk 25ce9f2a5a Fix filling out drawcall timings if 'hide empty' option is enabled
* Previously we'd expect to run through the same algorithm to generate
  the drawcall nodes, but fill in the existing nodes. However this
  completely broke down when some nodes weren't created because they
  were empty. Now instead we just iterate the nodes that are there and
  look up any values in the timing results.
2015-03-26 18:16:38 +00:00
baldurk 47737d4192 Remove assert since we handle the asserted case, it's not unexpected
* It's reasonably common to get mismatched begin/end events especially
  around frame boundaries.
2015-03-26 17:55:52 +00:00
baldurk cc34f5749a Fix crash if a marker group has children but doesn't have any nodes
* This could happen if the option to remove empty groups was enabled,
  and all the children in a group were removed.
2015-03-26 17:54:26 +00:00
baldurk 490dbea556 A couple of fixes to not index in invalid ways into vectors/strings 2015-03-25 20:18:30 +00:00
baldurk 1f9918a7c8 Fix some crashes and bad handling of indices
* If buffer wasn't a multiple of 4, a Buffer.BlockCopy call could crash
* Unsigned byte indices (for GL) weren't supported
* Post-transform index buffer was assumed to just be uints, but in fact
  it is the same size as the drawcall's existing indices.
2015-03-20 20:52:31 +00:00
baldurk d2a1d2950a Allow predicate to be NULL without skipping the SetPredication() call
* Call to HasLiveResource needs to make sure to account for a NULL
  parameter that ends up with Resource ID 0. Bug introduced in 7aee40f.
2015-03-20 19:20:33 +00:00
baldurk 26f2d0fbb8 fix linux preprocessor macro use in API header files 2015-03-18 21:26:56 +00:00
Baldur Karlsson 055058c53b Update README.md to mention GL support 2015-03-18 17:35:11 +00:00
baldurk 1759a7ba35 Fix crash if constant buffer preview window is too small
* You can't set SplitterDistance unless both MinSize values will be
  respected, which needs a big enough window. Smaller than that, we just
  have to skip setting the size.
2015-03-18 17:34:18 +00:00
Baldur Karlsson 1c99b0359b Merge pull request #126 from vvuk/master
Use DXGI 1.2 to call Present1(), not 1.3
2015-03-16 16:22:26 +00:00
Vladimir Vukicevic c6e8f0d708 Use DXGI 1.2 to call Present1(), not 1.3 2015-03-16 12:11:29 -04:00
baldurk 0aa5dc2e66 Fix check for over-sized depthtargets with rendertargets
* Was causing some valid output mergers to not be tracked correctly.
2015-03-13 11:29:42 +00:00
baldurk c962fbb043 Allow more queries in the initial wrapped pool
* The Talos Principle allocs more than 8192
2015-03-13 11:28:56 +00:00
baldurk 6cd1f70bb6 Fix several warnings for compiling on VS2015
* Note at the time of committing there are still some warnings in MS
  headers that you might need to suppress in a couple of files.
* 3rd party code just has the warnings suppressed for ease of merging.
* The majority of warning fixes were for local variables shadowing
  other locals, function parameters, or members. In most cases they
  weren't a problem, but in some cases it was potentially dangerous!
2015-03-13 10:16:19 +00:00
baldurk b1dd9371e6 Clean up gitignore and add .sln.ide folder for VS2015 2015-03-13 00:43:37 +00:00
baldurk 0475408d7e Use the source resource's length, not destination's, when box is NULL
* Thanks to @bkaradzic for finding this one!
2015-03-12 23:42:48 +00:00
baldurk af97e30376 Linux compile fix, and include copies/generatemips in pixel history
* We treat them the same as UAV writes where we just list them in case
  the pixel is modified without checking.
2015-03-12 10:25:32 +00:00
baldurk 7e1e87af1f Fix crash if shader debug comes back with empty trace array
* The current step wasn't being clamped correctly, so it would be set
  to -1 then used to index.
2015-03-12 00:43:13 +00:00
baldurk c30fd3e1e1 Fix a crash if constant buffer is still open when log is closed 2015-03-12 00:39:47 +00:00
baldurk 5bcbb47203 List GenerateMips, Copy and Resolve calls in event browser with draws
* What gets listed as a 'drawcall' is a bit fuzzy - previously it was
  drawing calls, dispatches and clears, but you could make a good
  argument for these to be included as well. As a semi-experiment, these
  calls are now included and will be listed in the event browser.
* Other calls can change resources like direct buffer or texture uploads
  and Map() type calls, but these remain as API calls listed between
  draw calls. Again this is mostly an arbitrary distinction.
* D3D11 logs are backwards compatible, GL logs are not (although it'd
  be relatively simple, GL logs will likely break backwards compat soon
  anyway, so not worth supporting it now only to break it soon).
2015-03-11 13:13:41 +00:00