summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-05-05 14:29:35 +0200
committerwwylele <wwylele@gmail.com>2017-05-05 14:35:17 +0200
commit039b2930928c34c011fcc236d7f8c32599077ad0 (patch)
treefe23bee60f856aa18b5ddda1d4094a452489babc /src/video_core
parentpica: use correct coordinates for texture 2 (diff)
downloadyuzu-039b2930928c34c011fcc236d7f8c32599077ad0.tar
yuzu-039b2930928c34c011fcc236d7f8c32599077ad0.tar.gz
yuzu-039b2930928c34c011fcc236d7f8c32599077ad0.tar.bz2
yuzu-039b2930928c34c011fcc236d7f8c32599077ad0.tar.lz
yuzu-039b2930928c34c011fcc236d7f8c32599077ad0.tar.xz
yuzu-039b2930928c34c011fcc236d7f8c32599077ad0.tar.zst
yuzu-039b2930928c34c011fcc236d7f8c32599077ad0.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/regs.h2
-rw-r--r--src/video_core/regs_texturing.h8
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp2
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp3
5 files changed, 12 insertions, 7 deletions
diff --git a/src/video_core/regs.h b/src/video_core/regs.h
index 86826088b..1776dad89 100644
--- a/src/video_core/regs.h
+++ b/src/video_core/regs.h
@@ -93,7 +93,7 @@ ASSERT_REG_POSITION(rasterizer.viewport_corner, 0x68);
ASSERT_REG_POSITION(rasterizer.depthmap_enable, 0x6D);
ASSERT_REG_POSITION(texturing, 0x80);
-ASSERT_REG_POSITION(texturing.texture0_enable, 0x80);
+ASSERT_REG_POSITION(texturing.main_config, 0x80);
ASSERT_REG_POSITION(texturing.texture0, 0x81);
ASSERT_REG_POSITION(texturing.texture0_format, 0x8e);
ASSERT_REG_POSITION(texturing.fragment_lighting_enable, 0x8f);
diff --git a/src/video_core/regs_texturing.h b/src/video_core/regs_texturing.h
index 515848bd6..8a7c6efe4 100644
--- a/src/video_core/regs_texturing.h
+++ b/src/video_core/regs_texturing.h
@@ -126,7 +126,7 @@ struct TexturingRegs {
BitField<10, 1, u32> texture3_enable; // TODO: unimplemented
BitField<13, 1, u32> texture2_use_coord1;
BitField<16, 1, u32> clear_texture_cache; // TODO: unimplemented
- };
+ } main_config;
TextureConfig texture0;
INSERT_PADDING_WORDS(0x8);
BitField<0, 4, TextureFormat> texture0_format;
@@ -146,9 +146,9 @@ struct TexturingRegs {
};
const std::array<FullTextureConfig, 3> GetTextures() const {
return {{
- {texture0_enable.ToBool(), texture0, texture0_format},
- {texture1_enable.ToBool(), texture1, texture1_format},
- {texture2_enable.ToBool(), texture2, texture2_format},
+ {main_config.texture0_enable.ToBool(), texture0, texture0_format},
+ {main_config.texture1_enable.ToBool(), texture1, texture1_format},
+ {main_config.texture2_enable.ToBool(), texture2, texture2_format},
}};
}
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index a47307099..12ac9bbd9 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -402,6 +402,10 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
SyncLogicOp();
break;
+ case PICA_REG_INDEX(texturing.main_config):
+ shader_dirty = true;
+ break;
+
// Texture 0 type
case PICA_REG_INDEX(texturing.texture0.type):
shader_dirty = true;
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index 5077e38b7..7b44dade8 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -40,7 +40,7 @@ PicaShaderConfig PicaShaderConfig::BuildFromRegs(const Pica::Regs& regs) {
state.texture0_type = regs.texturing.texture0.type;
- state.texture2_use_coord1 = regs.texturing.texture2_use_coord1 != 0;
+ state.texture2_use_coord1 = regs.texturing.main_config.texture2_use_coord1 != 0;
// Copy relevant tev stages fields.
// We don't sync const_color here because of the high variance, it is a
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index fa8377f80..20addf0bd 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -276,7 +276,8 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
DEBUG_ASSERT(0 != texture.config.address);
- int coordinate_i = (i == 2 && regs.texturing.texture2_use_coord1) ? 1 : i;
+ int coordinate_i =
+ (i == 2 && regs.texturing.main_config.texture2_use_coord1) ? 1 : i;
float24 u = uv[coordinate_i].u();
float24 v = uv[coordinate_i].v();