소스 검색

REVIEWED: UnloadShader() issue

Avoid unloading default shader, raylib will take care of it
pull/1381/head
raysan5 5 년 전
부모
커밋
cbdb9bfe42
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. +3
    -3
      src/rlgl.h

+ 3
- 3
src/rlgl.h 파일 보기

@ -3161,13 +3161,13 @@ Shader LoadShaderCode(const char *vsCode, const char *fsCode)
// Unload shader from GPU memory (VRAM) // Unload shader from GPU memory (VRAM)
void UnloadShader(Shader shader) void UnloadShader(Shader shader)
{ {
if (shader.id > 0)
if (p">(shader.id != RLGL.State.defaultShader.id) && (shader.id > 0))
{ {
rlDeleteShader(shader.id); rlDeleteShader(shader.id);
RL_FREE(shader.locs);
TRACELOG(LOG_INFO, "SHADER: [ID %i] Unloaded shader program data from VRAM (GPU)", shader.id); TRACELOG(LOG_INFO, "SHADER: [ID %i] Unloaded shader program data from VRAM (GPU)", shader.id);
} }
RL_FREE(shader.locs);
} }
// Begin custom shader mode // Begin custom shader mode

불러오는 중...
취소
저장