Permalink
Browse files

Reporting: Use a different link message on preload.

May help us determine if this only happens from a corrupt cache.
  • Loading branch information...
unknownbrackets committed Dec 1, 2017
1 parent be63436 commit 2a540de329120eaf3eed7c91dd7f07695cb78585
@@ -60,7 +60,7 @@ void GenerateVertexShaderHLSL(const ShaderID &id, char *buffer, ShaderLanguage l
const u32 vertType = gstate.vertType;
bool isModeThrough = id.Bit(VS_BIT_IS_THROUGH);
bool lmode = id.Bit(VS_BIT_LMODE) && !isModeThrough; // TODO: Different expression than in shaderIDgen
bool lmode = id.Bit(VS_BIT_LMODE);
bool doTexture = id.Bit(VS_BIT_DO_TEXTURE);
bool doTextureTransform = id.Bit(VS_BIT_DO_TEXTURE_TRANSFORM);
@@ -92,8 +92,8 @@ Shader::~Shader() {
glDeleteShader(shader);
}
LinkedShader::LinkedShader(ShaderID VSID, Shader *vs, ShaderID FSID, Shader *fs, bool useHWTransform)
: useHWTransform_(useHWTransform), program(0), dirtyUniforms(0) {
LinkedShader::LinkedShader(ShaderID VSID, Shader *vs, ShaderID FSID, Shader *fs, bool useHWTransform, bool preloading)
: useHWTransform_(useHWTransform) {
PROFILE_THIS_SCOPE("shaderlink");
program = glCreateProgram();
@@ -153,7 +153,11 @@ LinkedShader::LinkedShader(ShaderID VSID, Shader *vs, ShaderID FSID, Shader *fs,
ERROR_LOG(G3D, "FS desc:\n%s", fs_desc.c_str());
ERROR_LOG(G3D, "VS:\n%s\n", vs_source.c_str());
ERROR_LOG(G3D, "FS:\n%s\n", fs_source.c_str());
Reporting::ReportMessage("Error in shader program link: info: %s\nfs: %s\n%s\nvs: %s\n%s", buf, fs_desc.c_str(), fs_source.c_str(), vs_desc.c_str(), vs_source.c_str());
if (preloading) {
Reporting::ReportMessage("Error in shader program link during preload: info: %s\nfs: %s\n%s\nvs: %s\n%s", buf, fs_desc.c_str(), fs_source.c_str(), vs_desc.c_str(), vs_source.c_str());
} else {
Reporting::ReportMessage("Error in shader program link: info: %s\nfs: %s\n%s\nvs: %s\n%s", buf, fs_desc.c_str(), fs_source.c_str(), vs_desc.c_str(), vs_source.c_str());
}
#ifdef SHADERLOG
OutputDebugStringUTF8(buf);
OutputDebugStringUTF8(vs_source.c_str());
@@ -1011,7 +1015,7 @@ void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) {
Shader *vs = vsCache_.Get(vsid);
Shader *fs = fsCache_.Get(fsid);
if (vs && fs) {
LinkedShader *ls = new LinkedShader(vsid, vs, fsid, fs, vs->UseHWTransform());
LinkedShader *ls = new LinkedShader(vsid, vs, fsid, fs, vs->UseHWTransform(), true);
LinkedShaderCacheEntry entry(vs, fs, ls);
linkedShaderCache_.push_back(entry);
}
@@ -43,7 +43,7 @@ enum {
class LinkedShader {
public:
LinkedShader(ShaderID VSID, Shader *vs, ShaderID FSID, Shader *fs, bool useHWTransform);
LinkedShader(ShaderID VSID, Shader *vs, ShaderID FSID, Shader *fs, bool useHWTransform, bool preloading = false);
~LinkedShader();
void use(const ShaderID &VSID, LinkedShader *previous);
@@ -54,9 +54,9 @@ class LinkedShader {
// Set to false if the VS failed, happens on Mali-400 a lot for complex shaders.
bool useHWTransform_;
uint32_t program;
uint32_t program = 0;
uint64_t availableUniforms;
uint64_t dirtyUniforms;
uint64_t dirtyUniforms = 0;
// Present attributes in the shader.
int attrMask; // 1 << ATTR_ ... or-ed together.
@@ -165,7 +165,7 @@ void GenerateVertexShader(const ShaderID &id, char *buffer, uint32_t *attrMask,
}
bool isModeThrough = id.Bit(VS_BIT_IS_THROUGH);
bool lmode = id.Bit(VS_BIT_LMODE) && !isModeThrough; // TODO: Different expression than in shaderIDgen
bool lmode = id.Bit(VS_BIT_LMODE);
bool doTexture = id.Bit(VS_BIT_DO_TEXTURE);
bool doTextureProjection = id.Bit(VS_BIT_DO_TEXTURE_TRANSFORM);
@@ -106,7 +106,7 @@ bool GenerateVulkanGLSLVertexShader(const ShaderID &id, char *buffer, bool *uses
bool highpTexcoord = false;
bool isModeThrough = id.Bit(VS_BIT_IS_THROUGH);
bool lmode = id.Bit(VS_BIT_LMODE) && !isModeThrough; // TODO: Different expression than in shaderIDgen
bool lmode = id.Bit(VS_BIT_LMODE);
bool doTexture = id.Bit(VS_BIT_DO_TEXTURE);
bool doTextureTransform = id.Bit(VS_BIT_DO_TEXTURE_TRANSFORM);

0 comments on commit 2a540de

Please sign in to comment.