fix shader for Apple devices
This commit is contained in:
@@ -259,7 +259,7 @@ void RTT::clear_mask(glm::bool4 mask, glm::vec4 color)
|
||||
{
|
||||
// save old state
|
||||
std::array<GLboolean, 4> old_mask;
|
||||
glGetBooleanv(GL_COLOR_WRITEMASK, std::data(old_mask));
|
||||
glGetBooleanv(GL_COLOR_WRITEMASK, old_mask.data());
|
||||
|
||||
// clear with mask
|
||||
glColorMask(mask.r, mask.g, mask.b, mask.a);
|
||||
|
||||
@@ -15,7 +15,8 @@ std::string Shader::read(const std::string& path)
|
||||
if (a.open(path.c_str()))
|
||||
{
|
||||
struct stat tmp_info;
|
||||
if (stat(path.c_str(), &tmp_info) == 0)
|
||||
std::string abs_path = Asset::absolute(path);
|
||||
if (stat(abs_path.c_str(), &tmp_info) == 0)
|
||||
m_deps[path] = tmp_info;
|
||||
|
||||
std::regex reg_include(R"!(#include "([^"]+)")!");
|
||||
@@ -133,7 +134,8 @@ bool Shader::reload()
|
||||
struct stat tmp_info;
|
||||
for (auto& d : m_deps)
|
||||
{
|
||||
if (stat(d.first.c_str(), &tmp_info) != 0)
|
||||
std::string abs_path = Asset::absolute(d.first);
|
||||
if (stat(abs_path.c_str(), &tmp_info) != 0)
|
||||
continue;
|
||||
if (tmp_info.st_mtime > d.second.st_mtime)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user