trunk/src/osd/windows/d3dhlsl.c
| r20381 | r20382 | |
| 1059 | 1059 | |
| 1060 | 1060 | int hlsl_info::create_resources(bool reset) |
| 1061 | 1061 | { |
| 1062 | | printf("create_resources enter\n"); fflush(stdout); |
| 1063 | 1062 | initialized = true; |
| 1064 | 1063 | |
| 1065 | 1064 | if (!master_enable || !d3dintf->post_fx_available) |
| r20381 | r20382 | |
| 1117 | 1116 | shadow_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32)); |
| 1118 | 1117 | } |
| 1119 | 1118 | |
| 1120 | | printf("load shaders enter\n"); fflush(stdout); |
| 1121 | | |
| 1122 | 1119 | const char *fx_dir = downcast<windows_options &>(window->machine().options()).screen_post_fx_dir(); |
| 1123 | 1120 | |
| 1124 | 1121 | // Replace all this garbage with a proper data-driven system |
| r20381 | r20382 | |
| 1305 | 1302 | if (yiq_decode_name) |
| 1306 | 1303 | osd_free(yiq_decode_name); |
| 1307 | 1304 | |
| 1308 | | printf("load shaders exit\n"); fflush(stdout); |
| 1309 | | |
| 1310 | 1305 | return 0; |
| 1311 | 1306 | } |
| 1312 | 1307 | |
| r20381 | r20382 | |
| 1535 | 1530 | (*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight); |
| 1536 | 1531 | (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f / (poly->texture->ustop - poly->texture->ustart)); |
| 1537 | 1532 | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f / (poly->texture->vstop - poly->texture->vstart)); |
| 1533 | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", d3d->width); |
| 1534 | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", d3d->height); |
| 1538 | 1535 | (*d3dintf->effect.set_vector)(curr_effect, "Floor", 3, options->floor); |
| 1539 | 1536 | (*d3dintf->effect.set_float)(curr_effect, "SnapX", snap_width); |
| 1540 | 1537 | (*d3dintf->effect.set_float)(curr_effect, "SnapY", snap_height); |
| r20381 | r20382 | |
| 1854 | 1851 | |
| 1855 | 1852 | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width); |
| 1856 | 1853 | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height); |
| 1854 | (*d3dintf->effect.set_float)(curr_effect, "RawWidth", (float)poly->texture->rawwidth); |
| 1855 | (*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight); |
| 1856 | (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f); |
| 1857 | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f); |
| 1857 | 1858 | (*d3dintf->effect.set_vector)(curr_effect, "Defocus", 2, &options->defocus[0]); |
| 1858 | 1859 | |
| 1859 | 1860 | (*d3dintf->effect.begin)(curr_effect, &num_passes, 0); |
| r20381 | r20382 | |
| 1880 | 1881 | |
| 1881 | 1882 | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width); |
| 1882 | 1883 | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height); |
| 1884 | (*d3dintf->effect.set_float)(curr_effect, "RawWidth", (float)poly->texture->rawwidth); |
| 1885 | (*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight); |
| 1886 | (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f); |
| 1887 | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f); |
| 1883 | 1888 | (*d3dintf->effect.set_vector)(curr_effect, "Defocus", 2, &options->defocus[1]); |
| 1884 | 1889 | |
| 1885 | 1890 | (*d3dintf->effect.begin)(curr_effect, &num_passes, 0); |
| r20381 | r20382 | |
| 1908 | 1913 | { |
| 1909 | 1914 | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width); |
| 1910 | 1915 | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height); |
| 1916 | (*d3dintf->effect.set_float)(curr_effect, "RawWidth", (float)poly->texture->rawwidth); |
| 1917 | (*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight); |
| 1918 | (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f / (poly->texture->ustop - poly->texture->ustart)); |
| 1919 | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f / (poly->texture->vstop - poly->texture->vstart)); |
| 1911 | 1920 | (*d3dintf->effect.set_vector)(curr_effect, "Phosphor", 3, options->phosphor); |
| 1912 | 1921 | } |
| 1913 | 1922 | (*d3dintf->effect.set_float)(curr_effect, "TextureWidth", (float)rt->target_width); |
| r20381 | r20382 | |
| 2014 | 2023 | |
| 2015 | 2024 | (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]); |
| 2016 | 2025 | |
| 2017 | | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)rt->target_width); |
| 2018 | | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)rt->target_height); |
| 2026 | //(*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)rt->target_width); |
| 2027 | //(*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)rt->target_height); |
| 2019 | 2028 | |
| 2020 | 2029 | #if HLSL_VECTOR |
| 2021 | 2030 | result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]); |
| r20381 | r20382 | |
| 2030 | 2039 | { |
| 2031 | 2040 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2032 | 2041 | // add the primitives |
| 2033 | | result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2); |
| 2042 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2034 | 2043 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2035 | 2044 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2036 | 2045 | } |
| r20381 | r20382 | |
| 2367 | 2376 | #endif |
| 2368 | 2377 | else |
| 2369 | 2378 | { |
| 2370 | | (*d3dintf->effect.set_float)(curr_effect, "RawWidth", d3d->width);//poly->texture != NULL ? (float)poly->texture->rawwidth : 8.0f); |
| 2371 | | (*d3dintf->effect.set_float)(curr_effect, "RawHeight", d3d->height);//poly->texture != NULL ? (float)poly->texture->rawheight : 8.0f); |
| 2372 | | (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f);//poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f); |
| 2373 | | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f);//poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f); |
| 2379 | (*d3dintf->effect.set_float)(curr_effect, "RawWidth", poly->texture != NULL ? (float)poly->texture->rawwidth : 8.0f); |
| 2380 | (*d3dintf->effect.set_float)(curr_effect, "RawHeight", poly->texture != NULL ? (float)poly->texture->rawheight : 8.0f); |
| 2381 | (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f); |
| 2382 | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f); |
| 2374 | 2383 | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width); |
| 2375 | 2384 | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height); |
| 2376 | 2385 | (*d3dintf->effect.set_float)(curr_effect, "PostPass", 0.0f); |