const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType,
const void *idxData, UINT idxSize, UINT startIdx)
{
- unsigned int textureNo = 0;
+ unsigned int textureNo;
const WORD *pIdxBufS = NULL;
const DWORD *pIdxBufL = NULL;
UINT vx_index;
}
gl_info = context->gl_info;
- if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
+ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
- /* Invalidate the back buffer memory so LockRect will read it the next time */
- for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
- {
#if defined(STAGING_CSMT)
- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(state->fb.render_targets[i]);
- if (target)
+ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(state->fb.render_targets[i]);
+ if (target && target->resource.format->id != WINED3DFMT_NULL)
+ {
+ if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
{
wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding);
wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding);
+#else /* STAGING_CSMT */
+ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
+ if (target && target->resource.format->id != WINED3DFMT_NULL)
+ {
+ if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
+ {
+ surface_load_location(target, context, target->container->resource.draw_binding);
+ surface_invalidate_location(target, ~target->container->resource.draw_binding);
+#endif /* STAGING_CSMT */
+ }
+ else
+ {
+ wined3d_surface_prepare(target, context, target->container->resource.draw_binding);
}
}
}
+#if defined(STAGING_CSMT)
if (state->fb.depth_stencil)
{
/* Note that this depends on the context_acquire() call above to set
* that we never copy the stencil data.*/
DWORD location = context->render_offscreen ? state->fb.depth_stencil->resource->draw_binding
: WINED3D_LOCATION_DRAWABLE;
+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil);
+
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
{
- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil);
RECT current_rect, draw_rect, r;
if (!context->render_offscreen && ds != device->cs->onscreen_depth_stencil)
if (ds->resource.locations & location)
#else /* STAGING_CSMT */
- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
- if (target)
- {
- surface_load_location(target, context, target->container->resource.draw_binding);
- surface_invalidate_location(target, ~target->container->resource.draw_binding);
- }
- }
- }
-
if (device->fb.depth_stencil)
{
/* Note that this depends on the context_acquire() call above to set
* that we never copy the stencil data.*/
DWORD location = context->render_offscreen ? device->fb.depth_stencil->resource->draw_binding
: WINED3D_LOCATION_DRAWABLE;
+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil);
+
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
{
- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil);
RECT current_rect, draw_rect, r;
if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
IntersectRect(&r, &draw_rect, ¤t_rect);
if (!EqualRect(&r, &draw_rect))
surface_load_ds_location(ds, context, location);
+ else
+ wined3d_surface_prepare(ds, context, location);
}
+ else
+ wined3d_surface_prepare(ds, context, location);
}
#if defined(STAGING_CSMT)