mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-08-24 10:04:19 -05:00
opengl: allow texture filter to be changed (#13078)
* opengl: allow texture filter to be changed * format * correct filter * Moved from OpenGL.hpp to Texture.hpp * Shortened names
This commit is contained in:
@@ -1363,8 +1363,8 @@ void CHyprOpenGLImpl::renderTextureInternal(SP<CTexture> tex, const CBox& box, c
|
||||
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
} else {
|
||||
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, tex->magFilter);
|
||||
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, tex->minFilter);
|
||||
}
|
||||
|
||||
const bool isHDRSurface = m_renderData.surface.valid() && m_renderData.surface->m_colorManagement.valid() ? m_renderData.surface->m_colorManagement->isHDR() : false;
|
||||
@@ -1616,8 +1616,8 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP<CTexture> tex, const CBox& box)
|
||||
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
} else {
|
||||
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
tex->setTexParameter(GL_TEXTURE_MAG_FILTER, tex->magFilter);
|
||||
tex->setTexParameter(GL_TEXTURE_MIN_FILTER, tex->minFilter);
|
||||
}
|
||||
|
||||
auto shader = useShader(m_shaders->frag[SH_FRAG_PASSTHRURGBA]);
|
||||
|
||||
@@ -49,6 +49,9 @@ class CTexture {
|
||||
uint32_t m_drmFormat = 0; // for shm
|
||||
bool m_isSynchronous = false;
|
||||
|
||||
GLenum magFilter = GL_LINEAR; // useNearestNeighbor overwrites these
|
||||
GLenum minFilter = GL_LINEAR;
|
||||
|
||||
private:
|
||||
enum eTextureParam : uint8_t {
|
||||
TEXTURE_PAR_WRAP_S = 0,
|
||||
|
||||
Reference in New Issue
Block a user