mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 00:33:01 +00:00
rsx: misc fixes
- Supply explicit options for spv emit allowing optimizations (not yet compiled into the backend) - Add epsilon fix to glslcommon - Fix shader dialog crash when using qt (race condition)
This commit is contained in:
parent
648fc92184
commit
2e04dceaf0
@ -337,7 +337,7 @@ namespace glsl
|
||||
OS << " result.x = 1.;\n";
|
||||
OS << " result.w = 1.;\n";
|
||||
OS << " result.y = clamped_val.x;\n";
|
||||
OS << " result.z = clamped_val.x > 0. ? exp(clamped_val.w * log(max(clamped_val.y, 0.000001))) : 0.;\n";
|
||||
OS << " result.z = clamped_val.x > 0. ? exp(clamped_val.w * log(max(clamped_val.y, 0.0000000001))) : 0.;\n";
|
||||
OS << " return result;\n";
|
||||
OS << "}\n\n";
|
||||
|
||||
|
@ -144,6 +144,10 @@ namespace vk
|
||||
|
||||
glslang::TProgram program;
|
||||
glslang::TShader shader_object(lang);
|
||||
|
||||
shader_object.setEnvInput(glslang::EShSourceGlsl, lang, glslang::EShClientVulkan, 100);
|
||||
shader_object.setEnvClient(glslang::EShClientVulkan, 100);
|
||||
shader_object.setEnvTarget(glslang::EshTargetSpv, 0x00001000);
|
||||
|
||||
bool success = false;
|
||||
const char *shader_text = shader.data();
|
||||
@ -154,11 +158,13 @@ namespace vk
|
||||
if (shader_object.parse(&g_default_config, 400, EProfile::ECoreProfile, false, true, msg))
|
||||
{
|
||||
program.addShader(&shader_object);
|
||||
success = program.link(EShMsgVulkanRules);
|
||||
success = program.link(msg);
|
||||
if (success)
|
||||
{
|
||||
glslang::TIntermediate* bytes = program.getIntermediate(lang);
|
||||
glslang::GlslangToSpv(*bytes, spv);
|
||||
glslang::SpvOptions options;
|
||||
options.disableOptimizer = false;
|
||||
options.optimizeSize = true;
|
||||
glslang::GlslangToSpv(*program.getIntermediate(lang), spv, &options);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -282,6 +282,7 @@ namespace rsx
|
||||
struct progress_dialog_helper
|
||||
{
|
||||
std::shared_ptr<MsgDialogBase> dlg;
|
||||
atomic_t<bool> initialized{ false };
|
||||
|
||||
virtual void create()
|
||||
{
|
||||
@ -300,7 +301,13 @@ namespace rsx
|
||||
Emu.CallAfter([&]()
|
||||
{
|
||||
dlg->Create("Preloading cached shaders from disk.\nPlease wait...");
|
||||
initialized.store(true);
|
||||
});
|
||||
|
||||
while (!initialized.load() && !Emu.IsStopped())
|
||||
{
|
||||
_mm_pause();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void update_msg(u32 processed, u32 entry_count)
|
||||
|
Loading…
x
Reference in New Issue
Block a user