mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-05-19 00:20:23 -07:00
core: drop the legacy renderer (#10408)
* core: drop the legacy renderer the legacy renderer is broken and barely used, drop it. * Nix: drop support for legacyRenderer --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
parent
f707d86912
commit
5ceb0ec15d
@ -99,11 +99,7 @@ message(STATUS "Checking deps...")
|
|||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
if(LEGACY_RENDERER)
|
|
||||||
set(GLES_VERSION "GLES2")
|
|
||||||
else()
|
|
||||||
set(GLES_VERSION "GLES3")
|
set(GLES_VERSION "GLES3")
|
||||||
endif()
|
|
||||||
find_package(OpenGL REQUIRED COMPONENTS ${GLES_VERSION})
|
find_package(OpenGL REQUIRED COMPONENTS ${GLES_VERSION})
|
||||||
|
|
||||||
pkg_check_modules(aquamarine_dep REQUIRED IMPORTED_TARGET aquamarine>=0.8.0)
|
pkg_check_modules(aquamarine_dep REQUIRED IMPORTED_TARGET aquamarine>=0.8.0)
|
||||||
@ -216,11 +212,6 @@ if(NOT HAS_INOTIFY AND inotify_FOUND)
|
|||||||
target_link_libraries(Hyprland PkgConfig::inotify)
|
target_link_libraries(Hyprland PkgConfig::inotify)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LEGACY_RENDERER)
|
|
||||||
message(STATUS "Using the legacy GLES2 renderer!")
|
|
||||||
add_compile_definitions(LEGACY_RENDERER)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NO_XWAYLAND)
|
if(NO_XWAYLAND)
|
||||||
message(STATUS "Using the NO_XWAYLAND flag, disabling XWayland!")
|
message(STATUS "Using the NO_XWAYLAND flag, disabling XWayland!")
|
||||||
add_compile_definitions(NO_XWAYLAND)
|
add_compile_definitions(NO_XWAYLAND)
|
||||||
|
8
Makefile
8
Makefile
@ -3,14 +3,6 @@ PREFIX = /usr/local
|
|||||||
stub:
|
stub:
|
||||||
@echo "Do not run $(MAKE) directly without any arguments. Please refer to the wiki on how to compile Hyprland."
|
@echo "Do not run $(MAKE) directly without any arguments. Please refer to the wiki on how to compile Hyprland."
|
||||||
|
|
||||||
legacyrenderer:
|
|
||||||
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -DLEGACY_RENDERER:BOOL=true -S . -B ./build
|
|
||||||
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
|
|
||||||
|
|
||||||
legacyrendererdebug:
|
|
||||||
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -DLEGACY_RENDERER:BOOL=true -S . -B ./build
|
|
||||||
cmake --build ./build --config Debug --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build
|
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build
|
||||||
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
|
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
|
||||||
|
@ -132,7 +132,6 @@
|
|||||||
# hyprland-packages
|
# hyprland-packages
|
||||||
hyprland
|
hyprland
|
||||||
hyprland-debug
|
hyprland-debug
|
||||||
hyprland-legacy-renderer
|
|
||||||
hyprland-unwrapped
|
hyprland-unwrapped
|
||||||
# hyprland-extras
|
# hyprland-extras
|
||||||
xdg-desktop-portal-hyprland
|
xdg-desktop-portal-hyprland
|
||||||
|
@ -77,10 +77,6 @@ if (systemd_option.enabled())
|
|||||||
subdir('systemd')
|
subdir('systemd')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('legacy_renderer').enabled()
|
|
||||||
add_project_arguments('-DLEGACY_RENDERER', language: 'cpp')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if get_option('buildtype') == 'debug'
|
if get_option('buildtype') == 'debug'
|
||||||
add_project_arguments('-DHYPRLAND_DEBUG', language: 'cpp')
|
add_project_arguments('-DHYPRLAND_DEBUG', language: 'cpp')
|
||||||
endif
|
endif
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
|
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
|
||||||
option('systemd', type: 'feature', value: 'auto', description: 'Enable systemd integration')
|
option('systemd', type: 'feature', value: 'auto', description: 'Enable systemd integration')
|
||||||
option('uwsm', type: 'feature', value: 'enabled', description: 'Enable uwsm integration (only if systemd is enabled)')
|
option('uwsm', type: 'feature', value: 'enabled', description: 'Enable uwsm integration (only if systemd is enabled)')
|
||||||
option('legacy_renderer', type: 'feature', value: 'disabled', description: 'Enable legacy renderer')
|
|
||||||
option('hyprpm', type: 'feature', value: 'enabled', description: 'Enable hyprpm')
|
option('hyprpm', type: 'feature', value: 'enabled', description: 'Enable hyprpm')
|
||||||
option('tracy_enable', type: 'boolean', value: false , description: 'Enable profiling')
|
option('tracy_enable', type: 'boolean', value: false , description: 'Enable profiling')
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
xwayland,
|
xwayland,
|
||||||
debug ? false,
|
debug ? false,
|
||||||
enableXWayland ? true,
|
enableXWayland ? true,
|
||||||
legacyRenderer ? false,
|
|
||||||
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
|
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
|
||||||
wrapRuntimeDeps ? true,
|
wrapRuntimeDeps ? true,
|
||||||
version ? "git",
|
version ? "git",
|
||||||
@ -52,6 +51,7 @@
|
|||||||
enableNvidiaPatches ? false,
|
enableNvidiaPatches ? false,
|
||||||
nvidiaPatches ? false,
|
nvidiaPatches ? false,
|
||||||
hidpiXWayland ? false,
|
hidpiXWayland ? false,
|
||||||
|
legacyRenderer ? false,
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) baseNameOf foldl' readFile;
|
inherit (builtins) baseNameOf foldl' readFile;
|
||||||
inherit (lib.asserts) assertMsg;
|
inherit (lib.asserts) assertMsg;
|
||||||
@ -70,6 +70,7 @@ in
|
|||||||
assert assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
|
assert assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
|
||||||
assert assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
|
assert assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
|
||||||
assert assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
|
assert assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
|
||||||
|
assert assertMsg (!legacyRenderer) "The option `legacyRenderer` has been removed. Legacy renderer is no longer supported.";
|
||||||
customStdenv.mkDerivation (finalAttrs: {
|
customStdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "hyprland${optionalString debug "-debug"}";
|
pname = "hyprland${optionalString debug "-debug"}";
|
||||||
inherit version;
|
inherit version;
|
||||||
@ -165,7 +166,6 @@ in
|
|||||||
mesonFlags = flatten [
|
mesonFlags = flatten [
|
||||||
(mapAttrsToList mesonEnable {
|
(mapAttrsToList mesonEnable {
|
||||||
"xwayland" = enableXWayland;
|
"xwayland" = enableXWayland;
|
||||||
"legacy_renderer" = legacyRenderer;
|
|
||||||
"systemd" = withSystemd;
|
"systemd" = withSystemd;
|
||||||
"uwsm" = false;
|
"uwsm" = false;
|
||||||
"hyprpm" = false;
|
"hyprpm" = false;
|
||||||
|
@ -50,9 +50,15 @@ in {
|
|||||||
hyprutils = final.hyprutils.override {debug = true;};
|
hyprutils = final.hyprutils.override {debug = true;};
|
||||||
debug = true;
|
debug = true;
|
||||||
};
|
};
|
||||||
hyprland-legacy-renderer = final.hyprland.override {legacyRenderer = true;};
|
|
||||||
|
|
||||||
# deprecated packages
|
# deprecated packages
|
||||||
|
hyprland-legacy-renderer =
|
||||||
|
builtins.trace ''
|
||||||
|
hyprland-legacy-renderer was removed. Please use the hyprland package.
|
||||||
|
Legacy renderer is no longer supported.
|
||||||
|
''
|
||||||
|
final.hyprland;
|
||||||
|
|
||||||
hyprland-nvidia =
|
hyprland-nvidia =
|
||||||
builtins.trace ''
|
builtins.trace ''
|
||||||
hyprland-nvidia was removed. Please use the hyprland package.
|
hyprland-nvidia was removed. Please use the hyprland package.
|
||||||
|
@ -109,9 +109,6 @@ void NCrashReporter::createAndSaveCrash(int sig) {
|
|||||||
finalCrashReport += "\nDate: ";
|
finalCrashReport += "\nDate: ";
|
||||||
finalCrashReport += GIT_COMMIT_DATE;
|
finalCrashReport += GIT_COMMIT_DATE;
|
||||||
finalCrashReport += "\nFlags:\n";
|
finalCrashReport += "\nFlags:\n";
|
||||||
#ifdef LEGACY_RENDERER
|
|
||||||
finalCrashReport += "legacyrenderer\n";
|
|
||||||
#endif
|
|
||||||
#if ISDEBUG
|
#if ISDEBUG
|
||||||
finalCrashReport += "debug\n";
|
finalCrashReport += "debug\n";
|
||||||
#endif
|
#endif
|
||||||
|
@ -931,13 +931,10 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) {
|
|||||||
HYPRLAND_VERSION, GIT_BRANCH, GIT_COMMIT_HASH, GIT_DIRTY, commitMsg, GIT_COMMIT_DATE, GIT_TAG, GIT_COMMITS, AQUAMARINE_VERSION,
|
HYPRLAND_VERSION, GIT_BRANCH, GIT_COMMIT_HASH, GIT_DIRTY, commitMsg, GIT_COMMIT_DATE, GIT_TAG, GIT_COMMITS, AQUAMARINE_VERSION,
|
||||||
HYPRLANG_VERSION, HYPRUTILS_VERSION, HYPRCURSOR_VERSION, HYPRGRAPHICS_VERSION);
|
HYPRLANG_VERSION, HYPRUTILS_VERSION, HYPRCURSOR_VERSION, HYPRGRAPHICS_VERSION);
|
||||||
|
|
||||||
#if (!defined(LEGACY_RENDERER) && !ISDEBUG && !defined(NO_XWAYLAND))
|
#if (!ISDEBUG && !defined(NO_XWAYLAND))
|
||||||
result += "no flags were set\n";
|
result += "no flags were set\n";
|
||||||
#else
|
#else
|
||||||
result += "flags set:\n";
|
result += "flags set:\n";
|
||||||
#ifdef LEGACY_RENDERER
|
|
||||||
result += "legacyrenderer\n";
|
|
||||||
#endif
|
|
||||||
#if ISDEBUG
|
#if ISDEBUG
|
||||||
result += "debug\n";
|
result += "debug\n";
|
||||||
#endif
|
#endif
|
||||||
@ -966,9 +963,6 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) {
|
|||||||
GIT_BRANCH, GIT_COMMIT_HASH, HYPRLAND_VERSION, (strcmp(GIT_DIRTY, "dirty") == 0 ? "true" : "false"), escapeJSONStrings(commitMsg), GIT_COMMIT_DATE, GIT_TAG,
|
GIT_BRANCH, GIT_COMMIT_HASH, HYPRLAND_VERSION, (strcmp(GIT_DIRTY, "dirty") == 0 ? "true" : "false"), escapeJSONStrings(commitMsg), GIT_COMMIT_DATE, GIT_TAG,
|
||||||
GIT_COMMITS, AQUAMARINE_VERSION, HYPRLANG_VERSION, HYPRUTILS_VERSION, HYPRCURSOR_VERSION, HYPRGRAPHICS_VERSION);
|
GIT_COMMITS, AQUAMARINE_VERSION, HYPRLANG_VERSION, HYPRUTILS_VERSION, HYPRCURSOR_VERSION, HYPRGRAPHICS_VERSION);
|
||||||
|
|
||||||
#ifdef LEGACY_RENDERER
|
|
||||||
result += "\"legacyrenderer\",";
|
|
||||||
#endif
|
|
||||||
#if ISDEBUG
|
#if ISDEBUG
|
||||||
result += "\"debug\",";
|
result += "\"debug\",";
|
||||||
#endif
|
#endif
|
||||||
|
@ -263,11 +263,8 @@ void CHyprDebugOverlay::draw() {
|
|||||||
glBindTexture(GL_TEXTURE_2D, m_texture->m_texID);
|
glBindTexture(GL_TEXTURE_2D, m_texture->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||||
|
|
||||||
|
@ -238,11 +238,8 @@ void CHyprNotificationOverlay::draw(PHLMONITOR pMonitor) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, m_texture->m_texID);
|
glBindTexture(GL_TEXTURE_2D, m_texture->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, MONSIZE.x, MONSIZE.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, MONSIZE.x, MONSIZE.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||||
|
|
||||||
|
@ -16,11 +16,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_ARGB8888,
|
.drmFormat = DRM_FORMAT_ARGB8888,
|
||||||
.flipRB = true,
|
.flipRB = true,
|
||||||
#ifndef GLES2
|
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#else
|
|
||||||
.glFormat = GL_BGRA_EXT,
|
|
||||||
#endif
|
|
||||||
.glType = GL_UNSIGNED_BYTE,
|
.glType = GL_UNSIGNED_BYTE,
|
||||||
.withAlpha = true,
|
.withAlpha = true,
|
||||||
.alphaStripped = DRM_FORMAT_XRGB8888,
|
.alphaStripped = DRM_FORMAT_XRGB8888,
|
||||||
@ -29,11 +25,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_XRGB8888,
|
.drmFormat = DRM_FORMAT_XRGB8888,
|
||||||
.flipRB = true,
|
.flipRB = true,
|
||||||
#ifndef GLES2
|
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#else
|
|
||||||
.glFormat = GL_BGRA_EXT,
|
|
||||||
#endif
|
|
||||||
.glType = GL_UNSIGNED_BYTE,
|
.glType = GL_UNSIGNED_BYTE,
|
||||||
.withAlpha = false,
|
.withAlpha = false,
|
||||||
.alphaStripped = DRM_FORMAT_XRGB8888,
|
.alphaStripped = DRM_FORMAT_XRGB8888,
|
||||||
@ -106,11 +98,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_XBGR2101010,
|
.drmFormat = DRM_FORMAT_XBGR2101010,
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#ifndef GLES2
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||||
#else
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV_EXT,
|
|
||||||
#endif
|
|
||||||
.withAlpha = false,
|
.withAlpha = false,
|
||||||
.alphaStripped = DRM_FORMAT_XBGR2101010,
|
.alphaStripped = DRM_FORMAT_XBGR2101010,
|
||||||
.bytesPerBlock = 4,
|
.bytesPerBlock = 4,
|
||||||
@ -118,11 +106,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_ABGR2101010,
|
.drmFormat = DRM_FORMAT_ABGR2101010,
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#ifndef GLES2
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||||
#else
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV_EXT,
|
|
||||||
#endif
|
|
||||||
.withAlpha = true,
|
.withAlpha = true,
|
||||||
.alphaStripped = DRM_FORMAT_XBGR2101010,
|
.alphaStripped = DRM_FORMAT_XBGR2101010,
|
||||||
.bytesPerBlock = 4,
|
.bytesPerBlock = 4,
|
||||||
@ -130,11 +114,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_XRGB2101010,
|
.drmFormat = DRM_FORMAT_XRGB2101010,
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#ifndef GLES2
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||||
#else
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV_EXT,
|
|
||||||
#endif
|
|
||||||
.withAlpha = false,
|
.withAlpha = false,
|
||||||
.alphaStripped = DRM_FORMAT_XRGB2101010,
|
.alphaStripped = DRM_FORMAT_XRGB2101010,
|
||||||
.bytesPerBlock = 4,
|
.bytesPerBlock = 4,
|
||||||
@ -142,11 +122,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_ARGB2101010,
|
.drmFormat = DRM_FORMAT_ARGB2101010,
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#ifndef GLES2
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
.glType = GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||||
#else
|
|
||||||
.glType = GL_UNSIGNED_INT_2_10_10_10_REV_EXT,
|
|
||||||
#endif
|
|
||||||
.withAlpha = true,
|
.withAlpha = true,
|
||||||
.alphaStripped = DRM_FORMAT_XRGB2101010,
|
.alphaStripped = DRM_FORMAT_XRGB2101010,
|
||||||
.bytesPerBlock = 4,
|
.bytesPerBlock = 4,
|
||||||
@ -154,11 +130,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_XBGR16161616F,
|
.drmFormat = DRM_FORMAT_XBGR16161616F,
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#ifndef GLES2
|
|
||||||
.glType = GL_HALF_FLOAT,
|
.glType = GL_HALF_FLOAT,
|
||||||
#else
|
|
||||||
.glType = GL_HALF_FLOAT_OES,
|
|
||||||
#endif
|
|
||||||
.withAlpha = false,
|
.withAlpha = false,
|
||||||
.alphaStripped = DRM_FORMAT_XBGR16161616F,
|
.alphaStripped = DRM_FORMAT_XBGR16161616F,
|
||||||
.bytesPerBlock = 8,
|
.bytesPerBlock = 8,
|
||||||
@ -166,22 +138,14 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_ABGR16161616F,
|
.drmFormat = DRM_FORMAT_ABGR16161616F,
|
||||||
.glFormat = GL_RGBA,
|
.glFormat = GL_RGBA,
|
||||||
#ifndef GLES2
|
|
||||||
.glType = GL_HALF_FLOAT,
|
.glType = GL_HALF_FLOAT,
|
||||||
#else
|
|
||||||
.glType = GL_HALF_FLOAT_OES,
|
|
||||||
#endif
|
|
||||||
.withAlpha = true,
|
.withAlpha = true,
|
||||||
.alphaStripped = DRM_FORMAT_XBGR16161616F,
|
.alphaStripped = DRM_FORMAT_XBGR16161616F,
|
||||||
.bytesPerBlock = 8,
|
.bytesPerBlock = 8,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_XBGR16161616,
|
.drmFormat = DRM_FORMAT_XBGR16161616,
|
||||||
#ifndef GLES2
|
|
||||||
.glFormat = GL_RGBA16UI,
|
.glFormat = GL_RGBA16UI,
|
||||||
#else
|
|
||||||
.glFormat = GL_RGBA16_EXT,
|
|
||||||
#endif
|
|
||||||
.glType = GL_UNSIGNED_SHORT,
|
.glType = GL_UNSIGNED_SHORT,
|
||||||
.withAlpha = false,
|
.withAlpha = false,
|
||||||
.alphaStripped = DRM_FORMAT_XBGR16161616,
|
.alphaStripped = DRM_FORMAT_XBGR16161616,
|
||||||
@ -189,11 +153,7 @@ inline const std::vector<SPixelFormat> GLES3_FORMATS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
.drmFormat = DRM_FORMAT_ABGR16161616,
|
.drmFormat = DRM_FORMAT_ABGR16161616,
|
||||||
#ifndef GLES2
|
|
||||||
.glFormat = GL_RGBA16UI,
|
.glFormat = GL_RGBA16UI,
|
||||||
#else
|
|
||||||
.glFormat = GL_RGBA16_EXT,
|
|
||||||
#endif
|
|
||||||
.glType = GL_UNSIGNED_SHORT,
|
.glType = GL_UNSIGNED_SHORT,
|
||||||
.withAlpha = true,
|
.withAlpha = true,
|
||||||
.alphaStripped = DRM_FORMAT_XBGR16161616,
|
.alphaStripped = DRM_FORMAT_XBGR16161616,
|
||||||
@ -290,12 +250,7 @@ uint32_t NFormatUtils::drmFormatToGL(DRMFormat drm) {
|
|||||||
case DRM_FORMAT_XRGB8888:
|
case DRM_FORMAT_XRGB8888:
|
||||||
case DRM_FORMAT_XBGR8888: return GL_RGBA; // doesn't matter, opengl is gucci in this case.
|
case DRM_FORMAT_XBGR8888: return GL_RGBA; // doesn't matter, opengl is gucci in this case.
|
||||||
case DRM_FORMAT_XRGB2101010:
|
case DRM_FORMAT_XRGB2101010:
|
||||||
case DRM_FORMAT_XBGR2101010:
|
case DRM_FORMAT_XBGR2101010: return GL_RGB10_A2;
|
||||||
#ifdef GLES2
|
|
||||||
return GL_RGB10_A2_EXT;
|
|
||||||
#else
|
|
||||||
return GL_RGB10_A2;
|
|
||||||
#endif
|
|
||||||
default: return GL_RGBA;
|
default: return GL_RGBA;
|
||||||
}
|
}
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
@ -303,13 +258,7 @@ uint32_t NFormatUtils::drmFormatToGL(DRMFormat drm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t NFormatUtils::glFormatToType(uint32_t gl) {
|
uint32_t NFormatUtils::glFormatToType(uint32_t gl) {
|
||||||
return gl != GL_RGBA ?
|
return gl != GL_RGBA ? GL_UNSIGNED_INT_2_10_10_10_REV : GL_UNSIGNED_BYTE;
|
||||||
#ifdef GLES2
|
|
||||||
GL_UNSIGNED_INT_2_10_10_10_REV_EXT :
|
|
||||||
#else
|
|
||||||
GL_UNSIGNED_INT_2_10_10_10_REV :
|
|
||||||
#endif
|
|
||||||
GL_UNSIGNED_BYTE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string NFormatUtils::drmFormatName(DRMFormat drm) {
|
std::string NFormatUtils::drmFormatName(DRMFormat drm) {
|
||||||
|
@ -146,11 +146,8 @@ void CHyprError::createQueued() {
|
|||||||
glBindTexture(GL_TEXTURE_2D, m_texture->m_texID);
|
glBindTexture(GL_TEXTURE_2D, m_texture->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||||
|
|
||||||
|
@ -17,15 +17,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
|
|
||||||
#ifdef LEGACY_RENDERER
|
|
||||||
#include <GLES2/gl2.h>
|
|
||||||
#include <GLES2/gl2ext.h>
|
|
||||||
#define GLES2
|
|
||||||
#else
|
|
||||||
#define GLES32
|
#define GLES32
|
||||||
#include <GLES3/gl32.h>
|
#include <GLES3/gl32.h>
|
||||||
#include <GLES3/gl3ext.h>
|
#include <GLES3/gl3ext.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NO_XWAYLAND
|
#ifdef NO_XWAYLAND
|
||||||
#define XWAYLAND false
|
#define XWAYLAND false
|
||||||
|
@ -264,11 +264,7 @@ bool CScreencopyFrame::copyShm() {
|
|||||||
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_screencopyDeniedTexture, texbox, 1);
|
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_screencopyDeniedTexture, texbox, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, fb.getFBID());
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, fb.getFBID());
|
||||||
#else
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, fb.getFBID());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const auto PFORMAT = NFormatUtils::getPixelFormatFromDRM(shm.format);
|
const auto PFORMAT = NFormatUtils::getPixelFormatFromDRM(shm.format);
|
||||||
if (!PFORMAT) {
|
if (!PFORMAT) {
|
||||||
@ -304,11 +300,7 @@ bool CScreencopyFrame::copyShm() {
|
|||||||
|
|
||||||
g_pHyprOpenGL->m_renderData.pMonitor.reset();
|
g_pHyprOpenGL->m_renderData.pMonitor.reset();
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||||
#else
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LOGM(TRACE, "Copied frame via shm");
|
LOGM(TRACE, "Copied frame via shm");
|
||||||
|
|
||||||
|
@ -281,10 +281,7 @@ bool CToplevelExportFrame::copyShm(const Time::steady_tp& now) {
|
|||||||
g_pHyprOpenGL->m_renderData.pMonitor = PMONITOR;
|
g_pHyprOpenGL->m_renderData.pMonitor = PMONITOR;
|
||||||
outFB.bind();
|
outFB.bind();
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, outFB.getFBID());
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, outFB.getFBID());
|
||||||
#endif
|
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
|
|
||||||
auto glFormat = PFORMAT->flipRB ? GL_BGRA_EXT : GL_RGBA;
|
auto glFormat = PFORMAT->flipRB ? GL_BGRA_EXT : GL_RGBA;
|
||||||
@ -318,10 +315,7 @@ bool CToplevelExportFrame::copyShm(const Time::steady_tp& now) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
outFB.unbind();
|
outFB.unbind();
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -40,14 +40,11 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
|
|||||||
glBindFramebuffer(GL_FRAMEBUFFER, m_fb);
|
glBindFramebuffer(GL_FRAMEBUFFER, m_fb);
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_tex->m_texID, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_tex->m_texID, 0);
|
||||||
|
|
||||||
// TODO: Allow this with gles2
|
|
||||||
#ifndef GLES2
|
|
||||||
if (m_stencilTex) {
|
if (m_stencilTex) {
|
||||||
glBindTexture(GL_TEXTURE_2D, m_stencilTex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, m_stencilTex->m_texID);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, w, h, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, w, h, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_stencilTex->m_texID, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_stencilTex->m_texID, 0);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
auto status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
auto status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
RASSERT((status == GL_FRAMEBUFFER_COMPLETE), "Framebuffer incomplete, couldn't create! (FB status: {}, GL Error: 0x{:x})", status, (int)glGetError());
|
RASSERT((status == GL_FRAMEBUFFER_COMPLETE), "Framebuffer incomplete, couldn't create! (FB status: {}, GL Error: 0x{:x})", status, (int)glGetError());
|
||||||
@ -64,8 +61,6 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CFramebuffer::addStencil(SP<CTexture> tex) {
|
void CFramebuffer::addStencil(SP<CTexture> tex) {
|
||||||
// TODO: Allow this with gles2
|
|
||||||
#ifndef GLES2
|
|
||||||
m_stencilTex = tex;
|
m_stencilTex = tex;
|
||||||
glBindTexture(GL_TEXTURE_2D, m_stencilTex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, m_stencilTex->m_texID);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, m_size.x, m_size.y, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, m_size.x, m_size.y, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
|
||||||
@ -79,15 +74,10 @@ void CFramebuffer::addStencil(SP<CTexture> tex) {
|
|||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFramebuffer::bind() {
|
void CFramebuffer::bind() {
|
||||||
#ifndef GLES2
|
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fb);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fb);
|
||||||
#else
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, m_iFb);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (g_pHyprOpenGL)
|
if (g_pHyprOpenGL)
|
||||||
glViewport(0, 0, g_pHyprOpenGL->m_renderData.pMonitor->m_pixelSize.x, g_pHyprOpenGL->m_renderData.pMonitor->m_pixelSize.y);
|
glViewport(0, 0, g_pHyprOpenGL->m_renderData.pMonitor->m_pixelSize.x, g_pHyprOpenGL->m_renderData.pMonitor->m_pixelSize.y);
|
||||||
@ -96,11 +86,7 @@ void CFramebuffer::bind() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CFramebuffer::unbind() {
|
void CFramebuffer::unbind() {
|
||||||
#ifndef GLES2
|
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||||
#else
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFramebuffer::release() {
|
void CFramebuffer::release() {
|
||||||
|
@ -162,24 +162,14 @@ void CHyprOpenGLImpl::initEGL(bool gbm) {
|
|||||||
|
|
||||||
auto attrsNoVer = attrs;
|
auto attrsNoVer = attrs;
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
attrs.push_back(EGL_CONTEXT_MAJOR_VERSION);
|
attrs.push_back(EGL_CONTEXT_MAJOR_VERSION);
|
||||||
attrs.push_back(3);
|
attrs.push_back(3);
|
||||||
attrs.push_back(EGL_CONTEXT_MINOR_VERSION);
|
attrs.push_back(EGL_CONTEXT_MINOR_VERSION);
|
||||||
attrs.push_back(2);
|
attrs.push_back(2);
|
||||||
#else
|
|
||||||
attrs.push_back(EGL_CONTEXT_CLIENT_VERSION);
|
|
||||||
attrs.push_back(2);
|
|
||||||
m_eglContextVersion = EGL_CONTEXT_GLES_2_0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
attrs.push_back(EGL_NONE);
|
attrs.push_back(EGL_NONE);
|
||||||
|
|
||||||
m_eglContext = eglCreateContext(m_eglDisplay, EGL_NO_CONFIG_KHR, EGL_NO_CONTEXT, attrs.data());
|
m_eglContext = eglCreateContext(m_eglDisplay, EGL_NO_CONFIG_KHR, EGL_NO_CONTEXT, attrs.data());
|
||||||
if (m_eglContext == EGL_NO_CONTEXT) {
|
if (m_eglContext == EGL_NO_CONTEXT) {
|
||||||
#ifdef GLES2
|
|
||||||
RASSERT(false, "EGL: failed to create a context with GLES2.0");
|
|
||||||
#endif
|
|
||||||
Debug::log(WARN, "EGL: Failed to create a context with GLES3.2, retrying 3.0");
|
Debug::log(WARN, "EGL: Failed to create a context with GLES3.2, retrying 3.0");
|
||||||
|
|
||||||
attrs = attrsNoVer;
|
attrs = attrsNoVer;
|
||||||
@ -362,10 +352,6 @@ CHyprOpenGLImpl::CHyprOpenGLImpl() : m_drmFD(g_pCompositor->m_drmFD) {
|
|||||||
|
|
||||||
TRACY_GPU_CONTEXT;
|
TRACY_GPU_CONTEXT;
|
||||||
|
|
||||||
#ifdef GLES2
|
|
||||||
Debug::log(WARN, "!RENDERER: Using the legacy GLES2 renderer!");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
initDRMFormats();
|
initDRMFormats();
|
||||||
|
|
||||||
initAssets();
|
initAssets();
|
||||||
@ -669,7 +655,6 @@ GLuint CHyprOpenGLImpl::compileShader(const GLuint& type, std::string src, bool
|
|||||||
void CHyprOpenGLImpl::beginSimple(PHLMONITOR pMonitor, const CRegion& damage, SP<CRenderbuffer> rb, CFramebuffer* fb) {
|
void CHyprOpenGLImpl::beginSimple(PHLMONITOR pMonitor, const CRegion& damage, SP<CRenderbuffer> rb, CFramebuffer* fb) {
|
||||||
m_renderData.pMonitor = pMonitor;
|
m_renderData.pMonitor = pMonitor;
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
const GLenum RESETSTATUS = glGetGraphicsResetStatus();
|
const GLenum RESETSTATUS = glGetGraphicsResetStatus();
|
||||||
if (RESETSTATUS != GL_NO_ERROR) {
|
if (RESETSTATUS != GL_NO_ERROR) {
|
||||||
std::string errStr = "";
|
std::string errStr = "";
|
||||||
@ -682,7 +667,6 @@ void CHyprOpenGLImpl::beginSimple(PHLMONITOR pMonitor, const CRegion& damage, SP
|
|||||||
RASSERT(false, "Aborting, glGetGraphicsResetStatus returned {}. Cannot continue until proper GPU reset handling is implemented.", errStr);
|
RASSERT(false, "Aborting, glGetGraphicsResetStatus returned {}. Cannot continue until proper GPU reset handling is implemented.", errStr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TRACY_GPU_ZONE("RenderBeginSimple");
|
TRACY_GPU_ZONE("RenderBeginSimple");
|
||||||
|
|
||||||
@ -721,7 +705,6 @@ void CHyprOpenGLImpl::beginSimple(PHLMONITOR pMonitor, const CRegion& damage, SP
|
|||||||
void CHyprOpenGLImpl::begin(PHLMONITOR pMonitor, const CRegion& damage_, CFramebuffer* fb, std::optional<CRegion> finalDamage) {
|
void CHyprOpenGLImpl::begin(PHLMONITOR pMonitor, const CRegion& damage_, CFramebuffer* fb, std::optional<CRegion> finalDamage) {
|
||||||
m_renderData.pMonitor = pMonitor;
|
m_renderData.pMonitor = pMonitor;
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
const GLenum RESETSTATUS = glGetGraphicsResetStatus();
|
const GLenum RESETSTATUS = glGetGraphicsResetStatus();
|
||||||
if (RESETSTATUS != GL_NO_ERROR) {
|
if (RESETSTATUS != GL_NO_ERROR) {
|
||||||
std::string errStr = "";
|
std::string errStr = "";
|
||||||
@ -734,7 +717,6 @@ void CHyprOpenGLImpl::begin(PHLMONITOR pMonitor, const CRegion& damage_, CFrameb
|
|||||||
RASSERT(false, "Aborting, glGetGraphicsResetStatus returned {}. Cannot continue until proper GPU reset handling is implemented.", errStr);
|
RASSERT(false, "Aborting, glGetGraphicsResetStatus returned {}. Cannot continue until proper GPU reset handling is implemented.", errStr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TRACY_GPU_ZONE("RenderBegin");
|
TRACY_GPU_ZONE("RenderBegin");
|
||||||
|
|
||||||
@ -860,11 +842,7 @@ void CHyprOpenGLImpl::end() {
|
|||||||
// check for gl errors
|
// check for gl errors
|
||||||
const GLenum ERR = glGetError();
|
const GLenum ERR = glGetError();
|
||||||
|
|
||||||
#ifdef GLES2
|
|
||||||
if (ERR == GL_CONTEXT_LOST_KHR) /* We don't have infra to recover from this */
|
|
||||||
#else
|
|
||||||
if (ERR == GL_CONTEXT_LOST) /* We don't have infra to recover from this */
|
if (ERR == GL_CONTEXT_LOST) /* We don't have infra to recover from this */
|
||||||
#endif
|
|
||||||
RASSERT(false, "glGetError at Opengl::end() returned GL_CONTEXT_LOST. Cannot continue until proper GPU reset handling is implemented.");
|
RASSERT(false, "glGetError at Opengl::end() returned GL_CONTEXT_LOST. Cannot continue until proper GPU reset handling is implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -946,9 +924,7 @@ bool CHyprOpenGLImpl::initShaders() {
|
|||||||
shaders->TEXVERTSRC320 = processShader("tex320.vert", includes);
|
shaders->TEXVERTSRC320 = processShader("tex320.vert", includes);
|
||||||
|
|
||||||
GLuint prog;
|
GLuint prog;
|
||||||
#ifdef GLES2
|
|
||||||
m_cmSupported = false;
|
|
||||||
#else
|
|
||||||
if (!*PCM)
|
if (!*PCM)
|
||||||
m_cmSupported = false;
|
m_cmSupported = false;
|
||||||
else {
|
else {
|
||||||
@ -983,7 +959,6 @@ bool CHyprOpenGLImpl::initShaders() {
|
|||||||
"WARNING: CM Shader failed compiling, color management will not work. It's likely because your GPU is an old piece of garbage, don't file bug reports "
|
"WARNING: CM Shader failed compiling, color management will not work. It's likely because your GPU is an old piece of garbage, don't file bug reports "
|
||||||
"about this!");
|
"about this!");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
const auto FRAGSHADOW = processShader(m_cmSupported ? "shadow.frag" : "shadow_legacy.frag", includes);
|
const auto FRAGSHADOW = processShader(m_cmSupported ? "shadow.frag" : "shadow_legacy.frag", includes);
|
||||||
const auto FRAGBORDER1 = processShader(m_cmSupported ? "border.frag" : "border_legacy.frag", includes);
|
const auto FRAGBORDER1 = processShader(m_cmSupported ? "border.frag" : "border_legacy.frag", includes);
|
||||||
@ -1392,13 +1367,7 @@ void CHyprOpenGLImpl::renderRectWithDamage(const CBox& box, const CHyprColor& co
|
|||||||
Mat3x3 glMatrix = m_renderData.projection.copy().multiply(matrix);
|
Mat3x3 glMatrix = m_renderData.projection.copy().multiply(matrix);
|
||||||
|
|
||||||
useProgram(m_shaders->m_shQUAD.program);
|
useProgram(m_shaders->m_shQUAD.program);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shQUAD.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(m_shaders->m_shQUAD.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(m_renderData.pCurrentMonData->m_shQUAD.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// premultiply the color as well as we don't work with straight alpha
|
// premultiply the color as well as we don't work with straight alpha
|
||||||
glUniform4f(m_shaders->m_shQUAD.color, col.r * col.a, col.g * col.a, col.b * col.a, col.a);
|
glUniform4f(m_shaders->m_shQUAD.color, col.r * col.a, col.g * col.a, col.b * col.a, col.a);
|
||||||
@ -1602,12 +1571,7 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, const CB
|
|||||||
passCMUniforms(*shader, imageDescription);
|
passCMUniforms(*shader, imageDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(shader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(shader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(shader->proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform1i(shader->tex, 0);
|
glUniform1i(shader->tex, 0);
|
||||||
|
|
||||||
if ((usingFinalShader && *PDT == 0) || CRASHING) {
|
if ((usingFinalShader && *PDT == 0) || CRASHING) {
|
||||||
@ -1735,15 +1699,8 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP<CTexture> tex, const CBox& box)
|
|||||||
glBindTexture(tex->m_target, tex->m_texID);
|
glBindTexture(tex->m_target, tex->m_texID);
|
||||||
|
|
||||||
useProgram(shader->program);
|
useProgram(shader->program);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(shader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(shader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(shader->proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform1i(shader->tex, 0);
|
glUniform1i(shader->tex, 0);
|
||||||
|
|
||||||
glBindVertexArray(shader->shaderVao);
|
glBindVertexArray(shader->shaderVao);
|
||||||
|
|
||||||
for (auto const& RECT : m_renderData.damage.getRects()) {
|
for (auto const& RECT : m_renderData.damage.getRects()) {
|
||||||
@ -1777,13 +1734,7 @@ void CHyprOpenGLImpl::renderTextureMatte(SP<CTexture> tex, const CBox& box, CFra
|
|||||||
SShader* shader = &m_shaders->m_shMATTE;
|
SShader* shader = &m_shaders->m_shMATTE;
|
||||||
|
|
||||||
useProgram(shader->program);
|
useProgram(shader->program);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(shader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(shader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(shader->proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform1i(shader->tex, 0);
|
glUniform1i(shader->tex, 0);
|
||||||
glUniform1i(shader->alphaMatte, 1);
|
glUniform1i(shader->alphaMatte, 1);
|
||||||
|
|
||||||
@ -1886,12 +1837,7 @@ CFramebuffer* CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* origi
|
|||||||
1.0f);
|
1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBLURPREPARE.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(m_shaders->m_shBLURPREPARE.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBLURPREPARE.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform1f(m_shaders->m_shBLURPREPARE.contrast, *PBLURCONTRAST);
|
glUniform1f(m_shaders->m_shBLURPREPARE.contrast, *PBLURCONTRAST);
|
||||||
glUniform1f(m_shaders->m_shBLURPREPARE.brightness, *PBLURBRIGHTNESS);
|
glUniform1f(m_shaders->m_shBLURPREPARE.brightness, *PBLURBRIGHTNESS);
|
||||||
glUniform1i(m_shaders->m_shBLURPREPARE.tex, 0);
|
glUniform1i(m_shaders->m_shBLURPREPARE.tex, 0);
|
||||||
@ -1927,12 +1873,7 @@ CFramebuffer* CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* origi
|
|||||||
useProgram(pShader->program);
|
useProgram(pShader->program);
|
||||||
|
|
||||||
// prep two shaders
|
// prep two shaders
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(pShader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(pShader->proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(pShader->proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform1f(pShader->radius, *PBLURSIZE * a); // this makes the blursize change with a
|
glUniform1f(pShader->radius, *PBLURSIZE * a); // this makes the blursize change with a
|
||||||
if (pShader == &m_shaders->m_shBLUR1) {
|
if (pShader == &m_shaders->m_shBLUR1) {
|
||||||
glUniform2f(m_shaders->m_shBLUR1.halfpixel, 0.5f / (m_renderData.pMonitor->m_pixelSize.x / 2.f), 0.5f / (m_renderData.pMonitor->m_pixelSize.y / 2.f));
|
glUniform2f(m_shaders->m_shBLUR1.halfpixel, 0.5f / (m_renderData.pMonitor->m_pixelSize.x / 2.f), 0.5f / (m_renderData.pMonitor->m_pixelSize.y / 2.f));
|
||||||
@ -1997,13 +1938,7 @@ CFramebuffer* CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* origi
|
|||||||
glTexParameteri(currentTex->m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(currentTex->m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
useProgram(m_shaders->m_shBLURFINISH.program);
|
useProgram(m_shaders->m_shBLURFINISH.program);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBLURFINISH.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(m_shaders->m_shBLURFINISH.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBLURFINISH.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform1f(m_shaders->m_shBLURFINISH.noise, *PBLURNOISE);
|
glUniform1f(m_shaders->m_shBLURFINISH.noise, *PBLURNOISE);
|
||||||
glUniform1f(m_shaders->m_shBLURFINISH.brightness, *PBLURBRIGHTNESS);
|
glUniform1f(m_shaders->m_shBLURFINISH.brightness, *PBLURBRIGHTNESS);
|
||||||
|
|
||||||
@ -2341,13 +2276,7 @@ void CHyprOpenGLImpl::renderBorder(const CBox& box, const CGradientValueData& gr
|
|||||||
if (!skipCM)
|
if (!skipCM)
|
||||||
passCMUniforms(m_shaders->m_shBORDER1, SImageDescription{});
|
passCMUniforms(m_shaders->m_shBORDER1, SImageDescription{});
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glUniform4fv(m_shaders->m_shBORDER1.gradient, grad.m_colorsOkLabA.size() / 4, (float*)grad.m_colorsOkLabA.data());
|
glUniform4fv(m_shaders->m_shBORDER1.gradient, grad.m_colorsOkLabA.size() / 4, (float*)grad.m_colorsOkLabA.data());
|
||||||
glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad.m_colorsOkLabA.size() / 4);
|
glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad.m_colorsOkLabA.size() / 4);
|
||||||
glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
|
glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
|
||||||
@ -2428,14 +2357,7 @@ void CHyprOpenGLImpl::renderBorder(const CBox& box, const CGradientValueData& gr
|
|||||||
blend(true);
|
blend(true);
|
||||||
|
|
||||||
useProgram(m_shaders->m_shBORDER1.program);
|
useProgram(m_shaders->m_shBORDER1.program);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glUniform4fv(m_shaders->m_shBORDER1.gradient, grad1.m_colorsOkLabA.size() / 4, (float*)grad1.m_colorsOkLabA.data());
|
glUniform4fv(m_shaders->m_shBORDER1.gradient, grad1.m_colorsOkLabA.size() / 4, (float*)grad1.m_colorsOkLabA.data());
|
||||||
glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad1.m_colorsOkLabA.size() / 4);
|
glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad1.m_colorsOkLabA.size() / 4);
|
||||||
glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad1.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
|
glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad1.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
|
||||||
@ -2515,12 +2437,7 @@ void CHyprOpenGLImpl::renderRoundedShadow(const CBox& box, int round, float roun
|
|||||||
if (!skipCM)
|
if (!skipCM)
|
||||||
passCMUniforms(m_shaders->m_shSHADOW, SImageDescription{});
|
passCMUniforms(m_shaders->m_shSHADOW, SImageDescription{});
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shSHADOW.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
glUniformMatrix3fv(m_shaders->m_shSHADOW.proj, 1, GL_TRUE, glMatrix.getMatrix().data());
|
||||||
#else
|
|
||||||
glMatrix.transpose();
|
|
||||||
glUniformMatrix3fv(m_shaders->m_shSHADOW.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
|
|
||||||
#endif
|
|
||||||
glUniform4f(m_shaders->m_shSHADOW.color, col.r, col.g, col.b, col.a * a);
|
glUniform4f(m_shaders->m_shSHADOW.color, col.r, col.g, col.b, col.a * a);
|
||||||
|
|
||||||
const auto TOPLEFT = Vector2D(range + round, range + round);
|
const auto TOPLEFT = Vector2D(range + round, range + round);
|
||||||
@ -2675,13 +2592,7 @@ SP<CTexture> CHyprOpenGLImpl::loadAsset(const std::string& filename) {
|
|||||||
tex->allocate();
|
tex->allocate();
|
||||||
tex->m_size = {cairo_image_surface_get_width(CAIROSURFACE), cairo_image_surface_get_height(CAIROSURFACE)};
|
tex->m_size = {cairo_image_surface_get_width(CAIROSURFACE), cairo_image_surface_get_height(CAIROSURFACE)};
|
||||||
|
|
||||||
const GLint glIFormat = CAIROFORMAT == CAIRO_FORMAT_RGB96F ?
|
const GLint glIFormat = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_RGB32F : GL_RGBA;
|
||||||
#ifdef GLES2
|
|
||||||
GL_RGB32F_EXT :
|
|
||||||
#else
|
|
||||||
GL_RGB32F :
|
|
||||||
#endif
|
|
||||||
GL_RGBA;
|
|
||||||
const GLint glFormat = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_RGB : GL_RGBA;
|
const GLint glFormat = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_RGB : GL_RGBA;
|
||||||
const GLint glType = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_FLOAT : GL_UNSIGNED_BYTE;
|
const GLint glType = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_FLOAT : GL_UNSIGNED_BYTE;
|
||||||
|
|
||||||
@ -2689,12 +2600,12 @@ SP<CTexture> CHyprOpenGLImpl::loadAsset(const std::string& filename) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
#ifndef GLES2
|
|
||||||
if (CAIROFORMAT != CAIRO_FORMAT_RGB96F) {
|
if (CAIROFORMAT != CAIRO_FORMAT_RGB96F) {
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, glIFormat, tex->m_size.x, tex->m_size.y, 0, glFormat, glType, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, glIFormat, tex->m_size.x, tex->m_size.y, 0, glFormat, glType, DATA);
|
||||||
|
|
||||||
cairo_surface_destroy(CAIROSURFACE);
|
cairo_surface_destroy(CAIROSURFACE);
|
||||||
@ -2772,10 +2683,8 @@ SP<CTexture> CHyprOpenGLImpl::renderText(const std::string& text, CHyprColor col
|
|||||||
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex->m_size.x, tex->m_size.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex->m_size.x, tex->m_size.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||||
|
|
||||||
cairo_destroy(CAIRO);
|
cairo_destroy(CAIRO);
|
||||||
@ -2815,10 +2724,8 @@ void CHyprOpenGLImpl::initMissingAssetTexture() {
|
|||||||
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, glFormat, tex->m_size.x, tex->m_size.y, 0, glFormat, glType, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, glFormat, tex->m_size.x, tex->m_size.y, 0, glFormat, glType, DATA);
|
||||||
|
|
||||||
cairo_surface_destroy(CAIROSURFACE);
|
cairo_surface_destroy(CAIROSURFACE);
|
||||||
@ -2928,10 +2835,8 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(PHLMONITOR pMonitor) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, glFormat, tex->m_size.x, tex->m_size.y, 0, glFormat, glType, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, glFormat, tex->m_size.x, tex->m_size.y, 0, glFormat, glType, DATA);
|
||||||
|
|
||||||
cairo_surface_destroy(CAIROSURFACE);
|
cairo_surface_destroy(CAIROSURFACE);
|
||||||
|
@ -72,12 +72,12 @@ void CTexture::createFromShm(uint32_t drmFormat, uint8_t* pixels, uint32_t strid
|
|||||||
GLCALL(glBindTexture(GL_TEXTURE_2D, m_texID));
|
GLCALL(glBindTexture(GL_TEXTURE_2D, m_texID));
|
||||||
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
|
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
|
||||||
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
|
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
|
||||||
#ifndef GLES2
|
|
||||||
if (format->flipRB) {
|
if (format->flipRB) {
|
||||||
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE));
|
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE));
|
||||||
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED));
|
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
GLCALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride / format->bytesPerBlock));
|
GLCALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride / format->bytesPerBlock));
|
||||||
GLCALL(glTexImage2D(GL_TEXTURE_2D, 0, format->glInternalFormat ? format->glInternalFormat : format->glFormat, size_.x, size_.y, 0, format->glFormat, format->glType, pixels));
|
GLCALL(glTexImage2D(GL_TEXTURE_2D, 0, format->glInternalFormat ? format->glInternalFormat : format->glFormat, size_.x, size_.y, 0, format->glFormat, format->glType, pixels));
|
||||||
GLCALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0));
|
GLCALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0));
|
||||||
@ -120,12 +120,10 @@ void CTexture::update(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, cons
|
|||||||
|
|
||||||
auto rects = damage.copy().intersect(CBox{{}, m_size}).getRects();
|
auto rects = damage.copy().intersect(CBox{{}, m_size}).getRects();
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
if (format->flipRB) {
|
if (format->flipRB) {
|
||||||
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE));
|
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE));
|
||||||
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED));
|
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (auto const& rect : rects) {
|
for (auto const& rect : rects) {
|
||||||
GLCALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride / format->bytesPerBlock));
|
GLCALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride / format->bytesPerBlock));
|
||||||
|
@ -332,11 +332,8 @@ static void renderGradientTo(SP<CTexture> tex, CGradientValueData* grad) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
glBindTexture(GL_TEXTURE_2D, tex->m_texID);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
#ifndef GLES2
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
|
||||||
#endif
|
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bufferSize.x, bufferSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bufferSize.x, bufferSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user