mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-27 07:46:17 +02:00
[vk, gl, spv] Opcode Promotion path emulation
This commit is contained in:
parent
4cc99b9ff5
commit
178a0ce571
11 changed files with 391 additions and 75 deletions
29
src/shader_recompiler/backend/spirv/texture_helpers.h
Normal file
29
src/shader_recompiler/backend/spirv/texture_helpers.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shader_recompiler/profile.h"
|
||||
#include "shader_recompiler/shader_info.h"
|
||||
|
||||
namespace Shader::Backend::SPIRV {
|
||||
|
||||
inline bool Is1DTexture(TextureType type) noexcept {
|
||||
return type == TextureType::Color1D || type == TextureType::ColorArray1D;
|
||||
}
|
||||
|
||||
inline bool Needs1DPromotion(const Profile& profile, TextureType type) noexcept {
|
||||
return !profile.support_sampled_1d && Is1DTexture(type);
|
||||
}
|
||||
|
||||
inline TextureType EffectiveTextureType(const Profile& profile, TextureType type) noexcept {
|
||||
if (!Needs1DPromotion(profile, type)) {
|
||||
return type;
|
||||
}
|
||||
if (type == TextureType::Color1D) {
|
||||
return TextureType::Color2D;
|
||||
}
|
||||
return TextureType::ColorArray2D;
|
||||
}
|
||||
|
||||
} // namespace Shader::Backend::SPIRV
|
||||
Loading…
Add table
Add a link
Reference in a new issue