Commit Graph
50 Commits
Author SHA1 Message Date
baldurk 0d026a43d6 Remove CompType::Double
* This is a leftover artifact from before we had general extended type support
  and double was the only non-32 bit type we handled. Now we support most type
  formats so doubles are just CompType::Float with 8 byte width
2020-07-12 10:52:10 +01:00
Lionel LandwerlinandBaldur Karlsson aa16eb0ed0 Allow KHR counters on pass boundary commands
We would like to be able to measure implicit resolves operations.
2020-06-15 10:28:21 +01:00
Lionel LandwerlinandBaldur Karlsson 70ef09eb52 Filter out non command scope KHR counters
KHR counters come in 3 different scopes (quoting the spec) :

  * VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR - the performance
    counter scope is a single complete command buffer.

  * VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR - the performance
    counter scope is zero or more complete render passes. The
    performance query containing the performance counter must begin
    and end outside a render pass instance.

  * VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR - the performance counter
    scope is zero or more commands.

The way we're currently using the counters is tied to draw/dispatch
commands so we should only use the SCOPE_COMMAND type of counters.
2020-06-15 10:28:21 +01:00
baldurk a5fe4ebde5 Use enabled not available features to determine what shaders to create
* We still check available features to know which shaders we could create on
  replay, to determine whether we should add STORAGE_BIT to MSAA images we want
  to store into.
2020-05-19 12:57:28 +01:00
Aliya PazylbekovaandBaldur Karlsson f63dd71221 Vulkan Pixel History: secondary command buffers
Also:
- support for choosing mip level and slice
- tests for secondary command buffers
- adds a callback around vkCmdExecuteCommands
- refactors pixel history occlusion callback into its own
callback. Allows processing fewer events later on, and getting colour
information separately.
- keep track of subpassContents for vkCmdBeginRenderPass (inline or
  secondary)
2020-04-23 19:13:42 +01:00
Lionel LandwerlinandBaldur Karlsson d88026a697 Fix KHR storage counter issue for time units
Renderdoc seems to somewhat require time units to be in float to be
able to present prettyfied results (ms/us/ns).

We were assuming that but a couple of errors slipped in :

   * we were asserting that KHR time units are floats

   * we didn't describe the renderdoc units as double (even though we
     forced the conversion later on)
2020-04-02 18:15:28 +01:00
Lionel LandwerlinandBaldur Karlsson f666770b48 Fix KHR storage counter issue
While we always use an 8 byte storage within renderdoc, the KHR
storage can be of multiple size & type.

The issue was that we were storing a counter in double but then
reporting the type in uint.

To fix this use the KHR storage type to figure the renderdoc type. The
byteWidth size remains always 8 bytes within renderdoc.
2020-03-04 19:12:07 +00:00
Tayfun Kayhanandbaldurk 2373ae7b45 Convert GPU Time counter correctly 2020-03-03 18:06:11 +00:00
Aliya PazylbekovaandBaldur Karlsson 791d1089b0 Add drawcall callbacks to end and next renderpass cmds
For Vulkan pixel history vkCmdEndRenderPass and vkCmdNextSubpass
can represent a modification, since it might be doing an implicit
image resolve. Pixel history is using drawcall callbacks to figure
out values pre- post- events, and vkCmdEndRenderPass and
vkCmdNextSubpass might be such events.

Also adds clear image usage to vkCmdBeginRenderPass(2) for images that
have VK_ATTACHMENT_LOAD_OP_CLEAR.
2020-01-16 23:04:53 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 667f1cf8d1 Remove std::vector/std::string use from Vulkan driver 2019-12-16 18:10:31 +00:00
baldurk f68645bddc Reduce dependencies pulled in by common.h 2019-12-16 17:06:16 +00:00
Lionel LandwerlinandBaldur Karlsson 80183c068a Expose Vulkan performance counter from VK_KHR_performance_query 2019-11-18 22:01:12 +00:00
baldurk fba0ff9621 Fix reading wrong counter value for PSInvocations on vulkan 2019-07-09 16:16:14 +01:00
baldurk 7206a0cd25 Removing 'use std::vector' 2019-05-17 16:32:56 +01:00
baldurk e48065c96b Replace use of std::pair with rdcpair wherever possible
* Only remaining uses in our code is when we're interacting with std::map where
  it uses std::pair internally
2019-05-17 16:32:56 +01:00
baldurk 462772af91 Remove 'using std::set' 2019-05-17 16:32:56 +01:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
Lionel LandwerlinandBaldur Karlsson 6d95122189 Do not include Intel counters in the generic ones
At this point we don't have Intel GL counters. But the current logic
assumes there is only AMD ones (and that if it's not AMD's, it must be
the generic ones).
2018-10-23 14:22:25 +01:00
baldurk 47f3f64fc7 Rename Samples Written to Samples Passed
* This measure the number of samples that pass the depth/stencil tests -
 In the case of early tests, this means it doesn't account for shader discard before writing.
2018-06-13 13:22:11 +01:00
Amit Prakashandbaldurk 6cf36322c1 Add GPA-v3.0
* Currently GPA is disabled for DX12 debug version

Change-Id: Id942f32c809e30e502f7513b03b72e4a9dbec0a7
2018-05-24 21:42:30 +01:00
herb marselasandbaldurk f720cd1e7d AMD GPUPerfAPI 3.0 Preview Integration.
Direct3D11, Direct3D12, OpenGL, and Vulkan supported.
Fixes Direct3D11 counter command isolation.
2018-02-28 12:10:36 +00:00
baldurk 3c72341f63 Set category name for all API's built-in counters, not just D3D11 2018-02-12 20:48:07 +00:00
baldurk a69efa1702 Refactor debug manager, reducing duplication and better organisation
* In many cases (particularly on D3D11/D3D12) the replay would simply
  forward functions as-is to the debug manager for implementation. This
  meant that change any of those function signatures required more
  tedious copy-pasting than was necessary, and didn't make much sense.
* Now the replay class is responsible for implementing all the
  functionality and owns any debug-only API resources, but can still use
  the debug manager for any indirect utility functions like caching,
  etc.
* The API resources are better organised by task in the replay class
  rather than being all over the place.
* Finally on vulkan, added some helper functions to reduce the
  boilerplate involved in initialising objects.
2018-01-16 16:29:39 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk ebaefc82a9 Normalise and make python/public interface more consistent
* We enforce a naming scheme more strongly - types, member functions,
  and enum values must be UpperCaseCamel, and member variables must be
  lowerCaseCamel. No underscores allowed.
* eventId not eventID or EID, and Id preferred to ID in general. Also
  for resourceId.
* Removed some lingering hungarian m_Foo naming.
* Some pipeline state structs that are almost identical between the
  different APIs are pulled out into common structs. Where something
  doesn't make sense (e.g. viewport enable for vulkan) it will just be
  set to a sensible default (in that case always true).
* Changed scissors to be x/y & width/height instead of sometimes
  left/top/right/bottom
* Abbreviations are discouraged, e.g. operation not op, function not
  func.
2017-12-22 13:02:36 +00:00
baldurk 8d29758851 Remove members of public structs called 'bytes'
* It is at best confusing, and at worst could cause errors by aliasing
  with the python type.
2017-12-15 17:33:53 +00:00
baldurk 1c44f91cb8 Change vulkan/D3D12 to always re-record any cmd buffers being submitted
* Previously we'd cache a copy of each command buffer at load time, and
  submit it any time we're not partially re-recording. This has a couple
  of drawbacks though:
  - Technically we do some things that invalidate those command buffers,
    like updating descriptor sets (with initial state application) and
    so for 100% correctness we'd need to re-record.
  - It also means that any edits we apply, like modified shaders, don't
    properly apply to the whole frame, they only apply to whichever
    command buffer is currently being partially recorded.
* We refactor out the 're-record all commands' behaviour previously
  reserved just for applying GPU counters, and use that for re-recording
  any command buffers that are wholly or partially submitted. Note that
  it's still true that only one primary and one secondary at most are
  actually *partially* re-recorded. The others are re-recorded in their
  entirety.
2017-12-11 19:37:40 +00:00
baldurk 725337df26 Clarify some iterator checks (where asserts were used before)
* Reported by Coverity Scan - mostly this is just adding error checking
  where there was previously just an assert before a use of an invalid
  iterator.
2017-11-22 19:11:23 +00:00
baldurk b992e95f94 Update replay proxy to use new serialisation mechanism 2017-11-07 19:30:36 +00:00
baldurk 08aa7399cd Don't perform occlusion/statistics queries that aren't needed 2017-09-11 20:23:56 +01:00
Matthäus G. Chajdasandbaldurk cb84ff695e Add UUIDs to counter descriptors to allow uniquely identifiying them.
For built-in types, use a hard-coded GUID and just modify the last 32-bits; for the AMD counters, we just hash the description/name for now.
2017-08-24 13:21:05 +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
Michael RennieandBaldur Karlsson 74ffa0ef87 VK_NULL_HANDLE build fix. 2017-03-27 05:56:42 -07:00
Victor MoyaandBaldur Karlsson 0964034b4b Implemented Vulkan counters
Implemented support for Vulkan counters in FetchCounters based on the
vulkan Pipeline Statistics query and the precise Occlusion query.
2017-03-13 06:33:14 -07:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk f48b379dbd Call into the drawcall callback for copy/resolve/blit/etc.
* This means that drawcall timers are fetched for those functions.
2016-12-12 17:33:59 +00:00
baldurk 6b00cb0228 Disambiguate D3D12 and Vulkan draw callbacks, else it violates ODR 2016-11-30 16:07:03 +01:00
baldurk 8d0915401f Unify feature macro handling 2016-11-07 18:14:49 +01:00
baldurk 00cea7bbd5 Implement drawcall callbacks on D3D12 (untested - nothing uses them) 2016-08-06 18:31:39 +02:00
baldurk 5f28b745a2 Format code according to newly added clang-format
_  /)
                 mo / )
                 |/)\)
                  /\_
                  \__|=
                 (    )
                 __)(__
           _____/      \\_____
          |  _     ___   _   ||
          | | \     |   | \  ||
          | |  |    |   |  | ||
          | |_/     |   |_/  ||
          | | \     |   |    ||
          | |  \    |   |    ||
          | |   \. _|_. | .  ||
          |                  ||
          |repository history||
          |                  ||
  *       | *   **    * **   |**      **
   \))ejm97/.,(//,,..,,\||(,,.,\\,.((//
2016-05-22 19:41:53 +02:00
baldurk 68228db199 Add a "single flush validate" mode, to track device lost errors
* It tries to submit commands one at a time (except those replayed from
  the log) and flushes and checks status after each one.
2016-05-12 07:52:50 +02:00
baldurk fc4537857a Add callback hooks for dispatches, allows timing dispatch calls 2016-04-24 20:01:48 +02:00
baldurk 70b99a4412 Remove antiquated 'multiple frames in one capture' support.
* Cleans up the code a bunch, this support is unlikely to ever return
  and if it does it will need a rethink anyway.
2016-04-13 00:28:09 +02:00
baldurk ba36dec115 Change a load of asserts to the new value-printing style assert. 2016-02-27 17:40:32 +01:00
baldurk 2e0ffa7813 Batch update copyright years everywhere 2016-02-07 18:50:45 +01:00
baldurk bb2394183c Add ability to re-record all cmd buffers (for whole-frame timing) 2016-02-07 18:49:50 +01:00
baldurk 8134642812 Let drawcall callbacks specify that all cmd buffers should be re-done 2016-02-07 18:49:49 +01:00
baldurk 251a9773c2 remove min/max event IDs from FetchCounters - always times whole frame 2016-02-07 18:49:47 +01:00
baldurk 0a4957320d Implement GPU counters via timestamp query pools 2016-02-07 18:49:45 +01:00