From 45566c3663d8b5567df9e903647c56370ff5c17a Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 23 May 2012 23:27:09 +0200 Subject: [PATCH] Set identity matrices by default in HLSL. --- gfx/shader_hlsl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/shader_hlsl.c b/gfx/shader_hlsl.c index 6e68f1c0e1..c1f0c205a2 100644 --- a/gfx/shader_hlsl.c +++ b/gfx/shader_hlsl.c @@ -206,6 +206,7 @@ static void set_program_attributes(unsigned i) prg[i].frame_cnt_v = prg[i].v_ctable->GetConstantByName(NULL, "$IN.frame_count"); prg[i].frame_dir_v = prg[i].v_ctable->GetConstantByName(NULL, "$IN.frame_direction"); prg[i].mvp = prg[i].v_ctable->GetConstantByName(NULL, "$modelViewProj"); + prg[i].mvp_val = XMMIdentity(); } bool hlsl_load_shader(unsigned index, const char *path) @@ -215,6 +216,8 @@ bool hlsl_load_shader(unsigned index, const char *path) if (!hlsl_active || index == 0) retval = false; + // FIXME: This could cause corruption issues if prg[index] == prg[0] + // (Set earlier if path == NULL). if(retval) { //check if fragment program already exists