Skip to content

Commit 510c280

Browse files
committed
nv2a/gl: Unify ShaderBinding and ShaderLruNode
1 parent e7047ef commit 510c280

File tree

2 files changed

+104
-115
lines changed

2 files changed

+104
-115
lines changed

hw/xbox/nv2a/pgraph/gl/renderer.h

+13-14
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ typedef struct TextureBinding {
8383
} TextureBinding;
8484

8585
typedef struct ShaderBinding {
86+
LruNode node;
87+
bool initialized;
88+
89+
bool cached;
90+
void *program;
91+
size_t program_size;
92+
GLenum program_format;
93+
ShaderState state;
94+
QemuThread *save_thread;
95+
8696
GLuint gl_program;
8797
GLenum gl_primitive_mode;
8898

@@ -117,17 +127,6 @@ typedef struct ShaderBinding {
117127
GLint material_alpha_loc;
118128
} ShaderBinding;
119129

120-
typedef struct ShaderLruNode {
121-
LruNode node;
122-
bool cached;
123-
void *program;
124-
size_t program_size;
125-
GLenum program_format;
126-
ShaderState state;
127-
ShaderBinding *binding;
128-
QemuThread *save_thread;
129-
} ShaderLruNode;
130-
131130
typedef struct VertexKey {
132131
size_t count;
133132
size_t stride;
@@ -196,7 +195,7 @@ typedef struct PGRAPHGLState {
196195
TextureLruNode *texture_cache_entries;
197196

198197
Lru shader_cache;
199-
ShaderLruNode *shader_cache_entries;
198+
ShaderBinding *shader_cache_entries;
200199
ShaderBinding *shader_binding;
201200
QemuMutex shader_cache_lock;
202201
QemuThread shader_disk_thread;
@@ -279,8 +278,8 @@ SurfaceBinding *pgraph_gl_surface_get_within(NV2AState *d, hwaddr addr);
279278
void pgraph_gl_surface_invalidate(NV2AState *d, SurfaceBinding *e);
280279
void pgraph_gl_unbind_surface(NV2AState *d, bool color);
281280
void pgraph_gl_upload_surface_data(NV2AState *d, SurfaceBinding *surface, bool force);
282-
void pgraph_gl_shader_cache_to_disk(ShaderLruNode *snode);
283-
bool pgraph_gl_shader_load_from_memory(ShaderLruNode *snode);
281+
void pgraph_gl_shader_cache_to_disk(ShaderBinding *snode);
282+
bool pgraph_gl_shader_load_from_memory(ShaderBinding *snode);
284283
void pgraph_gl_shader_write_cache_reload_list(PGRAPHState *pg);
285284
void pgraph_gl_set_surface_scale_factor(NV2AState *d, unsigned int scale);
286285
unsigned int pgraph_gl_get_surface_scale_factor(NV2AState *d);

0 commit comments

Comments
 (0)