Commit Graph

156 Commits

Author SHA1 Message Date
baldurk bffea4c788 Don't handle filesystem watcher callbacks once texture viewer is closed
* Fixes a reported crash
2017-04-26 20:47:04 +01:00
baldurk f6c045f473 Refactor public interface to be less strict C and more python friendly
* Generally this means removing ref out parameters and instead returning
  values. In a couple of cases we will want to avoid copies in future
  either by returning const references (e.g. to the pipeline state which
  is immutable).
* At the same time, some pointless bool return values that were always
  true and didn't indicate errors have been removed. They can be added
  again if an error condition comes back.
* Some free functions still have out parameters as C linkage doesn't
  allow returning user types by value.
* The C# UI still invokes into C wrappers for all the C++ classes, which
  handle taking the return value and doing a copy into an out parameter
  still for compatibility.
2017-04-18 14:57:46 +01:00
baldurk d40fc8471d Change API enums to enum class, remove now redundant prefixing
* This gives a little nicer syntax, a bit better type safety, and also
  reflects better for SWIG bindings. Overall it's a minor change but
  better.
* We don't update the C# UI at all, since it's soon to be removed and
  not worth the effort/code churn.
* For now so we're ABI compatible with C#, all enums are uint32_t, but
  that is an obvious optimisation in future to reduce struct packing.
* We avoid 'None' as an enum value, because it's a reserved word in
  python so will cause problems generating bindings.
2017-04-18 14:57:33 +01:00
baldurk 666aee093b Backport 'tagged' render invokes from qrenderdoc
* This is a possible fix for a case where render work triggered by mouse
  movements (such as pixel and vertex picking) can happen faster than it
  executes, leading to a backlog of render commands and a noticeable lag
  which only gets worse the more you move the mouse until everything
  seems to be unresponsive or laggy (especially if you then trigger a
  blocking command like event change, which will block the whole UI
  until the queued picks happen).
* Since a new pick coming in will override and make redundant the
  previous pick, we allow the render commands to do just that. If a new
  command comes in, we remove any previous commands with the same tag
  and put the command in the first match (this prevents a tagged invoke
  always being pushed to the back of the queue).
2017-04-03 18:31:59 +01:00
baldurk 01c3a76625 Apply the type hint when displaying pixel values in texture viewer 2017-01-12 13:15:32 +00:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk 4a2e901807 Don't display pixel context right-click context menu if no log is loaded
* This fixes an uploaded crash, where this context menu could launch
  operations that crash without a capture to work on.
2017-01-04 16:45:54 +00:00
baldurk b1809c1949 Support HLSL custom display shaders on D3D12 2016-11-18 16:31:33 +01:00
baldurk f260d5e2c8 Don't display 'resolve samples' option for non-resolveable formats 2016-11-07 18:14:47 +01:00
baldurk e040249398 When selecting the final swapchain present, use present target
* It was using the last bound render target, which could be empty if
  state was reset before presentation. Instead we use the copy target
  listed in the present drawcall as the actual swap buffer presented to.
2016-11-02 23:39:35 +01:00
baldurk 5a5c576a33 Allow TGA and PNG to discard/flatten alpha as desired. Refs #407
* DDS will always save the format entirely literally, and the float
  formats do not support alpha processing currently.
* TGA and PNG will either discard the alpha and write entirely opaque,
  or they'll include it in the file. Blending to colour or checkerboard
  is not supported.
2016-11-02 23:39:35 +01:00
baldurk 820b343ef3 Remove redundant numSubresources struct member that was just mips*slices 2016-10-14 16:19:15 +02:00
baldurk 2936756ddf Update texture display before updating visual range. Refs #388
* This was broken in 0f4d43cd37 which changed from specifying texture
  settings directly, to using them from the output's settings.
2016-10-06 12:49:46 +02:00
baldurk 0f4d43cd37 Make minmax/histogram aware of custom shaders. Refs #385
* This moves those functions relative to an output instead of the
  renderer, so they pick up the settings etc from the output
  configuration.
2016-10-04 19:54:30 +02:00
baldurk 0f660e3ec2 Create and fill out D3D12 pipeline state, without shader resources.
* We make shaders into fake resources with IDs, so they can be
  identified individually (for replacement, fetching reflection data,
  and things like that). This is a little but ugly but worth it for the
  simplicity it will provide everywhere else.
2016-09-22 12:05:47 +02:00
baldurk a2a63104dd When nudging with arrow keys, account for selected mip 2016-09-16 18:36:38 +02:00
baldurk 2a27c94b1a When selecting a mip in a 3D texture, update slice list. Refs #359
* The sliceFace passed in via the replay interface is still in 0-n range
  with n being the top level mip dimension. We just change the drop-down
  so that it only lists the number of slices at that mip, and scales up
  accordingly.
2016-09-15 17:10:16 +02:00
baldurk 4377297544 Don't override user selected mip or slice for RO textures, or same draw
* This means we only jump to the 'active' mip or slice when switching to
  a new draw with some texture on output. This still lets us
  automatically follow through a mip generation chain or cubemap
  rendering, but when looking at a particular slice or mip on a texture
  it doesn't get reset when switching textures around.
2016-09-15 17:10:16 +02:00
baldurk c909c4e5b0 Make sure that 'selected' preview remains even if its thumb index moves 2016-09-15 17:10:16 +02:00
baldurk ebbef4e1aa Fix a crash if a barrier event happens not within a drawcall 2016-09-10 12:54:43 +02:00
baldurk 6921b37d8e Don't display previews for sampler resources 2016-09-09 20:53:20 +02:00
baldurk 258da93e94 Speculative crash fix - ensure prev array slice is in valid range 2016-08-26 13:52:46 +02:00
baldurk e8e3d50c86 Expose the different local and remote renderers to the UI 2016-08-24 15:53:58 +02:00
baldurk a786ac2eab When switching textures/events, leave pixel pick result valid
* This avoids a flicker when using remote replay while the pick result
  comes in
2016-08-19 17:26:39 +02:00
baldurk ebea48260d Mark blocking invokes for painting as lower priority
* This allows them to be enqueued without the usual synchronous block
  if there's something long-running on the queue while in remote mode.
2016-08-19 17:26:24 +02:00
baldurk c4310373fd clamp when assigning prevHighestMip, just in case 2016-08-12 15:57:00 +02:00
baldurk 9f9610ce6d Recreate output windows after use, since D3D12 breaks them 2016-08-06 18:31:33 +02:00
baldurk 610b22f600 Fix a lot of high-contrast inconsistencies or brokenness. Refs #315
* In a couple of places I had to resort to if(IsHighContrast) but mostly
  this is just using system brushes consistently or not assuming black
  text.
* The default DockPanel theme doesn't work well, so make a minimal high-
  contrast theme for it and assign it everywhere.
* The pipeline flow was using fixed colours, use system brushes for the
  different elements and switch based on high-contrast to ensure active
  and inactive stages are visible (using ActiveCaption looks bad on
  normal themes because it's a big block of colour).
* For some reason the flat toolstrip renderer doesn't handle white-on-
  black themes, but the system one does. It's a little clunkier but it
  shows up correctly without writing tons of custom painting code.
* Range histogram uses a properly contrasting colour for the border.
* Treelist views use a better system colour for selected rows when
  inactive and hovered rows (when high contrast).
* Mesh view grids have a system background instead of white
* Various things (pipeline state, mesh viewe) set text colour when
  colourising backgrounds of things instead of assuming black.
2016-08-05 12:46:56 +02:00
baldurk e8cb71a895 Add protection for buffer/texture viewer layouts failing to load. 2016-08-01 22:28:57 +02:00
baldurk 4f06161fb9 Update template custom shader to include UV, add new globals. Refs #304 2016-07-26 15:18:45 +02:00
baldurk fbcd79b27d Don't create thumbnails until output has been created 2016-07-25 18:27:21 +02:00
baldurk ba7c6711ff Hide *all* remaining thumbnails after setting the visible ones up 2016-07-25 18:27:17 +02:00
baldurk 170df95924 Make usage entries menu items not labels, to be clickable 2016-07-25 18:27:16 +02:00
baldurk eaa53adbc3 For locked textures, reset type hint so they don't inherit from previous 2016-07-25 18:27:13 +02:00
baldurk 54ea69a619 Always enable custom shaders create button, prompt for name. Refs #304 2016-07-25 11:39:47 +02:00
baldurk 12a51ee5a4 Save display type (RGB vs custom) and custom shader per-tex. Refs #304 2016-07-25 11:39:46 +02:00
baldurk 5b74d2f90a Add a little Ctrl-G popup on the texture viewer to jump to a pixel 2016-07-22 12:28:26 +02:00
baldurk bde21b0c73 Render custom shaders at the selected mip level. Refs #302 2016-07-19 20:40:11 +02:00
baldurk 2b5e37b442 Make handling of mips more consistent around locked textures. Refs #292 2016-07-12 19:22:17 +02:00
baldurk 2a68153def Make sure resource context menu items are large enough 2016-07-12 19:00:37 +02:00
baldurk 123476fd30 Allow fetching view params (bound mip, etc) for copy/compute. Refs #292 2016-07-12 18:48:03 +02:00
baldurk 53d739c659 Add fallback if miplevel doesn't have a selected value 2016-07-12 18:41:51 +02:00
baldurk 80b61b2e37 Fix picked pixel co-ordinates as well as hover co-ords. Refs #300 2016-07-12 18:39:10 +02:00
baldurk e12d789a83 Fix incorrect use of texture height instead of mip. Refs #300 2016-07-11 18:54:22 +02:00
baldurk ce2b7a88d3 Remove redundant word 2016-07-11 11:54:58 +02:00
baldurk 49dc23cb7e Add compatibility for loading old layouts with bad checkerboard colours 2016-07-11 11:28:24 +02:00
baldurk 6608a965ed Fix sRGB handling on clear colours 2016-07-10 18:10:06 +02:00
baldurk 4268d8f58f Remove structure size and redundant 32-bit length field from FetchBuffer 2016-07-10 18:10:02 +02:00
baldurk e8b3400ebb Fix crash if tex doesn't have any settings yet 2016-06-28 11:38:07 +02:00
baldurk edbd1ce89b Pass through view format as a type hint to texture display/sampling
* This is only applicable really on D3D11 where the underlying texture
  can be typeless, and a default interpretation as unorm/float won't
  necessarily how the texture is actually being used.
2016-06-27 12:10:21 +02:00