Commit Graph

3667 Commits

Author SHA1 Message Date
baldurk e0d1b49bb4 Remove unused VkClearValue entries from calls to vkCmdBeginRenderPass 2017-02-02 15:33:29 +00:00
baldurk 3b7ebe8998 Fix bug decoding hex digits 'a'-'f' without offset by 0xa. Refs #499 2017-02-02 12:54:02 +00:00
baldurk 801f47a31a Fix crashes with redundant changes or 0 refcount binds. Refs #23, #503
* Two potential crashes here - one from the previous fix to #503, we
  would double-release a refcount on an object that was set for write.
  First we'd decrement the refcount when it was 'unbound', then again
  trying to unbind it for write because the slot wasn't NULL'd. This was
  just plain broken.
* The second more obscure one was when binding for read. If the external
  object had no other refcount than the one in the binding slot, then
  changing its binding would implicitly destroy it. However if the code
  was setting the same object back again (ie. with the pointer they had
  not reference to) then the refcount would drop to 0 then should be
  incremented again to 1 when it's re-bound. However because the count
  bounces off 0, the object is destroyed between being unbound and
  re-bound causing pure virtual calls and other crashes when we try to
  access it.
* The fix is first to check if we're binding something to its own slot
  and skip it. Second we need to keep the new objects ref'd at all times
  during the binding (in case we are e.g. performing an array bind which
  moves the 1-refcount object from slot 2 to slot 3. It would be unbound
  when processing slot 2, hit refcount 0, and then be added again when
  processing slot 3).
2017-02-02 12:28:34 +00:00
baldurk c44935ab41 Set compute shader stage bit when reconstructing pipeline info 2017-02-02 10:50:44 +00:00
baldurk 1895f38c4e Strip out direct-display extensions on replay 2017-02-02 10:50:42 +00:00
baldurk 3ac85ab3ee Give display plane surfaces a fake non-0 window handle 2017-02-01 16:35:12 +00:00
baldurk 9d6acd1d00 When binding resources for write, unbind all other write uses. Refs #503
* The D3D11 hazard tracking rules are then as follows:
  - When binding a resource for read, if it is bound for write anywhere
    then NULL is bound instead. If it's not, then any other read
    references are preserved.
  - When binding a resource for write, all other binds for read AND
    write are forced to zero.
  - The exception to the above: If a DSV is bound with depth read-only
    then any read binds reading the depth channel remain bound. Likewise
    for stencil read-only and stencil channel read binds.
  - Special case: When binding RTVs and UAVs at the same time, if there
    is a write overlap within that bind, the entire bind gets discarded
    (including any non-overlapping binds) and state remains unchanged.
  - When considering if a bind overlaps, it only overlaps if the view
    in question covers an overlapping subresource range. In other words,
    it is valid to have a write bind of mip 1 and a read bind of mip 0
    at the same time (the classic case being mip generation).
* This commit fixes the second point, other write binds weren't being
  NULL'd out. So binding a UAV to slot 0 then slot 1 in that order will
  cause slot 0 to become unbound. Or binding to an RTV will unbind a
  UAV or vice-versa.
2017-02-01 14:40:18 +00:00
Michael Rennie 0a119e58f3 Fix setting adb setprop debug.vulkan.layers to empty string.
Workaround inconsistent CreateProcessW string parsing by setting the
property to the Vulkan layer delimiter character. On some PCs it would
remove the quotes before sending to adb, and on others they would remain.

The quotes were interpreted by the Android loader as a layer name, and the
replay context's vkCreateInstance returned VK_ERROR_LAYER_NOT_PRESENT.
2017-01-30 16:50:29 +00:00
baldurk e8c2189dc8 Fix for unsigned/signed comparison 2017-01-27 15:22:25 +00:00
baldurk 804ffb00e2 Try to merge subresource states for resources that were split apart
* When a barrier applies to only one subresource out of an image, it's
  split into individual subresource tracking. There's nothing to merge
  it back together again, so it remains split even if the subresources
  go back to all being in the same state again. Simply checking when
  fetching the frame-initial states if we can merge can be a big win.
2017-01-27 11:00:22 +00:00
Tiago Rodrigues 472960d92f Add PIX3 event support to D3D12 driver
PIX3 events (from WinPixEventRuntime) are passed as a blob of unformatted parameters which the profiling application must parse and format.
2017-01-26 08:30:47 +00:00
baldurk 74a2da2b11 Handle pixel history for D16 targets directly without failing 2017-01-25 21:48:38 +00:00
baldurk 503e60b6a5 Fix setting GL_TEXTURE_MAX_LEVEL to number of mips, not #mips - 1
* This resulted in a lot of textures being incomplete, which could cause
  weird problems depending on if mips are used or not.
2017-01-25 20:13:40 +00:00
baldurk d0aec2197d Implement GL pipeline state viewer for Qt 2017-01-24 19:02:29 +00:00
baldurk 1983414560 Make sure to swap channels when saving BGRA formats. Refs #495 2017-01-24 16:24:36 +00:00
baldurk 31c29c3149 Give Vulkan shader stage structs in pipeline state consistent names 2017-01-24 12:12:33 +00:00
baldurk 581c55f615 Add a log message when a capture is closed for better post-mortem debug 2017-01-24 10:15:14 +00:00
baldurk d368cf2919 Require GL_ARB_gpu_shader5 for gl_SampleMaskIn in quad write shader 2017-01-24 10:14:55 +00:00
baldurk 67e806a8c1 Remove unused rdctype::array constructor 2017-01-23 19:09:28 +00:00
Pierre-Loup A. Griffais b335d32424 posix process: don't crash on malformed environment 2017-01-23 19:09:28 +00:00
baldurk 1c29bcfec7 Look for renderdoccmd.exe in development environment folder structure
* This means that if you just build Win32 and x64 matching, then it will
  all work, no need to manually copy into the deployed folder structure.
2017-01-23 19:09:28 +00:00
Steve Legg 87adee1bf1 Implement multi-instance mesh picking 2017-01-20 16:12:48 +00:00
Steve Legg a41c35b764 Fix mesh picking with perspective camera 2017-01-20 16:12:36 +00:00
baldurk 92c697618a Compile fixes for VS2015 (variable shadowing and 32-bit size_t) 2017-01-18 14:55:49 +00:00
baldurk 43b66df816 Correct byte size calculation for D3D12 array textures 2017-01-18 14:26:36 +01:00
baldurk a59ebcbc3b For large D3D12 upload heap buffers, allocate on default heap instead
* The cost of memcpy'ing data across to upload heap buffers for initial
  contents and maps is significant, so for large buffers it's better to
  allocate them GPU-side so we can do GPU copies.
* This also means that maps cannot happen directly, so instead while
  reading we allocate a GPU-side copy of the map source data, and
  perform a buffer copy instead.
2017-01-18 14:26:11 +01:00
baldurk 112d750e30 Mute nonsense D3D12 debug message 2017-01-18 14:23:22 +01:00
baldurk 70b2976b9a Protect against crashing if VB is not bound 2017-01-18 13:05:37 +01:00
baldurk 9c1d8ae798 Compile fix for OS X - don't try to print a size_t in assert macro 2017-01-17 23:49:50 +00:00
baldurk 914bb63ffa Rework error logging of required extensions.
* There was some weird clang-format issue with the macro that this
  hopefully fixes. It also means less log spam if multiple extensions
  are missing.
2017-01-17 21:24:55 +00:00
baldurk 04c24ad855 Variable shadowing compile fix 2017-01-17 20:00:37 +00:00
baldurk e4a4c701cd Check GL version number to enable extensions that became core
* This means that even if the extension isn't reported in the string
  for whatever reason, we still mark it available. It saves on checks
  of (GLCoreVersion >= 43 || HasExt[foo]) all over the place.
2017-01-17 19:23:42 +00:00
baldurk 4f8d6d5c70 Add a few last things that need extension checks 2017-01-17 19:11:24 +00:00
baldurk 80e786427b Update messages if output window contexts fail to create 2017-01-17 18:59:27 +00:00
baldurk 8c91f5a808 Mark capture as degraded if we're missing key hardware capabilities
* This includes primarily compute shaders and image load/store
2017-01-17 18:59:07 +00:00
baldurk a05581621f Don't use GetBaseFormat/GetDataType where format could be compressed 2017-01-17 18:38:33 +00:00
baldurk 5c8fca5791 Require GL_ARB_shader_image_load_store for quad-overdraw resolve pass 2017-01-17 18:38:32 +00:00
baldurk a88486d380 Fix uint/int cast compile error 2017-01-17 18:38:32 +00:00
baldurk 5ea84f84ee Only re-interpret pixels from float to int if it was an int texture 2017-01-17 17:46:40 +00:00
baldurk 8f55abdde9 Check for extensions during replay for pipeline state save, tex display 2017-01-17 17:46:26 +00:00
baldurk 34834d802f Check for texture storage extension in vendor check 2017-01-17 16:55:38 +00:00
baldurk 21d6f41c97 Change GLSL shaders to compile at #version 150 and add #extensions
* For some #extensions we can fallback to a lesser path (or just drop
  that functionality - e.g. displaying cubemap arrays if there's no
  extension for it).
2017-01-17 16:55:26 +00:00
baldurk 031ea659be Fix check for glClipControl to check extension not just function pointer 2017-01-17 16:54:18 +00:00
baldurk 6be852bfa2 Check for extensions needed when creating replay shaders
* If a replay shader can't be created we'll just skip the replay
  functionality it is needed for.
2017-01-17 16:54:03 +00:00
baldurk e8456f5d36 Check and save the GLSL version, vs specifically checking for 420 2017-01-17 16:51:26 +00:00
baldurk ec41661f5f Remove replay-time use of buffer/texture storage
* Of course if the capture used the storage functions during capture,
  then they will still be used on replay. We are only removing extra
  usage here for internal textures/buffers
2017-01-17 16:47:46 +00:00
baldurk d214098dce Create the highest versioned context possible on replay 2017-01-17 11:02:47 +00:00
baldurk 2b722541e7 Compile/warning fixes 2017-01-17 11:02:46 +00:00
baldurk 00ebb7d8a3 Check for SSBO support before introspecting programs for SSBO binds 2017-01-17 11:02:45 +00:00
baldurk ed358ab8a3 Check extensions properly for GL state fetch and apply 2017-01-17 11:02:45 +00:00