mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(D3D11) change the sprite vertex buffer to a ring buffer to avoid data
races with the gpu.
This commit is contained in:
parent
013ecf3719
commit
45541a0d44
@ -522,7 +522,7 @@ static bool d3d11_gfx_frame(
|
|||||||
D3D11SetPShaderSamplers(d3d11->ctx, 0, 1, &d3d11->sampler_linear);
|
D3D11SetPShaderSamplers(d3d11->ctx, 0, 1, &d3d11->sampler_linear);
|
||||||
D3D11SetBlendState(d3d11->ctx, d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
D3D11SetBlendState(d3d11->ctx, d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||||
|
|
||||||
d3d11->sprites.offset = 0;
|
|
||||||
d3d11->sprites.enabled = true;
|
d3d11->sprites.enabled = true;
|
||||||
|
|
||||||
if (d3d11->menu.enabled)
|
if (d3d11->menu.enabled)
|
||||||
|
@ -135,9 +135,12 @@ static void d3d11_font_render_line(
|
|||||||
int x = roundf(pos_x * width);
|
int x = roundf(pos_x * width);
|
||||||
int y = roundf((1.0 - pos_y) * height);
|
int y = roundf((1.0 - pos_y) * height);
|
||||||
|
|
||||||
if (!d3d11->sprites.enabled || d3d11->sprites.offset + msg_len > d3d11->sprites.capacity)
|
if (!d3d11->sprites.enabled || msg_len > d3d11->sprites.capacity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(d3d11->sprites.offset + msg_len > d3d11->sprites.capacity)
|
||||||
|
d3d11->sprites.offset = 0;
|
||||||
|
|
||||||
switch (text_align)
|
switch (text_align)
|
||||||
{
|
{
|
||||||
case TEXT_ALIGN_RIGHT:
|
case TEXT_ALIGN_RIGHT:
|
||||||
|
@ -53,7 +53,8 @@ static void menu_display_d3d11_draw(void* data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(d3d11->sprites.offset + 1 > d3d11->sprites.capacity)
|
if(d3d11->sprites.offset + 1 > d3d11->sprites.capacity)
|
||||||
return;
|
d3d11->sprites.offset = 0;
|
||||||
|
|
||||||
|
|
||||||
D3D11_MAPPED_SUBRESOURCE mapped_vbo;
|
D3D11_MAPPED_SUBRESOURCE mapped_vbo;
|
||||||
D3D11MapBuffer(d3d11->ctx, d3d11->sprites.vbo, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &mapped_vbo);
|
D3D11MapBuffer(d3d11->ctx, d3d11->sprites.vbo, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &mapped_vbo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user