mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
gl: Add extra checks around invalid render/compute passes
- These would have saved a lot of time debugging problems
This commit is contained in:
parent
5907a6a67d
commit
008bfa2cd2
2 changed files with 8 additions and 5 deletions
|
@ -58,6 +58,8 @@ namespace gl
|
||||||
|
|
||||||
if (!compiled)
|
if (!compiled)
|
||||||
{
|
{
|
||||||
|
ensure(!m_src.empty(), "Compute shader is not initialized!");
|
||||||
|
|
||||||
m_shader.create(::glsl::program_domain::glsl_compute_program, m_src);
|
m_shader.create(::glsl::program_domain::glsl_compute_program, m_src);
|
||||||
m_shader.compile();
|
m_shader.compile();
|
||||||
|
|
||||||
|
@ -82,6 +84,7 @@ namespace gl
|
||||||
|
|
||||||
void compute_task::run(gl::command_context& cmd, u32 invocations_x, u32 invocations_y)
|
void compute_task::run(gl::command_context& cmd, u32 invocations_x, u32 invocations_y)
|
||||||
{
|
{
|
||||||
|
ensure(compiled && m_program.id() != GL_NONE);
|
||||||
bind_resources();
|
bind_resources();
|
||||||
|
|
||||||
cmd->use_program(m_program.id());
|
cmd->use_program(m_program.id());
|
||||||
|
|
|
@ -23,6 +23,8 @@ namespace gl
|
||||||
{
|
{
|
||||||
if (!compiled)
|
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.create(::glsl::program_domain::glsl_fragment_program, fs_src);
|
||||||
fs.compile();
|
fs.compile();
|
||||||
|
|
||||||
|
@ -34,6 +36,8 @@ namespace gl
|
||||||
program_handle.attach(fs);
|
program_handle.attach(fs);
|
||||||
program_handle.link();
|
program_handle.link();
|
||||||
|
|
||||||
|
ensure(program_handle.id());
|
||||||
|
|
||||||
fbo.create();
|
fbo.create();
|
||||||
|
|
||||||
m_sampler.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)
|
void overlay_pass::run(gl::command_context& cmd, const areau& region, GLuint target_texture, GLuint image_aspect_bits, bool enable_blending)
|
||||||
{
|
{
|
||||||
if (!compiled)
|
ensure(compiled && program_handle.id() != GL_NONE, "You must initialize overlay passes with create() before calling run()");
|
||||||
{
|
|
||||||
rsx_log.error("You must initialize overlay passes with create() before calling run()");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLint viewport[4];
|
GLint viewport[4];
|
||||||
std::unique_ptr<fbo::save_binding_state> save_fbo;
|
std::unique_ptr<fbo::save_binding_state> save_fbo;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue