12995 Commits

Author SHA1 Message Date
baldurk eb1e625b96 Add better documentation for how to specify separate shader debug info v1.19 2022-03-30 14:53:20 +01:00
baldurk cd10efb693 Fix some abstraction defines for custom shaders 2022-03-30 13:05:46 +01:00
baldurk 9c1eeed29b Fix copy-paste error with GLSL unsigned integer texture declarations 2022-03-30 12:51:36 +01:00
baldurk 378cad24bd Fix some missing comments in custom shader snippet generation 2022-03-30 12:48:38 +01:00
baldurk 4dcdd6dbd6 Register hooks for unsupported functions
* This is necessary on e.g. Windows where some legacy functions are only
  exported via the dll and need to be 'properly' hooked and not just intercepted
  via GL's GetProcAddr
2022-03-30 11:49:35 +01:00
baldurk 1c265bd1df Fix calculation of temp memory for pRenderingInfo 2022-03-25 18:17:24 +00:00
baldurk 2d518a5d90 Re-fetch device after fatal error check 2022-03-25 17:50:50 +00:00
baldurk b9d18690bb Treat surfaces with no capabilities as swap failure
* This can sometimes happen when shutting down
2022-03-25 17:50:44 +00:00
baldurk e660fc85dd Ensure custom shader output is updated before fetching histogram
* The custom shader output is updated when displaying, but this can lag by a
  call or two (a 'frame' if you like) when the display is only triggered by a
  window repaint and the histogram can be fetched first. Since the custom shader
  apply is only expensive when we need to recreate the output texture, we can do
  it on-demand similar to what we do with the overlay texture.
2022-03-25 12:12:39 +00:00
Jake Turner 0173671fde Fix compile error when building on SDK 11.1
SDK 11.1 and SDK 12 have different declaration for MTLDevice::supportsBCTextureCompression. 
On SDK 11.1 it is marked as API_AVAILABLE for ios and on SDK 12 is marked as API_UNAVAILABLE ios. 
Guard the API_UNAVAILABLE(ios) declaration to only be included when compiling for SDK 12.0 or above.

The compile error message before the fix:

renderdoc/driver/metal/metal_device_bridge.mm:158:64: error: method cannot be unavailable on iOS when the protocol method it implements is available [-Werror,-Wavailability]
69
- (BOOL)supportsBCTextureCompression API_AVAILABLE(macos(11.0))API_UNAVAILABLE(ios)
2022-03-25 12:01:29 +00:00
Jake Turner 58f6061bdb Enable Metal for Mac CI builds 2022-03-25 12:01:29 +00:00
Jake Turner 02d72c038e MetalChunk entries for MTLCommandQueue 2022-03-25 10:24:22 +00:00
Jake Turner 61bac7a3ba MetalChunk entries for MTLDevice 2022-03-25 10:24:22 +00:00
Jake Turner 565e4a711a MetalChunk entries for MTLLibary and MTLFunction 2022-03-25 10:24:22 +00:00
Jake Turner 7de4345426 Serialisation for MTLLibary::newFunctionWithName 2022-03-25 10:24:22 +00:00
Jake Turner 0d58ae8c2e Tweak element name in Serialise_newDefaultLibrary
buffer -> data
2022-03-25 10:24:22 +00:00
Jake Turner 6ec18421bb Add obj-c message forwarding to real object 2022-03-25 10:24:22 +00:00
Jake Turner 260ecd28f6 Add missing dealloc messages to obj-c wrappers 2022-03-25 10:24:22 +00:00
Jake Turner d4cf31689e Serialise Device as part of MTLDevice API capture 2022-03-25 10:24:22 +00:00
baldurk 47f87e95f1 Don't overwrite sampler type when structurising. Closes #2528 2022-03-23 11:17:36 +00:00
baldurk ab228c51b8 Update feedback code to not use ptr-to-function type
* The previous PR that added this code existed before ptr-to-function was
  stripped down to just function for function types, so this change brings it in
  line.
2022-03-21 11:34:00 +00:00
baldurk ef68bb1646 Add sanity check that direct-heap access has a heap bound 2022-03-21 11:34:00 +00:00
baldurk d7dc8a5cd0 Fix code not properly using vulkan dynamic vertex inputs. Closes #2527 2022-03-21 11:34:00 +00:00
Benoit Dumesnil 2ace1fe84d Add test of D3D12 bindless feedback for shadermodel 6.6. 2022-03-21 11:30:47 +00:00
Benoit Dumesnil e47450a43b Fix test of D3D12 bindless feedback.
Fix a typo in a comment in D3D12_Descriptor_Indexing.py.
Fix UAV using a typed buffer view instead of a structured buffer view.
Fix SetDescriptorHeaps being called before ClearUnorderedAccessViewUint
2022-03-21 11:30:47 +00:00
Benoit Dumesnil 29770ef762 Update D3D headers in test project to latest D3D12 headers 2022-03-21 11:30:47 +00:00
Benoit Dumesnil dfd00b1e38 Add support for shader model 6.6 bindless resources. 2022-03-21 11:30:47 +00:00
Benoit Dumesnil c122b41155 Fix possible uint32 overflow when using unbounded resource tables. 2022-03-21 11:30:47 +00:00
Benoit Dumesnil 620d5c1fce Fix dx.op.annotateHandle having changed format. 2022-03-21 11:30:47 +00:00
Jake Turner a4d5bbe801 Use Unwrap() instead of class method GetReal()
Simplify code to get objc bridge from API result to single line instead of using a temporary variable
Fix missing forward declaration for bool IsObjCBridge(MTL::CPPTYPE *objCWrapped);
2022-03-21 11:04:32 +00:00
Jake Turner 065d229607 Added serialisation of WrappedMTL* types via IDs
Simplify code to get objc bridge from API result to single line instead of using a temporary variable.
Fix missing forward declaration for bool IsObjCBridge(MTL::CPPTYPE *objCWrapped);
2022-03-21 11:04:32 +00:00
baldurk 7a29e6a6bb Add a fallback path to manually get git commit on VS2022
* Loading LibGit2Sharp.dll by hand in msbuild no longer works in VS2022 due to
  architecture changes. We can fairly reliably get the same result by manually
  reading (and following the ref in) .git/HEAD
2022-03-18 14:10:28 +00:00
baldurk c161f6942c Test building in VS2022 in CI, drop VS2017 check 2022-03-18 14:10:28 +00:00
baldurk 20744fb1a2 Fix cmake version check to work in older cmake 2022-03-18 14:10:28 +00:00
baldurk 05d31025c0 Test that minimum cmake version works in CI 2022-03-18 14:10:28 +00:00
baldurk 1591ebcb1e Represent function types as plain func, not ptr-to-func
* This is not how LLVM does things, but sometimes DXIL blobs don't have the ptr-
  to-func types present, and we always access the real function type anyway so
  it should be safe to store the direct function type.
2022-03-17 23:49:09 +00:00
baldurk 5076ab1b4d Allow easier switching between offline/online reflection for tests 2022-03-17 18:10:06 +00:00
baldurk 345206b2b8 Fix validation error with inline uniform block writes 2022-03-17 18:10:05 +00:00
baldurk f4d9cf2b7e Fix UAV slot matching for D3D11 with merged UAV/RTV bindings 2022-03-17 18:10:05 +00:00
Jake Turner b743580b79 Use new macros for serialising APIs with returns
Use DECLARE_FUNCTION_WITH_RETURN_SERIALISED & INSTANTIATE_FUNCTION_WITH_RETURN_SERIALISED for
MTLDevice::newDefaultLibrary
MTLDevice::newLibraryWithSource
2022-03-17 10:19:21 +00:00
Jake Turner 0c8e41b201 Added wrapped MTLCommandQueue
Implemented capture serialisation for MTLDevice::newCommandQueue
Introduce new helper macros DECLARE_FUNCTION_WITH_RETURN_SERIALISED & INSTANTIATE_FUNCTION_WITH_RETURN_SERIALISED for serialising APIs with return values that need serialising ie. Metal resource creation APIs
2022-03-17 10:19:21 +00:00
Jake Turner f01a4df484 Fix Xcode 13.3 and Clang 13.x compile errors
Disable warnings
-Wunused-but-set-variable
-Wdeprecated-copy
2022-03-17 09:36:44 +00:00
Jake Turner 308456535f Rename ObjC helper GetResId -> GetResID 2022-03-15 19:01:52 +00:00
Jake Turner 6a657bd19f Rename ObjC helper GetId -> GetResId 2022-03-15 19:01:52 +00:00
Jake Turner b92dccc5e9 Add declarations for ObjC helper methods 2022-03-15 19:01:52 +00:00
Jake Turner ca7495a3c8 Remove extra #include "serialise/serialiser.h" 2022-03-15 19:01:52 +00:00
Jake Turner 247e2d7d0b Use bytebuf to serialise default library data 2022-03-15 19:01:52 +00:00
Jake Turner 00e8c31255 Change ObjCWrappedMTL* to ObjCBridgeMTL*
Change:
AllocateObjCWrapper -> AllocateObjCBridge
IsObjCWrapped -> IsObjCBridge
GetObjC -> GetObjCBridge
WrappedMTLObject::objc -> WrappedMTLObject::objcBridge
WrappedMTLObject::GetObjCWrappedMTLDevice -> WrappedMTLObject::GetObjCBridgeMTLDevice

Added GetReal() to C++ Wrapped objects
2022-03-15 19:01:52 +00:00
Jake Turner 5f3203c698 Hooking for MTLDevice basic new Library APIs 2022-03-15 19:01:52 +00:00
Jake Turner 88a2b3d74a Added basic MetalResourceManager implementation
Added MetalResourceManager to WrappedMTLDevice

Added helper macros:
METAL_NOT_IMPLEMENTED
METAL_NOT_IMPLEMENTED_ONCE

Added WrappedMTLDevice InitialState methods to metal_init_state.cpp
Added WrappedMTLDevice Serialiser helper methods to metal_core.cpp
2022-03-15 19:01:52 +00:00