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

OpenGL error 1281 or 1282 #32

Open
Pathoschild opened this issue Aug 6, 2021 · 1 comment
Open

OpenGL error 1281 or 1282 #32

Pathoschild opened this issue Aug 6, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Pathoschild
Copy link
Collaborator

Pathoschild commented Aug 6, 2021

Some users report MonoGameGLException: GL.GetError() returned 1281 or 1282 errors when mods edit textures. This is relatively rare but there's no known fix, so this ticket tracks the known info,

Sample error

[Content Patcher] Unhandled exception applying patch: Trypophobia > EditImage Maps\fall_beach #1.
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned 1281
   at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError()
   at Microsoft.Xna.Framework.Graphics.Texture2D.<PlatformSetData>c__AnonStorey1`1.<>m__0()
   at Microsoft.Xna.Framework.Threading.BlockOnUIThread(Action action)
   at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[T](Int32 level, Int32 arraySlice, Nullable`1 rect, T[] data, Int32 startIndex, Int32 elementCount)
   at StardewModdingAPI.Framework.Content.AssetDataForImage.PatchImage_PatchedBy<Platonymous.PyTK>(Object source, Texture2D sourceArea, Nullable`1 targetArea, Nullable`1 patchMode, PatchMode )
   at ContentPatcher.Framework.Patches.EditImagePatch.Edit[T](IAssetData asset) in C:\source\_Stardew\Mods.Pathoschild\Common\Items\ItemRepository.cs:line 291
   at ContentPatcher.Framework.PatchManager.Edit[T](IAssetData asset) in C:\source\_Stardew\Mods.Pathoschild\ContentPatcher\Framework\Tokens\ValueProviders\ManualValueProvider.cs:line 61

OpenGL error descriptions for 1281 (0x0501) and 1282 (0x0502):

GL_INVALID_VALUE, 0x0501
Given when a value parameter is not a legal value for that function. This is only given for local problems; if the spec allows the value in certain circumstances, where other parameters or state dictate those circumstances, then GL_INVALID_OPERATION is the result instead.

GL_INVALID_OPERATION, 0x0502
Given when the set of state for a command is not legal for the parameters given to that command. It is also given for commands where combinations of parameters define what the legal parameters are.

Known patterns

Error 1281

  • Most players never see this error.
  • Affected users generally see the error every time they play, but it can affect different mods or textures each time.
  • Affected textures are shown as black blocks in-game.
  • This portion of the stack trace seems to be consistent for all such errors:
    at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError()
    at Microsoft.Xna.Framework.Graphics.Texture2D.<PlatformSetData>c__AnonStorey1`1.<>m__0()
    at Microsoft.Xna.Framework.Threading.BlockOnUIThread(Action action)
    at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[T](Int32 level, Int32 arraySlice, Nullable`1 rect, T[] data, Int32 startIndex, Int32 elementCount)
    at StardewModdingAPI.Framework.Content.AssetDataForImage.PatchImage_PatchedBy<Platonymous.PyTK>(Object source, Texture2D sourceArea, Nullable`1 targetArea, Nullable`1 patchMode, PatchMode )
    

Error 1282

This is possibly related to 1281, but not enough reports yet to see patterns.

Known affected users

Error 1281

user log Win SMAPI patcher notes
Fri 2021-08-06
marry481
log 10 3.12.2 1.1.8 Affects Content Patcher. Has PyTK.
Thu 2021-07-29
acearohippo (Saelym) on Discord
A, B 10 3.11.0 1.1.8 Affects Content Patcher, Lunar Disturbances, Walk of Life. Has PyTK.
Mon 2021-06-21
Nari on Discord
n/a ? ? ? Attempted fixes: updated graphics drivers.
Tue 2021-05-04
Zilch on Discord
n/a ? ? ?

Error 1282

user log Win SMAPI patcher notes
Sun 2021-08-08
PurrplingCat on Discord
log 10 3.12.2 1.1.8 Affects NPC Adventures.
Thu 2021-06-17
Wingheart on Discord
n/a ? ? ? Affects SpriteMaster.
@Pathoschild Pathoschild added the bug Something isn't working label Aug 6, 2021
@steviegt6
Copy link
Owner

It'd be valuable to get information on system hardware, especially given that this remains seemingly consistent for all affected users.

@Pathoschild Pathoschild changed the title OpenGL error 1281 OpenGL error 1281 or 1282 Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants