mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
VideoCommon: Handle emboss texgen with only a single normal
Fixes a large number of effects in Rogue Squadron 2 and 3.
This commit is contained in:
@ -453,6 +453,7 @@ void VertexManagerBase::Flush()
|
||||
}
|
||||
}
|
||||
|
||||
CalculateBinormals(VertexLoaderManager::GetCurrentVertexFormat());
|
||||
// Calculate ZSlope for zfreeze
|
||||
VertexShaderManager::SetConstants();
|
||||
if (!bpmem.genMode.zfreeze)
|
||||
@ -595,6 +596,31 @@ void VertexManagerBase::CalculateZSlope(NativeVertexFormat* format)
|
||||
m_zslope.dirty = true;
|
||||
}
|
||||
|
||||
void VertexManagerBase::CalculateBinormals(NativeVertexFormat* format)
|
||||
{
|
||||
const PortableVertexDeclaration vert_decl = format->GetVertexDeclaration();
|
||||
|
||||
// Only update the binormal/tangent vertex shader constants if the vertex format lacks binormals
|
||||
// (VertexLoaderManager::binormal_cache gets updated by the vertex loader when binormals are
|
||||
// present, though)
|
||||
if (vert_decl.normals[1].enable)
|
||||
return;
|
||||
|
||||
VertexLoaderManager::tangent_cache[3] = 0;
|
||||
VertexLoaderManager::binormal_cache[3] = 0;
|
||||
|
||||
if (VertexShaderManager::constants.cached_tangent != VertexLoaderManager::tangent_cache)
|
||||
{
|
||||
VertexShaderManager::constants.cached_tangent = VertexLoaderManager::tangent_cache;
|
||||
VertexShaderManager::dirty = true;
|
||||
}
|
||||
if (VertexShaderManager::constants.cached_binormal != VertexLoaderManager::binormal_cache)
|
||||
{
|
||||
VertexShaderManager::constants.cached_binormal = VertexLoaderManager::binormal_cache;
|
||||
VertexShaderManager::dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
void VertexManagerBase::UpdatePipelineConfig()
|
||||
{
|
||||
NativeVertexFormat* vertex_format = VertexLoaderManager::GetCurrentVertexFormat();
|
||||
|
Reference in New Issue
Block a user