Previous 15994 Revisions Next

r11596 Friday 20th May, 2011 at 07:37:17 UTC by MooglyGuy
HLSL Updates [Ryan Holtz, Bat Country Entertainment]
- Re-worked render target handling to align pixels better, reducing unintentional blurring
- Made major fixes to CVBS simulation, significantly increasing color saturation
[hlsl]post.fx yiq_decode.fx yiq_encode.fx
[src/osd/windows]drawd3d.c winmain.c winmain.h

hlsl/post.fx
r11595r11596
8080   Output.Position.y -= 0.5f;
8181   Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
8282   Output.Color = Input.Color;
83   float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
84   float2 TexCoord = (Input.Position.xy * InvTexSize) / float2(WidthRatio, HeightRatio);
85   Output.TexCoord = TexCoord;//(Input.TexCoord - float2(0.5f, 0.5f)) / 8.0f + float2(0.25f, 0.25f);
83   //float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
84   //float2 TexCoord = (Input.Position.xy * InvTexSize) / float2(WidthRatio, HeightRatio);
85   float2 Ratios = float2(WidthRatio, HeightRatio);
86   float2 Offset = float2(0.5f / RawWidth, 0.5f / RawHeight);
87   Output.TexCoord = Input.TexCoord;//(Input.TexCoord - float2(0.5f, 0.5f)) / 8.0f + float2(0.25f, 0.25f);
8688   Output.ExtraInfo = Input.ExtraInfo;
8789   
8890   return Output;
r11595r11596
148150   float3 PincushionCurveX = PinUnitCoord.x * PincushionAmount * PincushionR2;
149151   float3 PincushionCurveY = PinUnitCoord.y * PincushionAmount * PincushionR2;
150152
151   float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord * Ratios);
153   float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
152154
153155   // -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
154156   clip((ScreenClipCoord.x < 1.0f / TargetWidth) ? -1 : 1);
hlsl/yiq_decode.fx
r11595r11596
77sampler DiffuseSampler = sampler_state
88{
99   Texture   = <Diffuse>;
10   MipFilter = LINEAR;
11   MinFilter = LINEAR;
12   MagFilter = LINEAR;
10   MipFilter = POINT;
11   MinFilter = POINT;
12   MagFilter = POINT;
1313   AddressU = CLAMP;
1414   AddressV = CLAMP;
1515   AddressW = CLAMP;
r11595r11596
7070   Output.Position = float4(Input.Position.xyz, 1.0f);
7171   Output.Position.x /= TargetWidth;
7272   Output.Position.y /= TargetHeight;
73   //Output.Position.x /= WidthRatio;
74   //Output.Position.y /= HeightRatio;
7375   Output.Position.y = 1.0f - Output.Position.y;
7476   Output.Position.x -= 0.5f;
7577   Output.Position.y -= 0.5f;
7678   Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
7779   Output.Color = Input.Color;
78   float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
79   float2 Ratios = float2(WidthRatio, HeightRatio);
80   float2 TexCoord = (Input.Position.xy * InvTexSize) / Ratios;
81   Output.Coord0 = TexCoord + float2(0.0f / RawWidth, 0.0f);
82   Output.Coord1 = TexCoord + float2(0.25f / RawWidth, 0.0f);
83   Output.Coord2 = TexCoord + float2(0.5f / RawWidth, 0.0f);
84   Output.Coord3 = TexCoord + float2(0.75f / RawWidth, 0.0f);
85   Output.Coord4 = TexCoord + float2(1.0f / RawWidth, 0.0f);
86   Output.Coord5 = TexCoord + float2(1.25f / RawWidth, 0.0f);
80   Output.Coord0 = Input.TexCoord + float2(0.00f / RawWidth, 0.0f);
81   Output.Coord1 = Input.TexCoord + float2(0.25f / RawWidth, 0.0f);
82   Output.Coord2 = Input.TexCoord + float2(0.50f / RawWidth, 0.0f);
83   Output.Coord3 = Input.TexCoord + float2(0.75f / RawWidth, 0.0f);
84   Output.Coord4 = Input.TexCoord + float2(1.00f / RawWidth, 0.0f);
85   Output.Coord5 = Input.TexCoord + float2(1.25f / RawWidth, 0.0f);
8786
8887   return Output;
8988}
r11595r11596
102101
103102float4 ps_main(PS_INPUT Input) : COLOR
104103{
104   float2 RawDims = float2(RawWidth, RawHeight);
105105   float4 OrigC = tex2D(DiffuseSampler, Input.Coord0.xy);
106106   float4 OrigC2 = tex2D(DiffuseSampler, Input.Coord4.xy);
107107   float4 C = OrigC;
r11595r11596
116116   
117117   float PI = 3.14159265f;
118118
119   float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio);
120   float2 Scaler = float2(RawWidth, RawHeight) * InvRatios;
119   float2 Scaler = RawDims;
121120   float2 Coord0 = Input.Coord0.xy * Scaler;
122121   float2 Coord1 = Input.Coord1.xy * Scaler;
123122   float2 Coord2 = Input.Coord2.xy * Scaler;
r11595r11596
125124   float2 Coord4 = Input.Coord4.xy * Scaler;
126125   float2 Coord5 = Input.Coord5.xy * Scaler;
127126   
128   float W = WValue * 2.0f;
129   float YRatio = 0.5333f;
127   float W = WValue;
128   float YRatio = 1.0f;
130129   float T0 = Coord0.x + AValue * YRatio * Coord0.y + BValue;
131130   float T1 = Coord1.x + AValue * YRatio * Coord1.y + BValue;
132131   float T2 = Coord2.x + AValue * YRatio * Coord2.y + BValue;
r11595r11596
152151   
153152   float3 OutRGB = float3(dot(YIQ, float3(1.0f, 0.9563f, 0.6210f)), dot(YIQ, float3(1.0f, -0.2721f, -0.6474f)), dot(YIQ, float3(1.0f, -1.1070f, 1.7046f)));   
154153   
155   // Debugging: return sin(W * Tc) * 0.5f + 0.5f;
156   // Debugging: return float4(0.5f + 0.5f * sin(W * float3(T0, T2, T4)), 1.0f);
157154   return float4(OutRGB, 1.0f);
158155}
159156
hlsl/yiq_encode.fx
r11595r11596
6666   Output.Position = float4(Input.Position.xyz, 1.0f);
6767   Output.Position.x /= TargetWidth;
6868   Output.Position.y /= TargetHeight;
69   Output.Position.y /= HeightRatio;
7069   Output.Position.y = 1.0f - Output.Position.y;
71   Output.Position.x /= WidthRatio;
7270   Output.Position.x -= 0.5f;
7371   Output.Position.y -= 0.5f;
7472   Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
7573   Output.Color = Input.Color;
76   float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
7774   Output.Coord0 = Input.TexCoord + float2(0.00f / RawWidth, 0.0f);
7875   Output.Coord1 = Input.TexCoord + float2(0.25f / RawWidth, 0.0f);
7976   Output.Coord2 = Input.TexCoord + float2(0.50f / RawWidth, 0.0f);
8077   Output.Coord3 = Input.TexCoord + float2(0.75f / RawWidth, 0.0f);
81
78   
8279   return Output;
8380}
8481
r11595r11596
9693
9794float4 ps_main(PS_INPUT Input) : COLOR
9895{
99   float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0).rgb;
100   float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1).rgb;
101   float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2).rgb;
102   float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3).rgb;
96   float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio);
97   float2 Offset = float2(0.5f / RawWidth, 0.5f / RawHeight);
98   float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0 - Offset).rgb;
99   float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1 - Offset).rgb;
100   float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2 - Offset).rgb;
101   float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3 - Offset).rgb;
103102   
104   // Cos goes from 1 to 0 to 1 over the course of 2PI
105   // Sin goes from 0 to 1 to 0 over the course of 2PI
106   // WValue is 4PI / 3
107   // That is, 3 cycles through WValue will reuslt in 4PI being traversed, or cos() to go from 1 to 0 to 1 to 0 to 1
108   // WValue appears to be the chroma carrier rate
109   // 1 Pixel -> 1 cycle
110   // WValue will cycle from 1 to 0 to 1 to 0 to 1 over 3 pixels
111
112
113   float PI = 3.14159265f;
114   float W = WValue;
103   float2 Scaler = float2(RawWidth, RawHeight);
104   float2 Coord0 = Input.Coord0.xy * Scaler;
105   float2 Coord1 = Input.Coord1.xy * Scaler;
106   float2 Coord2 = Input.Coord2.xy * Scaler;
107   float2 Coord3 = Input.Coord3.xy * Scaler;
115108   
116   float T0 = Input.Coord0.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord0.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f;
117   float T1 = Input.Coord1.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord1.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f;
118   float T2 = Input.Coord2.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord2.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f;
119   float T3 = Input.Coord3.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord3.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f;
120   
109   float W = WValue;
110   float YRatio = 1.0f;
111   float T0 = Coord0.x + AValue * YRatio * Coord0.y + BValue;
112   float T1 = Coord1.x + AValue * YRatio * Coord1.y + BValue;
113   float T2 = Coord2.x + AValue * YRatio * Coord2.y + BValue;
114   float T3 = Coord3.x + AValue * YRatio * Coord3.y + BValue;
115
121116   float Y0 = dot(Texel0, float3(0.299f, 0.587f, 0.114f));
122117   float I0 = dot(Texel0, float3(0.595716f, -0.274453f, -0.321263f));
123118   float Q0 = dot(Texel0, float3(0.211456f, -0.522591f, 0.311135f));
r11595r11596
134129   float I3 = dot(Texel3, float3(0.595716f, -0.274453f, -0.321263f));
135130   float Q3 = dot(Texel3, float3(0.211456f, -0.522591f, 0.311135f));
136131
137   //float MaxC = 1.5957f;
138   //float MinC = -0.5957f;
139132   float MaxC = 2.1183f;
140133   float MinC = -1.1183f;
141134   float CRange = MaxC - MinC;
r11595r11596
149142   C2 = (C2 - MinC) / CRange;
150143   C3 = (C3 - MinC) / CRange;
151144   
152   float4 Tc = float4(T0, T1, T2, T3);
153145   return float4(C0, C1, C2, C3);
154146}
155147
src/osd/windows/winmain.c
r11595r11596
341341   { WINOPTION_OVERSAMPLE_X";fs_overx(0.1-9.0)",               "1.0",         OPTION_FLOAT,       "oversample amount in screen-relative X direction, multiple" },
342342   { WINOPTION_OVERSAMPLE_Y";fs_overy(0.1-9.0)",               "1.0",         OPTION_FLOAT,        "oversample amount in screen-relative Y direction, multiple" },
343343   { WINOPTION_CURVATURE";fs_curv(0.0-4.0)",                  "0.0",       OPTION_FLOAT,       "screen curvature amount" },
344   { WINOPTION_SCREEN_SCALE_TOP";fs_scalex(0.0-2.0)",          "1.0",       OPTION_FLOAT,       "screen scale, top" },
345   { WINOPTION_SCREEN_SCALE_BOTTOM";fs_scaley(0.0-2.0)",        "1.0",       OPTION_FLOAT,       "screen scale, bottom" },
344346   /* Beam-related values below this line*/
345347   { WINOPTION_PINCUSHION";fs_pin(0.0-4.0)",                  "0.0",       OPTION_FLOAT,       "pincushion amount" },
346348   { WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)",          "0.0",       OPTION_FLOAT,       "overall alpha scaling value for scanlines" },
src/osd/windows/winmain.h
r11595r11596
9090#define WINOPTION_SHADOW_MASK_USIZE         "shadow_mask_usize"
9191#define WINOPTION_SHADOW_MASK_VSIZE         "shadow_mask_vsize"
9292#define WINOPTION_PINCUSHION            "pincushion"
93#define WINOPTION_SCREEN_SCALE_TOP         "screen_scale_top"
94#define WINOPTION_SCREEN_SCALE_BOTTOM      "screen_scale_bottom"
9395#define WINOPTION_CURVATURE               "curvature"
9496#define WINOPTION_OVERSAMPLE_X            "oversample_x"
9597#define WINOPTION_OVERSAMPLE_Y            "oversample_y"
r11595r11596
224226   float screen_scanline_bright_offset() const { return float_value(WINOPTION_SCANLINE_BRIGHT_OFFSET); }
225227   float screen_scanline_offset() const { return float_value(WINOPTION_SCANLINE_OFFSET); }
226228   float screen_pincushion() const { return float_value(WINOPTION_PINCUSHION); }
229   float screen_scale_top() const { return float_value(WINOPTION_SCREEN_SCALE_TOP); }
230   float screen_scale_bottom() const { return float_value(WINOPTION_SCREEN_SCALE_BOTTOM); }
227231   float screen_curvature() const { return float_value(WINOPTION_CURVATURE); }
228232   float screen_defocus_x() const { return float_value(WINOPTION_DEFOCUS_X); }
229233   float screen_defocus_y() const { return float_value(WINOPTION_DEFOCUS_Y); }
src/osd/windows/drawd3d.c
r11595r11596
8787#define ENABLE_BORDER_PIX   (1)
8888
8989#define VERTEX_BASE_FORMAT   (D3DFVF_DIFFUSE | D3DFVF_TEX1 | D3DFVF_TEX2)
90#define VERTEX_BUFFER_SIZE   (2048*4)
90#define VERTEX_BUFFER_SIZE   (2048*6+6)
9191
9292enum
9393{
r11595r11596
200200   d3d_effect *         color_effect;            // pointer to the current color-effect object
201201   d3d_effect *         yiq_encode_effect;         // pointer to the current YIQ encoder effect object
202202   d3d_effect *         yiq_decode_effect;         // pointer to the current YIQ decoder effect object
203   d3d_vertex *         fsfx_vertices;            // pointer to our full-screen-quad object
203204
204205   poly_info            poly[VERTEX_BUFFER_SIZE / 3];// array to hold polygons as they are created
205206   int                  numpolys;               // number of accumulated polygons
r11595r11596
524525// drawing
525526static void draw_line(d3d_info *d3d, const render_primitive *prim);
526527static void draw_quad(d3d_info *d3d, const render_primitive *prim);
528static void init_fsfx_quad(d3d_info *d3d);
527529
528530// primitives
529531static d3d_vertex *primitive_alloc(d3d_info *d3d, int numverts);
r11595r11596
744746   d3d->lockedbuf = NULL;
745747
746748   // loop over primitives
749   if(d3d->hlsl_enable && d3dintf->post_fx_available)
750   {
751      init_fsfx_quad(d3d);
752   }
753
747754mtlog_add("drawd3d_window_draw: primitive loop begin");
748755   for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
749756      switch (prim->type)
r11595r11596
19741981
19751982
19761983//============================================================
1984//  init_fsfx_quad
1985//============================================================
1986
1987static void init_fsfx_quad(d3d_info *d3d)
1988{
1989   // get a pointer to the vertex buffer
1990   d3d->fsfx_vertices = primitive_alloc(d3d, 6);
1991   if (d3d->fsfx_vertices == NULL)
1992      return;
1993
1994   // fill in the vertexes clockwise
1995   windows_options &options = downcast<windows_options &>(d3d->window->machine().options());
1996   float scale_top = options.screen_scale_top();
1997   float scale_bottom = options.screen_scale_bottom();
1998
1999   d3d->fsfx_vertices[0].x = (d3d->width * (scale_top * 0.5f - 0.5f));
2000   d3d->fsfx_vertices[0].y = 0.0f;
2001   d3d->fsfx_vertices[1].x = d3d->width - (d3d->width * (scale_top * 0.5f - 0.5f));
2002   d3d->fsfx_vertices[1].y = 0.0f;
2003   d3d->fsfx_vertices[2].x = (d3d->width * (scale_bottom * 0.5f - 0.5f));
2004   d3d->fsfx_vertices[2].y = d3d->height;
2005   d3d->fsfx_vertices[3].x = d3d->width - (d3d->width * (scale_top * 0.5f - 0.5f));
2006   d3d->fsfx_vertices[3].y = 0.0f;
2007   d3d->fsfx_vertices[4].x = (d3d->width * (scale_bottom * 0.5f - 0.5f));
2008   d3d->fsfx_vertices[4].y = d3d->height;
2009   d3d->fsfx_vertices[5].x = d3d->width - (d3d->width * (scale_bottom * 0.5f - 0.5f));
2010   d3d->fsfx_vertices[5].y = d3d->height;
2011
2012   d3d->fsfx_vertices[0].u0 = 0.0f;
2013   d3d->fsfx_vertices[0].v0 = 0.0f;
2014   d3d->fsfx_vertices[1].u0 = 1.0f;
2015   d3d->fsfx_vertices[1].v0 = 0.0f;
2016   d3d->fsfx_vertices[2].u0 = 0.0f;
2017   d3d->fsfx_vertices[2].v0 = 1.0f;
2018   d3d->fsfx_vertices[3].u0 = 1.0f;
2019   d3d->fsfx_vertices[3].v0 = 0.0f;
2020   d3d->fsfx_vertices[4].u0 = 0.0f;
2021   d3d->fsfx_vertices[4].v0 = 1.0f;
2022   d3d->fsfx_vertices[5].u0 = 1.0f;
2023   d3d->fsfx_vertices[5].v0 = 1.0f;
2024
2025   // set the color, Z parameters to standard values
2026   for (int i = 0; i < 6; i++)
2027   {
2028      d3d->fsfx_vertices[i].z = 0.0f;
2029      d3d->fsfx_vertices[i].rhw = 1.0f;
2030      d3d->fsfx_vertices[i].color = D3DCOLOR_ARGB(255, 255, 255, 255);
2031   }
2032}
2033
2034
2035
2036//============================================================
19772037//  primitive_alloc
19782038//============================================================
19792039
r11595r11596
20502110   {
20512111      result = (*d3dintf->device.get_render_target)(d3d->device, 0, &backbuffer);
20522112      if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device get_render_target call\n", (int)result);
2113      vertnum = 6;
20532114   }
2115   else
2116   {
2117      vertnum = 0;
2118   }
20542119
20552120   windows_options &options = downcast<windows_options &>(d3d->window->machine().options());
20562121
20572122   int cur_render_screen = 0;
20582123   // now do the polys
2059   for (polynum = vertnum = 0; polynum < d3d->numpolys; polynum++)
2124   for (polynum = 0; polynum < d3d->numpolys; polynum++)
20602125   {
20612126      poly_info *poly = &d3d->poly[polynum];
20622127      int newfilter;
r11595r11596
21602225               {
21612226                  (*d3dintf->effect.begin_pass)(curr_effect, pass);
21622227                  // add the primitives
2163                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2228                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
21642229                  if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
21652230                  (*d3dintf->effect.end_pass)(curr_effect);
21662231               }
r11595r11596
21772242               (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f);
21782243               (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
21792244               (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
2180               (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
2181               (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
21822245               (*d3dintf->effect.set_float)(curr_effect, "WValue", options.screen_yiq_w());
21832246               (*d3dintf->effect.set_float)(curr_effect, "AValue", options.screen_yiq_a());
21842247               (*d3dintf->effect.set_float)(curr_effect, "BValue", (float)poly->texture->cur_frame * options.screen_yiq_b());
r11595r11596
21952258               {
21962259                  (*d3dintf->effect.begin_pass)(curr_effect, pass);
21972260                  // add the primitives
2198                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2261                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
21992262                  if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
22002263                  (*d3dintf->effect.end_pass)(curr_effect);
22012264               }
r11595r11596
22522315            {
22532316               (*d3dintf->effect.begin_pass)(curr_effect, pass);
22542317               // add the primitives
2255               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2318               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
22562319               if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
22572320               (*d3dintf->effect.end_pass)(curr_effect);
22582321            }
r11595r11596
22932356            {
22942357               (*d3dintf->effect.begin_pass)(curr_effect, pass);
22952358               // add the primitives
2296               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2359               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
22972360               if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
22982361               (*d3dintf->effect.end_pass)(curr_effect);
22992362            }
r11595r11596
23312394               {
23322395                  (*d3dintf->effect.begin_pass)(curr_effect, pass);
23332396                  // add the primitives
2334                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2397                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
23352398                  if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
23362399                  (*d3dintf->effect.end_pass)(curr_effect);
23372400               }
r11595r11596
23612424               {
23622425                  (*d3dintf->effect.begin_pass)(curr_effect, pass);
23632426                  // add the primitives
2364                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2427                  result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
23652428                  if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
23662429                  (*d3dintf->effect.end_pass)(curr_effect);
23672430               }
r11595r11596
23962459            {
23972460               (*d3dintf->effect.begin_pass)(curr_effect, pass);
23982461               // add the primitives
2399               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2462               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
24002463               if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
24012464               (*d3dintf->effect.end_pass)(curr_effect);
24022465            }
r11595r11596
24222485            {
24232486               (*d3dintf->effect.begin_pass)(curr_effect, pass);
24242487               // add the primitives
2425               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
2488               result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count);
24262489               if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
24272490               (*d3dintf->effect.end_pass)(curr_effect);
24282491            }
r11595r11596
24322495            /* Scanlines and shadow mask */
24332496            curr_effect = d3d->post_effect;
24342497
2435            (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", poly->texture->d3dtexture0);
2498            (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", poly->texture->d3dtexture3);
24362499
24372500            result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
24382501            if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 5\n", (int)result);
r11595r11596
26862749                  goto error;
26872750               (*d3dintf->texture.get_surface_level)(texture->d3dtexture3, 0, &texture->d3dtarget3);
26882751
2689               printf("Boo\n");
26902752               result = (*d3dintf->device.create_texture)(d3d->device, (int)(scwidth * d3d->oversample_x), (int)(scheight * d3d->oversample_y), 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture->d3dtexture4);
26912753               if (result != D3D_OK)
26922754                  goto error;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team