Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8433057909 | ||
|
c4c90f0190 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
matrix:
|
||||
target: ["appimage", "fresh"]
|
||||
container:
|
||||
image: citraemu/build-environments:linux-${{ matrix.target }}
|
||||
image: pablomk7/build-environments:linux-${{ matrix.target }}
|
||||
options: -u 1001
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
2
.github/workflows/ci-merge.js
vendored
2
.github/workflows/ci-merge.js
vendored
@@ -200,7 +200,7 @@ async function mergebot(github, context, execa) {
|
||||
}
|
||||
console.info("The following pull requests will be merged:");
|
||||
console.table(displayList);
|
||||
await fetchPullRequests(pulls, "https://github.com/citra-emu/citra", execa);
|
||||
await fetchPullRequests(pulls, "https://github.com/PabloMK7/citra", execa);
|
||||
const mergeResults = await mergePullRequests(pulls, execa);
|
||||
await generateReadme(pulls, context, mergeResults, execa);
|
||||
await tagAndPush(github, context.repo.owner, `${context.repo.repo}-canary`, execa, true);
|
||||
|
2
.github/workflows/format.yml
vendored
2
.github/workflows/format.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
clang-format:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: citraemu/build-environments:linux-fresh
|
||||
image: pablomk7/build-environments:linux-fresh
|
||||
options: -u 1001
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
100
.github/workflows/publish.yml
vendored
100
.github/workflows/publish.yml
vendored
@@ -1,100 +0,0 @@
|
||||
name: citra-publish
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '7 0 * * *'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
nightly:
|
||||
description: 'Whether to trigger a nightly build (true/false/auto)'
|
||||
required: false
|
||||
default: 'true'
|
||||
canary:
|
||||
description: 'Whether to trigger a canary build (true/false/auto)'
|
||||
required: false
|
||||
default: 'true'
|
||||
|
||||
jobs:
|
||||
nightly:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.inputs.nightly != 'false' && github.repository == 'citra-emu/citra' }}
|
||||
steps:
|
||||
# this checkout is required to make sure the GitHub Actions scripts are available
|
||||
- uses: actions/checkout@v4
|
||||
name: Pre-checkout
|
||||
with:
|
||||
submodules: false
|
||||
- uses: actions/github-script@v7
|
||||
id: check-changes
|
||||
name: 'Check for new changes'
|
||||
env:
|
||||
# 24 hours
|
||||
DETECTION_TIME_FRAME: 86400000
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
if (context.payload.inputs && context.payload.inputs.nightly === 'true') return true;
|
||||
const checkBaseChanges = require('./.github/workflows/ci-merge.js').checkBaseChanges;
|
||||
return checkBaseChanges(github, context);
|
||||
- run: npm install execa@5
|
||||
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout
|
||||
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
||||
with:
|
||||
path: 'citra-merge'
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
token: ${{ secrets.ALT_GITHUB_TOKEN }}
|
||||
- uses: actions/github-script@v7
|
||||
name: 'Update and tag new commits'
|
||||
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
||||
env:
|
||||
ALT_GITHUB_TOKEN: ${{ secrets.ALT_GITHUB_TOKEN }}
|
||||
with:
|
||||
script: |
|
||||
const execa = require("execa");
|
||||
const tagAndPush = require('./.github/workflows/ci-merge.js').tagAndPush;
|
||||
process.chdir('${{ github.workspace }}/citra-merge');
|
||||
tagAndPush(github, context.repo.owner, `${context.repo.repo}-nightly`, execa);
|
||||
canary:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.inputs.canary != 'false' && github.repository == 'citra-emu/citra' }}
|
||||
steps:
|
||||
# this checkout is required to make sure the GitHub Actions scripts are available
|
||||
- uses: actions/checkout@v4
|
||||
name: Pre-checkout
|
||||
with:
|
||||
submodules: false
|
||||
- uses: actions/github-script@v7
|
||||
id: check-changes
|
||||
name: 'Check for new changes'
|
||||
env:
|
||||
# 24 hours
|
||||
DETECTION_TIME_FRAME: 86400000
|
||||
with:
|
||||
script: |
|
||||
if (context.payload.inputs && context.payload.inputs.canary === 'true') return true;
|
||||
const checkCanaryChanges = require('./.github/workflows/ci-merge.js').checkCanaryChanges;
|
||||
return checkCanaryChanges(github, context);
|
||||
- run: npm install execa@5
|
||||
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout
|
||||
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
||||
with:
|
||||
path: 'citra-merge'
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
token: ${{ secrets.ALT_GITHUB_TOKEN }}
|
||||
- uses: actions/github-script@v7
|
||||
name: 'Check and merge canary changes'
|
||||
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
||||
env:
|
||||
ALT_GITHUB_TOKEN: ${{ secrets.ALT_GITHUB_TOKEN }}
|
||||
with:
|
||||
script: |
|
||||
const execa = require("execa");
|
||||
const mergebot = require('./.github/workflows/ci-merge.js').mergebot;
|
||||
process.chdir('${{ github.workspace }}/citra-merge');
|
||||
mergebot(github, context, execa);
|
2
.github/workflows/transifex.yml
vendored
2
.github/workflows/transifex.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
transifex:
|
||||
runs-on: ubuntu-latest
|
||||
container: citraemu/build-environments:linux-fresh
|
||||
container: pablomk7/build-environments:linux-fresh
|
||||
if: ${{ github.repository == 'citra-emu/citra' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@@ -20,6 +20,21 @@ layout (push_constant, std140) uniform DrawInfo {
|
||||
|
||||
layout (set = 0, binding = 0) uniform sampler2D screen_textures[3];
|
||||
|
||||
void main() {
|
||||
color = texture(screen_textures[screen_id_l], frag_tex_coord);
|
||||
vec4 GetScreen(int screen_id) {
|
||||
#ifdef ARRAY_DYNAMIC_INDEX
|
||||
return texture(screen_textures[screen_id], frag_tex_coord);
|
||||
#else
|
||||
switch (screen_id) {
|
||||
case 0:
|
||||
return texture(screen_textures[0], frag_tex_coord);
|
||||
case 1:
|
||||
return texture(screen_textures[1], frag_tex_coord);
|
||||
case 2:
|
||||
return texture(screen_textures[2], frag_tex_coord);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void main() {
|
||||
color = GetScreen(screen_id_l);
|
||||
}
|
||||
|
@@ -32,8 +32,23 @@ layout (push_constant, std140) uniform DrawInfo {
|
||||
|
||||
layout (set = 0, binding = 0) uniform sampler2D screen_textures[3];
|
||||
|
||||
vec4 GetScreen(int screen_id) {
|
||||
#ifdef ARRAY_DYNAMIC_INDEX
|
||||
return texture(screen_textures[screen_id], frag_tex_coord);
|
||||
#else
|
||||
switch (screen_id) {
|
||||
case 0:
|
||||
return texture(screen_textures[0], frag_tex_coord);
|
||||
case 1:
|
||||
return texture(screen_textures[1], frag_tex_coord);
|
||||
case 2:
|
||||
return texture(screen_textures[2], frag_tex_coord);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 color_tex_l = texture(screen_textures[screen_id_l], frag_tex_coord);
|
||||
vec4 color_tex_r = texture(screen_textures[screen_id_r], frag_tex_coord);
|
||||
vec4 color_tex_l = GetScreen(screen_id_l);
|
||||
vec4 color_tex_r = GetScreen(screen_id_r);
|
||||
color = vec4(color_tex_l.rgb*l+color_tex_r.rgb*r, color_tex_l.a);
|
||||
}
|
||||
|
@@ -20,10 +20,25 @@ layout (push_constant, std140) uniform DrawInfo {
|
||||
|
||||
layout (set = 0, binding = 0) uniform sampler2D screen_textures[3];
|
||||
|
||||
vec4 GetScreen(int screen_id) {
|
||||
#ifdef ARRAY_DYNAMIC_INDEX
|
||||
return texture(screen_textures[screen_id], frag_tex_coord);
|
||||
#else
|
||||
switch (screen_id) {
|
||||
case 0:
|
||||
return texture(screen_textures[0], frag_tex_coord);
|
||||
case 1:
|
||||
return texture(screen_textures[1], frag_tex_coord);
|
||||
case 2:
|
||||
return texture(screen_textures[2], frag_tex_coord);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void main() {
|
||||
float screen_row = o_resolution.x * frag_tex_coord.x;
|
||||
if (int(screen_row) % 2 == reverse_interlaced)
|
||||
color = texture(screen_textures[screen_id_l], frag_tex_coord);
|
||||
color = GetScreen(screen_id_l);
|
||||
else
|
||||
color = texture(screen_textures[screen_id_r], frag_tex_coord);
|
||||
color = GetScreen(screen_id_r);
|
||||
}
|
||||
|
@@ -224,15 +224,17 @@ void RendererVulkan::LoadFBToScreenInfo(const Pica::FramebufferConfig& framebuff
|
||||
}
|
||||
|
||||
void RendererVulkan::CompileShaders() {
|
||||
vk::Device device = instance.GetDevice();
|
||||
const vk::Device device = instance.GetDevice();
|
||||
const std::string_view preamble =
|
||||
instance.IsImageArrayDynamicIndexSupported() ? "#define ARRAY_DYNAMIC_INDEX" : "";
|
||||
present_vertex_shader =
|
||||
Compile(HostShaders::VULKAN_PRESENT_VERT, vk::ShaderStageFlagBits::eVertex, device);
|
||||
present_shaders[0] =
|
||||
Compile(HostShaders::VULKAN_PRESENT_FRAG, vk::ShaderStageFlagBits::eFragment, device);
|
||||
present_shaders[0] = Compile(HostShaders::VULKAN_PRESENT_FRAG,
|
||||
vk::ShaderStageFlagBits::eFragment, device, preamble);
|
||||
present_shaders[1] = Compile(HostShaders::VULKAN_PRESENT_ANAGLYPH_FRAG,
|
||||
vk::ShaderStageFlagBits::eFragment, device);
|
||||
vk::ShaderStageFlagBits::eFragment, device, preamble);
|
||||
present_shaders[2] = Compile(HostShaders::VULKAN_PRESENT_INTERLACED_FRAG,
|
||||
vk::ShaderStageFlagBits::eFragment, device);
|
||||
vk::ShaderStageFlagBits::eFragment, device, preamble);
|
||||
|
||||
auto properties = instance.GetPhysicalDevice().getProperties();
|
||||
for (std::size_t i = 0; i < present_samplers.size(); i++) {
|
||||
|
@@ -248,6 +248,11 @@ public:
|
||||
return triangle_fan_supported;
|
||||
}
|
||||
|
||||
/// Returns true if dynamic indices can be used inside shaders.
|
||||
bool IsImageArrayDynamicIndexSupported() const {
|
||||
return features.shaderSampledImageArrayDynamicIndexing;
|
||||
}
|
||||
|
||||
/// Returns the minimum vertex stride alignment
|
||||
u32 GetMinVertexStrideAlignment() const {
|
||||
return min_vertex_stride_alignment;
|
||||
|
@@ -158,7 +158,8 @@ bool InitializeCompiler() {
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device) {
|
||||
vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device,
|
||||
std::string_view premable) {
|
||||
if (!InitializeCompiler()) {
|
||||
return {};
|
||||
}
|
||||
@@ -176,6 +177,7 @@ vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, v
|
||||
shader->setEnvTarget(glslang::EShTargetSpv,
|
||||
glslang::EShTargetLanguageVersion::EShTargetSpv_1_3);
|
||||
shader->setStringsWithLengths(&pass_source_code, &pass_source_code_length, 1);
|
||||
shader->setPreamble(premable.data());
|
||||
|
||||
glslang::TShader::ForbidIncluder includer;
|
||||
if (!shader->parse(&DefaultTBuiltInResource, default_version, profile, false, true, messages,
|
||||
|
@@ -16,7 +16,8 @@ namespace Vulkan {
|
||||
* @param stage The pipeline stage the shader will be used in.
|
||||
* @param device The vulkan device handle.
|
||||
*/
|
||||
vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device);
|
||||
vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device,
|
||||
std::string_view premable = "");
|
||||
|
||||
/**
|
||||
* @brief Creates a vulkan shader module from SPIR-V bytecode.
|
||||
|
Reference in New Issue
Block a user