Skip to content
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

libobs-d3d11: Allow for arbitrary marker name lengths #11328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Xaymar
Copy link
Contributor

@Xaymar Xaymar commented Sep 30, 2024

Description

Allows using arbitrary marker name lengths with libobs-d3d11.

Motivation and Context

When gs_debug_marker_begin is provided with a utf8 string that happens to exceeds 64 wchar_t's, the debug marker would have no name at all.

How Has This Been Tested?

I've compiled and tested this on Windows 10 22H2 with Microsoft Visual Studio 2022 (C++) on the 30.2.3 tag, as master is not buildable locally due to over 600 "already defined in" errors from Qt MOC files. Dunno what's causing them, tried a completely clean clone and it still happens.

I was unable to measure any noticable performance impact with stock plugins, not even with #define GS_USE_DEBUG_MARKERS 1. The expected behavior of being able to use arbitrarily long marker names also worked just fine, with the longest tested being just around 4k characters long.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate. I think i did it correctly?
  • I have included updates to all appropriate documentation.

By using _malloca to allocate memory on the stack, we can allow for
marker names well in excess of 63 wide characters like before. In
testing this had no measurable negative performance impact, which
should mean that it is working as intended.

This will fall back to the old behavior if /EH is completely disabled.
@WizardCM WizardCM added the Enhancement Improvement to existing functionality label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants