mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 02:08:49 +12:00
rsx: Do not sample as pcf shader if writing a vector result
This commit is contained in:
parent
590bb7cbe4
commit
17318112eb
2 changed files with 19 additions and 1 deletions
|
@ -224,6 +224,18 @@ std::string FragmentProgramDecompiler::NoOverflow(const std::string& code)
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FragmentProgramDecompiler::DstExpectsSca()
|
||||||
|
{
|
||||||
|
int writes = 0;
|
||||||
|
|
||||||
|
if (dst.mask_x) writes++;
|
||||||
|
if (dst.mask_y) writes++;
|
||||||
|
if (dst.mask_z) writes++;
|
||||||
|
if (dst.mask_w) writes++;
|
||||||
|
|
||||||
|
return (writes == 1);
|
||||||
|
}
|
||||||
|
|
||||||
std::string FragmentProgramDecompiler::Format(const std::string& code)
|
std::string FragmentProgramDecompiler::Format(const std::string& code)
|
||||||
{
|
{
|
||||||
const std::pair<std::string, std::function<std::string()>> repl_list[] =
|
const std::pair<std::string, std::function<std::string()>> repl_list[] =
|
||||||
|
@ -542,7 +554,8 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
|
||||||
return true;
|
return true;
|
||||||
case rsx::texture_dimension_extended::texture_dimension_2d:
|
case rsx::texture_dimension_extended::texture_dimension_2d:
|
||||||
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ));
|
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ));
|
||||||
if (m_prog.shadow_textures & (1 << dst.tex_num))
|
//Note shadow comparison only returns a true/false result!
|
||||||
|
if (DstExpectsSca() && (m_prog.shadow_textures & (1 << dst.tex_num)))
|
||||||
m_shadow_sampled_textures |= (1 << dst.tex_num);
|
m_shadow_sampled_textures |= (1 << dst.tex_num);
|
||||||
return true;
|
return true;
|
||||||
case rsx::texture_dimension_extended::texture_dimension_cubemap:
|
case rsx::texture_dimension_extended::texture_dimension_cubemap:
|
||||||
|
|
|
@ -58,6 +58,11 @@ class FragmentProgramDecompiler
|
||||||
//Prevents operations from overflowing the max range (tested with fp_dynamic3 autotest sample)
|
//Prevents operations from overflowing the max range (tested with fp_dynamic3 autotest sample)
|
||||||
std::string NoOverflow(const std::string& code);
|
std::string NoOverflow(const std::string& code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the dst set is not a vector (i.e only a single component)
|
||||||
|
*/
|
||||||
|
bool DstExpectsSca();
|
||||||
|
|
||||||
void AddCodeCond(const std::string& dst, const std::string& src);
|
void AddCodeCond(const std::string& dst, const std::string& src);
|
||||||
std::string GetRawCond();
|
std::string GetRawCond();
|
||||||
std::string GetCond();
|
std::string GetCond();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue