Commit Graph

3262 Commits

Author SHA1 Message Date
baldurk 09e3d9a81c When remapping down, read subsequently from mip 0. Refs #390 2016-10-06 18:09:26 +02:00
baldurk d2b2e77d35 Clean up GL/Vulkan display shader, fixes remapping of mips. Refs #390 2016-10-06 18:09:06 +02:00
baldurk 44706c3f7b Need to remap for 8-bit formats with less than 4 channels 2016-10-06 18:07:02 +02:00
baldurk 5b02be386f Don't read off the end of IB when up-converting to mesh pick
* This could lead to a crash at least on vulkan, where the memcpy reads
  off the end of the data. On GL this could mean the index data doesn't
  get read back.
2016-10-06 15:18:26 +02:00
baldurk a52ca923b2 Check for File I/O failures when opening log in replay driver.
* I got a crash report that seemed to have a file become invalid or
  unavailable in between it being opened to determine the driver (which
  already handles I/O failures) and the driver opening it. This check
  just makes that more robust
2016-10-06 14:36:24 +02:00
baldurk 2c9de11a89 Fix histogram slice sampling for 3D textures
* This changed earlier when the mip/slice indexing changed to be more
  sensible.
2016-10-06 12:52:54 +02:00
baldurk dc90d5e9dd Make sure reported texture sample count is always at least 1. Refs #387
* Particularly, GL texture buffers were incorrectly setting it to 0
  which was invalid and caused a crash later.
2016-10-06 12:35:09 +02:00
baldurk d322f17695 Cache textures in GL GetTexture if they weren't seen before. Refs #386
* When saving the result of a custom shader visualisation, we need to
  get the texture details of a live-created (ie. not from the capture)
  texture.
2016-10-06 12:12:53 +02:00
baldurk 202ab8867c Treat backbuffers as sRGB for the purposes of remapping. Refs #368 2016-10-05 11:16:04 +02:00
baldurk c47ab2c515 Fix for conflicts between X headers and Qt due to overlapping #defines 2016-10-05 01:13:09 +02:00
baldurk 39bfe99ae5 Implement common pipeline state abstraction 2016-10-04 19:54:32 +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 a1c72464fd Fix a case where UNKNOWN_PREV_IMG_LAYOUT could leak out into barrier
* In this case we fall back to transitioning from LAYOUT_UNDEFINED
2016-10-04 19:54:29 +02:00
baldurk 00c5546198 Bump GL serialise version to account for added buffer initial states 2016-10-04 19:54:27 +02:00
baldurk 8c09722d67 Fix variable shadow warnings 2016-10-02 20:25:19 +02:00
baldurk 9ee4653a7a Add triangle size overlay, showing heatmap of triangles < 4x4 in area 2016-10-02 20:04:43 +02:00
baldurk b959b0ce30 Specify TRANSFER_DST usage for overlay image, to allow clears 2016-10-02 20:01:32 +02:00
baldurk f7113e94ae Make sure image view formats match properly for dummy views 2016-10-02 20:01:31 +02:00
baldurk 010917c787 Fixes to quad overdraw overlay on GL 2016-10-02 18:26:19 +02:00
James Fulop 317e01c22f fix file line endings 2016-09-30 11:01:35 +02:00
James Fulop bd14750702 ignore w component in default path 2016-09-30 10:58:30 +02:00
James Fulop ceeba57c12 vk handles unproject sign more robustly
vk format

vk handles unproject sign more robustly
2016-09-30 10:58:29 +02:00
James Fulop 8054365bd6 picking works on tiny/detailed VS_Out meshes 2016-09-30 10:58:29 +02:00
James Fulop d71e7340e1 d3d11 handles unproject sign flip more robustly
float2 to vec2f

d3d11 handles unproject sign flip more robustly
2016-09-30 10:58:28 +02:00
James Fulop 5f178bd765 gl handles unproject sign flip more robustly
gl format

gl handles unrpoject sign flip more robustly
2016-09-30 10:58:28 +02:00
James Fulop bfd1d96f8f ignoring w component on VS_In 2016-09-30 10:58:27 +02:00
James Fulop d306f27c72 minor tidying 2016-09-30 10:58:13 +02:00
James Fulop 67246868f5 vs_out tri picking works from all angles 2016-09-30 10:55:01 +02:00
James Fulop 15978532e3 updated vertex picking for d3d11 2016-09-30 10:55:00 +02:00
James Fulop a8b2be5643 minor comment/logic changes 2016-09-30 10:55:00 +02:00
James Fulop 770843554d triangle picking for Vulkan
Essentially a straight copypaste from the GL version.

VS_Out picking isn't working correctly in the triangle path.
2016-09-30 10:54:59 +02:00
James Fulop 03fdfc7593 triangle selection path works in VSOut stage now 2016-09-30 10:54:58 +02:00
James Fulop 11563d770f fixed bug were index buffers with a width less than 4 were truncated
indexes with a size less than uint32 were being ugpraded to uint32,
but the buffer range size was still dependent on the original width.
Before this change, when doing selection on indexed meshes with a
width of 2, the second half of the mesh would be unpickable.
2016-09-30 10:54:26 +02:00
James Fulop f630e4a7d6 all mesh types functioning in opengl 2016-09-30 10:51:59 +02:00
James Fulop becf01701f triangle fan support 2016-09-30 10:51:59 +02:00
James Fulop ea861ed3e1 fixed bug were it would pick vertices behind the camera 2016-09-30 10:51:58 +02:00
James Fulop 8851da66af added original picking back in as a fallback. 2016-09-30 10:51:57 +02:00
James Fulop bdfd44ebc9 triangle lists pick correctly 2016-09-30 10:51:57 +02:00
James Fulop dd55043527 add lerp macro 2016-09-30 10:51:56 +02:00
James Fulop ef185bca34 improved vertex picking, only Opengl VS Input
The new vertex picking solution raycasts from the mouse's position,
picking vertices based on
1. The triangle it has intersected (take the nearest triangle)
2. The nearest vertex to the intersection point on the triangle

This is replacing a solution that was based on how close the vertex was
to the mouse in screen space and its depth.

This commit only supports the OpenGL path in the VS Input window.

I have disabled vertex picking in Vulkan for now, as there are some
cross dependencies (debuguniforms.h).
2016-09-30 10:51:56 +02:00
baldurk e55f92cf67 Fix an off-by-one error in runtime warning reporting. Refs #380
* Pixel shader debugging was right by coincidence because it replayed
  the drawcall, but technically that could produce incorrect results as
  we would then pick up UAV contents from after the draw, not before.
2016-09-30 10:50:29 +02:00
Michael Rennie 35a30be896 Forgotten break in remap switch label. 2016-09-29 15:31:51 +02:00
baldurk 9f4a60028e Handle injecting environment variable params
* This also fixes the problem of capturing 32-bit programs with 64-bit
  RenderDoc failing to properly insert environment variables and
  error'ing when it tries to do it directly.
2016-09-28 17:55:45 +02:00
baldurk 8e80192c4a Add an error for remapping unhandled special formats 2016-09-28 16:33:11 +02:00
baldurk 2b9b152f1d return DXGI_FORMAT_UNKNOWN for all unsupported/unmappable formats
* This means that when creating a proxy texture, all non-native formats
  will be remapped by the proxy to a safe linear format.
2016-09-28 16:28:12 +02:00
Michael Rennie 5d23e39994 Remap texture formats across different APIs.
For example ASTC/ETC2 textures in Vulkan need to be forced to RGBA8 to be
displayed by D3D11.

IReplayDriver has virtual method IsTextureFormatSupported(ResourceFormat)
so each API can decide if a format should be converted.

Parameters to GetTextureData() are moved to a struct, to save any
non-default behaviour needed for fetching texture data into the proxy.

MakeDXGIFormat now returns DXGI_FORMAT_UNKNOWN for unsupported formats
instead of asserting. We use this to determine whether to remap.
2016-09-28 16:24:34 +02:00
baldurk bfcfcd37b5 Make sure DSVs show up with their view parameters properly. 2016-09-28 15:51:54 +02:00
baldurk 4ccfe298f3 Force initial states for 'viewed' resources in GL
* If a buffer is used as a texbuffer, or a texture as a view, then any
  time the underlying data is dirty and needs to be saved as initial
  contents but the data object is never referenced directly (only the
  view), we need to force the underlying data object to have initial
  contents.
2016-09-28 15:09:02 +02:00
baldurk a9e4396655 Fix compile error that somehow doesn't trigger on VS 2016-09-28 13:55:24 +02:00
baldurk c47f4f8e07 Implement proper buffer initial contents, don't save into record data
* This fixes a couple of cases - the case where a buffer is modified
  mid frame would not properly have its contents reset each frame
* Also any buffer that isn't modified during the frame would have its
  initial contents overwritten by some partially recorded updates before
  a buffer was marked as high traffic/dirty.
2016-09-28 13:18:21 +02:00