UID Change: Fix bug with indirect stage UIDs

Bug Fix: The normal stage UIDs were randomly overwriting indirect
         stage texture map UID fields. It was possible for multiple
	 shaders with diffrent indirect texture targets to map to
	 the same UID.
         Once again, it dpesn't look like this bug was ever triggered.
This commit is contained in:
Scott Mansell 2016-01-16 13:01:04 +13:00
parent 03f2c9648d
commit e99364c7c9
2 changed files with 1 additions and 24 deletions

View File

@ -849,7 +849,6 @@ static void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, API_TYPE
ac.b == TEVALPHAARG_RASA || ac.c == TEVALPHAARG_RASA || ac.d == TEVALPHAARG_RASA)
{
const int i = bpmem.combiners[n].alphaC.rswap;
uid_data->stagehash[n].ac |= bpmem.combiners[n].alphaC.rswap;
uid_data->stagehash[n].tevksel_swap1a = bpmem.tevksel[i * 2].swap1;
uid_data->stagehash[n].tevksel_swap2a = bpmem.tevksel[i * 2].swap2;
uid_data->stagehash[n].tevksel_swap1b = bpmem.tevksel[i * 2 + 1].swap1;
@ -875,7 +874,6 @@ static void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, API_TYPE
}
const int i = bpmem.combiners[n].alphaC.tswap;
uid_data->stagehash[n].ac |= bpmem.combiners[n].alphaC.tswap << 2;
uid_data->stagehash[n].tevksel_swap1c = bpmem.tevksel[i * 2].swap1;
uid_data->stagehash[n].tevksel_swap2c = bpmem.tevksel[i * 2].swap2;
uid_data->stagehash[n].tevksel_swap1d = bpmem.tevksel[i * 2 + 1].swap1;
@ -884,8 +882,6 @@ static void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, API_TYPE
uid_data->stagehash[n].tevorders_texmap = bpmem.tevorders[n / 2].getTexMap(n & 1);
const char* texswap = swapModeTable[bpmem.combiners[n].alphaC.tswap];
uid_data->SetTevindrefTexmap(i, texmap);
out.Write("\ttextemp = ");
SampleTexture<T>(out, "float2(tevcoord.xy)", texswap, texmap, ApiType);
}

View File

@ -85,31 +85,12 @@ struct pixel_shader_uid_data
tevindref_bi4 = texmap;
}
}
inline void SetTevindrefTexmap(int index, u32 texmap)
{
if (index == 0)
{
tevindref_bi0 = texmap;
}
else if (index == 1)
{
tevindref_bi1 = texmap;
}
else if (index == 2)
{
tevindref_bi2 = texmap;
}
else if (index == 3)
{
tevindref_bi4 = texmap;
}
}
struct
{
// TODO: Can save a lot space by removing the padding bits
u32 cc : 24;
u32 ac : 24;
u32 ac : 24; // tswap and rswap are left blank (encoded into the tevksel fields below)
u32 tevorders_texmap : 3;
u32 tevorders_texcoord : 3;