Get rid of some implicit memsets for state tracker

This commit is contained in:
twinaphex 2016-12-19 19:08:37 +01:00
parent 3c7c667cf5
commit 31b87594aa
2 changed files with 21 additions and 15 deletions

View File

@ -699,7 +699,7 @@ static bool gl_cg_load_imports(void *data)
{
unsigned i;
retro_ctx_memory_info_t mem_info;
struct state_tracker_info tracker_info = {0};
struct state_tracker_info tracker_info;
cg_shader_data_t *cg = (cg_shader_data_t*)data;
if (!cg->shader->variables)
@ -731,15 +731,17 @@ static bool gl_cg_load_imports(void *data)
}
}
mem_info.data = NULL;
mem_info.size = 0;
mem_info.id = RETRO_MEMORY_SYSTEM_RAM;
mem_info.data = NULL;
mem_info.size = 0;
mem_info.id = RETRO_MEMORY_SYSTEM_RAM;
core_get_memory(&mem_info);
tracker_info.wram = (uint8_t*)mem_info.data;
tracker_info.info = cg->shader->variable;
tracker_info.info_elem = cg->shader->variables;
tracker_info.wram = (uint8_t*)mem_info.data;
tracker_info.info = cg->shader->variable;
tracker_info.info_elem = cg->shader->variables;
tracker_info.script = NULL;
tracker_info.script_is_file = false;
#ifdef HAVE_PYTHON
if (*cg->shader->script_path)

View File

@ -881,23 +881,27 @@ static void *gl_glsl_init(void *data, const char *path)
if (glsl->shader->variables)
{
retro_ctx_memory_info_t mem_info;
struct state_tracker_info info = {0};
struct state_tracker_info info;
mem_info.id = RETRO_MEMORY_SYSTEM_RAM;
mem_info.id = RETRO_MEMORY_SYSTEM_RAM;
core_get_memory(&mem_info);
info.wram = (uint8_t*)mem_info.data;
info.info = glsl->shader->variable;
info.info_elem = glsl->shader->variables;
info.wram = (uint8_t*)mem_info.data;
info.info = glsl->shader->variable;
info.info_elem = glsl->shader->variables;
info.script = NULL;
info.script_class = NULL;
#ifdef HAVE_PYTHON
info.script = glsl->shader->script;
info.script_class = *glsl->shader->script_class ?
glsl->shader->script_class : NULL;
info.script = glsl->shader->script;
if (*glsl->shader->script_class)
info.script_class= glsl->shader->script_class;
#endif
info.script_is_file = NULL;
glsl->state_tracker = state_tracker_init(&info);
if (!glsl->state_tracker)
RARCH_WARN("Failed to init state tracker.\n");
}