-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
Fix missing Utilities.CopyMemory for other graphics APIs #1697
Conversation
* Also some minor cleanup
* Also some minor cleanup
* Also some minor cleanup
Em...Is it a duplicate of my PR #1690 ? |
From a quick overview... yes, it seems so. |
No worries 👌, I'll name my PR more precisely next time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a couple of nice changes, but a ton of unnecessary stylistic changes in there, please refrain from auto formatting files - think of us poor maintainer, we don't want to dig in looking for the actual changes to logic between all of those stylistic ones.
@Jklawreszuk does @Ethereal77's PR cover yours in its entirety ? |
@Eideren After quick look into @Ethereal77 PR and the only difference I can see his PR has some refactoring. Plus I've also replaced Utilities.ClearMemory method with dotnet alternative, because that also causes compilation errors |
Okay, thanks @Jklawreszuk . Could you take care of this @Ethereal77 ? If not that's fine too, I'll do it after I merge yours in. |
Sorry about stylistic changes. Force of habit and also auto-formatting enabled :( |
@Eideren Of course, but... What specifically are you asking me to do? |
Looking at Jklawreszuk's PR I'm pretty sure he's talking about this stuff: |
Ok, I'll check that out and also I'll search all Stride for uses of |
* Also remove some helper methods that copied memory in favor of new built-in ones
@Ethereal77 is this PR ready for merge ? |
While it does build, vulkan is broken on my end. Launching a game with Vulkan as the graphics API spawns a blank fully white window and closes after a second or so.
There's no callstack or anything else in the console. Vulkan does build and run properly on the main branch if we add back the |
Ok. I'll check that out. You mean launching a game with |
Yeah, after building the engine with |
I've compiled Stride as you say for all the supported graphics APIs. Then I've created a new simple game (as DX runs fine), I've set it to use Vulkan, and executed it.
It can't find the file |
@Ethereal77 add |
@Eideren Can you check if it says the same for you? Just run the project from the command line to see what exception (if any) it prints |
I see what you mean. Now it starts compiling the fragment and vertex shaders, and later exits just saying:
|
I think your best bet to debug this is to use the previous |
This btw brings a question. I haven't checked but, is there a way in place to run the graphics tests for all supported graphics APIs? |
Ok. I've tracked it down to a stupid mistake I made when reading the shader bytecode 🤦. I'll make another commit with the fix. By the way, I think instead of removing |
Nice ! |
Yeah, but that overload needs anyway that you construct a new |
Right, we don't have a static method that just takes in a stride/sources/core/Stride.Core/Serialization/SerializerExtensions.cs Lines 92 to 100 in 6d20024
Though this stuff is used very occasionally during a game session so it is unlikely to have any significant impact when playing. |
Oh, I know. Maybe a thing to look at a later time. |
Yep, works great now, thanks @Ethereal77 ! |
PR Details
When building the runtime, the other graphics APIs that are not Direct3D 11 (OpenGL, Vulkan, Direct3D 12) results in errors stating that
Utilities.CopyMemory()
andBinarySerialization.Read()
don't exist.A previous PR replaced several many interop and IL weaved methods with the use of
ref
s,Span<T>
, andUnsafe
calls, but several of those for the other graphics APIs were not replaced.This PR completes the replacement and fixes those errors when building
Stride.Runtime.sln
.Description
Utilities.CopyMemory()
withUnsafe.CopyBlockUnaligned()
.BinarySerialization.Read()
withUnsafe.Read()
.Stride.props
where users can set the design-time graphics API to override the default one with so the proper#define
s are set, Visual Studio can know what packages to restore, and IntelliSense can show the correct completions. This section is commented by default, but it's useful when working or modifying a specific graphics API.Related Issue
This PR continues the work of ericwj's PR #1469.
The original issue that motivated that PR was #1461.
Types of changes
Checklist
TODO