summaryrefslogtreecommitdiffstats
path: root/src/video_core/regs_texturing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/regs_texturing.h')
-rw-r--r--src/video_core/regs_texturing.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/video_core/regs_texturing.h b/src/video_core/regs_texturing.h
index be8bc6826..3318812da 100644
--- a/src/video_core/regs_texturing.h
+++ b/src/video_core/regs_texturing.h
@@ -29,6 +29,11 @@ struct TexturingRegs {
ClampToBorder = 1,
Repeat = 2,
MirroredRepeat = 3,
+ // Mode 4-7 produces some weird result and may be just invalid:
+ // 4: Positive coord: clamp to edge; negative coord: repeat
+ // 5: Positive coord: clamp to border; negative coord: repeat
+ // 6: Repeat
+ // 7: Repeat
};
enum TextureFilter : u32 {
@@ -45,22 +50,22 @@ struct TexturingRegs {
} border_color;
union {
- BitField<0, 16, u32> height;
- BitField<16, 16, u32> width;
+ BitField<0, 11, u32> height;
+ BitField<16, 11, u32> width;
};
union {
BitField<1, 1, TextureFilter> mag_filter;
BitField<2, 1, TextureFilter> min_filter;
- BitField<8, 2, WrapMode> wrap_t;
- BitField<12, 2, WrapMode> wrap_s;
- BitField<28, 2, TextureType>
- type; ///< @note Only valid for texture 0 according to 3DBrew.
+ BitField<8, 3, WrapMode> wrap_t;
+ BitField<12, 3, WrapMode> wrap_s;
+ /// @note Only valid for texture 0 according to 3DBrew.
+ BitField<28, 3, TextureType> type;
};
INSERT_PADDING_WORDS(0x1);
- u32 address;
+ BitField<0, 28, u32> address;
PAddr GetPhysicalAddress() const {
return address * 8;
@@ -122,7 +127,11 @@ struct TexturingRegs {
BitField<0, 1, u32> texture0_enable;
BitField<1, 1, u32> texture1_enable;
BitField<2, 1, u32> texture2_enable;
- };
+ BitField<8, 2, u32> texture3_coordinates; // TODO: unimplemented
+ 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;
@@ -142,9 +151,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},
}};
}
@@ -199,7 +208,7 @@ struct TexturingRegs {
Lerp = 4,
Subtract = 5,
Dot3_RGB = 6,
-
+ Dot3_RGBA = 7,
MultiplyThenAdd = 8,
AddThenMultiply = 9,
};