Commit Graph

13275 Commits

Author SHA1 Message Date
baldurk 7c68746fd9 Add missing reference to struct in python docs 2022-07-11 13:48:28 +01:00
baldurk 5ef8294375 Pass through include paths properly when compiling shaders. Closes #2646 2022-07-11 13:03:54 +01:00
baldurk c14fad42c0 Put quotes around the right parameter in disassembled debug printfs 2022-07-11 13:02:35 +01:00
baldurk 7bdf26d329 Implement location tracking and goto for GS printfs
* We can't debug geometry shaders but we can scroll to them, as long as we have
  the primitive. We can't differentiate instances currently without passing that
  data through from the VS (and through tessellation, if it exists).
* This also disables the debug and goto buttons for printfs from shader stages
  that don't support those operations.
2022-07-11 13:02:23 +01:00
baldurk d39197a499 Arrays of float3 with a stride of 12 is only possible in scalar packing
* Previously this would be treated as std430 due to being 'tight' array packed,
  even though std430 only allows as tight as the base alignment - which for a
  float3 is 16-bytes still.
2022-07-11 13:00:18 +01:00
baldurk 52c00efb75 Apply matrix stride to inner children for multi-dimensional arrays 2022-07-11 12:59:49 +01:00
baldurk 83bff08fd1 Don't enable global hook if short paths are unavailable. Closes #2645
* AppInit_DLLs requires short paths to be specified, if they can't be created on
  the volume we can't reliably enable the global hook.
* Detecting this programmatically is quite complex, but since we know the shim
  file is always longer than 8.3, if we detect that the short path is the same
  length as the long path we know short names weren't used.
2022-07-08 11:25:57 +01:00
baldurk 92971fb061 List the current EID when a fatal error is detected 2022-07-08 11:08:40 +01:00
baldurk 2307c3b088 Add explicit error message for fetching counters without developer mode
* Now that we can report proper error messages, also return more information and
  don't use a separate message box.
2022-07-08 11:08:40 +01:00
baldurk c395bb2cff Work around NV driver bug on D3D11 copying from >2GB buffer 2022-07-08 11:08:40 +01:00
Jake Turner 6d7832df6f Update testing docs with info about Apple
Adding note about using "--demos-binary" option to specify the filepath of the demos binary as an alternative to making sure the demos binary is in the PATH.

Fixed a typo "can'tbe" -> "can't be"
2022-07-08 11:08:18 +01:00
Jake Turner c83851e884 First Apple platform support for Vulkan demos
Uses Metal-CPP-Extensions code to create window and the event loop.
Does not include support for Nuklear
2022-07-08 11:08:18 +01:00
Jake Turner 4e13b1ad38 Update Metal CPP to support tests project
Copy Metal driver metal-cpp files to the tests project for use in the tests project

Add extensions from Learn Metal-cpp project: https://developer.apple.com/metal/cpp/

https://developer.apple.com/metal/LearnMetalCPP.zip

Custom additions to Metal CPP to get NSApplication, NSView, NSWindow, CAMetalLayer to work stand alone without requiring MetalKit library.
2022-07-08 11:08:18 +01:00
Orson Baines 420efa41a9 Only create one history item per event for now 2022-07-08 11:07:21 +01:00
John Kattukudiyil 988e7723fa Update OpenGL Pixel History with failed tests
- Use samples passed query to add pixel modification data per fragment
- detect draw events that failed culling, scissor, stencil, and depth tests
2022-07-08 11:07:21 +01:00
Jake Turner 01184079c3 Test editing vulkan compute shader
Replace existing HLSL compute shader with a GLSL compute shader
2022-07-05 13:37:47 +01:00
Jake Turner 5b2b988bb3 Test changing vulkan compute shader entry-point
Commit for original bug fix:
"Fix entry-point remapping when editing compute shaders on vulkan"
c81a522360
2022-07-05 13:37:47 +01:00
baldurk 530c8cf024 Don't call SPIR-V callback with optional IDs not present 2022-07-05 13:13:24 +01:00
baldurk 398a92baa2 Fix error introduced in 4ba631d where stencil byte offset was always 0 2022-07-05 13:13:24 +01:00
Jake Turner d361ebf7e1 Allow command line to override Apple cmake options
CMAKE_OSX_ARCHITECTURES
ENABLE_PYRENDERDOC
CMAKE_OSX_DEPLOYMENT_TARGET

Remove CMAKE_OSX_ARCHITECTURES default setting to build for multiple architectures.
Enable ENABLE_PYRENDERDOC to On by default for Apple.
2022-07-05 13:01:00 +01:00
Jake Turner 2f30ad3e27 Make METAL_NOT_HOOKED() be Fatal instead of Error 2022-07-05 11:23:03 +01:00
baldurk 049884f51b Don't make decisions based on legacy GL contexts
* This is especially relevant on Android where we fetch all function pointers at
  init time, so any that we replace via emulation are gone, but it is also
  generally true that we expect GL contexts to be representative.
2022-07-04 15:00:36 +01:00
baldurk 1fdb7db07e Don't use shader compile flags when editing decompiled shader 2022-07-04 14:22:59 +01:00
Jake Turner c56beb77c8 Added DeallocateObjCBridge(WrappedMTL<type> *)
This replaces WrappedMTLObject::Dealloc() which was not implemented or hooked up (it was a TODO).
Deleted WrappedMTLObject::Dealloc()
DeallocateObjCBridge calls resource manager ReleaseWrappedResource().
2022-07-04 10:15:25 +01:00
Jake Turner 8c41ff714e Added MetalResourceManager::ReleaseWrappedResource 2022-07-04 10:15:25 +01:00
Jake Turner c7dae679c1 Use objc_constructInstance in AllocateObjCBridge
This constructs in-place the ObjC bridge class.
This fixes a bug where the reference count of the ObjC bridge class was not guaranteed to be initialized on construction.
2022-07-04 10:15:25 +01:00
Jake Turner 02103a9669 Set non-replay state to BackgroundCapturing 2022-07-04 10:15:25 +01:00
baldurk 4dc80c1793 Use non-legacy ASIC to generate AMDIL
* This may break on drivers old enough to not recognise the first non-legacy
  ASIC, but that is much rarer than new drivers that have dropped support for
  the old ones.
2022-06-30 15:41:45 +01:00
baldurk c817b6f9ff Fix clang warning 2022-06-30 14:49:02 +01:00
baldurk 9603f5a925 Pre-compile shaders for math and sampling opcodes during shader debug
* D3D12 math shader was already precompiled, but on D3D11 we now allocate
  everything up front and on D3D12 we also up-front compile sampling.
* The only exception is const offsets which can't be variable, so we cache these
  (likely we'll only see a few variants per shader/capture) and create them on
  demand.
2022-06-30 13:51:27 +01:00
baldurk 8e4b44aed7 Add test of integer offsets on texture sample for D3D shader debug 2022-06-30 13:51:26 +01:00
baldurk de619024c8 Test for extended UAV support in D3D11 test 2022-06-30 13:51:26 +01:00
baldurk 337704df1e Use a dense map for SPIR-V ID deaths 2022-06-30 13:51:26 +01:00
baldurk 6870329a9e Detect java not being in PATH at all, document java PATH requirement 2022-06-30 13:51:26 +01:00
baldurk 7990254bc0 Avoid copying shader debug states, only move them 2022-06-30 13:51:26 +01:00
baldurk b9e5e2fd5c Use QList for variables in ShaderViewer
* Using a linked list instead of a vector makes insert/erase operations for
  variables being created and destroyed significantly faster.
2022-06-30 13:24:36 +01:00
Jake Turner 1816bb809b Use capture mode directly : don't use local var
ie. replace

bool backframe = IsBackgroundCapturing(m_State);
if(backframe)

with

if(IsBackgroundCapturing(m_State))
2022-06-30 11:40:09 +01:00
Jake Turner 8b8027ff89 Update MetalCmdBufferRecordingInfo data
Switch to caching the CA::MetalLayer & WrappedMTLTexture from the MTL::Drawable.
This is to avoid validation asserts about accessing the texture of a MTL::Drawable after calling MTLCommandBuffer::presentDrawable.

Switch "bool present" to "uint32_t flags" to future proof being able to store multiple flags on the command buffer recoring info
2022-06-30 11:40:09 +01:00
Jake Turner ee82cf1476 Add MetalCmdBufferStatus enum 2022-06-30 11:40:09 +01:00
Jake Turner 4d69962397 Return the WrappedMTLCommandQueue from CmdBuffer
Previous API return goes back to usage for objective C calls and this is not required now the objective C and C++ wrapping/unwrapping has advanced and simplified.
More sense/natural/correct to return type without casting it.
2022-06-30 11:40:09 +01:00
Jake Turner 681611d3c4 MTLCommandBuffer API: enqueue, waitUntilCompleted
Hook and capture serialization for enqueue() & waitUntilCompleted()
2022-06-30 11:40:09 +01:00
Christian Voss-Wolff 4ba631d822 Fix Vulkan crash when viewing NV12 in TextureViewer 2022-06-29 11:04:01 +01:00
Remi Palandri 44f4fdafbc fix preview window bug post-activity destruction 2022-06-29 11:03:38 +01:00
Jake Turner d257b5016d Wrapped MtlBlitCommandEncoder
Added temporary implementation of GetWrapped() and Unwrap() for the unimplemented Metal types used by MTLBlitCommandEncoder APIs (MTLFence, MTLIndirectCommandBuffer, MTLCounterSampleBuffer).
The API synchronizeResource uses ObjC inheritance for MTLResource, which uses new helper methods for MTLResource without implementing the complete type.

MTLResource helper methods: GetResID(), Unwrap(), GetWrapped().
The WrappedMTLResource* is cast to WrappedMTLObject* to get the ID and real resource.

For the unimplemented Metal types: MTLFence, MTLIndirectCommandBuffer, MTLCounterSampleBuffer have added temporary implementations of GetWrapped() and Unwrap().
These temporary implementations perform the appropriate casting. There is no actual implementation of the unimplemented wrapped types. These unimplemented wrapped types are a temporary solution to enable the ObjC bridge to be implemented.

The APIs related to retrieving GPU counters have been hooked with basic serialization. It is expected the replay and capture will need to be specific ie. capture & serialize the buffer data, then at replay upload the serialized buffer data to the GPU buffer.
2022-06-28 12:33:45 +01:00
Jake Turner 0a4fbe8c30 Improve Xcode project generation for qrenderdoc
Xcode does not match the cmake behaviour of rerunning the target every time if the output file does not exist and then letting the Qt build system handle dependency checking.
Xcode has a property to behave like this, however that is not exposed by cmake.
To improve this for the Xcode qrenderdoc project manually add qrenderdoc sources files as dependencies.

Changed the Xcode project for qrenderdoc to add the files to the UI grouped by the file system folders using the cmake source_group(TREE *) command.
2022-06-27 11:07:46 +01:00
Jake Turner dd58dd012b Update expected error message to match code
Fixes failing "Buffer format parsing" unit test
2022-06-27 11:03:22 +01:00
Jake Turner d34c2cf658 Do not clear catch failure return state 2022-06-27 11:03:22 +01:00
Jake Turner 98075c6759 Unit tests for Metal format helper methods
Basic tests for public methods:
MakeResourceFormat(MTL::PixelFormat format);
GetByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat format, uint32_t mip);

One test for helper method:
GetPlaneByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat format, uint32_t mip, uint32_t plane);
2022-06-24 21:03:36 +01:00
Jake Turner b6787686d3 Helpers for Texture byte size and ResourceFormat
public Methods

MakeResourceFormat(MTL::PixelFormat format);
GetByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat format, uint32_t mip);

private helper Methods

IsOneComponent(MTL::PixelFormat mtlFormat);
IsTwoComponent(MTL::PixelFormat mtlFormat);
IsThreeComponent(MTL::PixelFormat mtlFormat);
IsFourComponent(MTL::PixelFormat mtlFormat);
IsBlockFormat(MTL::PixelFormat mtlFormat);
IsDepthOrStencilFormat(MTL::PixelFormat mtlFormat);
IsUNormFormat(MTL::PixelFormat mtlFormat);
IsSNormFormat(MTL::PixelFormat mtlFormat);
IsFloatFormat(MTL::PixelFormat mtlFormat);
IsUIntFormat(MTL::PixelFormat mtlFormat);
IsSIntFormat(MTL::PixelFormat mtlFormat);
IsSRGBFormat(MTL::PixelFormat mtlFormat);
IsYUVFormat(MTL::PixelFormat format);
GetBlockShape(MTL::PixelFormat format, uint32_t plane);
GetPlaneByteSize(uint32_t width, uint32_t height, uint32_t depth, MTL::PixelFormat format, uint32_t mip, uint32_t plane);
2022-06-24 21:03:36 +01:00
Jake Turner 5096d0244d Future proofing MakeBlendMultiplier & MakeBlendOp
Remove default from switch statements to trigger compile errors if MTL::BlendFactor or MTL::BlendOperation enumerations change in the future.
2022-06-24 21:03:36 +01:00