Fix GXSetTevColorS10; fix sampling GX_TF_R8_PC

This commit is contained in:
Luke Street 2022-07-31 17:02:56 -04:00
parent e22541f175
commit 04590f30cd
4 changed files with 7 additions and 5 deletions

View File

@ -61,10 +61,10 @@ void GXSetTevColor(GXTevRegID id, GXColor color) {
void GXSetTevColorS10(GXTevRegID id, GXColorS10 color) {
update_gx_state(g_gxState.colorRegs[id], aurora::Vec4<float>{
static_cast<float>(color.r) / 1023.f,
static_cast<float>(color.g) / 1023.f,
static_cast<float>(color.b) / 1023.f,
static_cast<float>(color.a) / 1023.f,
static_cast<float>(color.r) / 255.f,
static_cast<float>(color.g) / 255.f,
static_cast<float>(color.b) / 255.f,
static_cast<float>(color.a) / 255.f,
});
}

View File

@ -310,6 +310,7 @@ static inline bool requires_load_conversion(const GXTexObj_& obj) {
case GX_TF_C4:
case GX_TF_C8:
case GX_TF_C14X2:
case GX_TF_R8_PC:
return true;
default:
return false;

View File

@ -574,6 +574,7 @@ static inline std::string texture_conversion(const TextureConfig& tex, u32 stage
break;
case GX_TF_I4:
case GX_TF_I8:
case GX_TF_R8_PC:
// Splat R to RGBA
out += fmt::format(FMT_STRING("\n sampled{0} = vec4<f32>(sampled{0}.r);"), stageIdx);
break;

View File

@ -36,7 +36,7 @@ struct TextureRef {
~TextureRef() {
wgpuTextureViewRelease(view);
wgpuTextureDestroy(texture);
wgpuTextureRelease(texture);
}
};