YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
11 stars 4 forks source link

[GPU Texture compression] Game crash when loading texture with "separate texture page" checked on sprite. #5775

Open cla8194 opened 1 week ago

cla8194 commented 1 week ago

Description

The new extension for GPU texture compression is causing a crash whenever a texture needs to be loaded and have the checkbox "separate texture page" selected. (tested only on windows)

I attached a video showing the problem on a new project: https://github.com/YoYoGames/GameMaker-Bugs/assets/12926581/81215e56-fadd-4856-b32d-8ccf15410800

35d47c394533096e57f88e6ddfecf364

Expected Change

Being able to have separate texture page enabled on textures while using the benefit of GPU texture compression

Steps To Reproduce

  1. Start GameMaker and add the new TextureEncode extension
  2. Create a new sprite and a new object with that sprite, place the object into the first room
  3. Create a new texture group with that sprite in, set the format to "custom" and the custom options to "BCN -u4"
  4. Launch the game with and without the "separate texture page" option checked on the sprite, the game crashes when the checkbox is selected

Example project (showed in the video): gpu_tex_importer_crash.zip

Contact us package: gpu_tex_crash.zip

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.4.0 (Monthly)

Which operating system(s) are you seeing the problem on?

Windows 10

Which platform(s) are you having trouble building this project for?

Windows

Are you running GameMaker from inside your Steam library?

No

Contact Us Package Attached?

Sample Project Added?

JonnoRobson commented 1 week ago

This issue is caused by the dimensions of the sprite with "separate texture page" enabled. Currently a crash will occur if separate texture page is enabled on a sprite whose width and height are not divisible by the block size of the texture compression format being used. In the case of BCN/GNF the block size is always fixed to 4 in both dimensions, for ASTC the block size is specified by the user in the custom options field.

Ideally GameMaker should pad sprites that use a separate texture page so their dimensions are compatible with the block size of the compression format being used. In the meantime one workaround is to resize any sprites using both GPU texture compression and a separate texture page so that the dimensions are divisible by the block size of the compression format. I tested this in the attached example project and resizing the sprite dimensions from 200x143 to 200x144 resolved the crash for me.

cla8194 commented 1 week ago

I resized all the sprites in my main project and can confirm it's working now, thank you! If a fix it's not coming in the near future I suggest adding this as a note in the manual though.