Fix minor discrepancy in shader ID calculation, I don't think this will fix anything though. Bumping shader cache version and doing minor cleanup too.

This commit is contained in:
Henrik Rydgård committed 2017-11-30 22:44:39 +01:00
1 parent 20e93515be
commit 3e011238c5
4 files changed
+5 -6

No files matched your search

+3 -3
View File
@@ -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);
-1
View File
@@ -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);
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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";