mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-13 11:30:44 +00:00
- core shader override block, backported from GZDoom.
This commit is contained in:
parent
61bc90949b
commit
585f841f96
3 changed files with 12 additions and 10 deletions
|
@ -175,7 +175,7 @@ public:
|
||||||
TObjPtr() = default;
|
TObjPtr() = default;
|
||||||
TObjPtr(const TObjPtr<T> &q) = default;
|
TObjPtr(const TObjPtr<T> &q) = default;
|
||||||
|
|
||||||
TObjPtr(T q) throw()
|
TObjPtr(T q) noexcept
|
||||||
: pp(q)
|
: pp(q)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -207,35 +207,35 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
T Get() throw()
|
T Get() noexcept
|
||||||
{
|
{
|
||||||
return GC::ReadBarrier(pp);
|
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;
|
return pp;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator T() throw()
|
operator T() noexcept
|
||||||
{
|
{
|
||||||
return GC::ReadBarrier(pp);
|
return GC::ReadBarrier(pp);
|
||||||
}
|
}
|
||||||
T &operator*()
|
T &operator*() noexcept
|
||||||
{
|
{
|
||||||
T q = GC::ReadBarrier(pp);
|
T q = GC::ReadBarrier(pp);
|
||||||
assert(q != NULL);
|
assert(q != NULL);
|
||||||
return *q;
|
return *q;
|
||||||
}
|
}
|
||||||
T operator->() throw()
|
T operator->() noexcept
|
||||||
{
|
{
|
||||||
return GC::ReadBarrier(pp);
|
return GC::ReadBarrier(pp);
|
||||||
}
|
}
|
||||||
bool operator!=(T u) throw()
|
bool operator!=(T u) noexcept
|
||||||
{
|
{
|
||||||
return GC::ReadBarrier(o) != u;
|
return GC::ReadBarrier(o) != u;
|
||||||
}
|
}
|
||||||
bool operator==(T u) throw()
|
bool operator==(T u) noexcept
|
||||||
{
|
{
|
||||||
return GC::ReadBarrier(o) == u;
|
return GC::ReadBarrier(o) == u;
|
||||||
}
|
}
|
||||||
|
|
|
@ -404,7 +404,8 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
||||||
|
|
||||||
if (*proc_prog_lump != '#')
|
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);
|
if (pp_lump == -1) I_Error("Unable to load '%s'", proc_prog_lump);
|
||||||
FileData pp_data = fileSystem.ReadFile(pp_lump);
|
FileData pp_data = fileSystem.ReadFile(pp_lump);
|
||||||
|
|
||||||
|
|
|
@ -386,7 +386,8 @@ FString VkShaderManager::GetTargetGlslVersion()
|
||||||
|
|
||||||
FString VkShaderManager::LoadPublicShaderLump(const char *lumpname)
|
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);
|
if (lump == -1) I_Error("Unable to load '%s'", lumpname);
|
||||||
FileData data = fileSystem.ReadFile(lump);
|
FileData data = fileSystem.ReadFile(lump);
|
||||||
return data.GetString();
|
return data.GetString();
|
||||||
|
|
Loading…
Reference in a new issue