compile_program - if 'program' is NULL, then try to set program

to built-in shader program slot
This commit is contained in:
twinaphex 2016-04-16 04:58:03 +02:00
parent 86cb092b02
commit 1f7e6690e3
2 changed files with 6 additions and 0 deletions

View File

@ -623,6 +623,9 @@ static bool gl_cg_compile_program(
struct shader_program_data *program = (struct shader_program_data*)program_data;
cg_shader_data_t *cg_data = (cg_shader_data_t*)data;
if (!program)
program = &cg_data->prg[idx];
argv[argc++] = "-DPARAMETER_UNIFORM";
for (i = 0; i < GFX_MAX_SHADERS; i++)
{

View File

@ -207,6 +207,9 @@ static bool hlsl_compile_program(
ID3DXBuffer *code_f = NULL;
ID3DXBuffer *code_v = NULL;
if (!program)
program = &hlsl->prg[idx];
if (program_info->is_file)
{
ret_fp = D3DXCompileShaderFromFile(program_info->combined, NULL, NULL,