Skip to content

Commit

Permalink
xrRender/ShaderResourceTraits.h: removed excessive string duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Sep 30, 2018
1 parent be54d04 commit bba8744
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Layers/xrRender/ShaderResourceTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,18 +394,12 @@ inline T* CResourceManager::CreateShader(const char* name, const char* filename
}
R_ASSERT3(file, "Shader file doesnt exist:", cname);

// Duplicate and zero-terminate
const auto size = file->length();
char* const data = (LPSTR)_alloca(size + 1);
CopyMemory(data, file->pointer(), size);
data[size] = 0;

// Select target
LPCSTR c_target = ShaderTypeTraits<T>::GetCompilationTarget();
LPCSTR c_entry = "main";

if (searchForEntryAndTarget)
ShaderTypeTraits<T>::GetCompilationTarget(c_target, c_entry, data);
ShaderTypeTraits<T>::GetCompilationTarget(c_target, c_entry, static_cast<pcstr>(file->pointer()));

#ifdef USE_OGL
DWORD flags = NULL;
Expand Down

0 comments on commit bba8744

Please sign in to comment.