mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-08 16:05:56 +00:00
gl: Refactor image and command-context handling
- Move texture object code out of the monolithic header - All texture binds go through the shared state - Transient texture binds use a dedicated temp image slot shared with native UI
This commit is contained in:
parent
0e5514003a
commit
d577cebd89
12 changed files with 1256 additions and 1202 deletions
33
rpcs3/Emu/RSX/GL/glutils/common.cpp
Normal file
33
rpcs3/Emu/RSX/GL/glutils/common.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include "state_tracker.hpp"
|
||||
|
||||
namespace gl
|
||||
{
|
||||
static thread_local bool s_tls_primary_context_thread = false;
|
||||
static gl::driver_state* s_current_state = nullptr;
|
||||
|
||||
void set_primary_context_thread(bool value)
|
||||
{
|
||||
s_tls_primary_context_thread = value;
|
||||
}
|
||||
|
||||
bool is_primary_context_thread()
|
||||
{
|
||||
return s_tls_primary_context_thread;
|
||||
}
|
||||
|
||||
void set_command_context(gl::command_context& ctx)
|
||||
{
|
||||
s_current_state = ctx.operator->();
|
||||
}
|
||||
|
||||
void set_command_context(gl::driver_state& ctx)
|
||||
{
|
||||
s_current_state = &ctx;
|
||||
}
|
||||
|
||||
gl::command_context get_command_context()
|
||||
{
|
||||
return { *s_current_state };
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue