-
-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
D3D11: Fix crash when re-preparing a HLSL program
Resource::unload(void) calls either unprepareImpl() or unloadImpl () depending on the 'old' load state of a shader program. if (old==LOADSTATE_PREPARED) { unprepareImpl(); else unloadImpl(); If you compile the source code via prepare() and it's state=LOADSTATE_PREPARED the old cleanup would only delete the allocated strings. The other vector based buffers were never actually cleaned out so they hold pointers to invalid/freed memory. If you re-prepare() the program the vector data is in a bad state and you get the crash.
- Loading branch information
Showing
2 changed files
with
46 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters