Permalink
Browse files

GLES: Log shader cache filesize error better.

  • Loading branch information...
unknownbrackets committed Dec 2, 2017
1 parent 9c52155 commit 681ce953ecbb7b4fc9ab17ef3b7b96312850e438
Showing with 1 addition and 5 deletions.
  1. +1 −5 GPU/GLES/ShaderManagerGLES.cpp
@@ -983,14 +983,13 @@ void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) {
expectedSize += header.numFragmentShaders * sizeof(FShaderID);
expectedSize += header.numLinkedPrograms * (sizeof(VShaderID) + sizeof(FShaderID));
if (sz != expectedSize) {
ERROR_LOG(G3D, "Shader cache file is too large, aborting.");
ERROR_LOG(G3D, "Shader cache file is wrong size: %lld instead of %lld", sz, expectedSize);
return;
}
for (int i = 0; i < header.numVertexShaders; i++) {
VShaderID id;
if (!f.ReadArray(&id, 1)) {
ERROR_LOG(G3D, "Truncated shader cache file, aborting.");
return;
}
if (!vsCache_.Get(id)) {
@@ -1016,7 +1015,6 @@ void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) {
for (int i = 0; i < header.numFragmentShaders; i++) {
FShaderID id;
if (!f.ReadArray(&id, 1)) {
ERROR_LOG(G3D, "Truncated shader cache file, aborting.");
return;
}
if (!fsCache_.Get(id)) {
@@ -1029,11 +1027,9 @@ void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) {
VShaderID vsid;
FShaderID fsid;
if (!f.ReadArray(&vsid, 1)) {
ERROR_LOG(G3D, "Truncated shader cache file, aborting.");
return;
}
if (!f.ReadArray(&fsid, 1)) {
ERROR_LOG(G3D, "Truncated shader cache file, aborting.");
return;
}
Shader *vs = vsCache_.Get(vsid);

0 comments on commit 681ce95

Please sign in to comment.