diff --git a/rpcs3/Emu/RSX/GL/GLCompute.cpp b/rpcs3/Emu/RSX/GL/GLCompute.cpp index 12ed12344c..5607c149ed 100644 --- a/rpcs3/Emu/RSX/GL/GLCompute.cpp +++ b/rpcs3/Emu/RSX/GL/GLCompute.cpp @@ -58,6 +58,8 @@ namespace gl if (!compiled) { + ensure(!m_src.empty(), "Compute shader is not initialized!"); + m_shader.create(::glsl::program_domain::glsl_compute_program, m_src); m_shader.compile(); @@ -82,6 +84,7 @@ namespace gl void compute_task::run(gl::command_context& cmd, u32 invocations_x, u32 invocations_y) { + ensure(compiled && m_program.id() != GL_NONE); bind_resources(); cmd->use_program(m_program.id()); diff --git a/rpcs3/Emu/RSX/GL/GLOverlays.cpp b/rpcs3/Emu/RSX/GL/GLOverlays.cpp index 9fb0e23291..613d62a9e8 100644 --- a/rpcs3/Emu/RSX/GL/GLOverlays.cpp +++ b/rpcs3/Emu/RSX/GL/GLOverlays.cpp @@ -23,6 +23,8 @@ namespace gl { if (!compiled) { + ensure(!fs_src.empty() && !vs_src.empty(), "Shaders have not been initialized."); + fs.create(::glsl::program_domain::glsl_fragment_program, fs_src); fs.compile(); @@ -34,6 +36,8 @@ namespace gl program_handle.attach(fs); program_handle.link(); + ensure(program_handle.id()); + fbo.create(); m_sampler.create(); @@ -88,11 +92,7 @@ namespace gl void overlay_pass::run(gl::command_context& cmd, const areau& region, GLuint target_texture, GLuint image_aspect_bits, bool enable_blending) { - if (!compiled) - { - rsx_log.error("You must initialize overlay passes with create() before calling run()"); - return; - } + ensure(compiled && program_handle.id() != GL_NONE, "You must initialize overlay passes with create() before calling run()"); GLint viewport[4]; std::unique_ptr save_fbo;