Commit Graph

189 Commits

Author SHA1 Message Date
Aliya Pazylbekova 9ebd796cd8 Remove GGP support 2024-07-08 14:19:42 +01:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
Jake Turner 977adf5001 Opening DDS file better estimate size of mip-tail closes #3179
If a mip-tail exists estimate that it will be the same size as mip 0
2023-12-20 10:00:56 +00:00
Er2 dcbbcee6a8 Add some fixes. 2023-11-06 14:42:45 +00:00
Eric Long f36d8a3b23 RISC-V support
With some addition to macros the project is able to build on riscv64
machine.

plthook has added RISC-V support upstream [1]. However upstream has
changed their code quite a bit, so I just modified the current vendored
version.

[1]: https://github.com/kubo/plthook/commit/a564738a4707fc5eb4d388b9e97eeab51b8c9d56
2023-09-29 17:26:11 +01:00
baldurk 9d39b8e1a8 Reformat code for clang-format 15 2023-09-05 11:02:08 +01:00
Jake Turner df1a7cec50 Use max of mips and slices to test for invalid dimensions
The assert was incorrectly triggering on a texture with depth of 128 and mipcount of 6
2023-09-01 20:02:06 +01:00
baldurk 00dcec8a25 Catch and try to more gracefully handle invalid DDS files 2023-06-05 16:21:19 +01:00
baldurk 1f72a09e3b Sanitise strings printed when received from target control/remote server
* Given socket corruption or network errors these strings could contain
  unprintable characters so we sanitise them reasonably. This also ameliorates a
  potential security concern with arbitrary strings being written to a log, but
  these connections are still considered trusted and users should not be
  exposing RenderDoc ports to the internet.
2023-05-19 10:28:58 +01:00
baldurk a0863b2aed Check for DDS files having legacy header but no bitmask 2023-03-29 10:29:37 +01:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk e33f1c1329 Add D32 conversion properly for DDS files 2022-12-15 15:17:15 +00:00
baldurk 013527b59c Some legay DDS formats should only be used for non-SRGB data 2022-12-15 15:17:05 +00:00
Danylo Piliaiev 623cd01919 Do not use inline asm for debugbreak on non i386/x86_64 targets
Fixes compilation on non i386/x86_64 Linux targets.

Don't use arch specific assembly for other architectures because
in most cases it breaks gdb ability to do next step.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
2022-06-17 17:26:16 +01:00
baldurk 4d8fdf4e31 Use inline asm for debugbreak on linux to remove stack frames
* raise() adds several stack frames in debug builds, and even an inline function
  will too, regardless of always_inline status.
2022-06-16 15:53:49 +01:00
baldurk 16f3764cda Work around gcc compiler bug
* It complains that there is switch fallthrough after an unconditional return,
  when it's inside a do{}while(0). Simplifying the while condition seems to
  address it.
2022-04-26 17:37:31 +01:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 4f6d6d9c7f Fatal errors should always print to stderr 2022-01-31 10:34:34 +00:00
baldurk 0ba16d187a Handle B8G8R8A8_UNORM case in DDS load 2021-11-19 11:18:51 +00:00
baldurk b4cf86c48c Fix compilation on mac 2021-09-21 18:48:43 +01:00
baldurk 29c16d17e8 Encode function instructions 2021-09-21 18:04:57 +01:00
Jake Turner 076b2827c6 Fixed unused variable warnings when compiling with VS 2022 compiler
Debug & Release builds for renderdoc.sln and demos.sln
2021-07-28 11:06:53 +01:00
baldurk 011acd74b0 Since printf is user-facing now, make formatter errors less fatal 2021-07-14 11:12:54 +01:00
baldurk 6dafc45b8b Allow custom string argument formatting without va_list 2021-05-11 11:03:54 +01:00
baldurk 2e0af1e3ca Fix string issues 2021-04-27 17:13:18 +01:00
Theodore Cipicchio 1e3fc0e320 Fix row count calculation when writing block-compressed DDS data
Block-compressed textures with dimensions that are not evenly divisible
by the block size are typically padded internally to align with the
block size. load_dds_from_file() was previously corrected to account for
this alignment when calculating the number of rows of blocks to read
from a DDS file, but the fix was not applied to write_dds_to_file(),
resulting in missing rows of texels or loading failures when attempting
to open a DDS file generated by RenderDoc from a texture whose
dimensions are not a multiple of four.
2021-04-26 12:18:15 +01:00
baldurk 287da369fc Fix handling of child processes on linux
* We need to ensure we remodify LD_LIBRARY_PATH and LD_PRELOAD before fork/exec
  if the application (say bash running a script) has overwritten them. We also
  don't want these to be accidentally inherited into children if we're not
  hooking children - the same for the vulkan env var, which can't be unset
  immediately on process injection like the others because it needs to hang
  around indefinitely.
2021-03-22 18:37:09 +00:00
baldurk 4de38aef1e Fix issue with DDS writing reading from wrong subresource index for data 2021-02-24 13:52:07 +00:00
baldurk 04e533742f Adjust pitch calculation in saved DDS files to match spec. Closes #2189
* The spec is not particularly clear but this matches the DirectXTex behaviour
  which is as close to 'official' as we'll get most likely.
2021-02-22 17:03:12 +00:00
baldurk 11268b358a Remap block-compressed 3D textures to 2D arrays on GL. Closes #2186 2021-02-22 12:38:43 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk e5f4ca7bb8 Remove use of const char * in public API and OS specific where possible
* This prevents unnecessary conversions back and forth between rdcstr and const
  char * when going through interfaces. In the OS specific layer this is rarely
  an issue because most of the implementations don't convert to rdcstr, but it
  is convenient to be able to pass in an rdcstr directly. The few cases where
  there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
  function, so can't return an rdcstr due to C ABI, so they still return a const
  char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
  and because that's one place where unnecessary conversions/constructions may
  be impactful.
2020-12-07 17:44:50 +00:00
baldurk 76d91d5eef Don't allow static logfile string to destruct before RenderDoc singleton 2020-09-12 23:18:04 +01:00
baldurk e9360a819f Don't pre-allocate such large wrapped pools
* The cost of searching a few more pools to check allocations isn't so bad
  especially if we can move IsAlloc() off the hot path. Better that than
  allocating 100MB in pools.
2020-09-10 13:35:16 +01:00
baldurk 78f1f8f3d1 Remove volatile from Atomic parameter declarations
* This was leaky from windows' InterlockedIncrement etc declarations, and is not
  necessary.
2020-09-09 16:40:04 +01:00
baldurk fa24dc8872 Silence some PVS warnings 2020-08-20 16:11:05 +01:00
baldurk 0859aaa163 Change descriptor set lock to spinlock
* We don't expect contention on this, the only time it will contend is when
  actively capturing a frame between updates and submits reading the descriptor
  contents, so we penalise that case while making the background case faster -
  since a spinlock is 'free' to take when there's no contention.
2020-08-19 14:24:51 +01:00
baldurk 31b7c35bae Fix logfiles not being deleted if captured application is the last user
* Previously only the UI itself would delete the log if it was the last thing to
  close.
2020-08-04 14:48:51 +01:00
baldurk ec6627af03 Use our own isinf/isnan over compiler provided ones that are unreliable
* Due to standards nonsense the availability of isinf/isnan in C++ is quite
  complex and varies a lot between compilers. Trying to access them reliably is
  quite brittle and they're easy to implement with bit-inspection of float
  patterns, so we do that instead.
2020-07-14 13:24:36 +01:00
baldurk 9f0787da33 Keep subpass self-dependencies when making loadRPs. 2020-05-29 14:11:03 +01:00
Rémi Palandri 1dd7aa9296 vulkan low-memory-mode 2020-05-27 22:37:51 +01:00
Kevin McCullough 6a2415f334 Add platform Switch defines. 2020-05-20 15:50:47 +01:00
baldurk 27db02b7e2 Handle legacy DDS headers for more than just RGBA8. Closes #1888
* DirectXTex seems to emit legacy DDS headers for any UNORM format less than
  32-bit per pixel, so we do the same.
2020-05-18 15:20:58 +01:00
baldurk d0bd2e8da2 Fix calculation of number of rows in block DDS formats. Closes #1870
* The number of rows should be the ceiling of the 4-row number, since any
  overlap becomes a whole extra row of blocks.
2020-05-07 12:37:06 +01:00
baldurk f2e9447954 Compress shader cache blobs with zstd 2020-04-22 20:40:14 +01:00
baldurk 6f2dfc1a2b Add support for non-compressed formats in DDS shell preview 2020-04-01 16:55:58 +01:00
baldurk fbe2d1fbee Change ReadAll/WriteAll to take rdcstr instead of char* filename 2020-03-31 18:45:36 +01:00
Arvastra d7af989746 Tidying up. 2020-03-19 17:16:01 +00:00
Arvastra 482114f6f4 Display Thumbnails for dds files. 2020-03-19 17:16:01 +00:00