Skip to content

Commit

Permalink
Revert "Further cleanup after the removal of hardware skinning."
Browse files Browse the repository at this point in the history
This reverts commit f086a09.

Increment the shader cache version. Restore some more.
  • Loading branch information
hrydgard committed Apr 10, 2018
1 parent 69309aa commit 6a90b8f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions GPU/Common/ShaderId.cpp
Expand Up @@ -45,6 +45,7 @@ std::string VertexShaderDesc(const ShaderID &id) {
}
}
if (id.Bits(VS_BIT_MATERIAL_UPDATE, 3)) desc << "MatUp:" << id.Bits(VS_BIT_MATERIAL_UPDATE, 3) << " ";
if (id.Bits(VS_BIT_WEIGHT_FMTSCALE, 2)) desc << "WScale " << id.Bits(VS_BIT_WEIGHT_FMTSCALE, 2) << " ";
if (id.Bit(VS_BIT_FLATSHADE)) desc << "Flat ";

if (id.Bit(VS_BIT_BEZIER)) desc << "Bezier ";
Expand Down
3 changes: 2 additions & 1 deletion GPU/Common/ShaderId.h
Expand Up @@ -44,7 +44,8 @@ enum {
VS_BIT_LIGHT2_ENABLE = 54,
VS_BIT_LIGHT3_ENABLE = 55,
VS_BIT_LIGHTING_ENABLE = 56,
// 57 - 61 are free.
VS_BIT_WEIGHT_FMTSCALE = 57, // only two bits
// 59 - 61 are free.
VS_BIT_FLATSHADE = 62, // 1 bit
VS_BIT_BEZIER = 63, // 1 bit
// No more free
Expand Down
1 change: 1 addition & 0 deletions GPU/D3D11/ShaderManagerD3D11.h
Expand Up @@ -101,6 +101,7 @@ class ShaderManagerD3D11 : public ShaderManagerCommon {
// Applies dirty changes and copies the buffer.
bool IsBaseDirty() { return true; }
bool IsLightDirty() { return true; }
bool IsBoneDirty() { return true; }

private:
void Clear();
Expand Down
3 changes: 3 additions & 0 deletions GPU/Directx9/VertexShaderGeneratorDX9.cpp
Expand Up @@ -89,6 +89,9 @@ void GenerateVertexShaderHLSL(const VShaderID &id, char *buffer, ShaderLanguage
}
}

int numBoneWeights = 0;
int boneWeightScale = id.Bits(VS_BIT_WEIGHT_FMTSCALE, 2);

if (lang == HLSL_DX9) {
WRITE(p, "#pragma warning( disable : 3571 )\n");
if (isModeThrough) {
Expand Down
4 changes: 3 additions & 1 deletion GPU/GLES/ShaderManagerGLES.cpp
Expand Up @@ -79,6 +79,8 @@ LinkedShader::LinkedShader(GLRenderManager *render, VShaderID VSID, Shader *vs,
semantics.push_back({ ATTR_POSITION, "position" });
semantics.push_back({ ATTR_TEXCOORD, "texcoord" });
semantics.push_back({ ATTR_NORMAL, "normal" });
semantics.push_back({ ATTR_W1, "w1" });
semantics.push_back({ ATTR_W2, "w2" });
semantics.push_back({ ATTR_COLOR0, "color0" });
semantics.push_back({ ATTR_COLOR1, "color1" });

Expand Down Expand Up @@ -788,7 +790,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 7
#define CACHE_VERSION 8
struct CacheHeader {
uint32_t magic;
uint32_t version;
Expand Down
6 changes: 4 additions & 2 deletions GPU/GLES/ShaderManagerGLES.h
Expand Up @@ -34,8 +34,10 @@ enum {
ATTR_POSITION = 0,
ATTR_TEXCOORD = 1,
ATTR_NORMAL = 2,
ATTR_COLOR0 = 3,
ATTR_COLOR1 = 4,
ATTR_W1 = 3,
ATTR_W2 = 4,
ATTR_COLOR0 = 5,
ATTR_COLOR1 = 6,

ATTR_COUNT,
};
Expand Down
2 changes: 1 addition & 1 deletion GPU/Vulkan/ShaderManagerVulkan.cpp
Expand Up @@ -350,7 +350,7 @@ VulkanFragmentShader *ShaderManagerVulkan::GetFragmentShaderFromModule(VkShaderM
// instantaneous.

#define CACHE_HEADER_MAGIC 0xff51f420
#define CACHE_VERSION 9
#define CACHE_VERSION 10
struct VulkanCacheHeader {
uint32_t magic;
uint32_t version;
Expand Down

0 comments on commit 6a90b8f

Please sign in to comment.