REVIEWED: UnloadShader() issue
Avoid unloading default shader, raylib will take care of it
This commit is contained in:
parent
b870b9f828
commit
cbdb9bfe42
1 changed files with 3 additions and 3 deletions
|
@ -3161,13 +3161,13 @@ Shader LoadShaderCode(const char *vsCode, const char *fsCode)
|
|||
// Unload shader from GPU memory (VRAM)
|
||||
void UnloadShader(Shader shader)
|
||||
{
|
||||
if (shader.id > 0)
|
||||
if ((shader.id != RLGL.State.defaultShader.id) && (shader.id > 0))
|
||||
{
|
||||
rlDeleteShader(shader.id);
|
||||
RL_FREE(shader.locs);
|
||||
|
||||
TRACELOG(LOG_INFO, "SHADER: [ID %i] Unloaded shader program data from VRAM (GPU)", shader.id);
|
||||
}
|
||||
|
||||
RL_FREE(shader.locs);
|
||||
}
|
||||
|
||||
// Begin custom shader mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue