mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
set_uniform_parameter - implement parameter lookup properly
This commit is contained in:
parent
4e63113f72
commit
7f9249830a
@ -122,8 +122,21 @@ static void gl_cg_set_uniform_parameter(
|
||||
return;
|
||||
|
||||
if (param->lookup.enable)
|
||||
location = cgGetNamedParameter(
|
||||
cg_data->prg[param->lookup.idx].fprg, cg_data->shader->lut[param->lookup.idx].id);
|
||||
{
|
||||
CGprogram prog = 0;
|
||||
|
||||
switch (param->lookup.type)
|
||||
{
|
||||
case SHADER_PROGRAM_VERTEX:
|
||||
prog = cg_data->prg[param->lookup.idx].vprg;
|
||||
break;
|
||||
case SHADER_PROGRAM_FRAGMENT:
|
||||
default:
|
||||
prog = cg_data->prg[param->lookup.idx].fprg;
|
||||
break;
|
||||
}
|
||||
location = cgGetNamedParameter(prog, cg_data->shader->lut[param->lookup.idx].id);
|
||||
}
|
||||
else
|
||||
{
|
||||
struct uniform_cg_data *cg_param = (struct uniform_cg_data*)uniform_data;
|
||||
|
@ -1216,8 +1216,8 @@ static void gl_glsl_set_params(void *data, void *shader_data,
|
||||
if (glsl->glsl_active_index)
|
||||
{
|
||||
unsigned j;
|
||||
struct uniform_info orig_uniforms[2];
|
||||
struct uniform_info feedback_uniforms[2];
|
||||
struct uniform_info orig_uniforms[2] = {0};
|
||||
struct uniform_info feedback_uniforms[2] = {0};
|
||||
|
||||
/* Set original texture. */
|
||||
if (uni->orig.texture >= 0)
|
||||
|
@ -91,6 +91,13 @@ enum shader_uniform_type
|
||||
UNIFORM_1I
|
||||
};
|
||||
|
||||
enum shader_program_type
|
||||
{
|
||||
SHADER_PROGRAM_VERTEX = 0,
|
||||
SHADER_PROGRAM_FRAGMENT,
|
||||
SHADER_PROGRAM_COMBINED
|
||||
};
|
||||
|
||||
struct shader_program_info
|
||||
{
|
||||
void *data;
|
||||
@ -111,6 +118,7 @@ struct uniform_info
|
||||
|
||||
struct
|
||||
{
|
||||
enum shader_program_type type;
|
||||
const char *ident;
|
||||
uint32_t idx;
|
||||
bool enable;
|
||||
|
Loading…
x
Reference in New Issue
Block a user