Commit Graph
1016 Commits
Author SHA1 Message Date
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
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 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 c0be5552e8 Extract command line #defines to fxc, roll them in when editing shaders 2015-03-29 18:29:20 +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 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 490dbea556 A couple of fixes to not index in invalid ways into vectors/strings 2015-03-25 20:18:30 +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
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 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 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
baldurk c3e381a76a Remap entire index buffer for post-vs data, instead of just shifting
* Previously for post VS data we could maintain the index buffer by just
  doing the stream-out/transform feedback for a point list with each
  unique index. To maintain the index buffer we padded out any gaps in
  the indices with a single value, so that we could just shift the
  indices. This causes severe problems though if the indices start at 0
  and contain an invalid value like 0xcccccccc - we'd allocate a huge
  array and perform a massively wasteful streamout.
* Instead, we just stream out on the tightly packed list of unique
  indices, then remap each 'real' index to where it is in the tightly
  packed output buffer.
2015-03-10 21:05:59 +00:00
baldurk f46e31c4ba Only account for mip in slice/face index for 3D textures.
* This prevents arrays or cubemaps from having the slice or face index
  be incorrectly modified by the mip being displayed. Thanks Xavyiy on
  twitter for the report.
  https://twitter.com/Xavyiy/status/574352181190594560
2015-03-07 23:58:37 +00:00
baldurk 94f25edfd0 Bump version number to v0.24 for subsequent unofficial builds 2015-03-07 23:56:42 +00:00
baldurk 05fd8374a6 Fix a couple of D3D11 overlays not setting up tess/gs & IA correctly 2015-03-02 16:15:56 +00:00
baldurk e2f7afc3a2 Make sure Fullscreen VS is also created in capturing program
* This shader is necessary for the MSAA-to-array copying functionality
  used, and without it we bind a NULL vertex shader and can end up with
  driver crashes.
2015-03-02 11:45:38 +00:00
baldurk 28922673cb Bump version number to 0.23 for future nightly/beta builds. 2015-02-28 22:58:12 +00:00
baldurk cca206a356 Fix array indexing crashes, ditch a lot of messing with UAV start slot
* The UAV array is provided as we expect it - with UAVs from 0 onwards
  even if their 'slots' are 4, 5, 6 etc or whatever. UAVStartSlot is
  the slot of the 0th UAV.
2015-02-27 14:07:58 +00:00
baldurk 954da5c0e4 Compile fix - uninitialised variable 2015-02-27 09:18:55 +00:00
baldurk f8e8ae1391 Add in gl_PerVertex redeclarations individually
* This means the redeclarations are a bit more flexible if a shader
  (like a geometry shader) redeclares one already, but not the other,
  we'll only substitute in the missing one.
* Note this code is still a bit flakey e.g. in edge cases like if
  someone puts "in gl_PerVertex" in a comment, then it will fail.
  I want to avoid putting a full parser in, but perhaps stripping the
  source of any comments is a reasonable future step.
2015-02-26 17:58:41 +00:00
baldurk 43d4fff314 Fix typo when fetching shader subroutine values 2015-02-26 17:40:16 +00:00
baldurk 3904fb636d Ensure that (where available) clip control is set for overlay text 2015-02-26 17:36:04 +00:00
baldurk 12519df942 Fix crash if we insert 0 into indices list that already contains 0 2015-02-26 17:28:25 +00:00
baldurk f160c28d16 Fix GL PickPixel to be able to read back depth & stencil in two passes
* GL doesn't seem to support reading both depth and stencil channels
  from a single texture, so we need to do a second pass to read back
  the stencil component
2015-02-26 15:41:47 +00:00
baldurk 08024a375b Make missing GL functionality not breakpoint, for release 2015-02-26 15:16:11 +00:00
baldurk c69389864e Fix buffer map diff comparison, and skip it for range maps
* For range maps, similar to glFlushMappedBufferRange, we assume the
  user selected the range deliberately and we upload it all. We only
  find a difference range for whole-buffer maps (of large enough
  buffers). This includes glMapBuffer(), by definition.
* Also, the comparison point is between the map pointer, so we have to
  offset the shadow pointer to compare it against to get accurate
  results.
2015-02-26 14:25:40 +00:00
baldurk 5892899729 For glBufferData/glBufferStorage ensure 'invalidate' data is consistent
* glBufferStorage was less of a problem as it was immutable but the data
  that got uploaded was uninitialised memory, it is now filled with 0xdd
* glBufferData could be used to invalidate a whole buffer, by passing
  NULL as data for an existing buffer. This caused a mismatch where the
  driver could (legally) have the same data, but our serialised copy
  was random uninitialised memory. The diff was done against the 'real'
  data but on serialise the base data was different, causing invalid
  data to be used.
2015-02-26 14:24:35 +00:00
baldurk 5ffb7c65a5 Hack around glCopyImageSubData being broken for compressed cubes on AMD
* Also for the hack that involves readback to CPU and reupload, make
  sure there's no pixel pack or unpack buffer bound for the duration.
2015-02-26 12:34:15 +00:00
baldurk d5b3337522 forcing all glBufferData calls into resource record isn't right
* glBufferData isn't only used for creation, it is often used to upload
  new data to a buffer, which means that during the captured frame any
  're-create' type calls should go into the context record.
2015-02-25 22:57:46 +00:00
baldurk 446d7d6da5 Take our own copy of the X connection that we are passed
* We need to copy the X display (by fetching its connection string and
  calling XOpenDisplay), so that if the Display* we had gets closed then
  nothing will crash.
2015-02-25 22:26:45 +00:00
baldurk fae5aabcce Handle missing/unsized formats on replay
* This can happen if someone binds an uncreated texture (!).
2015-02-25 22:22:32 +00:00
baldurk ae9e9e8f9f Fix highlight boxes to not have a little pixel missing in the corner
* Also in the HLSL version, we were indexing off the end of an array
  since we were drawing 5 lines but only had 4 verts in the array.
  Oops!
* We can remove D3D's OutlineStripVB, as we're doing it all in the
  shader.
2015-02-25 22:22:06 +00:00
baldurk 3a309dcd14 Fix for compile errors/warnings on linux
* The daily linux auto-compile script was broken, it's fixed now!
2015-02-25 19:02:26 +00:00
baldurk 884ee00107 Be much less forgiving about glBufferSubData calls marking high-traffic 2015-02-25 17:30:32 +00:00
baldurk debc787eb9 Check fast path for compressed pixel unpack requiring block dims
* The unpack parameters are ignored for compressed images unless the
  compressed width, height, depth and size parameters are set (whichever
  are required for the given unpack param). So we roll this into our
  calculation of the fast path, which means that we only use them in
  UnpackCompressed if they are valid.
2015-02-25 17:29:55 +00:00
baldurk 0796e5fbdf Handle cases where fragdata or attrib location idx is -1
* This can happen when we're copying from a source program to a dest
  program where the source is non-separable and had an attribute
  optimised out entirely, but the destination is separable and so still
  wants that attribute. In this case it'll come out in the wash and
  we can just skip it.
2015-02-25 17:28:06 +00:00
baldurk 75f58d19e8 Rejig initial state fetching for objects that are context-specific
* We used to switch to the context that the object was created on and
  fetch initial state there, but this isn't safe e.g. the switch
  operation could fail if the context was active on another thread.
  Instead we queue up such objects to have their data fetched the next
  time we see the context made current.
* If we never get the initial state for that object we assume that
  context is never used, so it's OK to just not have initial states -
  it's marked as invalid so we don't try to restore those states on
  replay.
* Note: this obviously falls down in the even that the context is
  already current on another thread and we just get commands from there
  without an explicit 'MakeCurrent' call. But we already don't handle
  that as we don't detect that and log the state change (or properly
  handle multithreaded commands), so it's not any worse support.
2015-02-25 16:47:50 +00:00
baldurk a0f35673bb Don't remove the MAPPED_BUFFER_BIT from glMemoryBarrier calls
* Apparently although there are no errors thrown if you pass
  GL_ALL_BARRIER_BITS (0xffffffff), if you remove a bit then an error
  will be thrown for unrecognised bits :(.
* Since it's not harmful to leave in the mapped buffer bit we just let
  it remain.
2015-02-25 14:04:23 +00:00
baldurk 8d54bbec32 Workaround for nvidia buggy implementation of glClearNamedFramebufferfi 2015-02-25 14:04:23 +00:00