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

improvements to wayland testing #1357

Open
wants to merge 78 commits into
base: VasanthBalguri-wayland-testing
Choose a base branch
from

Conversation

dardok
Copy link

@dardok dardok commented Jan 6, 2025

Description

General improvements to the wayland testing branch, including fullscreen support, native connection/surface reuse, device sharing.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • vsgviewer --fs --display eDP-1 ...
  • vsgwindows (with and without --no-shared-window) ...

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

jamierobertson1 and others added 30 commits December 13, 2024 11:19
In the PolytopeInterctor constructor with screen coordinates, the eyespace polytope should have been placed in the polytope stack before the worldspace polytope (as per LineSegmentIntersector constructor).

The omission meant that intersections were not calculated properly for nodes under transforms.
Otherwise some compilation units may use the definitions of inline glslang functions from the Vulkan SDK's copy of glslang instead of the glslang we're using, and if the necessary linker warnings aren't enabled and set as errors (they're not), this can cause ABI issues.

I noticed this after encountering stack corruption in glslang::GlslangToSpv as the Vulkan SDK version 1.3.296 provides glslang 15.0.0, where glslang::SpvOptions is ten bytes, whereas I was using glslang 14.3.0, where it's only nine bytes, so initialising defaultOptions would spill one byte past the object's end.
Fixing the include order ensures all TUs use the right function implementation and the linker won't randomly pick the wrong one.
We unconditionally use binary mode when reading them as we use the header to differentiate between a .vsgt and a .vsgb, and can't read the header without opening the stream first.

If the stream mode is mismatched, then this can cause problems.

On Unix, there are no symptoms as the only difference is whether a trailing line feed will be inserted if the file is closed and doesn't end with one - some Unices treat all files that don't end in a line feed as binary - and `AsciiOutput::write` adds one after the closing `}` anyway.

On Windows, it causes a bigger problem as automatic line ending conversion only happens in text mode - binary streams read and write carriage returns and line feeds as-is, but text streams convert a CRLF sequence to just the line feed when reading and convert a lone line feed to a CRLF sequence when writing.

Because of this, when reading a multiline string in a .vsgt file, like a shader listing, on Windows, the CRLF in the file would be read into memory as-is, but if the same object was written back, then the CR would be written, and then the LF would be written as CRLF, leaving CRCRLF in the file.
As well as being generally gross, most software for Windows attempts to accommodate files with weird line endings, so will interpret this as a 90s Mac line ending followed by a Windows line ending, and display it as two line breaks.

The alternative would be to conditionally enable binary mode after reading the header, but that would mean the stream would need to be closed and reopened, then the header skipped, which would be a nuisance.
Developers writing software for Windows are generally ready to deal with explicit carriage returns in strings, so it's fine to load them.
Also, this approach is consistent with the text and glsl loaders.
Older files don't have the new field, and loading them will make it yell at you.
robertosfield and others added 30 commits January 20, 2025 11:13
…xture(const std::string& name, const ImageInfoList& imageInfoList, uint32_t dstArrayElement)
Implemented sRGB support in ShaderSets and default format for colour framebuffer
Added extra controls and convinience functions related to ColorSpace work.
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.

4 participants