From b4399dbdf3a9380b5487753ac3dedf21daba2aed Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 24 Sep 2014 00:10:45 +1000 Subject: [PATCH 1/2] Fixed the "Undeclared identifier: uv0" OpenGL shader compile error that appears in NBA2K11. --- Source/Core/VideoCommon/PixelShaderGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 8e90713fd0..dec20636a9 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -318,7 +318,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T // compute window position if needed because binding semantic WPOS is not widely supported // Let's set up attributes - for (unsigned int i = 0; i < xfmem.numTexGen.numTexGens; ++i) + for (unsigned int i = 0; i < numTexgen; ++i) { out.Write("centroid in float3 uv%d;\n", i); } From 539f270c67c8dcd422e59dc87df4482542c82366 Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 24 Sep 2014 10:46:09 +1000 Subject: [PATCH 2/2] Added a xf.numtexgen != bp.numtextgen error log if there is a mismatch detected. --- Source/Core/VideoCommon/VertexManagerBase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp index 919cb0b17e..d637ad9017 100644 --- a/Source/Core/VideoCommon/VertexManagerBase.cpp +++ b/Source/Core/VideoCommon/VertexManagerBase.cpp @@ -232,6 +232,9 @@ void VertexManager::Flush() GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true); + if (xfmem.numTexGen.numTexGens != bpmem.genMode.numtexgens) + ERROR_LOG(VIDEO, "xf.numtexgens (%d) does not match bp.numtexgens (%d). Error in command stream.", xfmem.numTexGen.numTexGens, bpmem.genMode.numtexgens.Value()); + IsFlushed = true; }