Fix for previous commit

This commit is contained in:
Henrik Rydgård 2012-12-05 11:13:36 +07:00
parent 36943db4ec
commit a0d8017c22
3 changed files with 6 additions and 3 deletions

View File

@ -25,9 +25,7 @@
#include "TransformPipeline.h"
Shader::Shader(const char *code, uint32_t shaderType) {
#ifdef _DEBUG
source_ = code;
#endif
#ifdef _WIN32
// OutputDebugString(code);
#endif
@ -66,6 +64,8 @@ LinkedShader::LinkedShader(Shader *vs, Shader *fs)
char* buf = new char[bufLength];
glGetProgramInfoLog(program, bufLength, NULL, buf);
ERROR_LOG(G3D, "Could not link program:\n %s", buf);
ERROR_LOG(G3D, "VS:\n%s", vs->source().c_str());
ERROR_LOG(G3D, "FS:\n%s", fs->source().c_str());
delete [] buf; // we're dead!
}
return;

View File

@ -33,7 +33,6 @@ struct LinkedShader
void use();
uint32_t program;
u32 dirtyUniforms;
// Pre-fetched attrs and uniforms
@ -99,6 +98,7 @@ struct Shader
{
Shader(const char *code, uint32_t shaderType);
uint32_t shader;
const std::string &source() const { return source_; }
private:
std::string source_;
};

View File

@ -41,10 +41,13 @@ static char buffer[16384];
// prim so we can special case for RECTANGLES :(
void ComputeVertexShaderID(VertexShaderID *id, int prim)
{
int doTexture = (gstate.textureMapEnable & 1) && !(gstate.clearmode & 1);
memset(id->d, 0, sizeof(id->d));
id->d[0] = gstate.lmode & 1;
id->d[0] |= ((int)gstate.isModeThrough()) << 1;
id->d[0] |= ((int)gstate.isFogEnabled()) << 2;
id->d[0] |= doTexture << 3;
// Bits that we will need:
// lightenable * 4