You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Map DXGI HRESULTS to D3DERR/D3DDDIERR HRESULTS so that d3d9 apps can react appropriately ([#102](#102) )
* Contain dxgi error code mapping fix
* Remove debug assert in ConvertBoxToRect ([#103](#103))
* Contain debug assert fix
* Use tighter packing for non-planar resources ([#105](#105))
* Contain tighter packing for non-planar resources change
Backport bug: https://microsoft.visualstudio.com/OS/_workitems/edit/61561225/
----
#### AI description (iteration 1)
#### PR Classification
This pull request implements an API enhancement by optimizing non-planar resource packing and improving DXGI error code translation for D3D9.
#### PR Summary
The changes introduce a feature-flag-controlled tighter packing strategy in resource memory layout and add a new inline function to map DXGI error codes to their D3D9 counterparts, ensuring more efficient error handling and resource management.
- **`src/9on12Resource.cpp`**: Implements tighter packing for non-planar resources by recalculating row pitches and total size when the feature is enabled.
- **`include/9on12Util.h`**: Adds the `TranslateDxgiHrToD3D9` function and updates error handling macros to use a cached feature flag for efficient DXGI error translation.
- **`src/9on12Blit.cpp`**: Adjusts the box-to-rectangle conversion check to conditionally bypass strict validations based on the feature flag.
- **`src/CMakeLists.txt` & `include/pch.h`**: Update build dependencies and include directories to support the new feature integration.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
caseDXGI_ERROR_INVALID_CALL: returnD3DERR_DRIVERINTERNALERROR; // This is a driver error from the app's perspective as it means that 9on12 made an invalid call
@@ -103,6 +123,7 @@ __pragma(warning(suppress:4127)) /* conditional is constant due to constant macr
103
123
try \
104
124
{ \
105
125
126
+
staticbool g_Feature_K2FixesRound1_IsEnabled = Feature_K2FixesRound1::IsEnabled(); // cache this value since it's used in a lot of entry points and is weirdly expensive to call
106
127
#defineCLOSE_TRYCATCH_AND_STORE_HRESULT(hr) \
107
128
EntryPointHr = hr; \
108
129
} \
@@ -114,6 +135,9 @@ __pragma(warning(suppress:4127)) /* conditional is constant due to constant macr
m_physicalLinearRepresentation.m_rowPitces[subresourceIndex] = minPitch; // Even though we don't use the m_rowPitches field, keep it consistent with the newly computed RowPitch
0 commit comments