Previous 199869 Revisions Next

r20382 Monday 21st January, 2013 at 03:04:44 UTC by Ryan Holtz
Fix raster games with HLSL, nw
[src/osd/windows]d3dhlsl.c

trunk/src/osd/windows/d3dhlsl.c
r20381r20382
10591059
10601060int hlsl_info::create_resources(bool reset)
10611061{
1062    printf("create_resources enter\n"); fflush(stdout);
10631062   initialized = true;
10641063
10651064   if (!master_enable || !d3dintf->post_fx_available)
r20381r20382
11171116      shadow_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
11181117   }
11191118
1120    printf("load shaders enter\n"); fflush(stdout);
1121
11221119   const char *fx_dir = downcast<windows_options &>(window->machine().options()).screen_post_fx_dir();
11231120
11241121   // Replace all this garbage with a proper data-driven system
r20381r20382
13051302   if (yiq_decode_name)
13061303      osd_free(yiq_decode_name);
13071304
1308    printf("load shaders exit\n"); fflush(stdout);
1309
13101305   return 0;
13111306}
13121307
r20381r20382
15351530         (*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight);
15361531         (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f / (poly->texture->ustop - poly->texture->ustart));
15371532         (*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);
15381535         (*d3dintf->effect.set_vector)(curr_effect, "Floor", 3, options->floor);
15391536         (*d3dintf->effect.set_float)(curr_effect, "SnapX", snap_width);
15401537         (*d3dintf->effect.set_float)(curr_effect, "SnapY", snap_height);
r20381r20382
18541851
18551852         (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
18561853         (*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);
18571858         (*d3dintf->effect.set_vector)(curr_effect, "Defocus", 2, &options->defocus[0]);
18581859
18591860         (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
r20381r20382
18801881
18811882         (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
18821883         (*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);
18831888         (*d3dintf->effect.set_vector)(curr_effect, "Defocus", 2, &options->defocus[1]);
18841889
18851890         (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
r20381r20382
19081913      {
19091914         (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
19101915         (*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));
19111920         (*d3dintf->effect.set_vector)(curr_effect, "Phosphor", 3, options->phosphor);
19121921      }
19131922      (*d3dintf->effect.set_float)(curr_effect, "TextureWidth", (float)rt->target_width);
r20381r20382
20142023
20152024        (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
20162025
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);
20192028
20202029#if HLSL_VECTOR
20212030        result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
r20381r20382
20302039        {
20312040            (*d3dintf->effect.begin_pass)(curr_effect, pass);
20322041            // 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);
20342043            if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
20352044            (*d3dintf->effect.end_pass)(curr_effect);
20362045        }
r20381r20382
23672376#endif
23682377   else
23692378   {
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);
23742383      (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
23752384      (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
23762385      (*d3dintf->effect.set_float)(curr_effect, "PostPass", 0.0f);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team