Permalink
Browse files

Fix minor discrepancy in shader ID calculation, I don't think this wi…

…ll fix anything though. Bumping shader cache version and doing minor cleanup too.
  • Loading branch information...
hrydgard committed Nov 30, 2017
1 parent 20e9351 commit 3e011238c5002e303da2da881405fd5d36ebf73a
@@ -57,6 +57,7 @@ std::string VertexShaderDesc(const ShaderID &id) {
}
void ComputeVertexShaderID(ShaderID *id_out, u32 vertType, bool useHWTransform) {
bool isModeThrough = gstate.isModeThrough();
bool doTexture = gstate.isTextureMapEnabled() && !gstate.isModeClear();
bool doTextureTransform = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX;
bool doShadeMapping = doTexture && (gstate.getUVGenMode() == GE_TEXMAP_ENVIRONMENT_MAP);
@@ -71,9 +72,8 @@ void ComputeVertexShaderID(ShaderID *id_out, u32 vertType, bool useHWTransform)
bool hasColorTess = (gstate.vertType & GE_VTYPE_COL_MASK) != 0 && (doBezier || doSpline);
bool hasTexcoordTess = (gstate.vertType & GE_VTYPE_TC_MASK) != 0 && (doBezier || doSpline);
bool enableFog = gstate.isFogEnabled() && !gstate.isModeThrough() && !gstate.isModeClear();
bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled();
// lmode: && !isModeThrough!?
bool enableFog = gstate.isFogEnabled() && !isModeThrough && !gstate.isModeClear();
bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled() && !isModeThrough;
ShaderID id;
id.SetBit(VS_BIT_LMODE, lmode);
@@ -207,7 +207,6 @@ void SoftwareTransform(
float uv[3] = {0, 0, 1};
float fogCoef = 1.0f;
// We do software T&L for now
float out[3];
float pos[3];
Vec3f normal(0, 0, 1);
@@ -930,7 +930,7 @@ std::string ShaderManagerGLES::DebugGetShaderString(std::string id, DebugShaderT
// as sometimes these features might have an effect on the ID bits.
#define CACHE_HEADER_MAGIC 0x83277592
#define CACHE_VERSION 4
#define CACHE_VERSION 5
struct CacheHeader {
uint32_t magic;
uint32_t version;
@@ -112,7 +112,7 @@ void GenerateVertexShader(const ShaderID &id, char *buffer, uint32_t *attrMask,
bool highpTexcoord = false;
if (gl_extensions.IsGLES) {
if (gstate_c.featureFlags & GPU_SUPPORTS_GLSL_ES_300) {
if (gstate_c.Supports(GPU_SUPPORTS_GLSL_ES_300)) {
WRITE(p, "#version 300 es\n");
glslES30 = true;
texelFetch = "texelFetch";

0 comments on commit 3e01123

Please sign in to comment.