summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorheapo <heapo3@gmail.com>2018-12-16 18:34:24 +0100
committerheapo <heapo3@gmail.com>2018-12-17 16:53:48 +0100
commita6daed74f58a37bfddd32bc1e0503013cd32df13 (patch)
tree587be4617c3b8a96ae2cc4590368c8043c13b0eb /src/video_core
parentMerge pull request #1905 from bunnei/ignore-empty-gpu-lists (diff)
downloadyuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.tar
yuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.tar.gz
yuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.tar.bz2
yuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.tar.lz
yuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.tar.xz
yuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.tar.zst
yuzu-a6daed74f58a37bfddd32bc1e0503013cd32df13.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index a5cfa0070..708c7b4e9 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1591,23 +1591,21 @@ private:
process_mode == Tegra::Shader::TextureProcessMode::LL ||
process_mode == Tegra::Shader::TextureProcessMode::LLA;
+ // LOD selection (either via bias or explicit textureLod) not supported in GL for
+ // sampler2DArrayShadow and samplerCubeArrayShadow.
const bool gl_lod_supported = !(
(texture_type == Tegra::Shader::TextureType::Texture2D && is_array && depth_compare) ||
- (texture_type == Tegra::Shader::TextureType::TextureCube && !is_array &&
- depth_compare));
+ (texture_type == Tegra::Shader::TextureType::TextureCube && is_array && depth_compare));
const std::string read_method = lod_needed && gl_lod_supported ? "textureLod(" : "texture(";
std::string texture = read_method + sampler + ", coord";
- if (process_mode != Tegra::Shader::TextureProcessMode::None) {
+ UNIMPLEMENTED_IF(process_mode != Tegra::Shader::TextureProcessMode::None &&
+ !gl_lod_supported);
+
+ if (process_mode != Tegra::Shader::TextureProcessMode::None && gl_lod_supported) {
if (process_mode == Tegra::Shader::TextureProcessMode::LZ) {
- if (gl_lod_supported) {
- texture += ", 0";
- } else {
- // Lod 0 is emulated by a big negative bias
- // in scenarios that are not supported by glsl
- texture += ", -1000";
- }
+ texture += ", 0.0";
} else {
// If present, lod or bias are always stored in the register indexed by the
// gpr20
@@ -1645,15 +1643,15 @@ private:
if (depth_compare && !is_array && texture_type == Tegra::Shader::TextureType::Texture1D) {
coord += ",0.0";
}
+ if (is_array) {
+ coord += ',' + regs.GetRegisterAsInteger(array_register);
+ }
if (depth_compare) {
// Depth is always stored in the register signaled by gpr20
// or in the next register if lod or bias are used
const u64 depth_register = instr.gpr20.Value() + (lod_bias_enabled ? 1 : 0);
coord += ',' + regs.GetRegisterAsFloat(depth_register);
}
- if (is_array) {
- coord += ',' + regs.GetRegisterAsInteger(array_register);
- }
coord += ");";
return std::make_pair(
coord, GetTextureCode(instr, texture_type, process_mode, depth_compare, is_array, 0));
@@ -1686,15 +1684,15 @@ private:
}
}
+ if (is_array) {
+ coord += ',' + regs.GetRegisterAsInteger(array_register);
+ }
if (depth_compare) {
// Depth is always stored in the register signaled by gpr20
// or in the next register if lod or bias are used
const u64 depth_register = instr.gpr20.Value() + (lod_bias_enabled ? 1 : 0);
coord += ',' + regs.GetRegisterAsFloat(depth_register);
}
- if (is_array) {
- coord += ',' + regs.GetRegisterAsInteger(array_register);
- }
coord += ");";
return std::make_pair(coord,