Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/engine/renderer/gl_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ void GLShaderManager::InitDriverInfo()
{
std::string driverInfo = std::string(glConfig.renderer_string) + glConfig.version_string;
_driverVersionHash = Com_BlockChecksum(driverInfo.c_str(), static_cast<int>(driverInfo.size()));
_shaderBinaryCacheInvalidated = false;
}

void GLShaderManager::GenerateBuiltinHeaders() {
Expand Down Expand Up @@ -1416,10 +1415,6 @@ bool GLShaderManager::LoadShaderBinary( const std::vector<ShaderEntry>& shaders,
return false;
}

if ( _shaderBinaryCacheInvalidated ) {
return false;
}

const int start = Sys::Milliseconds();

std::error_code err;
Expand Down Expand Up @@ -1459,14 +1454,7 @@ bool GLShaderManager::LoadShaderBinary( const std::vector<ShaderEntry>& shaders,

/* Check if the header struct is the correct format
and the binary was produced by the same GL driver */
if ( shaderHeader.version != GL_SHADER_VERSION /* || shaderHeader.driverVersionHash != _driverVersionHash */ ) {
/* These two fields should be the same for all shaders. So if there is a mismatch,
don't bother opening any of the remaining files.
I've disabled the cache invalidation on driver version change, because we now also cache shader programs that use
non-empty deformVertexes. This would mean that after updating the driver, any time you load a new map with
deformVertexes, it would cause the rebuild of *all* shaders */
Log::Notice( "Invalidating shader binary cache" );
_shaderBinaryCacheInvalidated = true;
if ( shaderHeader.version != GL_SHADER_VERSION || shaderHeader.driverVersionHash != _driverVersionHash ) {
return false;
}

Expand Down
1 change: 0 additions & 1 deletion src/engine/renderer/gl_shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ class GLShaderManager {
std::unordered_map<std::string, int> _deformShaderLookup;

unsigned int _driverVersionHash; // For cache invalidation if hardware changes
bool _shaderBinaryCacheInvalidated;

public:
GLHeader GLVersionDeclaration;
Expand Down