-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for D3D11 #1698
base: dev
Are you sure you want to change the base?
Commits on Aug 30, 2024
-
Generate globally unique anon union names
Ensure that anonymous union names processed by CppHeaderParser are globally unique to avoid conflicts between anonymous unions defined in separate header files.
Configuration menu - View commit details
-
Copy full SHA for 730b740 - Browse repository at this point
Copy the full SHA 730b740View commit details -
Updates to DX12 code generators to enable support for DX11, starting with the generated encoding code. Adds the DX11 header files for versions up to 11.0, 11.1, and 11.2 to the list of files to be processed by the DX code generator. Includes updates for DX11-specific syntax, types, and SAL annotations.
Configuration menu - View commit details
-
Copy full SHA for 76919d1 - Browse repository at this point
Copy the full SHA 76919d1View commit details -
Update codegen for anon structs
Ignore anonymous structs when generating API calls to process struct types.
Configuration menu - View commit details
-
Copy full SHA for 0bbf75d - Browse repository at this point
Copy the full SHA 0bbf75dView commit details -
Add D3D11_VIDEO_PROCESSOR_COLOR_SPACE to BIT_FIELD_LIST.
Configuration menu - View commit details
-
Copy full SHA for 58cff1b - Browse repository at this point
Copy the full SHA 58cff1bView commit details -
- Handle union decoding, with unions being treated as structs. - Handle 'get' functions that retrieve objects without returning an HRESULT value. - Handle object mapping for structs that contain arrays of objects.
Configuration menu - View commit details
-
Copy full SHA for 065f8ae - Browse repository at this point
Copy the full SHA 065f8aeView commit details -
Add DX11 enums to codegen bits list
Add DX11 bitmask enums to the enum to string code generator's BITS_LIST list.
Configuration menu - View commit details
-
Copy full SHA for a91b50a - Browse repository at this point
Copy the full SHA a91b50aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 06fb7cc - Browse repository at this point
Copy the full SHA 06fb7ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for d2cb319 - Browse repository at this point
Copy the full SHA d2cb319View commit details -
- Add DX11 dispatch table - Support encoding for API calls that create objects without returning an HRESULT value - Add info structures for D3D11 objects - Add a non-const overload for UnwrapObjects.
Configuration menu - View commit details
-
Copy full SHA for 0c17377 - Browse repository at this point
Copy the full SHA 0c17377View commit details -
Custom DX11 encode/decode routines
Custom encoding and decoding for unions and API calls receive resource data, requiring a special data size calculation.
Configuration menu - View commit details
-
Copy full SHA for 1e60ef3 - Browse repository at this point
Copy the full SHA 1e60ef3View commit details -
- Add JSON conversion routine for HandlePointerDecoder value types, operating on a const reference.
Configuration menu - View commit details
-
Copy full SHA for bd788a1 - Browse repository at this point
Copy the full SHA bd788a1View commit details -
Allocate output data for replay
Update code generation to allocate output data for output pointers.
Configuration menu - View commit details
-
Copy full SHA for ece0afd - Browse repository at this point
Copy the full SHA ece0afdView commit details -
Add replay support for output string parameters
Implement the same GetOutputPointer and AllocateOutputData interface used with PointerDecoder for replay of API calls with output parameters to BasicStringDecoder for D3D11 API calls that return strings with output parameters.
Configuration menu - View commit details
-
Copy full SHA for 9b23284 - Browse repository at this point
Copy the full SHA 9b23284View commit details -
Add codegen inout parameter support
Update the DX code generators to treat INOUT parameters as OUT parameters. All INOUT parameters are pointers to integers that specify and retrieve sizes for variable length arrays, where the input is the size of the array and the output is the total number of items copied to the array.
Configuration menu - View commit details
-
Copy full SHA for b696048 - Browse repository at this point
Copy the full SHA b696048View commit details -
Support D3D 'result_bytebuffer' case
D3D output parameters with a SAL labl including the text 'result_bytebuffer' and a size appear similar to arrays of bytes but are really a pointer to memory allocated internally by the implementation with the specified size. For this case, the following adjustments are made for capture and replay, where capture will continue to record the content of the retrieved memory and replay will allocate and retrieve a single pointer to the memory. - Update encoding for this case, where the type is void**, to dereference the pointer when invoking EncodeVoidArray. - Update replay to decode the array of bytes, but allocate a single pointer parameter for API call replay, using PointerDecoder<uint8_, void*> to represent the parameter.
Configuration menu - View commit details
-
Copy full SHA for 6fc9fe8 - Browse repository at this point
Copy the full SHA 6fc9fe8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 699df68 - Browse repository at this point
Copy the full SHA 699df68View commit details -
Gen AddObject for non HRESULT case
With D3D12, all functions that retrieve a COM object also return HRESULT. With D3D11, there are some functions that retrieve a COM object while returning void. The code generator has been updated to handle this case, generating calls to AddObject() for the COM objects retrieved by functions that don't return an HRESULT value.
Configuration menu - View commit details
-
Copy full SHA for 723faee - Browse repository at this point
Copy the full SHA 723faeeView commit details -
Implement the proxy d3d11.dll, with intialization and release functions added to the core d3d12_capture.dll module.
Configuration menu - View commit details
-
Copy full SHA for 18298d3 - Browse repository at this point
Copy the full SHA 18298d3View commit details -
Add the D3D11 API ID to the decoder's list of supported API IDs.
Configuration menu - View commit details
-
Copy full SHA for af92a59 - Browse repository at this point
Copy the full SHA af92a59View commit details -
Add capture/replay support for resource uploads.
Configuration menu - View commit details
-
Copy full SHA for c56a68d - Browse repository at this point
Copy the full SHA c56a68dView commit details -
Add replay support for mapped memory updates
Add Map/Unmap overrides to track mapped resource pointers.
Configuration menu - View commit details
-
Copy full SHA for d6abf2e - Browse repository at this point
Copy the full SHA d6abf2eView commit details -
Add ID3D11DeviceContext::GetData replay override
If GetData returned S_OK at capture and S_FALSE at replay, continue calling GetData until it returns S_OK or an error code.
Configuration menu - View commit details
-
Copy full SHA for ce73160 - Browse repository at this point
Copy the full SHA ce73160View commit details -
- Add d3d11_3.h to codegen header list. - Add custom struct encoders for new union types. - Add custom API call encode/decode for new resource creation functions.
Configuration menu - View commit details
-
Copy full SHA for 2a34189 - Browse repository at this point
Copy the full SHA 2a34189View commit details -
- Add d3d11_4.h to codegen header list. - Update enum to string generator to handle an aliasing case with YUV and RGB flags.
Configuration menu - View commit details
-
Copy full SHA for 75b12da - Browse repository at this point
Copy the full SHA 75b12daView commit details -
Add custom d3d11 object wrapper for ID3D11Resource
Add custom d3d11 object wrapper generator for the ID3D11Resource object, which can be retrieved from a view and must be wrapped.
Configuration menu - View commit details
-
Copy full SHA for a3c89cc - Browse repository at this point
Copy the full SHA a3c89ccView commit details -
Adjust variable length output array sizes
Update D3D12 repolay code generator to apply the same variable sized output array adjustment that is used for Vulkan. For API calls that have an optional output array parameter and a porinter to an integer size parameter, when the array parameter is NULL, store the retrieved size in the calling objects info struct, and then when the API call is made with a non-NULL array parameter, specify the size stored in the info struct when allocating the output array.
Configuration menu - View commit details
-
Copy full SHA for 8990592 - Browse repository at this point
Copy the full SHA 8990592View commit details -
Update codegen for arrays of COM pointers
Add support for arrays of COM pointers to the replay consumer code generator: - Handle output arrays of COM pointers, adding them to the object table. - Support variable length arrays of output COM pointers.
Configuration menu - View commit details
-
Copy full SHA for 1e449ff - Browse repository at this point
Copy the full SHA 1e449ffView commit details -
Prevent array size null pointer dereference
Update code generation to add a null check when dereferencing a pointer to an array size when encoding array data during capture and allocating array memory during replay. Added for cases where both the variable length array parameter and its associated size parameter are optional and are allowed to be null.
Configuration menu - View commit details
-
Copy full SHA for 92e8d61 - Browse repository at this point
Copy the full SHA 92e8d61View commit details -
Configuration menu - View commit details
-
Copy full SHA for f72c73c - Browse repository at this point
Copy the full SHA f72c73cView commit details -
Add unique codegen names for replay object info
Include the name of the object in the variable name generated for the object info structures that are created for replay overrides. This is needed for API calls that create more than one object.
Configuration menu - View commit details
-
Copy full SHA for eaef443 - Browse repository at this point
Copy the full SHA eaef443View commit details -
Adjust discard mapped memory case
- Allocate persistent memory when a resource is discarded, to skip memory allocation and copy for future discard/nooverwrite cases. - Add custom d3d11 resource destroy commands to free persistent memory allocations.
Configuration menu - View commit details
-
Copy full SHA for 813e378 - Browse repository at this point
Copy the full SHA 813e378View commit details -
Adjust exteral object/IUnknown handling
- Add external object handling for the software rendering module handle parameter from D3D11CreateDevice, warning when the handle is not null. - Silence the CreateSwapchain warning that is printed when the IUnknown pointer cannot be converted to a D3D12 queue, if it is an ID3D11Device object.
Configuration menu - View commit details
-
Copy full SHA for 88e539e - Browse repository at this point
Copy the full SHA 88e539eView commit details -
Make D3D11 view hold internal resource ref
ID3D11View_Wrapper now holds an internal reference to its associated ID3D11Resource_wrapper, ensuring the wrapper is always valid so that the data stored in the wrapper is not lost if the resource is released and then later retrieved with ID3D11View::GetResource().
Configuration menu - View commit details
-
Copy full SHA for 559ccff - Browse repository at this point
Copy the full SHA 559ccffView commit details -
Add -1 count check to debug assert
Update object array size assert to check both that the size parameter matches the decoded array size, or that the size parameter is -1, which has a special meaning for D3D11 APIs such as OMSetRenderTargetsAndUnorderedAccessViews to indicate that the RTVs and DSV should be preserved.
Configuration menu - View commit details
-
Copy full SHA for 290ed17 - Browse repository at this point
Copy the full SHA 290ed17View commit details -
Update swap chain handling for D3D11
- Store the ID3D11Device pointer in the swap chain info struct for D3D11. - Support internal reference counts for swap chain images acquired from swap chains chreated with the DISCARD and SEQUENTIAL swap effects. - Handle different FLIP_DISCARD behavior for D3D11, which behaves the same way as DISCARD. - Adjust child image tracking for cases that only allow the image at index 0 to be acquired (DISCARD and D3D11+FLIP_DISCARD).
Configuration menu - View commit details
-
Copy full SHA for 87e4beb - Browse repository at this point
Copy the full SHA 87e4bebView commit details -
Handle D3D11 MipLevels = 0 texture creation case
When a texture is created with MipLevels = 0, a full set of subtextures will be generated. The following has been added to support this case: - New utility function to calculate the number of mip levels from the texture creation parameters when MipLevels is specified as 0. - Updated utility functions that calculate the total number of subresources and individual subresource sizes from texture creation parameters to compute the total number of mip levels when MipLevels = 0.
Configuration menu - View commit details
-
Copy full SHA for 9fa53c4 - Browse repository at this point
Copy the full SHA 9fa53c4View commit details -
Handle uncommon map discard cases
Update capture to support the following mapped mempry case: - Game calls Map with WRITE_DISCARD flag without ever calling Unmap, calling Map to retrieve a new allocation when the previous allocation is full. This involves the following: - Process mapped memory before draw/dispatch to ensure any writes are properly recorded. - On repeated calls to Map with WRITE_DISCARD, update the entry for the resource in the mapped memory tracker for the new allocation returned by the driver.
Configuration menu - View commit details
-
Copy full SHA for 55a756b - Browse repository at this point
Copy the full SHA 55a756bView commit details -
Add swapchain init for CreateDeviceAndSwapChain
Add initialization for swapchain objects created by D3D11CreateDeviceAndSwapChain. - Add custom post call capture action to pre-acquire swapchain images. - Add replay override to initialize swapchain info.
Configuration menu - View commit details
-
Copy full SHA for 31ebc23 - Browse repository at this point
Copy the full SHA 31ebc23View commit details -
Force enable the D3D11 debug layer for capture and replay, based on the associated capture/replay debug option.
Configuration menu - View commit details
-
Copy full SHA for 376c517 - Browse repository at this point
Copy the full SHA 376c517View commit details -
Support aligned copies for mapped texture updates
Update ProcessFillMemoryCommand() to support copies for 1D, 2D, and 3D textures with different capture and replay row and/or depth alignments.
Configuration menu - View commit details
-
Copy full SHA for 386d2e6 - Browse repository at this point
Copy the full SHA 386d2e6View commit details -
- Adds a new DX11ImageRenderer class to generate screenshots for DX11 captures. Code that is common to both DX11 and DX12 screenshots was moved from the existing DX12ImageRenderer class to a shared base class that both DX11ImageRenderer and DX12ImageRenderer inherit from. - Updates both the capture and replay code responsible for generating DX12 screenshots to also support DX11 screenshots. The API to use for screenshot generation is determined based on the IDXGISwapChain creation parameters, which either include a ID3D12CommandQueue for DX12 or an ID3D11Device for DX11.
Configuration menu - View commit details
-
Copy full SHA for 6de279a - Browse repository at this point
Copy the full SHA 6de279aView commit details -
Keep persistent memory in table for DX11
Leave the persistent memory allocated for the D3D11_WRITE_DISCARD and D3D11_WRITE_NO_OVERWRITE DX11 map modes in the memory tracking table until the resources are released. Adds support for updating the mapped memory ID and pointer stored by PageGuardManager for use with DX11 resources mapped with the D3D11_MAP_DISCARD flag, which can return a new allocation for the resource. - Use separate values for the memory ID written to the capture file and the key used with the PageGuardManager table, allowing the ID to be updated without needing to add/remove the entry (the ID written to the capture file used to be the key). - Add a new PageGuardManager function to update the memory ID and pointer associated with a Resource, used to update the Resource entry with the new memory pointer returned with D3D11_MAP_DISCARD.
Configuration menu - View commit details
-
Copy full SHA for e0348ce - Browse repository at this point
Copy the full SHA e0348ceView commit details -
Custom ID3D11Device::CheckFeatureSupport routines
Update ID3D11Device::CheckFeatureSupport encoding and decoding with special case processing for the pFeatureSupportData parameter, which has a void* type with the actual type determined by the accompanying D3D11_FEATURE parameter. The implementation matches the custom implementations created for ID3D12Device and IDXGIFactory5.
Configuration menu - View commit details
-
Copy full SHA for 9608828 - Browse repository at this point
Copy the full SHA 9608828View commit details -
Per-write metadata API ID specification
Specify the API ID to use with metadata encoding as a parameter to the functions that write metadata instead of as a class member to support the use of multiple APIs from a single application.
Configuration menu - View commit details
-
Copy full SHA for 7a34447 - Browse repository at this point
Copy the full SHA 7a34447View commit details -
DX11 support for gfxrecon-info
- Write adapter and driver metadata for DX11 at device creation. - Update gfxrecon-info to collect and display DX11 info. - Collect all gfxrecon-info stats from a single pass. - Specify DX11 API ID for adatper metadata.
Configuration menu - View commit details
-
Copy full SHA for 486f589 - Browse repository at this point
Copy the full SHA 486f589View commit details -
Custom decoder for CheckFeatureSupport data param
Adds a new DxFeatureDataDecoder type to encapsulate the PointerDecoder<T> and StructPointerDecoder<T> types needed to decode the CheckFeatureSupport pFeatureSupportData parameter in a generic type that can be provided to DX consumers. Provides the same pointer decoder interface as PointerDecoder/StructPointerDecoder for managing pointer data, as well as functions for accessing the internal PointerDecoder/StructPointerDecoder with a specific type. Also allows the output allocation to be performed by the consumer instead of the decoder, which matches the standard consumer behavior.
Configuration menu - View commit details
-
Copy full SHA for c9ac977 - Browse repository at this point
Copy the full SHA c9ac977View commit details -
- Look for the renamed system DLL in the same folder as the capture DLL, instead of the same folder as the target executable, before attempting to copy and rename the DLL found in the system folder. This allows the capture DLL to be installed in locations other than the folder containing the target executable. - Use the shell API to retrieve the path to the system folder, relying on the WIN32 API to translate the returned path to the appropriate path for the architecture of the current process. This repalces code that tried to determine if it should use \Windows\System32 or \Windows\SysWOW64 as the system folder. For ARM devices, there are additional folders that need to be considered. - Only copy the D3D12 redist DLL when initializing the D3D12 DLL, not when initializing the DXGI and D3D11 DLLs. The redist DLL copy is now generic, with the redist DLL name specified by the DLL being initialized.
Configuration menu - View commit details
-
Copy full SHA for 08def37 - Browse repository at this point
Copy the full SHA 08def37View commit details -
Fix ResizeBuffers replay with width/height = 0
When IDXGISwapChain::ResizeBuffers is called with a width or height value that is equal to 0, that dimension will be resized to match the dimension of the client area of the target window. For this case, replay was resizing the window to have a width/height of 0, resulting in the client area no longer being visible. This change specifies the width/height of the window's client area to Window::SetSize, instead of 0, when width/height are 0.
Configuration menu - View commit details
-
Copy full SHA for d6b1e43 - Browse repository at this point
Copy the full SHA d6b1e43View commit details -
Fix gfxrecon-info ResizeBuffers usage
When IDXGISwapChain::ResizeBuffers is called with a width or height value that is equal to 0, that dimension will be resized to match the dimension of the client area of the target window. When the stats consumer used by gfxrecon-info processesed a ResizeBuffers call with width and height equal to zero, it reported the swap chain size as 0x0. The stats conusmer has been updated to ignore the ResizeBuffers width and height with a value of zero when determining swap chain size.
Configuration menu - View commit details
-
Copy full SHA for eae9eb0 - Browse repository at this point
Copy the full SHA eae9eb0View commit details -
Enable debug markers for DX11 replay
Enable DX11 support for the replay --dx12-override-object-names option.
Configuration menu - View commit details
-
Copy full SHA for b540828 - Browse repository at this point
Copy the full SHA b540828View commit details -
Handle UpdateSubresource data pointer adjustment
When ID3D11DeviceContext::UpdateSubresource is called from a deferred context with a driver that does not support command lists and the pDstBox parameter is non-null and the pDstBox parameter specifies a non-zero start offset for the update, the application is required to subtract the offset from the pSrcData parameter. Capture and replay have been updated to account for this adjustment. Note that this adjustment is not required for ID3D11DeviceContext1::UpdateSubresource1.
Configuration menu - View commit details
-
Copy full SHA for b2e1be0 - Browse repository at this point
Copy the full SHA b2e1be0View commit details -
Fix DX11 compressed tex1d/3d subresource size calc
When calculating the subresource size for block compressed 1D and 3D textures, apply the same pixel-to-block width/height conversion that is performed for 2D textures.
Configuration menu - View commit details
-
Copy full SHA for 734320b - Browse repository at this point
Copy the full SHA 734320bView commit details -
DX11 deferred context memory tracking optimization
Adds a custom mapped memory tracker for DX11 deferred contexts, which only support mapping resources with the D3D11_MAP_WRITE_DISCARD and D3D11_MAP_WRITE_NO_OVERWRITE map types. Because these map types only support writing to mapped memory, meaning that shadow memory would not need to be synchronized with driver memory for reads, this custom memory tracker can use write watch with shadow allocations. Write watch-based tracking eliminates the need for a single exception handler that must be shared by all contexts, which is required when using guard pages, allowing each deferred context to have its own independent instance of the memory tracker. The immediate context continues to use the original guard page memory tracking as it must process both read and write operations.
Configuration menu - View commit details
-
Copy full SHA for c0ef127 - Browse repository at this point
Copy the full SHA c0ef127View commit details -
Make IDXGISwapChain buffer cast conditional
Remove an unconditional cast of the object returned by IDXGISwapChain::GetBuffer to ID3D12Resource, as this method may return other resource types.
Configuration menu - View commit details
-
Copy full SHA for 5a2c4fe - Browse repository at this point
Copy the full SHA 5a2c4feView commit details