Skip to content

Commit

Permalink
- core shader override block, backported from GZDoom.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Sep 12, 2021
1 parent 61bc909 commit 585f841
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions source/common/objects/dobjgc.h
Expand Up @@ -175,7 +175,7 @@ class TObjPtr
TObjPtr() = default;
TObjPtr(const TObjPtr<T> &q) = default;

TObjPtr(T q) throw()
TObjPtr(T q) noexcept
: pp(q)
{
}
Expand Down Expand Up @@ -207,35 +207,35 @@ class TObjPtr
return *this;
}

T Get() throw()
T Get() noexcept
{
return GC::ReadBarrier(pp);
}

T ForceGet() throw() //for situations where the read barrier needs to be skipped.
T ForceGet() noexcept //for situations where the read barrier needs to be skipped.
{
return pp;
}

operator T() throw()
operator T() noexcept
{
return GC::ReadBarrier(pp);
}
T &operator*()
T &operator*() noexcept
{
T q = GC::ReadBarrier(pp);
assert(q != NULL);
return *q;
}
T operator->() throw()
T operator->() noexcept
{
return GC::ReadBarrier(pp);
}
bool operator!=(T u) throw()
bool operator!=(T u) noexcept
{
return GC::ReadBarrier(o) != u;
}
bool operator==(T u) throw()
bool operator==(T u) noexcept
{
return GC::ReadBarrier(o) == u;
}
Expand Down
3 changes: 2 additions & 1 deletion source/common/rendering/gl/gl_shader.cpp
Expand Up @@ -404,7 +404,8 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *

if (*proc_prog_lump != '#')
{
int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump);
int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump, 0); // if it's a core shader, ignore overrides by user mods.
if (pp_lump == -1) pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump);
if (pp_lump == -1) I_Error("Unable to load '%s'", proc_prog_lump);
FileData pp_data = fileSystem.ReadFile(pp_lump);

Expand Down
3 changes: 2 additions & 1 deletion source/common/rendering/vulkan/shaders/vk_shader.cpp
Expand Up @@ -386,7 +386,8 @@ FString VkShaderManager::GetTargetGlslVersion()

FString VkShaderManager::LoadPublicShaderLump(const char *lumpname)
{
int lump = fileSystem.CheckNumForFullName(lumpname);
int lump = fileSystem.CheckNumForFullName(lumpname, 0);
if (lump == -1) lump = fileSystem.CheckNumForFullName(lumpname);
if (lump == -1) I_Error("Unable to load '%s'", lumpname);
FileData data = fileSystem.ReadFile(lump);
return data.GetString();
Expand Down

0 comments on commit 585f841

Please sign in to comment.