From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/wined3d_gl.h | 189 +++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 196 +-------------------------------- 2 files changed, 190 insertions(+), 195 deletions(-)
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index ba8dc68aaad..09f5dd71708 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -564,4 +564,193 @@ struct wined3d_rendertarget_info unsigned int layer_count; };
+struct wined3d_command_fence_gl +{ + uint64_t id; + struct wined3d_fence *fence; +}; + +#define MAX_GL_FRAGMENT_SAMPLERS 32 + +struct wined3d_context_gl +{ + struct wined3d_context c; + + const struct wined3d_gl_info *gl_info; + + DWORD tid; /* Thread ID which owns this context at the moment. */ + + uint32_t dc_is_private : 1; + uint32_t dc_has_format : 1; /* Only meaningful for private DCs. */ + uint32_t fog_enabled : 1; + uint32_t diffuse_attrib_to_1 : 1; + uint32_t rebind_fbo : 1; + uint32_t untracked_material_count : 2; /* Max value 2 */ + uint32_t needs_set : 1; + uint32_t internal_format_set : 1; + uint32_t valid : 1; + uint32_t padding : 22; + + uint32_t default_attrib_value_set; + + GLenum tracking_parm; /* Which source is tracking current colour. */ + GLenum untracked_materials[2]; + SIZE blit_size; + unsigned int active_texture; + + GLenum *texture_type; + + /* The WGL context. */ + unsigned int level; + HGLRC restore_ctx; + HDC restore_dc; + int restore_pf; + HWND restore_pf_win; + HGLRC gl_ctx; + HDC dc; + int pixel_format; + HWND window; + GLint aux_buffers; + + /* FBOs. */ + unsigned int fbo_entry_count; + struct list fbo_list; + struct list fbo_destroy_list; + struct fbo_entry *current_fbo; + GLuint fbo_read_binding; + GLuint fbo_draw_binding; + struct wined3d_rendertarget_info blit_targets[WINED3D_MAX_RENDER_TARGETS]; + uint32_t draw_buffers_mask; /* Enabled draw buffers, 31 max. */ + + /* Queries. */ + struct list occlusion_queries; + struct list fences; + struct list timestamp_queries; + struct list so_statistics_queries; + struct list pipeline_statistics_queries; + + GLuint *free_occlusion_queries; + SIZE_T free_occlusion_query_size; + unsigned int free_occlusion_query_count; + + union wined3d_gl_fence_object *free_fences; + SIZE_T free_fence_size; + unsigned int free_fence_count; + + GLuint *free_timestamp_queries; + SIZE_T free_timestamp_query_size; + unsigned int free_timestamp_query_count; + + union wined3d_gl_so_statistics_query *free_so_statistics_queries; + SIZE_T free_so_statistics_query_size; + unsigned int free_so_statistics_query_count; + + union wined3d_gl_pipeline_statistics_query *free_pipeline_statistics_queries; + SIZE_T free_pipeline_statistics_query_size; + unsigned int free_pipeline_statistics_query_count; + + GLuint blit_vbo; + + unsigned int tex_unit_map[WINED3D_MAX_COMBINED_SAMPLERS]; + unsigned int rev_tex_unit_map[MAX_GL_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS]; + + /* Extension emulation. */ + GLint gl_fog_source; + GLfloat fog_coord_value; + GLfloat colour[4], fog_start, fog_end, fog_colour[4]; + + GLuint dummy_arbfp_prog; + + struct + { + struct wined3d_command_fence_gl *fences; + SIZE_T fences_size; + SIZE_T fence_count; + } submitted; +}; + +static inline struct wined3d_context_gl *wined3d_context_gl(struct wined3d_context *context) +{ + return CONTAINING_RECORD(context, struct wined3d_context_gl, c); +} + +static inline const struct wined3d_context_gl *wined3d_context_gl_const(const struct wined3d_context *context) +{ + return CONTAINING_RECORD(context, struct wined3d_context_gl, c); +} + +HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx); +DWORD context_get_tls_idx(void); +void context_gl_apply_texture_draw_state(struct wined3d_context_gl *context_gl, + struct wined3d_texture *texture, unsigned int sub_resource_idx, unsigned int location); +void context_gl_resource_released(struct wined3d_device *device, GLuint name, BOOL rb_namespace); + +struct wined3d_context *wined3d_context_gl_acquire(const struct wined3d_device *device, + struct wined3d_texture *texture, unsigned int sub_resource_idx); +void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl, + const struct wined3d_gl_info *gl_info, unsigned int unit); +void wined3d_context_gl_alloc_fence(struct wined3d_context_gl *context_gl, struct wined3d_fence *fence); +void wined3d_context_gl_alloc_occlusion_query(struct wined3d_context_gl *context_gl, + struct wined3d_occlusion_query *query); +void wined3d_context_gl_alloc_pipeline_statistics_query(struct wined3d_context_gl *context_gl, + struct wined3d_pipeline_statistics_query *query); +void wined3d_context_gl_alloc_so_statistics_query(struct wined3d_context_gl *context_gl, + struct wined3d_so_statistics_query *query); +void wined3d_context_gl_alloc_timestamp_query(struct wined3d_context_gl *context_gl, + struct wined3d_timestamp_query *query); +GLuint wined3d_context_gl_allocate_vram_chunk_buffer(struct wined3d_context_gl *context_gl, + unsigned int pool, size_t size); +void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device); +BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, + unsigned int rt_count, const struct wined3d_fb_state *fb); +void wined3d_context_gl_apply_fbo_state_blit(struct wined3d_context_gl *context_gl, GLenum target, + struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, + struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location); +void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_gl, + const struct wined3d_device *device); +void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name); +void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *context_gl); +void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name); +void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target); +void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, + const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, + unsigned int range_count, const struct wined3d_range *ranges, uint32_t map_flags); +void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl); +void wined3d_context_gl_destroy_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo); +void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, struct wined3d_texture_gl *texture_gl, + unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, + enum wined3d_texture_filter_type filter); +void wined3d_context_gl_draw_textured_quad(struct wined3d_context_gl *context_gl, + struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter); +void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t mask); +void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *context_gl); +void wined3d_context_gl_flush_bo_address(struct wined3d_context_gl *context_gl, + const struct wined3d_const_bo_address *data, size_t size); +void wined3d_context_gl_free_fence(struct wined3d_fence *fence); +void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *query); +void wined3d_context_gl_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query); +void wined3d_context_gl_free_so_statistics_query(struct wined3d_so_statistics_query *query); +void wined3d_context_gl_free_timestamp_query(struct wined3d_timestamp_query *query); +struct wined3d_context_gl *wined3d_context_gl_get_current(void); +GLenum wined3d_context_gl_get_offscreen_gl_buffer(const struct wined3d_context_gl *context_gl); +const unsigned int *wined3d_context_gl_get_tex_unit_mapping(const struct wined3d_context_gl *context_gl, + const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count); +HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wined3d_swapchain_gl *swapchain_gl); +void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl, + const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state); +void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl, + const struct wined3d_bo_address *data, size_t size, uint32_t flags); +struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_gl *context_gl); +void wined3d_context_gl_release(struct wined3d_context_gl *context_gl); +BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl); +void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_gl); +void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, + const struct wined3d_texture_gl *texture_gl); +void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl); +void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, + unsigned int range_count, const struct wined3d_range *ranges); +void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state); +void wined3d_context_gl_wait_command_fence(struct wined3d_context_gl *context_gl, uint64_t id); + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d5b2cc0e020..feaf874dd74 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1890,16 +1890,12 @@ struct wined3d_range unsigned int size; };
-#include "wined3d_gl.h" - struct wined3d_fb_state { struct wined3d_rendertarget_view *render_targets[WINED3D_MAX_RENDER_TARGETS]; struct wined3d_rendertarget_view *depth_stencil; };
-#define MAX_GL_FRAGMENT_SAMPLERS 32 - struct wined3d_context { const struct wined3d_d3d_info *d3d_info; @@ -1975,191 +1971,7 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi HRESULT wined3d_context_no3d_init(struct wined3d_context *context_no3d, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
-struct wined3d_command_fence_gl -{ - uint64_t id; - struct wined3d_fence *fence; -}; - -struct wined3d_context_gl -{ - struct wined3d_context c; - - const struct wined3d_gl_info *gl_info; - - DWORD tid; /* Thread ID which owns this context at the moment. */ - - uint32_t dc_is_private : 1; - uint32_t dc_has_format : 1; /* Only meaningful for private DCs. */ - uint32_t fog_enabled : 1; - uint32_t diffuse_attrib_to_1 : 1; - uint32_t rebind_fbo : 1; - uint32_t untracked_material_count : 2; /* Max value 2 */ - uint32_t needs_set : 1; - uint32_t internal_format_set : 1; - uint32_t valid : 1; - uint32_t padding : 22; - - uint32_t default_attrib_value_set; - - GLenum tracking_parm; /* Which source is tracking current colour. */ - GLenum untracked_materials[2]; - SIZE blit_size; - unsigned int active_texture; - - GLenum *texture_type; - - /* The WGL context. */ - unsigned int level; - HGLRC restore_ctx; - HDC restore_dc; - int restore_pf; - HWND restore_pf_win; - HGLRC gl_ctx; - HDC dc; - int pixel_format; - HWND window; - GLint aux_buffers; - - /* FBOs. */ - unsigned int fbo_entry_count; - struct list fbo_list; - struct list fbo_destroy_list; - struct fbo_entry *current_fbo; - GLuint fbo_read_binding; - GLuint fbo_draw_binding; - struct wined3d_rendertarget_info blit_targets[WINED3D_MAX_RENDER_TARGETS]; - uint32_t draw_buffers_mask; /* Enabled draw buffers, 31 max. */ - - /* Queries. */ - struct list occlusion_queries; - struct list fences; - struct list timestamp_queries; - struct list so_statistics_queries; - struct list pipeline_statistics_queries; - - GLuint *free_occlusion_queries; - SIZE_T free_occlusion_query_size; - unsigned int free_occlusion_query_count; - - union wined3d_gl_fence_object *free_fences; - SIZE_T free_fence_size; - unsigned int free_fence_count; - - GLuint *free_timestamp_queries; - SIZE_T free_timestamp_query_size; - unsigned int free_timestamp_query_count; - - union wined3d_gl_so_statistics_query *free_so_statistics_queries; - SIZE_T free_so_statistics_query_size; - unsigned int free_so_statistics_query_count; - - union wined3d_gl_pipeline_statistics_query *free_pipeline_statistics_queries; - SIZE_T free_pipeline_statistics_query_size; - unsigned int free_pipeline_statistics_query_count; - - GLuint blit_vbo; - - unsigned int tex_unit_map[WINED3D_MAX_COMBINED_SAMPLERS]; - unsigned int rev_tex_unit_map[MAX_GL_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS]; - - /* Extension emulation. */ - GLint gl_fog_source; - GLfloat fog_coord_value; - GLfloat colour[4], fog_start, fog_end, fog_colour[4]; - - GLuint dummy_arbfp_prog; - - struct - { - struct wined3d_command_fence_gl *fences; - SIZE_T fences_size; - SIZE_T fence_count; - } submitted; -}; - -static inline struct wined3d_context_gl *wined3d_context_gl(struct wined3d_context *context) -{ - return CONTAINING_RECORD(context, struct wined3d_context_gl, c); -} - -static inline const struct wined3d_context_gl *wined3d_context_gl_const(const struct wined3d_context *context) -{ - return CONTAINING_RECORD(context, struct wined3d_context_gl, c); -} - -struct wined3d_context *wined3d_context_gl_acquire(const struct wined3d_device *device, - struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; -void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl, - const struct wined3d_gl_info *gl_info, unsigned int unit) DECLSPEC_HIDDEN; -void wined3d_context_gl_alloc_fence(struct wined3d_context_gl *context_gl, - struct wined3d_fence *fence) DECLSPEC_HIDDEN; -void wined3d_context_gl_alloc_occlusion_query(struct wined3d_context_gl *context_gl, - struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; -void wined3d_context_gl_alloc_pipeline_statistics_query(struct wined3d_context_gl *context_gl, - struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN; -void wined3d_context_gl_alloc_so_statistics_query(struct wined3d_context_gl *context_gl, - struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN; -void wined3d_context_gl_alloc_timestamp_query(struct wined3d_context_gl *context_gl, - struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; -GLuint wined3d_context_gl_allocate_vram_chunk_buffer(struct wined3d_context_gl *context_gl, - unsigned int pool, size_t size) DECLSPEC_HIDDEN; -void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, - const struct wined3d_device *device) DECLSPEC_HIDDEN; -BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, - unsigned int rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; -void wined3d_context_gl_apply_fbo_state_blit(struct wined3d_context_gl *context_gl, GLenum target, - struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, - struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location) DECLSPEC_HIDDEN; -void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_gl, - const struct wined3d_device *device) DECLSPEC_HIDDEN; -void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name) DECLSPEC_HIDDEN; -void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, - GLenum target, GLuint name) DECLSPEC_HIDDEN; -void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target) DECLSPEC_HIDDEN; -void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, - const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, - unsigned int range_count, const struct wined3d_range *ranges, uint32_t map_flags) DECLSPEC_HIDDEN; -void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_destroy_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo) DECLSPEC_HIDDEN; -void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, struct wined3d_texture_gl *texture_gl, - unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, - enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -void wined3d_context_gl_draw_textured_quad(struct wined3d_context_gl *context_gl, - struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t mask) DECLSPEC_HIDDEN; -void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_flush_bo_address(struct wined3d_context_gl *context_gl, - const struct wined3d_const_bo_address *data, size_t size) DECLSPEC_HIDDEN; -void wined3d_context_gl_free_fence(struct wined3d_fence *fence) DECLSPEC_HIDDEN; -void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; -void wined3d_context_gl_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN; -void wined3d_context_gl_free_so_statistics_query(struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN; -void wined3d_context_gl_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; -struct wined3d_context_gl *wined3d_context_gl_get_current(void) DECLSPEC_HIDDEN; -GLenum wined3d_context_gl_get_offscreen_gl_buffer(const struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -const unsigned int *wined3d_context_gl_get_tex_unit_mapping(const struct wined3d_context_gl *context_gl, - const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count) DECLSPEC_HIDDEN; -HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, - struct wined3d_swapchain_gl *swapchain_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl, - const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state) DECLSPEC_HIDDEN; -void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl, - const struct wined3d_bo_address *data, size_t size, uint32_t flags) DECLSPEC_HIDDEN; -struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_release(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, - const struct wined3d_texture_gl *texture_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; -void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, - unsigned int range_count, const struct wined3d_range *ranges) DECLSPEC_HIDDEN; -void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, - const struct wined3d_state *state) DECLSPEC_HIDDEN; -void wined3d_context_gl_wait_command_fence(struct wined3d_context_gl *context_gl, uint64_t id) DECLSPEC_HIDDEN; +#include "wined3d_gl.h"
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
@@ -2295,12 +2107,6 @@ void wined3d_vk_blitter_create(struct wined3d_blitter **next) DECLSPEC_HIDDEN;
BOOL wined3d_clip_blit(const RECT *clip_rect, RECT *clipped, RECT *other) DECLSPEC_HIDDEN;
-HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN; -DWORD context_get_tls_idx(void) DECLSPEC_HIDDEN; -void context_gl_apply_texture_draw_state(struct wined3d_context_gl *context_gl, - struct wined3d_texture *texture, unsigned int sub_resource_idx, unsigned int location); -void context_gl_resource_released(struct wined3d_device *device, - GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN; void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; void context_invalidate_state(struct wined3d_context *context, unsigned int state_id) DECLSPEC_HIDDEN; void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/adapter_gl.c | 4 ++-- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/ati_fragment_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 8 ++++---- dlls/wined3d/nvidia_texture_shader.c | 2 +- dlls/wined3d/shader_spirv.c | 4 ++-- dlls/wined3d/state.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index f327c21b030..9b7a266e01f 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3880,8 +3880,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter_gl *adapter_gl, } }
- gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(gl_info) - | adapter->fragment_pipe->get_emul_mask(gl_info); + gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(adapter) + | adapter->fragment_pipe->get_emul_mask(adapter); if (gl_ext_emul_mask & GL_EXT_EMUL_ARB_MULTITEXTURE) install_gl_compat_wrapper(gl_info, ARB_MULTITEXTURE); if (gl_ext_emul_mask & GL_EXT_EMUL_EXT_FOG_COORD) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 34743d44918..14703e9c66c 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5802,7 +5802,7 @@ static void arbfp_get_caps(const struct wined3d_adapter *adapter, struct fragmen caps->MaxSimultaneousTextures = min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], WINED3D_MAX_TEXTURES); }
-static unsigned int arbfp_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int arbfp_get_emul_mask(const struct wined3d_adapter *adapter) { return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; } diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index 46fa5d4d64f..ec5c2ac6b6f 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -1315,7 +1315,7 @@ static void atifs_get_caps(const struct wined3d_adapter *adapter, struct fragmen caps->MaxSimultaneousTextures = 6; }
-static unsigned int atifs_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int atifs_get_emul_mask(const struct wined3d_adapter *adapter) { return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; } diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 8b3a25e276b..6bbb432dc1d 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11570,9 +11570,9 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_adapter *adapter, caps->raster_caps = WINED3DPRASTERCAPS_FOGRANGE; }
-static unsigned int glsl_vertex_pipe_vp_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int glsl_vertex_pipe_vp_get_emul_mask(const struct wined3d_adapter *adapter) { - if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + if (wined3d_adapter_gl_const(adapter)->gl_info.supported[WINED3D_GL_LEGACY_CONTEXT]) return GL_EXT_EMUL_ARB_MULTITEXTURE; return 0; } @@ -12083,9 +12083,9 @@ static void glsl_fragment_pipe_get_caps(const struct wined3d_adapter *adapter, s caps->MaxSimultaneousTextures = min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], WINED3D_MAX_TEXTURES); }
-static unsigned int glsl_fragment_pipe_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int glsl_fragment_pipe_get_emul_mask(const struct wined3d_adapter *adapter) { - if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + if (wined3d_adapter_gl_const(adapter)->gl_info.supported[WINED3D_GL_LEGACY_CONTEXT]) return GL_EXT_EMUL_ARB_MULTITEXTURE; return 0; } diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index e3d9f4fbf30..3d86e16c864 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -750,7 +750,7 @@ static void nvrc_fragment_get_caps(const struct wined3d_adapter *adapter, struct caps->MaxSimultaneousTextures = gl_info->limits.textures; }
-static unsigned int nvrc_fragment_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int nvrc_fragment_get_emul_mask(const struct wined3d_adapter *adapter) { return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; } diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index 966721905a4..355eac1ef7b 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1104,7 +1104,7 @@ static void spirv_vertex_pipe_vk_vp_get_caps(const struct wined3d_adapter *adapt caps->ffp_generic_attributes = TRUE; }
-static unsigned int spirv_vertex_pipe_vk_vp_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int spirv_vertex_pipe_vk_vp_get_emul_mask(const struct wined3d_adapter *adapter) { return 0; } @@ -1178,7 +1178,7 @@ static void spirv_fragment_pipe_vk_fp_get_caps(const struct wined3d_adapter *ada memset(caps, 0, sizeof(*caps)); }
-static unsigned int spirv_fragment_pipe_vk_fp_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int spirv_fragment_pipe_vk_fp_get_emul_mask(const struct wined3d_adapter *adapter) { return 0; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 26cae888345..d314345c31b 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -5130,7 +5130,7 @@ static void vp_ffp_get_caps(const struct wined3d_adapter *adapter, struct wined3 caps->raster_caps |= WINED3DPRASTERCAPS_FOGRANGE; }
-static unsigned int vp_ffp_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int vp_ffp_get_emul_mask(const struct wined3d_adapter *adapter) { return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; } @@ -5188,7 +5188,7 @@ static void ffp_fragment_get_caps(const struct wined3d_adapter *adapter, struct caps->MaxSimultaneousTextures = gl_info->limits.textures; }
-static unsigned int ffp_fragment_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int ffp_fragment_get_emul_mask(const struct wined3d_adapter *adapter) { return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; } @@ -5235,7 +5235,7 @@ static void vp_none_get_caps(const struct wined3d_adapter *adapter, struct wined memset(caps, 0, sizeof(*caps)); }
-static unsigned int vp_none_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int vp_none_get_emul_mask(const struct wined3d_adapter *adapter) { return 0; } @@ -5255,7 +5255,7 @@ static void fp_none_get_caps(const struct wined3d_adapter *adapter, struct fragm memset(caps, 0, sizeof(*caps)); }
-static unsigned int fp_none_get_emul_mask(const struct wined3d_gl_info *gl_info) +static unsigned int fp_none_get_emul_mask(const struct wined3d_adapter *adapter) { return 0; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index feaf874dd74..06aface2ec4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2008,7 +2008,7 @@ struct wined3d_fragment_pipe_ops { void (*fp_enable)(const struct wined3d_context *context, BOOL enable); void (*get_caps)(const struct wined3d_adapter *adapter, struct fragment_caps *caps); - unsigned int (*get_emul_mask)(const struct wined3d_gl_info *gl_info); + unsigned int (*get_emul_mask)(const struct wined3d_adapter *adapter); void *(*alloc_private)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*free_private)(struct wined3d_device *device, struct wined3d_context *context); BOOL (*allocate_context_data)(struct wined3d_context *context); @@ -2035,7 +2035,7 @@ struct wined3d_vertex_pipe_ops { void (*vp_enable)(const struct wined3d_context *context, BOOL enable); void (*vp_get_caps)(const struct wined3d_adapter *adapter, struct wined3d_vertex_caps *caps); - unsigned int (*vp_get_emul_mask)(const struct wined3d_gl_info *gl_info); + unsigned int (*vp_get_emul_mask)(const struct wined3d_adapter *adapter); void *(*vp_alloc)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*vp_free)(struct wined3d_device *device, struct wined3d_context *context); const struct wined3d_state_entry_template *vp_states;
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/wined3d_gl.h | 6 ++++++ dlls/wined3d/wined3d_private.h | 14 ++------------ 2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 09f5dd71708..79326c92bfd 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -753,4 +753,10 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state); void wined3d_context_gl_wait_command_fence(struct wined3d_context_gl *context_gl, uint64_t id);
+void wined3d_arbfp_blitter_create(struct wined3d_blitter **next, const struct wined3d_device *device); +void wined3d_fbo_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info); +void wined3d_ffp_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info); +struct wined3d_blitter *wined3d_glsl_blitter_create(struct wined3d_blitter **next, const struct wined3d_device *device); +void wined3d_raw_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info); + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 06aface2ec4..b980bd7f84e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1971,8 +1971,6 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi HRESULT wined3d_context_no3d_init(struct wined3d_context *context_no3d, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
-#include "wined3d_gl.h" - typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct wined3d_state_entry @@ -2092,17 +2090,9 @@ struct wined3d_blitter_ops enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format); };
-void wined3d_arbfp_blitter_create(struct wined3d_blitter **next, - const struct wined3d_device *device) DECLSPEC_HIDDEN; +#include "wined3d_gl.h" + struct wined3d_blitter *wined3d_cpu_blitter_create(void) DECLSPEC_HIDDEN; -void wined3d_fbo_blitter_create(struct wined3d_blitter **next, - const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; -void wined3d_ffp_blitter_create(struct wined3d_blitter **next, - const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; -struct wined3d_blitter *wined3d_glsl_blitter_create(struct wined3d_blitter **next, - const struct wined3d_device *device) DECLSPEC_HIDDEN; -void wined3d_raw_blitter_create(struct wined3d_blitter **next, - const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; void wined3d_vk_blitter_create(struct wined3d_blitter **next) DECLSPEC_HIDDEN;
BOOL wined3d_clip_blit(const RECT *clip_rect, RECT *clipped, RECT *other) DECLSPEC_HIDDEN;
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/wined3d_gl.h | 41 ++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 43 +--------------------------------- 2 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 79326c92bfd..c53e64fb203 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -759,4 +759,45 @@ void wined3d_ffp_blitter_create(struct wined3d_blitter **next, const struct wine struct wined3d_blitter *wined3d_glsl_blitter_create(struct wined3d_blitter **next, const struct wined3d_device *device); void wined3d_raw_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info);
+struct wined3d_caps_gl_ctx +{ + HDC dc; + HWND wnd; + HGLRC gl_ctx; + HDC restore_dc; + HGLRC restore_gl_ctx; + + const struct wined3d_gl_info *gl_info; + GLuint test_vbo; + GLuint test_program_id; + + const struct wined3d_gpu_description *gpu_description; + UINT64 vram_bytes; +}; + +BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx *ctx); +bool wined3d_caps_gl_ctx_test_filling_convention(struct wined3d_caps_gl_ctx *ctx, float offset); + +struct wined3d_adapter_gl +{ + struct wined3d_adapter a; + + struct wined3d_gl_info gl_info; + + struct wined3d_pixel_format *pixel_formats; + unsigned int pixel_format_count; +}; + +static inline struct wined3d_adapter_gl *wined3d_adapter_gl(struct wined3d_adapter *adapter) +{ + return CONTAINING_RECORD(adapter, struct wined3d_adapter_gl, a); +} + +static inline const struct wined3d_adapter_gl *wined3d_adapter_gl_const(const struct wined3d_adapter *adapter) +{ + return CONTAINING_RECORD(adapter, struct wined3d_adapter_gl, a); +} + +BOOL wined3d_adapter_gl_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx); + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b980bd7f84e..19b57a49277 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2090,8 +2090,6 @@ struct wined3d_blitter_ops enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format); };
-#include "wined3d_gl.h" - struct wined3d_blitter *wined3d_cpu_blitter_create(void) DECLSPEC_HIDDEN; void wined3d_vk_blitter_create(struct wined3d_blitter **next) DECLSPEC_HIDDEN;
@@ -2656,54 +2654,15 @@ BOOL wined3d_get_primary_adapter_luid(LUID *luid) DECLSPEC_HIDDEN; struct wined3d_adapter *wined3d_adapter_vk_create(unsigned int ordinal, unsigned int wined3d_creation_flags) DECLSPEC_HIDDEN;
-struct wined3d_adapter_gl -{ - struct wined3d_adapter a; - - struct wined3d_gl_info gl_info; - - struct wined3d_pixel_format *pixel_formats; - unsigned int pixel_format_count; -}; - -static inline struct wined3d_adapter_gl *wined3d_adapter_gl(struct wined3d_adapter *adapter) -{ - return CONTAINING_RECORD(adapter, struct wined3d_adapter_gl, a); -} - -static inline const struct wined3d_adapter_gl *wined3d_adapter_gl_const(const struct wined3d_adapter *adapter) -{ - return CONTAINING_RECORD(adapter, struct wined3d_adapter_gl, a); -} +#include "wined3d_gl.h"
struct wined3d_adapter *wined3d_adapter_gl_create(unsigned int ordinal, unsigned int wined3d_creation_flags) DECLSPEC_HIDDEN;
-struct wined3d_caps_gl_ctx -{ - HDC dc; - HWND wnd; - HGLRC gl_ctx; - HDC restore_dc; - HGLRC restore_gl_ctx; - - const struct wined3d_gl_info *gl_info; - GLuint test_vbo; - GLuint test_program_id; - - const struct wined3d_gpu_description *gpu_description; - UINT64 vram_bytes; -}; - -BOOL wined3d_adapter_gl_init_format_info(struct wined3d_adapter *adapter, - struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN; BOOL wined3d_adapter_no3d_init_format_info(struct wined3d_adapter *adapter) DECLSPEC_HIDDEN; ssize_t adapter_adjust_mapped_memory(struct wined3d_adapter *adapter, ssize_t size) DECLSPEC_HIDDEN; UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount) DECLSPEC_HIDDEN;
-BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN; -bool wined3d_caps_gl_ctx_test_filling_convention(struct wined3d_caps_gl_ctx *ctx, float offset) DECLSPEC_HIDDEN; - enum wined3d_projection_type { WINED3D_PROJECTION_NONE = 0,
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/wined3d_gl.h | 90 +++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 92 +--------------------------------- 2 files changed, 91 insertions(+), 91 deletions(-)
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index c53e64fb203..6f0996fe39f 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -800,4 +800,94 @@ static inline const struct wined3d_adapter_gl *wined3d_adapter_gl_const(const st
BOOL wined3d_adapter_gl_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx);
+struct wined3d_allocator_chunk_gl +{ + struct wined3d_allocator_chunk c; + unsigned int memory_type; + GLuint gl_buffer; +}; + +static inline struct wined3d_allocator_chunk_gl *wined3d_allocator_chunk_gl(struct wined3d_allocator_chunk *chunk) +{ + return CONTAINING_RECORD(chunk, struct wined3d_allocator_chunk_gl, c); +} + +struct wined3d_dummy_textures +{ + GLuint tex_1d; + GLuint tex_2d; + GLuint tex_rect; + GLuint tex_3d; + GLuint tex_cube; + GLuint tex_cube_array; + GLuint tex_1d_array; + GLuint tex_2d_array; + GLuint tex_buffer; + GLuint tex_2d_ms; + GLuint tex_2d_ms_array; +}; + +struct wined3d_device_gl +{ + struct wined3d_device d; + + /* Textures for when no other textures are bound. */ + struct wined3d_dummy_textures dummy_textures; + + CRITICAL_SECTION allocator_cs; + struct wined3d_allocator allocator; + uint64_t completed_fence_id; + uint64_t current_fence_id; + uint64_t retired_bo_size; + + struct wined3d_retired_block_gl + { + struct wined3d_allocator_block *block; + uint64_t fence_id; + } *retired_blocks; + SIZE_T retired_blocks_size; + SIZE_T retired_block_count; + + HWND backup_wnd; + HDC backup_dc; +}; + +static inline struct wined3d_device_gl *wined3d_device_gl(struct wined3d_device *device) +{ + return CONTAINING_RECORD(device, struct wined3d_device_gl, d); +} + +static inline struct wined3d_device_gl *wined3d_device_gl_from_allocator(struct wined3d_allocator *allocator) +{ + return CONTAINING_RECORD(allocator, struct wined3d_device_gl, allocator); +} + +static inline void wined3d_device_gl_allocator_lock(struct wined3d_device_gl *device_gl) +{ + EnterCriticalSection(&device_gl->allocator_cs); +} + +static inline void wined3d_device_gl_allocator_unlock(struct wined3d_device_gl *device_gl) +{ + LeaveCriticalSection(&device_gl->allocator_cs); +} + +static inline void wined3d_allocator_chunk_gl_lock(struct wined3d_allocator_chunk_gl *chunk_gl) +{ + wined3d_device_gl_allocator_lock(wined3d_device_gl_from_allocator(chunk_gl->c.allocator)); +} + +static inline void wined3d_allocator_chunk_gl_unlock(struct wined3d_allocator_chunk_gl *chunk_gl) +{ + wined3d_device_gl_allocator_unlock(wined3d_device_gl_from_allocator(chunk_gl->c.allocator)); +} + +bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, + struct wined3d_context_gl *context_gl, GLsizeiptr size, GLenum binding, + GLenum usage, bool coherent, GLbitfield flags, struct wined3d_bo_gl *bo); +void wined3d_device_gl_create_primary_opengl_context_cs(void *object); +void wined3d_device_gl_delete_opengl_contexts_cs(void *object); +HDC wined3d_device_gl_get_backup_dc(struct wined3d_device_gl *device_gl); +GLbitfield wined3d_device_gl_get_memory_type_flags(unsigned int memory_type_idx); + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 19b57a49277..36e5449a947 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2654,8 +2654,6 @@ BOOL wined3d_get_primary_adapter_luid(LUID *luid) DECLSPEC_HIDDEN; struct wined3d_adapter *wined3d_adapter_vk_create(unsigned int ordinal, unsigned int wined3d_creation_flags) DECLSPEC_HIDDEN;
-#include "wined3d_gl.h" - struct wined3d_adapter *wined3d_adapter_gl_create(unsigned int ordinal, unsigned int wined3d_creation_flags) DECLSPEC_HIDDEN;
@@ -2934,21 +2932,6 @@ static inline bool wined3d_state_uses_depth_buffer(const struct wined3d_state *s || state->depth_stencil_state->desc.stencil; }
-struct wined3d_dummy_textures -{ - GLuint tex_1d; - GLuint tex_2d; - GLuint tex_rect; - GLuint tex_3d; - GLuint tex_cube; - GLuint tex_cube_array; - GLuint tex_1d_array; - GLuint tex_2d_array; - GLuint tex_buffer; - GLuint tex_2d_ms; - GLuint tex_2d_ms_array; -}; - #define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that @@ -3096,18 +3079,6 @@ void wined3d_allocator_chunk_cleanup(struct wined3d_allocator_chunk *chunk) DECL bool wined3d_allocator_chunk_init(struct wined3d_allocator_chunk *chunk, struct wined3d_allocator *allocator) DECLSPEC_HIDDEN;
-struct wined3d_allocator_chunk_gl -{ - struct wined3d_allocator_chunk c; - unsigned int memory_type; - GLuint gl_buffer; -}; - -static inline struct wined3d_allocator_chunk_gl *wined3d_allocator_chunk_gl(struct wined3d_allocator_chunk *chunk) -{ - return CONTAINING_RECORD(chunk, struct wined3d_allocator_chunk_gl, c); -} - struct wined3d_allocator_block { struct list entry; @@ -3146,68 +3117,7 @@ void wined3d_allocator_cleanup(struct wined3d_allocator *allocator) DECLSPEC_HID bool wined3d_allocator_init(struct wined3d_allocator *allocator, size_t pool_count, const struct wined3d_allocator_ops *allocator_ops) DECLSPEC_HIDDEN;
-struct wined3d_device_gl -{ - struct wined3d_device d; - - /* Textures for when no other textures are bound. */ - struct wined3d_dummy_textures dummy_textures; - - CRITICAL_SECTION allocator_cs; - struct wined3d_allocator allocator; - uint64_t completed_fence_id; - uint64_t current_fence_id; - uint64_t retired_bo_size; - - struct wined3d_retired_block_gl - { - struct wined3d_allocator_block *block; - uint64_t fence_id; - } *retired_blocks; - SIZE_T retired_blocks_size; - SIZE_T retired_block_count; - - HWND backup_wnd; - HDC backup_dc; -}; - -static inline struct wined3d_device_gl *wined3d_device_gl(struct wined3d_device *device) -{ - return CONTAINING_RECORD(device, struct wined3d_device_gl, d); -} - -static inline struct wined3d_device_gl *wined3d_device_gl_from_allocator(struct wined3d_allocator *allocator) -{ - return CONTAINING_RECORD(allocator, struct wined3d_device_gl, allocator); -} - -static inline void wined3d_device_gl_allocator_lock(struct wined3d_device_gl *device_gl) -{ - EnterCriticalSection(&device_gl->allocator_cs); -} - -static inline void wined3d_device_gl_allocator_unlock(struct wined3d_device_gl *device_gl) -{ - LeaveCriticalSection(&device_gl->allocator_cs); -} - -static inline void wined3d_allocator_chunk_gl_lock(struct wined3d_allocator_chunk_gl *chunk_gl) -{ - wined3d_device_gl_allocator_lock(wined3d_device_gl_from_allocator(chunk_gl->c.allocator)); -} - -static inline void wined3d_allocator_chunk_gl_unlock(struct wined3d_allocator_chunk_gl *chunk_gl) -{ - wined3d_device_gl_allocator_unlock(wined3d_device_gl_from_allocator(chunk_gl->c.allocator)); -} - -bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, - struct wined3d_context_gl *context_gl, GLsizeiptr size, GLenum binding, - GLenum usage, bool coherent, GLbitfield flags, struct wined3d_bo_gl *bo) DECLSPEC_HIDDEN; -void wined3d_device_gl_create_primary_opengl_context_cs(void *object) DECLSPEC_HIDDEN; -void wined3d_device_gl_delete_opengl_contexts_cs(void *object) DECLSPEC_HIDDEN; -HDC wined3d_device_gl_get_backup_dc(struct wined3d_device_gl *device_gl) DECLSPEC_HIDDEN; -GLbitfield wined3d_device_gl_get_memory_type_flags(unsigned int memory_type_idx) DECLSPEC_HIDDEN; +#include "wined3d_gl.h"
static inline float wined3d_alpha_ref(const struct wined3d_state *state) {
This merge request was approved by Jan Sikorski.