mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(Shaders) Fix 'declaration shadows a variable in local scope' warnings
This commit is contained in:
parent
daa24a84e3
commit
f7d30b775f
@ -737,30 +737,30 @@ static void set_program_base_attrib(unsigned i)
|
||||
prg[i].lut_tex = cgGetNamedParameter(prg[i].vprg, "IN.lut_tex_coord");
|
||||
}
|
||||
|
||||
static void set_pass_attrib(struct cg_program *prg, struct cg_fbo_params *fbo,
|
||||
static void set_pass_attrib(struct cg_program *program, struct cg_fbo_params *fbo,
|
||||
const char *attr)
|
||||
{
|
||||
char attr_buf[64];
|
||||
|
||||
snprintf(attr_buf, sizeof(attr_buf), "%s.texture", attr);
|
||||
if (!fbo->tex)
|
||||
fbo->tex = cgGetNamedParameter(prg->fprg, attr_buf);
|
||||
fbo->tex = cgGetNamedParameter(program->fprg, attr_buf);
|
||||
|
||||
snprintf(attr_buf, sizeof(attr_buf), "%s.video_size", attr);
|
||||
if (!fbo->vid_size_v)
|
||||
fbo->vid_size_v = cgGetNamedParameter(prg->vprg, attr_buf);
|
||||
fbo->vid_size_v = cgGetNamedParameter(program->vprg, attr_buf);
|
||||
if (!fbo->vid_size_f)
|
||||
fbo->vid_size_f = cgGetNamedParameter(prg->fprg, attr_buf);
|
||||
fbo->vid_size_f = cgGetNamedParameter(program->fprg, attr_buf);
|
||||
|
||||
snprintf(attr_buf, sizeof(attr_buf), "%s.texture_size", attr);
|
||||
if (!fbo->tex_size_v)
|
||||
fbo->tex_size_v = cgGetNamedParameter(prg->vprg, attr_buf);
|
||||
fbo->tex_size_v = cgGetNamedParameter(program->vprg, attr_buf);
|
||||
if (!fbo->tex_size_f)
|
||||
fbo->tex_size_f = cgGetNamedParameter(prg->fprg, attr_buf);
|
||||
fbo->tex_size_f = cgGetNamedParameter(program->fprg, attr_buf);
|
||||
|
||||
snprintf(attr_buf, sizeof(attr_buf), "%s.tex_coord", attr);
|
||||
if (!fbo->coord)
|
||||
fbo->coord = cgGetNamedParameter(prg->vprg, attr_buf);
|
||||
fbo->coord = cgGetNamedParameter(program->vprg, attr_buf);
|
||||
}
|
||||
|
||||
static void set_program_attributes(unsigned i)
|
||||
|
@ -238,7 +238,7 @@ static GLint get_uniform(GLuint prog, const char *base)
|
||||
for (i = 0; i < ARRAY_SIZE(glsl_prefixes); i++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s%s", glsl_prefixes[i], base);
|
||||
GLint loc = glGetUniformLocation(prog, buf);
|
||||
loc = glGetUniformLocation(prog, buf);
|
||||
if (loc >= 0)
|
||||
return loc;
|
||||
}
|
||||
@ -258,7 +258,7 @@ static GLint get_attrib(GLuint prog, const char *base)
|
||||
for (i = 0; i < ARRAY_SIZE(glsl_prefixes); i++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s%s", glsl_prefixes[i], base);
|
||||
GLint loc = glGetAttribLocation(prog, buf);
|
||||
loc = glGetAttribLocation(prog, buf);
|
||||
if (loc >= 0)
|
||||
return loc;
|
||||
}
|
||||
|
@ -117,15 +117,6 @@ static struct gfx_shader *shader_null_get_current_shader(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void shader_null_set_get_proc_address(gfx_ctx_proc_t (*proc)(const char*))
|
||||
{
|
||||
}
|
||||
|
||||
void shader_null_set_context_type(bool core_profile,
|
||||
unsigned major, unsigned minor)
|
||||
{
|
||||
}
|
||||
|
||||
const shader_backend_t shader_null_backend = {
|
||||
shader_null_init,
|
||||
shader_null_deinit,
|
||||
|
@ -301,7 +301,7 @@ bool gfx_shader_resolve_parameters(config_file_t *conf,
|
||||
/* Find all parameters in our shaders. */
|
||||
for (i = 0; i < shader->passes; i++)
|
||||
{
|
||||
char line[2048];
|
||||
char line[PATH_MAX];
|
||||
FILE *file = fopen(shader->pass[i].source.path, "r");
|
||||
if (!file)
|
||||
continue;
|
||||
@ -338,7 +338,7 @@ bool gfx_shader_resolve_parameters(config_file_t *conf,
|
||||
/* Read in parameters which override the defaults. */
|
||||
if (conf)
|
||||
{
|
||||
char parameters[1024];
|
||||
char parameters[PATH_MAX];
|
||||
char *save = NULL;
|
||||
const char *id;
|
||||
|
||||
@ -349,7 +349,7 @@ bool gfx_shader_resolve_parameters(config_file_t *conf,
|
||||
for (id = strtok_r(parameters, ";", &save); id;
|
||||
id = strtok_r(NULL, ";", &save))
|
||||
{
|
||||
struct gfx_shader_parameter *param = (struct gfx_shader_parameter*)
|
||||
param = (struct gfx_shader_parameter*)
|
||||
find_parameter(shader->parameters, shader->num_parameters, id);
|
||||
|
||||
if (!param)
|
||||
|
Loading…
Reference in New Issue
Block a user