summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/drawbgfx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/render/drawbgfx.h')
-rw-r--r--src/osd/modules/render/drawbgfx.h29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h
index 806bc651344..814f073b05c 100644
--- a/src/osd/modules/render/drawbgfx.h
+++ b/src/osd/modules/render/drawbgfx.h
@@ -11,6 +11,7 @@
#include <vector>
#include "binpacker.h"
+#include "bgfx/vertex.h"
class texture_manager;
class target_manager;
@@ -54,27 +55,6 @@ public:
}
private:
- struct ScreenVertex
- {
- float m_x;
- float m_y;
- float m_z;
- UINT32 m_rgba;
- float m_u;
- float m_v;
-
- static void init()
- {
- ms_decl.begin()
- .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
- .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
- .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
- .end();
- }
-
- static bgfx::VertexDecl ms_decl;
- };
-
void allocate_buffer(render_primitive *prim, UINT32 blend, bgfx::TransientVertexBuffer *buffer);
enum buffer_status
{
@@ -85,6 +65,7 @@ private:
};
buffer_status buffer_primitives(int view, bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer);
+ void render_screen_quad(int view, render_primitive* prim);
void render_textured_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer);
void put_packed_quad(render_primitive *prim, UINT32 hash, ScreenVertex* vertex);
@@ -92,8 +73,9 @@ private:
void put_line(float x0, float y0, float x1, float y1, float r, UINT32 rgba, ScreenVertex* vertex, float fth = 1.0f);
void set_bgfx_state(UINT32 blend);
+ uint64_t get_blend_state(UINT32 blend);
- uint32_t u32Color(uint32_t r, uint32_t g, uint32_t b, uint32_t a);
+ static uint32_t u32Color(uint32_t r, uint32_t g, uint32_t b, uint32_t a);
bool check_for_dirty_atlas();
bool update_atlas();
@@ -115,7 +97,7 @@ private:
bgfx_effect* m_gui_effect[4];
bgfx_effect* m_screen_effect[4];
- //bgfx_chain* m_screen_chain[4];
+ bgfx_chain* m_screen_chain;
std::map<UINT32, rectangle_packer::packed_rectangle> m_hash_to_entry;
std::vector<rectangle_packer::packable_rectangle> m_texinfo;
@@ -124,6 +106,7 @@ private:
uint32_t m_width[16];
uint32_t m_height[16];
uint32_t m_white[16*16];
+
static const uint16_t CACHE_SIZE;
static const uint32_t PACKABLE_SIZE;
static const uint32_t WHITE_HASH;