Skip to content

Conversation

Jklawreszuk
Copy link
Collaborator

PR Details

This PR fixes incorrect buffer clearing for OpenGL when mapping a resource. It turns out that IntPtr.Zero was treated as some kind of value while this was not the author's intention. I also did a small refactoring

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Jklawreszuk
Copy link
Collaborator Author

I ping @MeharDT, because I think you'll be interested in a fix

@@ -930,29 +929,21 @@ public unsafe MappedResource MapSubresource(GraphicsResource resource, int subRe

GL.BindBuffer(buffer.BufferTarget, buffer.BufferId);

#if !STRIDE_GRAPHICS_API_OPENGLES
//if (mapMode != MapMode.WriteDiscard && mapMode != MapMode.WriteNoOverwrite)
Copy link
Collaborator Author

@Jklawreszuk Jklawreszuk Oct 24, 2024

Choose a reason for hiding this comment

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

I don't quite know what this code does but it seems to be possible to get rid of it since it hasn't been used since Paradox Engine

@Eideren Eideren merged commit d744a42 into stride3d:master Oct 27, 2024
6 checks passed
@Eideren
Copy link
Collaborator

Eideren commented Oct 27, 2024

Thanks !

@Jklawreszuk Jklawreszuk deleted the bufferdata-fix branch October 28, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants