Commit c78704fe authored by Johannes Braun's avatar Johannes Braun
Browse files

Removed several unnecessary errors and debug messages

parent 4b44a955
...@@ -9,7 +9,7 @@ Size=302,900 ...@@ -9,7 +9,7 @@ Size=302,900
Collapsed=0 Collapsed=0
[Settings] [Settings]
Pos=1145,1 Pos=946,3
Size=295,531 Size=295,531
Collapsed=0 Collapsed=0
...@@ -19,7 +19,7 @@ Size=172,86 ...@@ -19,7 +19,7 @@ Size=172,86
Collapsed=0 Collapsed=0
[System] [System]
Pos=1145,532 Pos=942,504
Size=295,368 Size=295,368
Collapsed=0 Collapsed=0
......
...@@ -12,26 +12,29 @@ namespace glare::core ...@@ -12,26 +12,29 @@ namespace glare::core
return m_latest_parameters; return m_latest_parameters;
} }
void Texture::apply(Parameters parameters) void Texture::apply(Parameters parameters, bool multisample)
{ {
m_latest_parameters = std::move(parameters); m_latest_parameters = std::move(parameters);
gl::textureParameter(m_handle, gl::TextureParameter::eBaseLevel, m_latest_parameters.base_level); gl::textureParameter(m_handle, gl::TextureParameter::eBaseLevel, m_latest_parameters.base_level);
gl::textureParameter(m_handle, gl::TextureParameter::eMaxLevel, m_latest_parameters.max_level); gl::textureParameter(m_handle, gl::TextureParameter::eMaxLevel, m_latest_parameters.max_level);
float anisotropy = m_latest_parameters.anisotropy; if (!multisample)
if (anisotropy == -1.f) gl::getFloatv(gl::GetParameter::eMaxTextureMaxAnisotropy, &anisotropy); {
gl::textureParameter(m_handle, gl::TextureParameter::eMaxAnisotropy, anisotropy); float anisotropy = m_latest_parameters.anisotropy;
if (anisotropy == -1.f) gl::getFloatv(gl::GetParameter::eMaxTextureMaxAnisotropy, &anisotropy);
gl::textureParameter(m_handle, gl::TextureParameter::eWrapR, m_latest_parameters.wrap_r); gl::textureParameter(m_handle, gl::TextureParameter::eMaxAnisotropy, anisotropy);
gl::textureParameter(m_handle, gl::TextureParameter::eWrapS, m_latest_parameters.wrap_s);
gl::textureParameter(m_handle, gl::TextureParameter::eWrapT, m_latest_parameters.wrap_t); gl::textureParameter(m_handle, gl::TextureParameter::eWrapR, m_latest_parameters.wrap_r);
gl::textureParameter(m_handle, gl::TextureParameter::eMagFilter, m_latest_parameters.filter_mag); gl::textureParameter(m_handle, gl::TextureParameter::eWrapS, m_latest_parameters.wrap_s);
gl::textureParameter(m_handle, gl::TextureParameter::eMinFilter, m_latest_parameters.filter_min); gl::textureParameter(m_handle, gl::TextureParameter::eWrapT, m_latest_parameters.wrap_t);
gl::textureParameter(m_handle, gl::TextureParameter::eCompareMode, m_latest_parameters.compare_mode); gl::textureParameter(m_handle, gl::TextureParameter::eMagFilter, m_latest_parameters.filter_mag);
gl::textureParameter(m_handle, gl::TextureParameter::eCompareFunc, m_latest_parameters.compare_func); gl::textureParameter(m_handle, gl::TextureParameter::eMinFilter, m_latest_parameters.filter_min);
gl::textureParameter(m_handle, gl::TextureParameter::eCompareMode, m_latest_parameters.compare_mode);
gl::generateTextureMipmap(m_handle); gl::textureParameter(m_handle, gl::TextureParameter::eCompareFunc, m_latest_parameters.compare_func);
gl::generateTextureMipmap(m_handle);
}
} }
unsigned Texture::id() const unsigned Texture::id() const
......
...@@ -152,7 +152,7 @@ namespace glare::core ...@@ -152,7 +152,7 @@ namespace glare::core
gl::clearTextureImage(m_handle, 0, texture_format, texture_type, &value); gl::clearTextureImage(m_handle, 0, texture_format, texture_type, &value);
} }
void apply(Parameters parameters); void apply(Parameters parameters, bool multisample);
bool textureResident() const; bool textureResident() const;
bool imageResident() const; bool imageResident() const;
...@@ -291,7 +291,6 @@ namespace glare::core ...@@ -291,7 +291,6 @@ namespace glare::core
} }
} }
template<typename T> void Texture::set(SubTargetMultisample t, const Image<T>& image) template<typename T> void Texture::set(SubTargetMultisample t, const Image<T>& image)
{ {
set(t, image, m_latest_parameters); set(t, image, m_latest_parameters);
...@@ -309,7 +308,7 @@ namespace glare::core ...@@ -309,7 +308,7 @@ namespace glare::core
m_components = image.components(); m_components = image.components();
gl::pixelStorei(gl::PixelStoreAlignment::eUnpack, 1); gl::pixelStorei(gl::PixelStoreAlignment::eUnpack, 1);
apply(std::move(parameters)); apply(std::move(parameters), true);
glGetError(); glGetError();
glGetError(); glGetError();
glGetError(); glGetError();
...@@ -361,11 +360,11 @@ namespace glare::core ...@@ -361,11 +360,11 @@ namespace glare::core
m_height = image.height(); m_height = image.height();
m_depth = image.depth(); m_depth = image.depth();
gl::pixelStorei(gl::PixelStoreAlignment::eUnpack, 1); gl::pixelStorei(gl::PixelStoreAlignment::eUnpack, 1);
clear(0); //clear(0);
gl::textureImage(m_handle, t, level, m_format, texture_format, { image.width(), image.height(), image.depth() }, image.data().empty() ? nullptr : image.data().data()); gl::textureImage(m_handle, t, level, m_format, texture_format, { image.width(), image.height(), image.depth() }, image.data().empty() ? nullptr : image.data().data());
if (!no_apply) if (!no_apply)
apply(std::move(parameters)); apply(std::move(parameters), false);
} }
......
...@@ -188,7 +188,6 @@ namespace glare::core ...@@ -188,7 +188,6 @@ namespace glare::core
// Light just has changed? // Light just has changed?
if (changed) if (changed)
{ {
Log_Info << m_color.r << ", " << m_color.g << ", " << m_color.b;
Context::current().messages().id(tags::light).push(std::make_any<LightUpdate>(m_id, this)); Context::current().messages().id(tags::light).push(std::make_any<LightUpdate>(m_id, this));
} }
} }
......
...@@ -59,7 +59,7 @@ namespace glare::core ...@@ -59,7 +59,7 @@ namespace glare::core
image.flip(); image.flip();
m_texture->set(gl::ImageTarget(static_cast<int>(gl::ImageTarget::eCubeMapPosX) + face), image, true); m_texture->set(gl::ImageTarget(static_cast<int>(gl::ImageTarget::eCubeMapPosX) + face), image, true);
} }
m_texture->apply(parameters); m_texture->apply(parameters, false);
} }
// Create a screen filling triangle // Create a screen filling triangle
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment