Skip to content

feat(frame generation): improve frame generation quality#1125

Merged
doodlum merged 6 commits into
devfrom
fg-updates
Jun 9, 2025
Merged

feat(frame generation): improve frame generation quality#1125
doodlum merged 6 commits into
devfrom
fg-updates

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented Jun 8, 2025

Updates FSR to 3.1.4 and includes the camera struct for future-proofing and quality improvements.
Implements proper frame markers for Streamline/DLSSG
Moved frame buffer capture hooks to share between classes.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added new API capabilities to query provider version information and improved support for advanced camera data in frame generation.
    • Introduced debug and reserved flags for frame generation, allowing enhanced diagnostics and future feature expansion.
    • Added support for specifying a separate surface format for hudless frame generation.
  • Enhancements

    • Improved integration with Reflex markers for better latency measurement and synchronization.
    • Added hooks to intercept and cache Direct3D 11 frame buffer data, enabling more robust upscaling and frame generation workflows.
    • Enhanced frame generation dispatch to include detailed camera orientation and position data for improved quality.
    • Restructured Streamline interface by moving some functionality to free functions and removing internal hooking and caching mechanisms.
  • Bug Fixes

    • Removed a redundant or incorrect type alias to ensure consistency and prevent potential issues.
  • Refactor

    • Streamlined internal handling of frame buffer caching by relocating related functionality and removing obsolete code.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 8, 2025

Walkthrough

This update introduces new API query types and structures for provider versioning, expands frame generation debug and context options, and implements detailed camera info dispatching. It removes frame buffer caching and D3D11 context hooks from the Streamline module, transferring these responsibilities to the Upscaling module, which now manages D3D11 device context hooks and frame buffer caching. Additional Streamline Reflex marker integration and update phase hooks are also included.

Changes

File(s) Change Summary
include/ffx_api.h Added provider version query type and struct for API querying.
include/ffx_api_types.h Included <stdbool.h> and removed a typedef alias with a typo.
include/ffx_framegeneration.h Added debug flag, reserved dispatch flags, new HUDless context struct, camera info struct, and updated typedefs.
include/ffx_framegeneration.hpp Moved and added specializations and structs for new HUDless and camera info dispatch types.
src/FidelityFX.cpp Extended frame generation dispatch to include camera orientation and position info.
src/Hooks.cpp Added Streamline Reflex markers to Present and update phases; replaced Streamline hooks with Upscaling D3D hooks.
src/Streamline.cpp, src/Streamline.h Removed D3D11 device context hooks, frame buffer caching, and related methods/structs from Streamline.
src/Upscaling.cpp, src/Upscaling.h Added D3D11 device context Map/Unmap hooks, frame buffer caching, and related structs/methods to Upscaling.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant FidelityFX
    participant FrameGenContext

    App->>FidelityFX: Present()
    FidelityFX->>FrameGenContext: Dispatch(framegen parameters)
    FidelityFX->>FrameGenContext: Dispatch(camera info: position, orientation)
    FrameGenContext-->>FidelityFX: Status
    FidelityFX-->>App: Return
Loading
sequenceDiagram
    participant D3D11Context
    participant Upscaling

    D3D11Context->>Upscaling: Map(resource)
    Upscaling->>Upscaling: If resource == per-frame, store mapped pointer

    D3D11Context->>Upscaling: Unmap(resource)
    Upscaling->>Upscaling: If resource == per-frame and mapped, CacheFramebuffer()
    Upscaling-->>D3D11Context: Call original Unmap
Loading

Suggested reviewers

  • alandtse

Poem

In code’s bright warren, rabbits leap,
Swapping hooks from Streamline’s keep.
Upscaling now with Map and cache,
Camera info in a flash!
New queries hop, debug flags cheer—
The warren’s code is crystal clear.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 858a727 and 845d9b0.

📒 Files selected for processing (1)
  • src/FidelityFX.cpp (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/FidelityFX.cpp (1)
include/ffx_api.hpp (2)
  • Dispatch (127-131)
  • Dispatch (127-127)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (4)
src/FidelityFX.cpp (4)

55-61: LGTM! Documentation improvement.

The Doxygen-style comment clearly documents the method's purpose, parameters, and behavior. This enhances code maintainability and developer understanding.


162-163: Good fix for the threading issue.

The removal of static keywords addresses the threading concern from the previous review. The matrices are now properly re-evaluated on each call, ensuring thread safety.


165-179: Camera configuration setup looks correct.

The extraction of camera right, up, forward vectors from the view matrix and position from cached frame buffer data follows the expected DirectX matrix conventions and should provide accurate camera information for FSR 3.1.4 frame generation.


181-183:

Details

✅ Verification successful

Verify the dual dispatch pattern with FidelityFX API.

The code makes two separate dispatch calls where the second call includes both dispatchParameters and cameraConfig. Please confirm this is the correct usage pattern for FSR 3.1.4 camera information dispatch.


🌐 Web query:

FidelityFX FSR 3.1.4 API documentation for DispatchDescFrameGenerationPrepareCameraInfo usage pattern

💡 Result:

The DispatchDescFrameGenerationPrepare function in AMD's FidelityFX Super Resolution (FSR) 3.1 API is designed to prepare the necessary data for frame generation by processing depth and motion vector information. This preparation is essential for generating interpolated frames, especially when integrating FSR with other upscaling technologies like DLSS or XeSS.

Usage Pattern:

  1. Include Necessary Headers:
    Ensure that your project includes the appropriate headers for FSR 3.1. For C++ applications, include:

    #include "ffx_api/ffx_api.hpp"
  2. Initialize the Frame Generation Context:
    Before dispatching frame generation commands, create and configure the frame generation context. This involves setting up the necessary callbacks and resources.

    ffx::Context frameGenContext;
    ffx::CreateContextDescFsrFrameGen fgContextDesc{};
    // Configure fgContextDesc as needed
    ffx::CreateContext(&frameGenContext, nullptr, fgContextDesc);
  3. Prepare the Dispatch Descriptor:
    Set up the DispatchDescFrameGenerationPrepare descriptor with the required parameters:

    ffx::DispatchDescFrameGenerationPrepare dispatchFgPrep{};
    dispatchFgPrep.commandList = /* Your command list */;
    dispatchFgPrep.depth = /* Depth buffer resource */;
    dispatchFgPrep.motionVectors = /* Motion vector resource */;
    dispatchFgPrep.frameTimeDelta = /* Time delta in milliseconds */;
    dispatchFgPrep.renderSize = { /* Width */, /* Height */ };
    dispatchFgPrep.jitterOffset = { /* X offset */, /* Y offset */ };
    dispatchFgPrep.motionVectorScale = { /* X scale */, /* Y scale */ };
    dispatchFgPrep.cameraNear = /* Near plane distance */;
    dispatchFgPrep.cameraFar = /* Far plane distance */;
    dispatchFgPrep.cameraFovAngleVertical = /* Vertical FOV in radians */;
    dispatchFgPrep.viewSpaceToMetersFactor = /* Conversion factor */;
    dispatchFgPrep.frameID = /* Frame ID */;
    dispatchFgPrep.flags = /* Flags */;
  4. Dispatch the Frame Generation Prepare Command:
    Execute the dispatch to prepare the data for frame generation:

    ffx::Dispatch(frameGenContext, dispatchFgPrep);

Key Considerations:

  • Thread Safety: The DispatchDescFrameGenerationPrepare function is not thread-safe. Ensure that it is not called concurrently with DispatchDescFrameGeneration.

  • Motion Vectors: Provide motion vectors in a floating-point format (e.g., FP16) for optimal performance and quality.

  • Depth Information: Utilize inverse or infinite depth representations when possible to enhance frame generation accuracy.

  • Camera Transformations: If the camera undergoes significant transformations (e.g., during scene changes or cinematic sequences), set the reset flag to true for the first frame to reset internal resources.

For a comprehensive understanding and additional details, refer to the AMD FidelityFX Super Resolution 3.1 Integration Overview document. (scribd.com)

Citations:


🏁 Script executed:

#!/bin/bash
# Locate all frame generation dispatch descriptor types
rg -n "DispatchDescFrameGeneration" -n ffx_api
# Find all ffx::Dispatch overloads in the FidelityFX API
rg -n "ffx::Dispatch" -n ffx_api
# Search for camera-related dispatch descriptors or types
rg -n "Camera" -n ffx_api

Length of output: 249


🏁 Script executed:

#!/bin/bash
# Search for FSR API headers
rg -l "ffx_api.hpp"
rg -l "ffx" -g '*.hpp'

# Search for DispatchDescFrameGenerationPrepare usage
rg -n "DispatchDescFrameGenerationPrepare" .

# Search for DispatchDescFrameGeneration usage
rg -n "DispatchDescFrameGeneration" .

# Search for all ffx::Dispatch calls
rg -n "ffx::Dispatch" .

# Search for dispatchParameters and cameraConfig definitions in source
rg -n "dispatchParameters" src
rg -n "cameraConfig" src

Length of output: 9927


Confirmed: Dual‐Dispatch Pattern Is Correct

The C++ wrapper’s variadic ffx::Dispatch call correctly links the camera‐info struct immediately after the prepare struct (see the “Link this struct after ffxDispatchDescFrameGenerationPrepare” note in include/ffx_framegeneration.h). Issuing:

ffx::Dispatch(frameGenContext, dispatchParameters);
…
ffx::Dispatch(frameGenContext, dispatchParameters, cameraConfig);

matches the AMD FSR 3.1.4 integration requirements for frame‐generation prepare + camera info. No changes required.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
coderabbitai Bot added a commit that referenced this pull request Jun 8, 2025
Docstrings generation was requested by @doodlum.

* #1125 (comment)

The following files were modified:

* `src/FidelityFX.cpp`
* `src/Hooks.cpp`
* `src/Streamline.cpp`
* `src/Streamline.h`
* `src/Upscaling.cpp`
* `src/Upscaling.h`
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 8, 2025

Note

Generated docstrings for this pull request at #1126

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (3)
src/Hooks.cpp (1)

1081-1084: Consider documenting why these hooks are VR-excluded.

The code correctly checks for VR mode before installing the update hooks, but it would be helpful to document why VR doesn't need these Reflex markers.

 if (!REL::Module::IsVR()) {
+    // VR has different frame timing requirements and doesn't use Reflex markers
     stl::write_thunk_call<Main_Update_Begin>(REL::RelocationID(35565, 36564).address() + REL::Relocate(0x53, 0x6E));
     stl::write_thunk_call<Main_Update_Swap>(REL::RelocationID(35565, 36564).address() + REL::Relocate(0x5D2, 0xA92));
 }
include/ffx_framegeneration.h (1)

170-175: Consider improving comment formatting.

The struct implementation is correct, but the comment could be reformatted for better readability.

-//Pass this optional linked struct at FG context creation to enable app to use different hudlessBackBufferformat (IE.RGBA8_UNORM) from backBufferFormat (IE. BGRA8_UNORM)
+// Pass this optional linked struct at FG context creation to enable app to use different hudlessBackBufferFormat 
+// (e.g., RGBA8_UNORM) from backBufferFormat (e.g., BGRA8_UNORM)
src/Upscaling.h (1)

201-204: Consider adding documentation for the caching mechanism.

The frame buffer caching implementation looks correct, but it would benefit from documentation explaining the lifecycle and usage.

+	// Pointer to the currently mapped frame buffer resource
 	D3D11_MAPPED_SUBRESOURCE* mappedFrameBuffer = nullptr;
+	// Cached frame buffer data from the last Map/Unmap operation
 	FrameBuffer frameBufferCached{};

+	// Caches the current frame buffer data from the mapped resource
 	void CacheFramebuffer();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d22a4c4 and d3402a8.

⛔ Files ignored due to path filters (1)
  • features/Frame Generation/SKSE/Plugins/FidelityFX/amd_fidelityfx_dx12.dll is excluded by !**/*.dll
📒 Files selected for processing (10)
  • include/ffx_api.h (1 hunks)
  • include/ffx_api_types.h (2 hunks)
  • include/ffx_framegeneration.h (6 hunks)
  • include/ffx_framegeneration.hpp (1 hunks)
  • src/FidelityFX.cpp (1 hunks)
  • src/Hooks.cpp (4 hunks)
  • src/Streamline.cpp (3 hunks)
  • src/Streamline.h (0 hunks)
  • src/Upscaling.cpp (1 hunks)
  • src/Upscaling.h (1 hunks)
💤 Files with no reviewable changes (1)
  • src/Streamline.h
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (12)
include/ffx_api_types.h (1)

26-26: Good addition for C standard compliance.

Adding <stdbool.h> enables proper bool type usage and boolean literals, improving C standard compliance and type safety.

include/ffx_api.h (1)

103-109: Well-structured API extension for provider version querying.

The new query descriptor follows established patterns and provides useful provider version information for API introspection. The sequential constant value and struct design are consistent with existing API conventions.

src/FidelityFX.cpp (1)

153-176: Well-implemented camera info dispatch for FSR 3.1.4.

The camera info dispatch implementation correctly:

  • Extracts camera orientation vectors from the view matrix
  • Retrieves camera position from cached frame buffer data
  • Follows the established error handling pattern
  • Supports the FSR 3.1.4 frame generation improvements mentioned in the PR objectives

The dispatch structure and error logging are consistent with existing code patterns.

include/ffx_framegeneration.hpp (1)

68-76: Consistent C++ wrapper additions for new API structures.

The template specializations and struct definitions follow the established patterns in the file and provide proper C++ wrapper support for the new hudless and camera info API structures introduced in FSR 3.1.4.

src/Streamline.cpp (1)

207-209:

Details

❓ Verification inconclusive

Verify thread safety when accessing shared framebuffer data.

The code now accesses globals::upscaling->frameBufferCached without any synchronization mechanism. Since the framebuffer is cached in the Upscaling module's Map/Unmap hooks (potentially on different threads), this could lead to data races.

Consider adding proper synchronization or verify that Map/Unmap operations always complete before this code executes:

Also applies to: 215-215


🏁 Script executed:

#!/bin/bash
# Search for other accesses to frameBufferCached to understand the access pattern
rg -A 5 "frameBufferCached" --type cpp

# Check if there's any existing synchronization mechanism
rg -A 5 "(mutex|lock|atomic).*frame" --type cpp

Length of output: 3282


Thread-safety of Upscaling framebuffer access

The frameBufferCached struct is written in src/Upscaling.cpp (via the Map/Unmap hook/CacheFramebuffer) and then read in multiple places without any locks or atomics:

  • src/Streamline.cpp (lines 207–209, 215)
  • src/FidelityFX.cpp (similar matrix and position reads)

No std::mutex, std::lock_guard, or std::atomic protecting these reads and writes. If the hook and the Streamline/FidelityFX code ever run on different threads, you risk torn or stale data.

• Verify that both the write (Map/Unmap hook) and all reads always occur on the same thread and in a deterministic order.
• If there’s any chance of concurrent execution, introduce a lightweight synchronization around frameBufferCached (e.g. a std::mutex or atomic copy with memory fences), or restructure the code so that all access remains single-threaded.

src/Hooks.cpp (1)

393-393: LGTM! Architectural change properly implemented.

The change from streamline->InstallHooks to upscaling->InstallD3DHooks correctly reflects the migration of D3D11 context hooking responsibility to the Upscaling module.

include/ffx_framegeneration.h (3)

41-41: LGTM!

The debug flag follows the existing bitfield pattern and provides useful runtime validation capability.


51-52: Good practice to reserve flags for future extensibility.

The reserved flags follow the proper bitfield pattern and provide room for future features.


72-82: Clean typedef usage improves API clarity.

Converting structs to typedefs is a good practice for C APIs, making the types easier to use.

Also applies to: 85-97

src/Upscaling.h (3)

180-180: LGTM!

The method declaration follows the class's naming conventions and has an appropriate parameter type.


182-199: Well-structured frame buffer data.

The FrameBuffer struct is well-organized with consistent naming conventions for camera transformation data.


206-216: Proper D3D11 hook implementation.

The hook structures correctly match the D3D11 DeviceContext interface signatures and follow the established thunk pattern.

Comment thread src/FidelityFX.cpp Outdated
Comment thread src/Upscaling.cpp
Comment on lines +783 to +787
void Upscaling::InstallD3DHooks(ID3D11DeviceContext* a_context)
{
stl::detour_vfunc<14, ID3D11DeviceContext_Map>(a_context);
stl::detour_vfunc<15, ID3D11DeviceContext_Unmap>(a_context);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for virtual function detouring.

The stl::detour_vfunc calls could fail, but there's no error checking or fallback mechanism.

Consider adding error handling:

 void Upscaling::InstallD3DHooks(ID3D11DeviceContext* a_context)
 {
-    stl::detour_vfunc<14, ID3D11DeviceContext_Map>(a_context);
-    stl::detour_vfunc<15, ID3D11DeviceContext_Unmap>(a_context);
+    if (!stl::detour_vfunc<14, ID3D11DeviceContext_Map>(a_context)) {
+        logger::error("[Upscaling] Failed to detour ID3D11DeviceContext::Map");
+    }
+    if (!stl::detour_vfunc<15, ID3D11DeviceContext_Unmap>(a_context)) {
+        logger::error("[Upscaling] Failed to detour ID3D11DeviceContext::Unmap");
+    }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
void Upscaling::InstallD3DHooks(ID3D11DeviceContext* a_context)
{
stl::detour_vfunc<14, ID3D11DeviceContext_Map>(a_context);
stl::detour_vfunc<15, ID3D11DeviceContext_Unmap>(a_context);
}
void Upscaling::InstallD3DHooks(ID3D11DeviceContext* a_context)
{
if (!stl::detour_vfunc<14, ID3D11DeviceContext_Map>(a_context)) {
logger::error("[Upscaling] Failed to detour ID3D11DeviceContext::Map");
}
if (!stl::detour_vfunc<15, ID3D11DeviceContext_Unmap>(a_context)) {
logger::error("[Upscaling] Failed to detour ID3D11DeviceContext::Unmap");
}
}
🤖 Prompt for AI Agents
In src/Upscaling.cpp around lines 783 to 787, the calls to stl::detour_vfunc for
detouring virtual functions lack error handling. Modify the code to check the
return value of each stl::detour_vfunc call, and if it indicates failure, log an
appropriate error message or handle the failure gracefully to ensure the program
can respond properly to detour setup issues.

Comment thread src/Upscaling.cpp
Comment on lines +789 to +797
HRESULT Upscaling::ID3D11DeviceContext_Map::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource, D3D11_MAP MapType, UINT MapFlags, D3D11_MAPPED_SUBRESOURCE* pMappedResource)
{
HRESULT hr = func(This, pResource, Subresource, MapType, MapFlags, pMappedResource);
if (hr == S_OK) {
if (*globals::game::perFrame.get() == pResource)
globals::upscaling->mappedFrameBuffer = pMappedResource;
}
return hr;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null pointer checks for global pointers.

The code accesses globals::game::perFrame and globals::upscaling without verifying they are valid.

 HRESULT Upscaling::ID3D11DeviceContext_Map::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource, D3D11_MAP MapType, UINT MapFlags, D3D11_MAPPED_SUBRESOURCE* pMappedResource)
 {
     HRESULT hr = func(This, pResource, Subresource, MapType, MapFlags, pMappedResource);
     if (hr == S_OK) {
-        if (*globals::game::perFrame.get() == pResource)
-            globals::upscaling->mappedFrameBuffer = pMappedResource;
+        if (globals::game::perFrame && globals::upscaling && *globals::game::perFrame.get() == pResource)
+            globals::upscaling->mappedFrameBuffer = pMappedResource;
     }
     return hr;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
HRESULT Upscaling::ID3D11DeviceContext_Map::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource, D3D11_MAP MapType, UINT MapFlags, D3D11_MAPPED_SUBRESOURCE* pMappedResource)
{
HRESULT hr = func(This, pResource, Subresource, MapType, MapFlags, pMappedResource);
if (hr == S_OK) {
if (*globals::game::perFrame.get() == pResource)
globals::upscaling->mappedFrameBuffer = pMappedResource;
}
return hr;
}
HRESULT Upscaling::ID3D11DeviceContext_Map::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource, D3D11_MAP MapType, UINT MapFlags, D3D11_MAPPED_SUBRESOURCE* pMappedResource)
{
HRESULT hr = func(This, pResource, Subresource, MapType, MapFlags, pMappedResource);
if (hr == S_OK) {
if (globals::game::perFrame && globals::upscaling && *globals::game::perFrame.get() == pResource)
globals::upscaling->mappedFrameBuffer = pMappedResource;
}
return hr;
}
🤖 Prompt for AI Agents
In src/Upscaling.cpp around lines 789 to 797, the code uses
globals::game::perFrame and globals::upscaling without checking if these
pointers are null. Add null pointer checks before dereferencing these globals to
ensure they are valid. Specifically, verify globals::game::perFrame.get() and
globals::upscaling are not null before accessing their members to prevent
potential crashes.

Comment thread src/Upscaling.cpp
Comment on lines +799 to +804
void Upscaling::ID3D11DeviceContext_Unmap::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource)
{
if (*globals::game::perFrame.get() == pResource && globals::upscaling->mappedFrameBuffer)
globals::upscaling->CacheFramebuffer();
func(This, pResource, Subresource);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null pointer checks for global pointers.

Similar to the Map thunk, this code needs defensive null checks.

 void Upscaling::ID3D11DeviceContext_Unmap::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource)
 {
-    if (*globals::game::perFrame.get() == pResource && globals::upscaling->mappedFrameBuffer)
-        globals::upscaling->CacheFramebuffer();
+    if (globals::game::perFrame && globals::upscaling && 
+        *globals::game::perFrame.get() == pResource && globals::upscaling->mappedFrameBuffer)
+        globals::upscaling->CacheFramebuffer();
     func(This, pResource, Subresource);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
void Upscaling::ID3D11DeviceContext_Unmap::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource)
{
if (*globals::game::perFrame.get() == pResource && globals::upscaling->mappedFrameBuffer)
globals::upscaling->CacheFramebuffer();
func(This, pResource, Subresource);
}
void Upscaling::ID3D11DeviceContext_Unmap::thunk(ID3D11DeviceContext* This, ID3D11Resource* pResource, UINT Subresource)
{
if (globals::game::perFrame && globals::upscaling &&
*globals::game::perFrame.get() == pResource && globals::upscaling->mappedFrameBuffer)
globals::upscaling->CacheFramebuffer();
func(This, pResource, Subresource);
}
🤖 Prompt for AI Agents
In src/Upscaling.cpp around lines 799 to 804, the function uses global pointers
without checking if they are null, which can cause crashes. Add null pointer
checks for globals::game::perFrame and globals::upscaling before dereferencing
or accessing their members. Only proceed with the CacheFramebuffer call if these
pointers are valid to ensure safe execution.

Comment thread src/Upscaling.cpp
Comment on lines +806 to +811
void Upscaling::CacheFramebuffer()
{
auto frameBuffer = (FrameBuffer*)mappedFrameBuffer->pData;
frameBufferCached = *frameBuffer;
mappedFrameBuffer = nullptr;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Consider adding size validation and thread safety.

The CacheFramebuffer method assumes the mapped data size matches the FrameBuffer struct size, which could lead to buffer overruns if assumptions are incorrect.

Consider validating the data size and adding thread safety:

 void Upscaling::CacheFramebuffer()
 {
+    std::lock_guard<std::mutex> lock(frameBufferMutex);  // Add mutex member
     auto frameBuffer = (FrameBuffer*)mappedFrameBuffer->pData;
     frameBufferCached = *frameBuffer;
     mappedFrameBuffer = nullptr;
 }

Run this script to check the FrameBuffer struct definition:


🏁 Script executed:

#!/bin/bash
# Find the FrameBuffer struct definition to understand its size
ast-grep --pattern 'struct FrameBuffer {
  $$$
}'

# Check if there's a size field in D3D11_MAPPED_SUBRESOURCE
rg -A 10 "D3D11_MAPPED_SUBRESOURCE" --type cpp

Length of output: 3663


I’ll locate the FrameBuffer type definition to confirm its layout and size before finalizing the recommendation.


🏁 Script executed:

#!/bin/bash
# Search for FrameBuffer struct or class definition in headers and source
rg -n "struct FrameBuffer" -t cpp -t h -A5 -B5
rg -n "class FrameBuffer"  -t cpp -t h -A5 -B5

Length of output: 505


Couldn’t locate the full FrameBuffer definition above. Let’s dump a larger range around its declaration to verify its size and layout:


🏁 Script executed:

#!/bin/bash
# Show full FrameBuffer struct for size/layout inspection
sed -n '180,260p' src/Upscaling.h

Length of output: 1149


Add data-pointer validation, size checks, and thread safety in CacheFramebuffer

Currently, CacheFramebuffer() unconditionally casts and dereferences mappedFrameBuffer->pData and updates shared members without synchronization. This can lead to UB if mapping failed or if the underlying buffer size doesn’t match sizeof(FrameBuffer), and to data races if called from multiple threads.

Suggested changes around src/Upscaling.cpp Lines ~806–811:

  • Introduce a std::mutex frameBufferMutex; (in Upscaling.hpp)
  • In CacheFramebuffer():
     void Upscaling::CacheFramebuffer()
     {
  • std::lock_guardstd::mutex lock(frameBufferMutex);
  • if (!mappedFrameBuffer || !mappedFrameBuffer->pData) {
  •    return;  // nothing to cache
    
  • }
  • // Ensure the mapped resource’s byte width (captured in Map hook via GetDesc)
  • // is at least sizeof(FrameBuffer)
  • if (bufferByteWidth < sizeof(FrameBuffer)) {
  •    return;  // mapped data too small
    
  • }
    auto frameBuffer = reinterpret_cast<FrameBuffer*>(mappedFrameBuffer->pData);
    frameBufferCached = *frameBuffer;
    mappedFrameBuffer = nullptr;
    }
- In your Map hook (ID3D11DeviceContext_Map::thunk), capture both the mapped subresource **and** the resource’s `ByteWidth` (via `ID3D11Buffer::GetDesc`) and store them in `Upscaling` so `CacheFramebuffer` can perform the size check.

These additions will prevent buffer overruns and data-race conditions.  

> Committable suggestion skipped: line range outside the PR's diff.

<details>
<summary>🤖 Prompt for AI Agents</summary>

In src/Upscaling.cpp around lines 806 to 811, the CacheFramebuffer method casts
and dereferences mappedFrameBuffer->pData without validating the pointer or
verifying the data size matches sizeof(FrameBuffer), risking buffer overruns and
undefined behavior. Additionally, it updates shared members without
synchronization, causing potential data races. To fix this, add a std::mutex
frameBufferMutex in Upscaling.hpp and lock it in CacheFramebuffer to ensure
thread safety. Modify the Map hook to capture the mapped subresource and the
resource's ByteWidth via ID3D11Buffer::GetDesc, store these in Upscaling, and in
CacheFramebuffer validate that the mapped data size is at least
sizeof(FrameBuffer) before copying. Also, check that mappedFrameBuffer and pData
are not null before accessing them.


</details>

<!-- This is an auto-generated comment by CodeRabbit -->

Comment thread src/Hooks.cpp
Comment on lines +487 to +500
struct Main_Update_Swap
{
static void thunk(void* This)
{
if (globals::streamline->featureReflex) {
sl::FrameToken* frameToken;
globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationEnd, *frameToken);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eRenderSubmitStart, *frameToken);
}
func(This);
}
static inline REL::Relocation<decltype(thunk)> func;
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null pointer check for globals::streamline.

Similar to Main_Update_Begin, this needs defensive null checking.

 static void thunk(void* This)
 {
-    if (globals::streamline->featureReflex) {
+    if (globals::streamline && globals::streamline->featureReflex) {
         sl::FrameToken* frameToken;
         globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
         globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationEnd, *frameToken);
         globals::streamline->slReflexSetMarker(sl::ReflexMarker::eRenderSubmitStart, *frameToken);
     }
     func(This);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
struct Main_Update_Swap
{
static void thunk(void* This)
{
if (globals::streamline->featureReflex) {
sl::FrameToken* frameToken;
globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationEnd, *frameToken);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eRenderSubmitStart, *frameToken);
}
func(This);
}
static inline REL::Relocation<decltype(thunk)> func;
};
struct Main_Update_Swap
{
static void thunk(void* This)
{
if (globals::streamline && globals::streamline->featureReflex) {
sl::FrameToken* frameToken;
globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationEnd, *frameToken);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eRenderSubmitStart, *frameToken);
}
func(This);
}
static inline REL::Relocation<decltype(thunk)> func;
};
🤖 Prompt for AI Agents
In src/Hooks.cpp around lines 487 to 500, add a null pointer check for
globals::streamline before accessing its members in the thunk function of
Main_Update_Swap. This means verifying globals::streamline is not null before
calling slGetNewFrameToken and slReflexSetMarker to prevent potential crashes.
Wrap the existing code that uses globals::streamline inside an if statement that
checks for its validity.

Comment thread src/Hooks.cpp
Comment thread src/Hooks.cpp
Comment on lines +472 to +485
struct Main_Update_Begin
{
static void thunk(RE::PlayerCharacter* a_player)
{
if (globals::streamline->featureReflex) {
sl::FrameToken* frameToken;
globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eInputSample, *frameToken);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationStart, *frameToken);
}
func(a_player);
}
static inline REL::Relocation<decltype(thunk)> func;
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null pointer check for globals::streamline.

The thunk accesses globals::streamline without verifying it's valid.

 static void thunk(RE::PlayerCharacter* a_player)
 {
-    if (globals::streamline->featureReflex) {
+    if (globals::streamline && globals::streamline->featureReflex) {
         sl::FrameToken* frameToken;
         globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
         globals::streamline->slReflexSetMarker(sl::ReflexMarker::eInputSample, *frameToken);
         globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationStart, *frameToken);
     }
     func(a_player);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
struct Main_Update_Begin
{
static void thunk(RE::PlayerCharacter* a_player)
{
if (globals::streamline->featureReflex) {
sl::FrameToken* frameToken;
globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eInputSample, *frameToken);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationStart, *frameToken);
}
func(a_player);
}
static inline REL::Relocation<decltype(thunk)> func;
};
struct Main_Update_Begin
{
static void thunk(RE::PlayerCharacter* a_player)
{
if (globals::streamline && globals::streamline->featureReflex) {
sl::FrameToken* frameToken;
globals::streamline->slGetNewFrameToken(frameToken, &globals::state->frameCount);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eInputSample, *frameToken);
globals::streamline->slReflexSetMarker(sl::ReflexMarker::eSimulationStart, *frameToken);
}
func(a_player);
}
static inline REL::Relocation<decltype(thunk)> func;
};
🤖 Prompt for AI Agents
In src/Hooks.cpp around lines 472 to 485, the thunk function accesses
globals::streamline without checking if it is null, which can cause a crash. Add
a null pointer check before accessing globals::streamline to ensure it is valid.
Only proceed with the existing logic if globals::streamline is not null.

Comment on lines +177 to +186
#define FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_CAMERAINFO 0x0002000au
//Link this struct after ffxDispatchDescFrameGenerationPrepare. This is a required input to FSR3.1.4 and onwards for best quality.
struct ffxDispatchDescFrameGenerationPrepareCameraInfo
{
ffxConfigureDescHeader header;
float cameraPosition[3]; ///< The camera position in world space
float cameraUp[3]; ///< The camera up normalized vector in world space.
float cameraRight[3]; ///< The camera right normalized vector in world space.
float cameraForward[3]; ///< The camera forward normalized vector in world space.
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the header type usage.

The struct uses ffxConfigureDescHeader while being a dispatch descriptor type. This might be intentional for chaining, but please verify this is the correct header type.


🏁 Script executed:

#!/bin/bash
# Description: Check if other dispatch descriptor types use ffxConfigureDescHeader for chaining

# Search for other dispatch descriptor types and their header usage
ast-grep --pattern 'struct $STRUCT {
  $HEADER header;
  $$$
}' | grep -B1 -A1 "FFX_API_DISPATCH_DESC_TYPE"

Length of output: 107


I’ll check all dispatch descriptor definitions and inspect their header fields for consistency:


🏁 Script executed:

#!/bin/bash
# List all dispatch descriptor macros and the next line (struct name)
rg "#define FFX_API_DISPATCH_DESC_TYPE" -n -A1

echo "----"

# Show each dispatch descriptor struct definition and its first few lines to see which header type is used
rg "struct ffxDispatchDesc" -n include -A5

Length of output: 3375


Use ffxDispatchDescHeader for dispatch descriptors

The camera-info dispatch struct is the only FFX_API_DISPATCH_DESC_TYPE_* that uses ffxConfigureDescHeader—all other dispatch descriptors use ffxDispatchDescHeader. To keep the chaining consistent, update the header type:

• File: include/ffx_framegeneration.h
Lines: ~181
Change:

-    ffxConfigureDescHeader header;
+    ffxDispatchDescHeader  header;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#define FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_CAMERAINFO 0x0002000au
//Link this struct after ffxDispatchDescFrameGenerationPrepare. This is a required input to FSR3.1.4 and onwards for best quality.
struct ffxDispatchDescFrameGenerationPrepareCameraInfo
{
ffxConfigureDescHeader header;
float cameraPosition[3]; ///< The camera position in world space
float cameraUp[3]; ///< The camera up normalized vector in world space.
float cameraRight[3]; ///< The camera right normalized vector in world space.
float cameraForward[3]; ///< The camera forward normalized vector in world space.
};
#define FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_CAMERAINFO 0x0002000au
//Link this struct after ffxDispatchDescFrameGenerationPrepare. This is a required input to FSR3.1.4 and onwards for best quality.
struct ffxDispatchDescFrameGenerationPrepareCameraInfo
{
ffxDispatchDescHeader header;
float cameraPosition[3]; ///< The camera position in world space
float cameraUp[3]; ///< The camera up normalized vector in world space.
float cameraRight[3]; ///< The camera right normalized vector in world space.
float cameraForward[3]; ///< The camera forward normalized vector in world space.
};
🤖 Prompt for AI Agents
In include/ffx_framegeneration.h around lines 177 to 186, the struct
ffxDispatchDescFrameGenerationPrepareCameraInfo currently uses
ffxConfigureDescHeader as its header type, but all other dispatch descriptor
structs use ffxDispatchDescHeader for chaining consistency. Update the header
type in this struct from ffxConfigureDescHeader to ffxDispatchDescHeader to
align with the other dispatch descriptors.

coderabbitai Bot and others added 2 commits June 8, 2025 12:06
Docstrings generation was requested by @doodlum.

* #1125 (comment)

The following files were modified:

* `src/FidelityFX.cpp`
* `src/Hooks.cpp`
* `src/Streamline.cpp`
* `src/Streamline.h`
* `src/Upscaling.cpp`
* `src/Upscaling.h`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (7)
src/Upscaling.cpp (4)

795-799: Add error handling for virtual function detouring.

The stl::detour_vfunc calls could fail, but there's no error checking or fallback mechanism.


808-816: Add null pointer checks for global pointers.

The code accesses globals::game::perFrame and globals::upscaling without verifying they are valid.


823-828: Add null pointer checks for global pointers.

Similar to the Map thunk, this code needs defensive null checks.


835-840: Add data-pointer validation, size checks, and thread safety in CacheFramebuffer

Currently, CacheFramebuffer() unconditionally casts and dereferences mappedFrameBuffer->pData and updates shared members without synchronization. This can lead to UB if mapping failed or if the underlying buffer size doesn't match sizeof(FrameBuffer), and to data races if called from multiple threads.

src/Hooks.cpp (3)

237-249: Potential frame token mismatch with multiple slGetNewFrameToken calls.

The code calls slGetNewFrameToken here and also in Main_Update_Begin and Main_Update_Swap, which could lead to mismatched frame tokens for the same frame.


498-507: Add null pointer check for globals::streamline.

The thunk accesses globals::streamline without verifying it's valid.


518-527: Add null pointer check for globals::streamline.

Similar to Main_Update_Begin, this needs defensive null checking.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3402a8 and 858a727.

📒 Files selected for processing (6)
  • src/FidelityFX.cpp (2 hunks)
  • src/Hooks.cpp (7 hunks)
  • src/Streamline.cpp (4 hunks)
  • src/Streamline.h (1 hunks)
  • src/Upscaling.cpp (2 hunks)
  • src/Upscaling.h (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/FidelityFX.cpp
  • src/Upscaling.h
  • src/Streamline.h
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons

Comment thread src/Streamline.cpp
Comment on lines +212 to +213
auto viewMatrix = globals::upscaling->frameBufferCached.CameraViewInverse.Transpose();
auto cameraViewToClip = globals::upscaling->frameBufferCached.CameraProjUnjittered.Transpose();
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null pointer check for globals::upscaling.

The code accesses globals::upscaling->frameBufferCached without verifying that globals::upscaling is valid, which could lead to a crash if the upscaling module is not initialized.

-    auto viewMatrix = globals::upscaling->frameBufferCached.CameraViewInverse.Transpose();
-    auto cameraViewToClip = globals::upscaling->frameBufferCached.CameraProjUnjittered.Transpose();
+    if (!globals::upscaling) {
+        logger::error("[Streamline] Upscaling module not initialized");
+        return;
+    }
+    auto viewMatrix = globals::upscaling->frameBufferCached.CameraViewInverse.Transpose();
+    auto cameraViewToClip = globals::upscaling->frameBufferCached.CameraProjUnjittered.Transpose();

Also update line 220:

-    slConstants.cameraPos = *(sl::float3*)&globals::upscaling->frameBufferCached.CameraPosAdjust;
+    slConstants.cameraPos = *(sl::float3*)&globals::upscaling->frameBufferCached.CameraPosAdjust;

Also applies to: 220-220

🤖 Prompt for AI Agents
In src/Streamline.cpp around lines 212 to 213 and line 220, add a null pointer
check for globals::upscaling before accessing its members. Verify that
globals::upscaling is not null to prevent potential crashes if the upscaling
module is uninitialized. Wrap the existing code that uses
globals::upscaling->frameBufferCached with an if statement checking for its
validity.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doodlum are we sure it won't be null?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2025

✅ A pre-release build is available for this PR:
Download

3 similar comments
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2025

✅ A pre-release build is available for this PR:
Download

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2025

✅ A pre-release build is available for this PR:
Download

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2025

✅ A pre-release build is available for this PR:
Download

Comment thread src/Streamline.cpp
}
}

/**
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I'd keep the docstrings in the .h.

Comment thread src/Upscaling.h

void InstallD3DHooks(ID3D11DeviceContext* a_context);

struct FrameBuffer
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this structure flat only?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@alandtse
Copy link
Copy Markdown
Collaborator

alandtse commented Jun 8, 2025

I'm going to approve this since my comments aren't blocking.

@doodlum doodlum merged commit 07ba81a into dev Jun 9, 2025
9 checks passed
davo0411 pushed a commit to davo0411/skyrim-community-shaders that referenced this pull request Jun 21, 2025
…haders#1125)

* feat(frame generation): update to latest FSR

* fix: errors

* fix: use correct streamline frame markers

* style: 🎨 apply pre-commit.ci formatting

Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.

* docs: add docstrings to fg-updates (community-shaders#1126)

Docstrings generation was requested by @doodlum.

* community-shaders#1125 (comment)

The following files were modified:

* `src/FidelityFX.cpp`
* `src/Hooks.cpp`
* `src/Streamline.cpp`
* `src/Streamline.h`
* `src/Upscaling.cpp`
* `src/Upscaling.h`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: remove statics

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
alandtse pushed a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
…haders#1125)

* feat(frame generation): update to latest FSR

* fix: errors

* fix: use correct streamline frame markers

* style: 🎨 apply pre-commit.ci formatting

Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.

* docs: add docstrings to fg-updates (community-shaders#1126)

Docstrings generation was requested by @doodlum.

* community-shaders#1125 (comment)

The following files were modified:

* `src/FidelityFX.cpp`
* `src/Hooks.cpp`
* `src/Streamline.cpp`
* `src/Streamline.h`
* `src/Upscaling.cpp`
* `src/Upscaling.h`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: remove statics

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants