diff --git a/gfx/d3d/render_chain_cg.cpp b/gfx/d3d/render_chain_cg.cpp index 17e39588ac..1aeab77b97 100644 --- a/gfx/d3d/render_chain_cg.cpp +++ b/gfx/d3d/render_chain_cg.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "render_chain_driver.h" #include "../video_driver.h" @@ -195,7 +196,7 @@ static INLINE CGparameter find_param_from_semantic( } static bool d3d9_cg_load_program(void *data, - void *fragment_data, void *vertex_data, const std::string &shader, bool path_is_file) + void *fragment_data, void *vertex_data, const char *shader, bool path_is_file) { char *listing_f = NULL; char *listing_v = NULL; @@ -210,13 +211,13 @@ static bool d3d9_cg_load_program(void *data, RARCH_LOG("[D3D Cg]: Vertex profile: %s\n", cgGetProfileString(vertex_profile)); RARCH_LOG("[D3D Cg]: Fragment profile: %s\n", cgGetProfileString(fragment_profile)); - if (path_is_file && shader.length() > 0) + if (path_is_file && !string_is_empty(shader)) { *fPrg = cgCreateProgramFromFile(cg_data->cgCtx, CG_SOURCE, - shader.c_str(), fragment_profile, "main_fragment", fragment_opts); + shader, fragment_profile, "main_fragment", fragment_opts); CG_D3D_SET_LISTING(cg_data, f); *vPrg = cgCreateProgramFromFile(cg_data->cgCtx, CG_SOURCE, - shader.c_str(), vertex_profile, "main_vertex", vertex_opts); + shader, vertex_profile, "main_vertex", vertex_opts); CG_D3D_SET_LISTING(cg_data, v); } else @@ -895,7 +896,7 @@ static bool cg_d3d9_renderchain_init(void *data, if (!renderchain_create_first_pass(chain, info, fmt)) return false; renderchain_log_info(chain, info); - if (!d3d9_cg_load_program(chain, &chain->fStock, &chain->vStock, "", false)) + if (!d3d9_cg_load_program(chain, &chain->fStock, &chain->vStock, NULL, false)) return false; return true;