Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-util/reshade-fx/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST reshade-6.1.1.tar.gz 1683533 BLAKE2B 2ad534fe0c832b1332fe2f7ebacbe6336900fac4691e5be5f0099263840848b0b78f751cfa54ac9983ea7ef8c71719268d8b401c26a9aa40020a19ee689d4e5a SHA512 ae95d483a948029f0c07a0d0a55c2fea4c9b27115e85e9464610441cfd39a80bdaa520a3a24f76f609ba5d198a6a2401328036babf46fc00f6da35161dd9da14
60 changes: 60 additions & 0 deletions dev-util/reshade-fx/files/reshade-fx-6.1.1-gcc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
--- a/source/effect_expression.hpp
+++ b/source/effect_expression.hpp
@@ -6,6 +6,7 @@
#pragma once

#include "effect_token.hpp"
+#include <climits> // UINT_MAX

namespace reshadefx
{
--- a/source/effect_codegen_glsl.cpp
+++ b/source/effect_codegen_glsl.cpp
@@ -7,6 +7,7 @@
#include "effect_codegen.hpp"
#include <cmath> // signbit, isinf, isnan
#include <cstdio> // snprintf
+#include <cstring> // memcmp
#include <cassert>
#include <algorithm> // std::find_if, std::max
#include <unordered_set>
--- a/source/effect_codegen_hlsl.cpp
+++ b/source/effect_codegen_hlsl.cpp
@@ -991,7 +991,7 @@ private:
code += '[' + std::to_string(param.type.array_length) + ']';

if (!param.semantic.empty())
- code += " : " + convert_semantic(param.semantic, std::max(1u, param.type.cols / 4) * std::max(1u, param.type.array_length));
+ code += " : " + convert_semantic(param.semantic, std::max(1u, uint32_t(param.type.cols / 4)) * std::max(1u, param.type.array_length));

if (i < num_params - 1)
code += ',';
--- a/source/effect_codegen_spirv.cpp
+++ b/source/effect_codegen_spirv.cpp
@@ -138,7 +138,7 @@ public:
private:
struct type_lookup
{
- type type;
+ reshadefx::type type;
bool is_ptr;
uint32_t array_stride;
std::pair<spv::StorageClass, spv::ImageFormat> storage;
@@ -143,7 +143,7 @@ private:
uint32_t array_stride;
std::pair<spv::StorageClass, spv::ImageFormat> storage;

- friend static bool operator==(const type_lookup &lhs, const type_lookup &rhs)
+ friend bool operator==(const type_lookup &lhs, const type_lookup &rhs)
{
return lhs.type == rhs.type && lhs.is_ptr == rhs.is_ptr && lhs.array_stride == rhs.array_stride && lhs.storage == rhs.storage;
}
@@ -157,7 +157,7 @@ private:
std::vector<type> param_types;
bool is_entry_point = false;

- friend static bool operator==(const function_blocks &lhs, const function_blocks &rhs)
+ friend bool operator==(const function_blocks &lhs, const function_blocks &rhs)
{
if (lhs.param_types.size() != rhs.param_types.size())
return false;
8 changes: 8 additions & 0 deletions dev-util/reshade-fx/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<remote-id type="github">crosire/reshade</remote-id>
</upstream>
</pkgmetadata>

76 changes: 76 additions & 0 deletions dev-util/reshade-fx/reshade-fx-6.1.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit meson-multilib

DESCRIPTION="A custom shader language called ReShade FX"
HOMEPAGE="https://github.com/crosire/reshade"
SRC_URI="https://github.com/crosire/reshade/archive/v${PV}.tar.gz -> reshade-${PV}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="test"

DEPEND=">=dev-util/spirv-headers-1.2"
RDEPEND=""
BDEPEND="${DEPEND}"

S="${WORKDIR}/reshade-${PV}"

PATCHES=(
"${FILESDIR}/${P}-gcc.patch"
)

multilib_src_configure() {
# Create meson.build file
# meson init -n ReShadeFX --version 4.8.2 $(ls -1 source/effect_*.cpp | xargs)
# meson rewrite target ReShadeFX rm_target
# meson rewrite target --type shared_library ReShadeFX add_target $(ls -1 source/effect_*.cpp | xargs)
cat > "${S}/meson.build" <<-EOF
project('${PN}', ['cpp'], default_options : ['cpp_std=c++20'], version : '${PV}', meson_version : '>= 0.50')

sources = [
'source/effect_codegen_glsl.cpp',
'source/effect_codegen_hlsl.cpp',
'source/effect_codegen_spirv.cpp',
'source/effect_expression.cpp',
'source/effect_lexer.cpp',
'source/effect_parser_exp.cpp',
'source/effect_parser_stmt.cpp',
'source/effect_preprocessor.cpp',
'source/effect_symbol_table.cpp',
]

headers = [
'source/effect_codegen.hpp',
'source/effect_expression.hpp',
'source/effect_lexer.hpp',
'source/effect_module.hpp',
'source/effect_parser.hpp',
'source/effect_preprocessor.hpp',
'source/effect_symbol_table.hpp',
'source/effect_token.hpp',
]

headers_install_dir = 'reshade'

# Shared lib
out_lib = shared_library('ReShadeFX', sources, include_directories: [ '/usr/include/spirv/unified1' ], install: true)

# pkgconfig
pkg = import('pkgconfig')
pkg.generate(out_lib, subdirs: headers_install_dir, description: '${DESCRIPTION}')

# Headers
install_headers(headers, subdir: headers_install_dir)
EOF

meson_src_configure
}

multilib_src_install() {
meson_src_install
}