Compare commits

...

2 Commits

Author SHA1 Message Date
GPUCode 208e1a0aaf rasterizer_cache: Clear null surface to transparent 2024-01-21 13:22:35 +02:00
GPUCode 1247bff174 glsl_shader_gen: Remove invariant qualifier
* Causes visual regressions in Pokemon with RADV
2024-01-21 11:57:56 +02:00
2 changed files with 16 additions and 0 deletions

View File

@ -67,6 +67,16 @@ RasterizerCache<T>::RasterizerCache(Memory::MemorySystem& memory_,
.wrap_s = TextureConfig::WrapMode::ClampToBorder,
.wrap_t = TextureConfig::WrapMode::ClampToBorder,
}));
auto& null_surface = slot_surfaces[NULL_SURFACE_ID];
runtime.ClearTexture(null_surface, {
.texture_level = 0,
.texture_rect = null_surface.GetScaledRect(),
.value =
{
.color = {0.f, 0.f, 0.f, 0.f},
},
});
}
template <class T>

View File

@ -63,7 +63,13 @@ static std::string GetVertexInterfaceDeclaration(bool is_output, bool use_clip_p
if (is_output && separable_shader) {
// gl_PerVertex redeclaration is required for separate shader object
out += "out gl_PerVertex {\n";
// Apple Silicon GPU drivers optimize more aggressively, which can create
// too much variance and cause visual artifacting in games like Pokemon.
#ifdef __APPLE__
out += " invariant vec4 gl_Position;\n";
#else
out += " vec4 gl_Position;\n";
#endif
if (use_clip_planes) {
out += " float gl_ClipDistance[2];\n";
}