(D3D) Move default usage value to d3d_wrapper.cpp function

This commit is contained in:
twinaphex 2015-04-07 02:53:27 +02:00
parent d32af58250
commit 7df57edf77
3 changed files with 7 additions and 12 deletions

View File

@ -1233,8 +1233,7 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay)
if (!overlay->vert_buf)
{
overlay->vert_buf = (LPDIRECT3DVERTEXBUFFER)d3d_vertex_buffer_new(
d3d->dev, sizeof(vert), d3d->dev->GetSoftwareVertexProcessing() ?
D3DUSAGE_SOFTWAREPROCESSING : 0, 0, D3DPOOL_MANAGED, NULL);
d3d->dev, sizeof(vert), 0, 0, D3DPOOL_MANAGED, NULL);
if (!overlay->vert_buf)
return;

View File

@ -91,11 +91,13 @@ void d3d_texture_free(LPDIRECT3DTEXTURE tex)
}
LPDIRECT3DVERTEXBUFFER d3d_vertex_buffer_new(LPDIRECT3DDEVICE dev,
unsigned length, unsigned usage, unsigned fvf,
D3DPOOL pool, void *handle)
unsigned length, unsigned usage,
unsigned fvf, D3DPOOL pool, void *handle)
{
HRESULT hr;
LPDIRECT3DVERTEXBUFFER buf;
if (usage == 0)
usage = (dev->GetSoftwareVertexProcessing()) ? D3DUSAGE_SOFTWAREPROCESSING : 0
#if defined(HAVE_D3D8)
hr = IDirect3DDevice8_CreateVertexBuffer(dev, length, usage, fvf, pool,

View File

@ -881,12 +881,7 @@ static bool renderchain_create_first_pass(void *data, const void *info_data,
chain->prev.last_width[i] = 0;
chain->prev.last_height[i] = 0;
chain->prev.vertex_buf[i] = d3d_vertex_buffer_new(
d3dr, 4 * sizeof(Vertex),
d3dr->GetSoftwareVertexProcessing()
? D3DUSAGE_SOFTWAREPROCESSING : 0,
0,
D3DPOOL_DEFAULT,
NULL);
d3dr, 4 * sizeof(Vertex), 0, 0, D3DPOOL_DEFAULT, NULL);
if (!chain->prev.vertex_buf[i])
return false;
@ -1101,8 +1096,7 @@ static bool cg_d3d9_renderchain_add_pass(void *data, const void *info_data)
return false;
pass.vertex_buf = (LPDIRECT3DVERTEXBUFFER)d3d_vertex_buffer_new(d3dr, 4 * sizeof(Vertex),
d3dr->GetSoftwareVertexProcessing() ? D3DUSAGE_SOFTWAREPROCESSING : 0,
0, D3DPOOL_DEFAULT, NULL);
0, 0, D3DPOOL_DEFAULT, NULL);
if (!pass.vertex_buf)
return false;