diff options
Diffstat (limited to 'src/osd/windows/drawd3d.c')
-rw-r--r-- | src/osd/windows/drawd3d.c | 123 |
1 files changed, 61 insertions, 62 deletions
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c index 8e58163f6a2..686df150f5e 100644 --- a/src/osd/windows/drawd3d.c +++ b/src/osd/windows/drawd3d.c @@ -362,7 +362,6 @@ static int drawd3d_window_draw(win_window_info *window, HDC dc, int update) namespace d3d { - void renderer::set_texture(texture_info *texture) { if (texture != m_last_texture) @@ -651,59 +650,59 @@ texture_info *texture_manager::find_texinfo(const render_texinfo *texinfo, UINT3 /*int checkidx = 0; for (texture = m_renderer->get_texture_manager()->get_texlist(); texture != NULL; texture = texture->get_next()) { - printf("Checking texture index %d\n", checkidx); - UINT32 test_screen = (UINT32)texture->get_texinfo().osddata >> 1; - UINT32 test_page = (UINT32)texture->get_texinfo().osddata & 1; - UINT32 prim_screen = (UINT32)texinfo->osddata >> 1; - UINT32 prim_page = (UINT32)texinfo->osddata & 1; - if (test_screen != prim_screen || test_page != prim_page) - { - printf("No screen/page match: %d vs. %d, %d vs. %d\n", test_screen, prim_screen, test_page, prim_page); - continue; - } - - if (texture->get_hash() == hash && - texture->get_texinfo().base == texinfo->base && - texture->get_texinfo().width == texinfo->width && - texture->get_texinfo().height == texinfo->height && - ((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0) - { - // Reject a texture if it belongs to an out-of-date render target, so as to cause the HLSL system to re-cache - if (m_renderer->get_shaders()->enabled() && texinfo->width != 0 && texinfo->height != 0 && (flags & PRIMFLAG_SCREENTEX_MASK) != 0) - { - if (m_renderer->get_shaders()->find_render_target(texture) != NULL) - { - return texture; - } - } - else - { - return texture; - } - } - - if (texture->get_hash() != hash) - { - printf("No hash match: %d vs. %d\n", texture->get_hash(), hash); - } - if (texture->get_texinfo().base != texinfo->base) - { - printf("No base match\n"); - } - if (texture->get_texinfo().width != texinfo->width) - { - printf("No width match: %d vs. %d\n", texture->get_texinfo().width, texinfo->width); - } - if (texture->get_texinfo().height != texinfo->height) - { - printf("No height match: %d vs. %d\n", texture->get_texinfo().height, texinfo->height); - } - if (((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) != 0) - { - printf("No flag match: %08x & %08x = %08x\n", texture->get_flags(), flags, ((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK))); - } - printf("\n"); - checkidx++; + printf("Checking texture index %d\n", checkidx); + UINT32 test_screen = (UINT32)texture->get_texinfo().osddata >> 1; + UINT32 test_page = (UINT32)texture->get_texinfo().osddata & 1; + UINT32 prim_screen = (UINT32)texinfo->osddata >> 1; + UINT32 prim_page = (UINT32)texinfo->osddata & 1; + if (test_screen != prim_screen || test_page != prim_page) + { + printf("No screen/page match: %d vs. %d, %d vs. %d\n", test_screen, prim_screen, test_page, prim_page); + continue; + } + + if (texture->get_hash() == hash && + texture->get_texinfo().base == texinfo->base && + texture->get_texinfo().width == texinfo->width && + texture->get_texinfo().height == texinfo->height && + ((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0) + { + // Reject a texture if it belongs to an out-of-date render target, so as to cause the HLSL system to re-cache + if (m_renderer->get_shaders()->enabled() && texinfo->width != 0 && texinfo->height != 0 && (flags & PRIMFLAG_SCREENTEX_MASK) != 0) + { + if (m_renderer->get_shaders()->find_render_target(texture) != NULL) + { + return texture; + } + } + else + { + return texture; + } + } + + if (texture->get_hash() != hash) + { + printf("No hash match: %d vs. %d\n", texture->get_hash(), hash); + } + if (texture->get_texinfo().base != texinfo->base) + { + printf("No base match\n"); + } + if (texture->get_texinfo().width != texinfo->width) + { + printf("No width match: %d vs. %d\n", texture->get_texinfo().width, texinfo->width); + } + if (texture->get_texinfo().height != texinfo->height) + { + printf("No height match: %d vs. %d\n", texture->get_texinfo().height, texinfo->height); + } + if (((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) != 0) + { + printf("No flag match: %08x & %08x = %08x\n", texture->get_flags(), flags, ((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK))); + } + printf("\n"); + checkidx++; } printf("\n\n\n\n");*/ @@ -733,7 +732,7 @@ texture_info *texture_manager::find_texinfo(const render_texinfo *texinfo, UINT3 texture->get_texinfo().base == texinfo->base && ((texture->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0 && (texture->get_texinfo().width != texinfo->width || - texture->get_texinfo().height != texinfo->height)) + texture->get_texinfo().height != texinfo->height)) { m_renderer->get_shaders()->remove_render_target(texture); } @@ -1835,9 +1834,9 @@ void renderer::draw_quad(const render_primitive *prim) } void poly_info::init(D3DPRIMITIVETYPE type, UINT32 count, UINT32 numverts, - UINT32 flags, texture_info *texture, UINT32 modmode, - float line_time, float line_length, - float prim_width, float prim_height) + UINT32 flags, texture_info *texture, UINT32 modmode, + float line_time, float line_length, + float prim_width, float prim_height) { init(type, count, numverts, flags, texture, modmode, prim_width, prim_height); m_line_time = line_time; @@ -1845,8 +1844,8 @@ void poly_info::init(D3DPRIMITIVETYPE type, UINT32 count, UINT32 numverts, } void poly_info::init(D3DPRIMITIVETYPE type, UINT32 count, UINT32 numverts, - UINT32 flags, texture_info *texture, UINT32 modmode, - float prim_width, float prim_height) + UINT32 flags, texture_info *texture, UINT32 modmode, + float prim_width, float prim_height) { m_type = type; m_count = count; @@ -1963,7 +1962,7 @@ void renderer::primitive_flush_pending() { // add the primitives result = (*d3dintf->device.draw_primitive)(m_device, m_poly[polynum].get_type(), vertnum, - m_poly[polynum].get_count()); + m_poly[polynum].get_count()); if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); } @@ -3007,4 +3006,4 @@ bool render_target::init(renderer *d3d, base *d3dintf, int width, int height, in return true; } -};
\ No newline at end of file +}; |