From dde471e0018fe70d058c20c07b20e04398f60e98 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 10 May 2016 02:39:09 +0200 Subject: [PATCH] Rename gfx_ structs --- gfx/common/gl_common.h | 4 ++-- gfx/d3d/d3d.cpp | 2 +- gfx/drivers/gl.c | 18 +++++++++--------- gfx/drivers/vulkan.c | 6 +++--- gfx/drivers_shader/shader_gl_cg.c | 10 +++++----- gfx/drivers_shader/shader_glsl.c | 8 ++++---- gfx/drivers_shader/shader_hlsl.c | 7 +++---- gfx/video_coord_array.h | 4 ++-- 8 files changed, 29 insertions(+), 30 deletions(-) diff --git a/gfx/common/gl_common.h b/gfx/common/gl_common.h index a9b2485f35..8c244d13bf 100644 --- a/gfx/common/gl_common.h +++ b/gfx/common/gl_common.h @@ -181,8 +181,8 @@ typedef struct gl GLuint texture[GFX_MAX_TEXTURES]; unsigned tex_index; /* For use with PREV. */ unsigned textures; - struct gfx_tex_info tex_info; - struct gfx_tex_info prev_info[GFX_MAX_TEXTURES]; + struct video_tex_info tex_info; + struct video_tex_info prev_info[GFX_MAX_TEXTURES]; GLuint tex_mag_filter; GLuint tex_min_filter; bool tex_mipmap; diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 5eb7950be2..f1399993bd 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -1074,7 +1074,7 @@ static bool d3d_construct(d3d_video_t *d3d, static void d3d_set_rotation(void *data, unsigned rot) { d3d_video_t *d3d = (d3d_video_t*)data; - struct gfx_ortho ortho = {0, 1, 0, 1, -1, 1}; + struct video_ortho ortho = {0, 1, 0, 1, -1, 1}; if (!d3d) return; diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 74ce5b09ed..767a2e47b0 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -859,7 +859,7 @@ static bool gl_init_hw_render(gl_t *gl, unsigned width, unsigned height) #endif static void gl_set_projection(gl_t *gl, - struct gfx_ortho *ortho, bool allow_rotate) + struct video_ortho *ortho, bool allow_rotate) { math_matrix_4x4 rot; @@ -885,7 +885,7 @@ static void gl_set_viewport(void *data, unsigned viewport_width, int x = 0; int y = 0; float device_aspect = (float)viewport_width / viewport_height; - struct gfx_ortho ortho = {0, 1, 0, 1, -1, 1}; + struct video_ortho ortho = {0, 1, 0, 1, -1, 1}; settings_t *settings = config_get_ptr(); gl_t *gl = (gl_t*)data; @@ -982,7 +982,7 @@ static void gl_set_viewport(void *data, unsigned viewport_width, static void gl_set_rotation(void *data, unsigned rotation) { gl_t *gl = (gl_t*)data; - struct gfx_ortho ortho = {0, 1, 0, 1, -1, 1}; + struct video_ortho ortho = {0, 1, 0, 1, -1, 1}; if (!gl) return; @@ -1117,8 +1117,8 @@ static void gl_check_fbo_dimensions(gl_t *gl) } static void gl_frame_fbo(gl_t *gl, uint64_t frame_count, - const struct gfx_tex_info *tex_info, - const struct gfx_tex_info *feedback_info) + const struct video_tex_info *tex_info, + const struct video_tex_info *feedback_info) { unsigned mip_level; video_shader_ctx_mvp_t mvp; @@ -1127,8 +1127,8 @@ static void gl_frame_fbo(gl_t *gl, uint64_t frame_count, video_shader_ctx_info_t shader_info; unsigned width, height; const struct video_fbo_rect *prev_rect; - struct gfx_tex_info *fbo_info; - struct gfx_tex_info fbo_tex_info[GFX_MAX_SHADERS]; + struct video_tex_info *fbo_info; + struct video_tex_info fbo_tex_info[GFX_MAX_SHADERS]; int i; GLfloat xamt, yamt; unsigned fbo_tex_info_cnt = 0; @@ -1599,7 +1599,7 @@ static INLINE void gl_copy_frame(gl_t *gl, const void *frame, } static INLINE void gl_set_prev_texture(gl_t *gl, - const struct gfx_tex_info *tex_info) + const struct video_tex_info *tex_info) { memmove(gl->prev_info + 1, gl->prev_info, sizeof(*tex_info) * (gl->textures - 1)); @@ -1757,7 +1757,7 @@ static bool gl_frame(void *data, const void *frame, video_shader_ctx_coords_t coords; video_shader_ctx_params_t params; unsigned width, height; - struct gfx_tex_info feedback_info; + struct video_tex_info feedback_info; video_shader_ctx_info_t shader_info; static struct retro_perf_counter frame_run = {0}; gl_t *gl = (gl_t*)data; diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 412529d79b..211828a348 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1191,7 +1191,7 @@ static bool vulkan_set_shader(void *data, } static void vulkan_set_projection(vk_t *vk, - struct gfx_ortho *ortho, bool allow_rotate) + struct video_ortho *ortho, bool allow_rotate) { math_matrix_4x4 rot; @@ -1212,7 +1212,7 @@ static void vulkan_set_projection(vk_t *vk, static void vulkan_set_rotation(void *data, unsigned rotation) { vk_t *vk = (vk_t*)data; - struct gfx_ortho ortho = {0, 1, 0, 1, -1, 1}; + struct video_ortho ortho = {0, 1, 0, 1, -1, 1}; if (!vk) return; @@ -1243,7 +1243,7 @@ static void vulkan_set_viewport(void *data, unsigned viewport_width, int x = 0; int y = 0; float device_aspect = (float)viewport_width / viewport_height; - struct gfx_ortho ortho = {0, 1, 0, 1, -1, 1}; + struct video_ortho ortho = {0, 1, 0, 1, -1, 1}; settings_t *settings = config_get_ptr(); vk_t *vk = (vk_t*)data; diff --git a/gfx/drivers_shader/shader_gl_cg.c b/gfx/drivers_shader/shader_gl_cg.c index 9e42d992a5..5e34234625 100644 --- a/gfx/drivers_shader/shader_gl_cg.c +++ b/gfx/drivers_shader/shader_gl_cg.c @@ -289,7 +289,7 @@ fallback: static void gl_cg_set_texture_info( cg_shader_data_t *cg, const struct cg_fbo_params *params, - const struct gfx_tex_info *info) + const struct video_tex_info *info) { unsigned i; struct uniform_cg uniform_data[4]; @@ -348,10 +348,10 @@ static void gl_cg_set_params(void *data, void *shader_data, struct uniform_cg uniform_data[10]; struct uniform_info uniform_params[10] = {{0}}; unsigned uniform_count = 0; - const struct gfx_tex_info *info = (const struct gfx_tex_info*)_info; - const struct gfx_tex_info *prev_info = (const struct gfx_tex_info*)_prev_info; - const struct gfx_tex_info *feedback_info = (const struct gfx_tex_info*)_feedback_info; - const struct gfx_tex_info *fbo_info = (const struct gfx_tex_info*)_fbo_info; + const struct video_tex_info *info = (const struct video_tex_info*)_info; + const struct video_tex_info *prev_info = (const struct video_tex_info*)_prev_info; + const struct video_tex_info *feedback_info = (const struct video_tex_info*)_feedback_info; + const struct video_tex_info *fbo_info = (const struct video_tex_info*)_fbo_info; cg_shader_data_t *cg = (cg_shader_data_t*)shader_data; if (!cg || (cg->active_idx == 0)) diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index a0161b53d0..38f6b81f1a 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -1019,10 +1019,10 @@ static void gl_glsl_set_params(void *data, void *shader_data, unsigned texunit = 1; const struct shader_uniforms *uni = NULL; size_t size = 0, attribs_size = 0; - const struct gfx_tex_info *info = (const struct gfx_tex_info*)_info; - const struct gfx_tex_info *prev_info = (const struct gfx_tex_info*)_prev_info; - const struct gfx_tex_info *feedback_info = (const struct gfx_tex_info*)_feedback_info; - const struct gfx_tex_info *fbo_info = (const struct gfx_tex_info*)_fbo_info; + const struct video_tex_info *info = (const struct video_tex_info*)_info; + const struct video_tex_info *prev_info = (const struct video_tex_info*)_prev_info; + const struct video_tex_info *feedback_info = (const struct video_tex_info*)_feedback_info; + const struct video_tex_info *fbo_info = (const struct video_tex_info*)_fbo_info; struct glsl_attrib *attr = (struct glsl_attrib*)attribs; glsl_shader_data_t *glsl = (glsl_shader_data_t*)shader_data; diff --git a/gfx/drivers_shader/shader_hlsl.c b/gfx/drivers_shader/shader_hlsl.c index 26467efafa..2509b2629c 100644 --- a/gfx/drivers_shader/shader_hlsl.c +++ b/gfx/drivers_shader/shader_hlsl.c @@ -124,10 +124,9 @@ static void hlsl_set_params(void *data, void *shader_data, { d3d_video_t *d3d = (d3d_video_t*)data; LPDIRECT3DDEVICE d3d_device_ptr = (LPDIRECT3DDEVICE)d3d->dev; - const struct gfx_tex_info *info = (const struct gfx_tex_info*)_info; - const struct gfx_tex_info *prev_info = (const struct gfx_tex_info*)_prev_info; - (void)_feedback_info; - const struct gfx_tex_info *fbo_info = (const struct gfx_tex_info*)_fbo_info; + const struct video_tex_info *info = (const struct video_tex_info*)_info; + const struct video_tex_info *prev_info = (const struct video_tex_info*)_prev_info; + const struct video_tex_info *fbo_info = (const struct video_tex_info*)_fbo_info; hlsl_shader_data_t *hlsl = (hlsl_shader_data_t*)shader_data; if (!hlsl) diff --git a/gfx/video_coord_array.h b/gfx/video_coord_array.h index 7b1f30e54c..88116a7b15 100644 --- a/gfx/video_coord_array.h +++ b/gfx/video_coord_array.h @@ -36,7 +36,7 @@ struct video_fbo_rect unsigned height; }; -struct gfx_ortho +struct video_ortho { float left; float right; @@ -46,7 +46,7 @@ struct gfx_ortho float zfar; }; -struct gfx_tex_info +struct video_tex_info { unsigned int tex; float input_size[2];