summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2013-03-29 20:33:28 +0100
committerNeoBrainX <NeoBrainX@gmail.com>2013-03-29 20:35:31 +0100
commit3c02f227db1e02f233f3aac8dc42476bd0b17f7a (patch)
tree27a762745f9aae2902f5cb8bd0a290b1fd7e8959 /Source/Core/VideoCommon/Src/PixelShaderGen.cpp
parentb2517c0308e992c7e3c13e0fe17140e422ae770d (diff)
PixelShaderManager: Disable constant cache (won't work in the non-UBO path of the opengl backend).
ShaderGen: Replace typeid usage with more general code.
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index 6ee5a72994..49b77274a8 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -19,7 +19,6 @@
#include <cmath>
#include <assert.h>
#include <locale.h>
-#include <typeinfo>
#include "LightingShaderGen.h"
#include "PixelShaderGen.h"
@@ -271,13 +270,12 @@ template<class T>
void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components)
{
// TODO: Can be optimized if using alpha pass
-#define SetUidField(name, value) if (typeid(T) == typeid(PixelShaderUid)) {out.GetUidData().name = value; };
-#define OR_UidField(name, value) if (typeid(T) == typeid(PixelShaderUid)) {out.GetUidData().name |= value; };
- if (typeid(T) == typeid(PixelShaderCode))
- {
+#define SetUidField(name, value) if (&out.GetUidData() != NULL) {out.GetUidData().name = value; };
+#define OR_UidField(name, value) if (&out.GetUidData() != NULL) {out.GetUidData().name |= value; };
+ out.SetBuffer(text);
+ if (out.GetBuffer() != NULL)
setlocale(LC_NUMERIC, "C"); // Reset locale for compilation
- out.SetBuffer(text);
- }
+
/// text[sizeof(text) - 1] = 0x7C; // canary
unsigned int numStages = bpmem.genMode.numtevstages + 1;
@@ -669,7 +667,8 @@ void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u
/// if (text[sizeof(text) - 1] != 0x7C)
/// PanicAlert("PixelShader generator - buffer too small, canary has been eaten!");
- setlocale(LC_NUMERIC, ""); // restore locale
+ if (out.GetBuffer() != NULL)
+ setlocale(LC_NUMERIC, ""); // restore locale
}