Commit Graph
128 Commits
Author SHA1 Message Date
baldurk 2b7070eddf Allow a few EXT & IHV vulkan extensions
* VK_EXT_astc_decode_mode
* VK_EXT_swapchain_colorspace - this will cause slight artifacts as we won't
  interpret pixels in the right color space, but it's minor.
* VK_EXT_validation_cache - we don't serialise this but we do allow it during
  capture and pass-through straight. We don't wrap the VkValidationCacheEXT
  object at all which makes support simpler.
* VK_EXT_external_memory_dma_buf - this is just a new memory type for external
  memory, we don't need to do anything special to handle it.
* VK_AMD_mixed_attachment_samples & VK_AMD_shader_core_properties - these are
  no-op once enabled
* Many shader-only extensions:
  - VK_AMD_gpu_shader_int16
  - VK_AMD_shader_fragment_mask
  - VK_AMD_image_load_store_lod
  - VK_AMD_texture_gather_bias_lod
  - VK_NV_compute_shader_derivatives
  - VK_NV_fragment_shader_barycentric
  - VK_NV_geometry_shader_passthrough
  - VK_NV_sample_mask_override_coverage
  - VK_NV_shader_image_footprint
  - VK_NV_shader_subgroup_partitioned
  - VK_NV_viewport_array2
2018-10-11 19:18:02 +01:00
baldurk 0bbf24bede Add support for VK_KHR_draw_indirect_count 2018-10-11 14:58:49 +01:00
baldurk 4e9c42e250 Add serialisers for indirect draw structs 2018-10-11 14:58:49 +01:00
baldurk 9ff71eb175 Readback indirect draw arguments and patch in later. Closes #1066
* This reads the argument once during load exactly when the draw itself
  executes. We read just before the draw in case the draw itself would modify
  the params (which is likely invalid, but something we should avoid).
2018-10-11 14:58:48 +01:00
baldurk b87792f721 Store map offset in GPUBuffer so we only flush the mapped range 2018-10-04 12:54:51 +01:00
baldurk a88c5c4008 Use VkBaseInStructure, official version of VkGenericStruct 2018-09-25 15:09:53 +01:00
baldurk d20624b32f Add fallback logic for locating MoltenVK & loader on macOS 2018-09-05 12:50:59 +01:00
Gary Sweet 9721150aa9 Add missing Vulkan cache flushes and invalidates
Without these flushes and invalidates, I see missing
data on readback and bad text in the overlay.
2018-08-28 14:24:13 +02:00
baldurk 5e81319424 When replaying a single multidraw draw, ensure the draw index is correct
* We accomplish this by doing a 'multidraw' for even the single draw case, but
  set the parameters for all prior draws to 0 so nothing happens.
2018-06-25 18:14:05 +01:00
baldurk 83a0066f00 Add support for VK_KHR_image_format_list 2018-06-21 17:46:15 +01:00
baldurk ea3e2c8610 Add multiqueue support for Vulkan. Closes #373 2018-06-13 09:17:03 +01:00
baldurk 1569a6f0dd Serialise all structs in pNext and discard at replay time
* Rather than not serialising structs that we aren't interested in, we serialise
  them (as best as we can in some cases) so that the information is available to
  the user. Also if in future we decide to replay them they are available.
* We also now replay dedicated allocation extension use.
2018-05-25 18:32:31 +01:00
baldurk 8b50413bf4 Report support for Vulkan 1.1. Closes #909
* We handle non-suffixed promoted functions but assume that calling
  forward to either the promoted function or the old KHR extension is
  equivalent.
* By this nature we won't record which function the user called, be that
  extension or promoted, it will just be reported as the core function.
* Remove KHR suffixes from function names, enums, etc for promoted
  extensions when serialising/stringising.
2018-05-01 12:36:05 +01:00
baldurk b7ab28a2c4 Add stringification for new bits in vulkan flag enums that had no bits 2018-04-30 19:07:40 +01:00
baldurk deab822e30 Add support for protected memory, new in Vulkan 1.1 2018-04-30 19:07:07 +01:00
baldurk 7961b25e80 Add support for VK_KHR_multiview extension 2018-04-30 18:37:12 +01:00
baldurk d03df4d1a9 Add support for VK_device_group & VK_device_group_creation 2018-04-30 18:31:47 +01:00
baldurk bfe021cf73 Add (mostly disabled) support for VK_KHR_sampler_ycbcr_conversion
* We report no support for Ycbcr conversions by snooping the physical
  device feature query.
* Just to be safe, we support pass-through/ignore implementations of
  most of the functions and pNext structs.
2018-04-30 16:41:46 +01:00
baldurk 49ea4dd8e3 Add support for VK_EXT_debug_utils extension 2018-04-30 13:52:17 +01:00
baldurk 7182e0af3a Add support for VK_EXT_sampler_filter_minmax extension 2018-04-30 10:50:46 +01:00
baldurk f87338dc0e Add support for VK_EXT_vertex_attribute_divisor 2018-04-25 19:11:04 +01:00
baldurk 5695f3e76f Set up conservative rasterization pNext when setting up pipeline info 2018-04-25 19:11:03 +01:00
baldurk 168d98bbde Add support for VK_AMD_buffer_marker extension 2018-04-25 19:10:58 +01:00
baldurk a1f5dbdaa6 Implement extension VK_KHR_maintenance2. Closes #818 2018-04-24 19:24:09 +01:00
baldurk bbc0581e7e Implement support VK_EXT_conservative_rasterization. Closes #898 2018-04-24 19:23:51 +01:00
baldurk e9a47112d4 Prepare for actually serialising pNext pointers in structs
* Any struct with a pNext pointer gets a Deserialise function, to clean
  up any dynamically allocated chains.
* The mechanism is as follows:
  - On writing, walk the pNext chain (assuming there is one) and skip
    any structs we don't care to serialise.
  - When we reach a struct we do want to serialise, save a nullable (i.e
    optional) VkStructureType* for it, then recurse and serialise the
    nullable casted struct.
  - If there is no pNext (or none we care about) we serialise a NULL
    VkStructureType*
  - On reading, we serialise the VkStructureType*. If it's NULL, rename
    it to look like a void *pNext = NULL.
  - If it's not NULL, use the structure type to serialise a nullable
    struct of the right type, and recurse.
* The pNext chain is dynamically allocated, which is why it gets cleaned
  up in the Deserialise() function.
2018-04-24 19:23:32 +01:00
baldurk 0fbeace478 Implement VK_KHR_bind_memory2 2018-04-24 15:57:44 +01:00
baldurk 0442c46aff Implement VK_KHR_descriptor_update_template. Closes #934 2018-04-24 14:42:05 +01:00
baldurk 94548886eb Implement VK_KHR_push_descriptor extension. Closes #905 2018-04-24 14:41:57 +01:00
baldurk 1cd8559d0c Pass through current GPU vendor in APIProperties, for analytics 2018-02-25 15:29:14 +00:00
baldurk 1ee01e1f82 Apply a normalisation pass over the serialised data
* This is a backwards-incompatible change, so it's done here before v1.0
  so that we can freely break compatibility and not need to define a lot
  of ugly compatibility code.
* The primary motivation is to make the serialised data more uniform
  and have fewer special cases where the serialised form is naturally
  defined from the functions/structs in question.
* There are still some special cases or variances but they should be
  more isolated and only where really necessary.
* Remove some cases in the D3D12 struct serialising where we were
  directly serialising child struct members in the parent struct.
* We now try to match argument/struct member order as closely as
  possible.
* Serialising an array with a count no longer reads the count back out
  into that variable, counts must be serialised separately. This means
  all members/arguments are explicitly present in the structured data
  and also eliminates the awkward case where a count needed to be
  serialised separately after an array if we want to have the count be
  a valid number even if the array could be NULL. It also means we don't
  need the FIXED_COUNT() macro since array lengths can be plain values
  and don't have to be a reference type.
2018-02-14 15:57:53 +00:00
baldurk a019797f88 Move vulkan layer name and android library filename to global defines 2018-01-26 21:19:13 +00:00
baldurk b17790e5c2 Batch vulkan initial state related allocations together
* We allocate chunks of 32MB - 256MB then suballocate as needed.
2018-01-25 18:18:47 +00:00
baldurk 67835c4d54 Split shader caching and text rendering out of debug manager classes 2018-01-16 16:29:36 +00:00
baldurk 25cfa2c9df Move GPUBuffer helper class out of VulkanDebugManager 2018-01-16 16:26:24 +00:00
baldurk 3170d8fa53 Add option to fetch debug messages at runtime and display them in the UI
* By default this is off as it will continually add more and more
  messages each time the frame is replayed. It could be useful to turn
  on to
* We also enable VK_EXT_debug_report any time it's available, not just
  when we're enabling the validation layers.
2018-01-11 13:48:34 +00:00
baldurk 6f6ee4ce01 Add workaround for Qualcomm chips where uniform buffer offsets 'leak'
* There's weird behaviour seen where after binding a descriptor set with
  an offset, subsequent work in other command buffers doesn't behave
  correctly. Re-binding the descriptor set with a 0 offset seems to fix
  it, so I assume the offset is leaking and applying to subsequent
  binds that don't have any dynamic offsets.
2018-01-02 15:50:21 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 9ca9e086b1 Add fake chunks for multi-indirect commands' data
* Currently we only have structured data for the CPU-side calls, but we
  want to display the information for the individual selectable GPU-side
  commands.
* So we add a new fake virtual chunk and insert it with data pulled from
  the GPU information, and any meta-data like the offset of that
  command.
2017-12-27 16:05:15 +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 db0e2400f8 Disable vulkan validation layers that were accidentally enabled 2017-12-14 12:48:48 +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 2651ef3185 Serialise memory requirements in vulkan with vkCreateBuffer/CreateImage 2017-11-24 18:14:24 +00:00
baldurk e08e5f0692 Move some common chunks into SystemChunk from API Chunks
* This makes API-agnostic processing over strucutred data a *little*
  easier. At least it's possible to differentiate initialisation from
  frame capture chunks.
2017-11-24 18:14:23 +00:00
baldurk 3ac3e6c3f1 Fill out resource descriptions in each driver
* For Vulkan and D3D12, we now create a dummy command buffer to ensure
  that there's actually a chunk available to correspond to the command
  buffer that gets submitted or recorded to.
2017-11-17 16:30:50 +00:00
baldurk 7329d864ec Update vulkan WSI function wrappers 2017-11-08 18:24:14 +00:00
baldurk d3069b74ad Update core vulkan driver code 2017-11-08 18:24:12 +00:00
baldurk 5a1a3fb6cf Update vulkan chunk enum to enum class, use ToStr for stringify-ing 2017-11-08 18:24:11 +00:00
baldurk 651ba25919 Update Vulkan common struct serialisation & split it into separate file
* This also includes serialising vulkan handles as Ids by type instead
  of using a macro as before.
* In contrast to the old code, we serialise handles as the wrapped type
  since e.g. when serialising a command buffer in a vkCmd* function we
  want to get back the wrapped type. This means some structs need to be
  unwrapped on replay when before they were "pre-unwrapped" after the
  serialisation, but this isn't a big deal.
2017-11-08 18:24:08 +00:00
baldurk 3aa3262089 Expose ToStr interface publicly, split out into separate files
* Note that while this is public and uses std::string, because it's a
  template with specialisations in a .inl the string never crosses a
  module boundary - each including module has its own implementation.
* This will be used as part of the upcoming serialisation refactor.
* Some POD structs are still given ToStr implementations as we haven't
  yet switched over the serialisation system to expect all structs to
  have serialise functions.
2017-11-03 16:23:02 +00:00