Commit Graph
506 Commits
Author SHA1 Message Date
baldurk dd3c63e8ca Add resource usage for CPU writes to resources 2020-02-05 13:53:59 +00:00
baldurk 0f827d5784 Use backdoor context when a context is needed for capture. Closes #1701
* This fixes the case where no context is current on the thread starting and
  ending the frame capture, but also all existing contexts are current on other
  threads and can't be temporarily used.
2020-01-30 11:28:01 +00:00
baldurk 7dd116abd4 Remove redundant/tautological comparisons identified by PVS Studio 2020-01-21 18:28:56 +00:00
baldurk ba9f0c0e89 Make sure replay contexts tidy up share groups correctly 2020-01-21 18:28:55 +00:00
thisisjimmyfbandbaldurk c7c929eca9 Backdoor context for opengl resource retrieval 2020-01-20 13:38:30 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 05a70164f6 Remove use of legacy StringFormat::snprintf variants 2019-12-16 18:10:32 +00:00
baldurk e76ade3c51 Remove std::vector/std::string use from GL driver 2019-12-16 18:10:31 +00:00
baldurk bd9f4fc389 Remove use of vector/string from core project
* This also affects the drivers via interfaces e.g. IReplayDriver and some
  utility functions.
2019-12-16 18:10:31 +00:00
baldurk c4ca8cb1d1 Reduce reliance on big public headers where possible
* Mostly moving includes from common headers to cpp where possible, and removing
  includes of the whole thing where only enums or rdcstr etc are needed.
2019-12-16 17:06:16 +00:00
baldurk 5f33403849 Switch string_utils to use rdc types 2019-12-16 17:06:15 +00:00
baldurk 6d1d302491 Fix a number of warnings identified by higher clang warning levels
* We enable a couple of high signal-to-noise warnings in all clang builds
2019-12-02 20:41:28 +00:00
baldurk 267eb7f6ea Ensure a sized format is used when creating MSAA textures. Closes #1623
* If the application used an unsized format like GL_DEPTH_COMPONENT to create
  the texture with glTexImage2DMultisample then that's legal, but if we promote
  it to glTextureStorage2DMultisampleEXT for DSA we can't continue to use that
  unsized format so we need to convert to sized by picking a sensible default.
2019-11-29 15:02:05 +00:00
baldurk 938056a67c Add support for serialising MSAA initial states on GL 2019-11-26 17:38:27 +00:00
baldurk 44b2247151 Support creating typeless proxy textures in GL. Closes #1516
* Since GL requires a concrete texture format, we create the textures as UINT
  format, and then cast to the right view on display once we know.
* The cast requires a copy - ARB_texture_view isn't always supported and even
  when they are they require immutable textures (ARB_texture_storage) which we
  don't want to require either.
2019-11-26 17:38:26 +00:00
Rémi PalandriandBaldur Karlsson 9da79fc778 add support for serialising invalidate framebuffer calls in GL 2019-11-25 23:39:31 +00:00
baldurk 4458ab3205 Remove assumptions that captures are always frames
* Previously we had "Frame X" and "Start of Frame" hardcoded in the event
  browser, and the end of frame was in many cases assumed to be a present call.
  However with the in-application API this is not necessarily true.
* Presents are now serialised separately in all APIs and displayed wherever they
  happen in the frame, and if there is no present at the end of the frame an
  "End of Capture" marker is inserted. Similarly API-defined captures are not
  given a potentially misleading frame number.
2019-11-21 17:09:01 +00:00
baldurk 7440497029 Invert tracking of texture views/texture buffers on GL
* Instead of the buffer/source texture tracking all the views of itself and
  checking to see if it should be force-included because any of its views were
  included, we instead track the underlying resource for each view or buffer
  texture.
* This means if e.g. a view or buffer texture gets dirtied, we can propagate
  that through to the underlying data store which needs to get dirtied so that
  we can fetch its initial states.
2019-11-20 22:58:08 +00:00
baldurk acfc226780 Fix support for GL_S[R|RG]8_EXT formats 2019-11-20 18:37:43 +00:00
baldurk 0867435a7e Whitelist some GL/GLES extensions that are already supported. 2019-11-19 23:20:56 +00:00
baldurk ad8a23e9c3 Handle backbuffers in GL that are 0 width or height. Closes #1571 2019-11-01 10:58:54 +00:00
baldurk 2492ebf26d Don't register debug callback on GL when structured-exporting 2019-10-24 18:02:54 +01:00
baldurk 190cba427c Refactor shader editing to more reliable approach
* When we replace a shader in GL there are a few knock-ons: we need to replace
  the programs that use this shader, and then from there we need to replace the
  pipelines that use the program. We also need to beware of programs created
  with glCreateShaderProgramv which refer to themselves as both a program and a
  shader.
* Previously we'd look at the edited shader, then recurse and look at programs,
  then recurse and look at pipelines. We'd try to remember which one replaced
  which so we could undo it again.
* Now we just do this in subsequent passes since there is only a one-way
  dependency: First replace the shader as needed, then update any programs and
  either replace or remove replacement as needed, and finally update any
  pipelines.
* On Vulkan and D3D12 it's simpler as we just have shaders -> pipelines but the
  same principle applies.
2019-09-05 20:36:12 +01:00
baldurk c48578fdd9 Add new location remapping when editing shaders on GL
* If they're autogenerated then unfortunately the locations in a shader can
  change over edits depending on what the shader is doing. We need to remap
  across this as well as composing that onto any capture-replay remapping.
2019-09-05 20:33:25 +01:00
baldurk 6d40bbb783 Add experimental wayland support. Refs #853
* This is only lightly tested and may break heavily. It is disabled by default
 and must be explicitly enabled.
* In particular this is only known to work for Wayland use at capture time.
 Wayland on replay is still unsupported. Known issues include: EGL pbuffer
 surfaces are not implemented on Wayland, Wayland cannot get window dimensions,
 and there are hangs/failures with GL and vulkan presentation with Wayland.
2019-09-02 15:02:27 +01:00
baldurk 0f3614a826 Fix preallocated chunk size for GL driver init 2019-08-28 23:06:03 +01:00
baldurk b4a3fb4490 Fetch debug messages at replay time if option is enabled 2019-08-27 18:51:56 +01:00
baldurk b0933dcf33 Implement forced GPU override on D3D11, D3D12 and Vulkan 2019-08-27 18:51:56 +01:00
baldurk d81331918e Save info about the used GPU on D3D11, D3D12 and GL
* On GL this is purely informational, but on D3D11 and D3D12 we use this to
  select the closest available adapter on replay, as we already do on Vulkan.
2019-08-27 18:51:56 +01:00
baldurk 936876234c Move SPIR-V utility/parsing/editing code into rdcspv namespace
* Everything except the reflection code which will be replaced
2019-08-16 17:38:35 +01:00
baldurk 04e92edf20 Handle 16-bit backbuffer colour as RGB565 in GLES captures 2019-07-29 16:54:42 +01:00
Dmitry SoshnikovandBaldur Karlsson 3cc9557264 Introduce Low-Memory mode 2019-07-24 22:45:41 +01:00
baldurk e17631a4cc Update unsupported GL extensions comment, add one for GLES
* This means we _should_ have all EXT/KHR etc extensions listed either as
  supported or explicitly as unsupported
2019-07-09 16:16:15 +01:00
baldurk 8fe3eda1f3 Whitelist some GLES extensions already supported on GL 2019-07-09 16:16:15 +01:00
baldurk a314e9a3d5 Whitelist GL_EXT_polygon_offset on GL
* This is an old extension but worth whitelisting as we do support it (in its
  core version)
2019-07-09 16:16:15 +01:00
baldurk a334056af4 Whitelist support for GL_EXT_texture_compression_s3tc_srgb. Closes #1448 2019-07-09 16:16:15 +01:00
baldurk 0766028724 Change wording of non-core context GL overlay warning
* Technically if you create a context with *CreateContextAttribsARB and don't
  specify a profile mask at all, the spec says the value of the profile bit is
  CORE_PROFILE_BIT. In practice this means drivers may or may not give you a
  core or compatibility profile.
* However what we're really looking for here is the chance that the user code
  will use only modern GL or will use deprecated functionality, and in that case
  the high likelihood is if they omit the PROFILE_BIT entirely they are probably
  unaware of it, rather than letting it set its default value.
2019-07-02 19:15:36 +01:00
baldurk ffaa445cf2 Unbind annoying buffer binds on GL that mess with normal functionality 2019-07-02 17:22:53 +01:00
baldurk f09c40b8c9 Fix broken cases with GL_ARB_gl_spirv. Closes #1405
* We can't rely on the driver's reflection, since name information might be
  stripped and the driver is within its rights to not reflect anything even if
  we have names. Similarly queries by names etc will not work.
* Also we can't try to change bindings that are immutable on SPIR-V shaders -
  UBO/SSBO bindings, transform feedback varyings, attrib and fragdata locations.
* Programs can't mix and match SPIR-V and GLSL, so when including our own
  shaders in the overlay program make sure they match what the user's shaders
  are.
* For mesh output, we need to patch the SPIR-V if it's a SPIR-V shader instead
  of trying to use the GL XFB varyings set.
2019-06-07 18:53:02 +01:00
baldurk a27234c28c Split apart some of the SPIR-V headers
* We don't want to have glslang specific bits mixed in with general SPIR-V bits.
  This is also preparing for moving some SPIR-V structs into common code that
  can be re-used in new reflection/disassembly as well as editing.
2019-06-03 14:16:42 +01:00
baldurk 419fa93ebf Implement GL_ARB_ES3_2_compatibility. Closes #146 2019-05-20 15:01:52 +01:00
baldurk 8aa515a47a Make drivers m_Events a direct lookup
* Rather than doing an expensive iteration for looking up m_Events, just index
  by eventId which will be very dense.
2019-05-20 12:24:41 +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 a965a3a703 Remove 'using std::string'
* This will make it easier to replace std::string with rdcstr in future
2019-05-17 16:32:56 +01:00
baldurk 699f8753af Convert ToStr, Serialise, and TypeName to use literal strings 2019-05-15 14:12:17 +01:00
baldurk fb333ebc9b Remove 'using std::map'
* This will make it easier to replace std::map in future
2019-05-15 14:12:17 +01:00
baldurk 95e63cb965 Remove pending-dirty operations, mark resources dirty immediately
* Now that the dirty list is only read once at the start of the frame we can
  mark resources dirty mid-frame freely and don't have to defer that. The
  internal resource manager locking prevents us from adding to the list while it
  is being modified.
2019-05-15 14:12:17 +01:00
baldurk 0ae245c4a8 Refactor initial state callbacks to always allow deleted resources
* Instead of passing the resource handle itself to GetSize_InitialState or
  Serialise_InitialState, we pass the Id, ResourceRecord, and prepared initial
  contents. All of these can survive past the destruction of the resource.
* Removes the need for AllowDeletedResource_InitialState() - it's always allowed
  now.
* Need_InitialStateChunk is also refactored but it's only used on D3D11
  currently and potentially will be removed in future.
2019-05-14 17:13:22 +01:00
baldurk 0fd6b0c546 Remove forced initial states for resources
* This was used for two things:
  - UAVs on D3D11, which we can just mark dirty at creation as we do
   with things on D3D12/Vulkan where we know we'll always want initial
   states.
  - Texture views/Texture buffers on GL, where we check if the texture
   was referenced and force initial states for the underlying data
   store. This requires a bit more work but can still be achieved by a
   GL-specific force-inclusion pass on the frame references.
2019-05-14 15:30:55 +01:00