diff --git a/gfx/common/d3d_common.c b/gfx/common/d3d_common.c index b5c9de8f52..0b026f15ab 100644 --- a/gfx/common/d3d_common.c +++ b/gfx/common/d3d_common.c @@ -1184,10 +1184,17 @@ bool d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index, } bool d3d_set_vertex_shader_constantf(LPDIRECT3DDEVICE dev, - UINT start_register,const float* constant_data, unsigned vector4f_count) + UINT start_register,const float* constant_data, + unsigned vector4f_count) { #if defined(HAVE_D3D9) - return (IDirect3DDevice9_SetVertexShaderConstantF(dev, start_register, constant_data, vector4f_count) == D3D_OK); +#ifdef __cplusplus + return (dev->SetVertexShaderConstantF( + start_register, constant_data, vector4f_count) == D3D_OK); +#else + return (IDirect3DDevice9_SetVertexShaderConstantF(dev, + start_register, constant_data, vector4f_count) == D3D_OK); +#endif #endif return false; } diff --git a/gfx/drivers_font/xdk360_fonts.cpp b/gfx/drivers_font/xdk360_fonts.cpp index b351dbda1a..55e26178d2 100644 --- a/gfx/drivers_font/xdk360_fonts.cpp +++ b/gfx/drivers_font/xdk360_fonts.cpp @@ -649,11 +649,7 @@ static void xdk360_render_msg_pre(xdk360_video_font_t * font) d3d_set_vertex_declaration(d3dr, font->s_FontLocals.m_pFontVertexDecl); d3d_set_vertex_shader(d3dr, 0, font->s_FontLocals.m_pFontVertexShader); d3d_set_pixel_shader(d3dr, font->s_FontLocals.m_pFontPixelShader); - - /* Set the texture scaling factor as a vertex shader constant. - * Call here to avoid load hit store from writing to vTexScale above - */ - d3dr->SetVertexShaderConstantF( 2, vTexScale, 1 ); + d3d_set_vertex_shader_constantf(d3dr, 2, vTexScale, 1); } static void xdk360_draw_text(xdk360_video_font_t *font, @@ -670,10 +666,7 @@ static void xdk360_draw_text(xdk360_video_font_t *font, vColor[2] = ((0xffffffff & 0x000000ff) >> 0L) / 255.0f; vColor[3] = ((0xffffffff & 0xff000000) >> 24L) / 255.0f; - /* Perform the actual storing of the color constant here to prevent - * a load-hit-store by inserting work between the store and the use of - * the vColor array. */ - d3dr->SetVertexShaderConstantF(1, vColor, 1); + d3d_set_vertex_shader_constantf(d3dr, 1, vColor, 1); m_fCursorX = floorf(x); m_fCursorY = floorf(y);