"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/wined3d/swapchain.c" between
wine-6.0.tar.xz and wine-6.0.1.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs.

swapchain.c  (wine-6.0.tar.xz):swapchain.c  (wine-6.0.1.tar.xz)
skipping to change at line 403 skipping to change at line 403
TRACE("swapchain %p, ramp %p.\n", swapchain, ramp); TRACE("swapchain %p, ramp %p.\n", swapchain, ramp);
dc = GetDCEx(swapchain->state.device_window, 0, DCX_USESTYLE | DCX_CACHE); dc = GetDCEx(swapchain->state.device_window, 0, DCX_USESTYLE | DCX_CACHE);
GetDeviceGammaRamp(dc, ramp); GetDeviceGammaRamp(dc, ramp);
ReleaseDC(swapchain->state.device_window, dc); ReleaseDC(swapchain->state.device_window, dc);
return WINED3D_OK; return WINED3D_OK;
} }
/* The is a fallback for cases where we e.g. can't create a GL context or
* Vulkan swapchain for the swapchain window. */
static void swapchain_blit_gdi(struct wined3d_swapchain *swapchain,
struct wined3d_context *context, const RECT *src_rect, const RECT *dst_r
ect)
{
struct wined3d_texture *back_buffer = swapchain->back_buffers[0];
D3DKMT_DESTROYDCFROMMEMORY destroy_desc;
D3DKMT_CREATEDCFROMMEMORY create_desc;
const struct wined3d_format *format;
unsigned int row_pitch, slice_pitch;
HDC src_dc, dst_dc;
NTSTATUS status;
HBITMAP bitmap;
static unsigned int once;
TRACE("swapchain %p, context %p, src_rect %s, dst_rect %s.\n",
swapchain, context, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst
_rect));
if (!once++)
FIXME("Using GDI present.\n");
format = back_buffer->resource.format;
if (!format->ddi_format)
{
WARN("Cannot create a DC for format %s.\n", debug_d3dformat(format->id))
;
return;
}
wined3d_texture_load_location(back_buffer, 0, context, WINED3D_LOCATION_SYSM
EM);
wined3d_texture_get_pitch(back_buffer, 0, &row_pitch, &slice_pitch);
create_desc.pMemory = back_buffer->resource.heap_memory;
create_desc.Format = format->ddi_format;
create_desc.Width = wined3d_texture_get_level_width(back_buffer, 0);
create_desc.Height = wined3d_texture_get_level_height(back_buffer, 0);
create_desc.Pitch = row_pitch;
create_desc.hDeviceDc = CreateCompatibleDC(NULL);
create_desc.pColorTable = NULL;
status = D3DKMTCreateDCFromMemory(&create_desc);
DeleteDC(create_desc.hDeviceDc);
if (status)
{
WARN("Failed to create DC, status %#x.\n", status);
return;
}
src_dc = create_desc.hDc;
bitmap = create_desc.hBitmap;
TRACE("Created source DC %p, bitmap %p for backbuffer %p.\n", src_dc, bitmap
, back_buffer);
if (!(dst_dc = GetDCEx(swapchain->win_handle, 0, DCX_USESTYLE | DCX_CACHE)))
ERR("Failed to get destination DC.\n");
if (!BitBlt(dst_dc, dst_rect->left, dst_rect->top, dst_rect->right - dst_rec
t->left,
dst_rect->bottom - dst_rect->top, src_dc, src_rect->left, src_rect->
top, SRCCOPY))
ERR("Failed to blit.\n");
ReleaseDC(swapchain->win_handle, dst_dc);
destroy_desc.hDc = src_dc;
destroy_desc.hBitmap = bitmap;
if ((status = D3DKMTDestroyDCFromMemory(&destroy_desc)))
ERR("Failed to destroy src dc, status %#x.\n", status);
}
/* A GL context is provided by the caller */ /* A GL context is provided by the caller */
static void swapchain_blit(const struct wined3d_swapchain *swapchain, static void swapchain_blit(const struct wined3d_swapchain *swapchain,
struct wined3d_context *context, const RECT *src_rect, const RECT *dst_r ect) struct wined3d_context *context, const RECT *src_rect, const RECT *dst_r ect)
{ {
struct wined3d_texture *texture = swapchain->back_buffers[0]; struct wined3d_texture *texture = swapchain->back_buffers[0];
struct wined3d_device *device = swapchain->device; struct wined3d_device *device = swapchain->device;
enum wined3d_texture_filter_type filter; enum wined3d_texture_filter_type filter;
DWORD location; DWORD location;
TRACE("swapchain %p, context %p, src_rect %s, dst_rect %s.\n", TRACE("swapchain %p, context %p, src_rect %s, dst_rect %s.\n",
skipping to change at line 526 skipping to change at line 593
WARN("Invalid context, skipping present.\n"); WARN("Invalid context, skipping present.\n");
return; return;
} }
gl_info = context_gl->gl_info; gl_info = context_gl->gl_info;
swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval); swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval);
TRACE("Presenting DC %p.\n", context_gl->dc); TRACE("Presenting DC %p.\n", context_gl->dc);
if (context_gl->dc == swapchain_gl->backup_dc)
swapchain_blit_gdi(swapchain, context, src_rect, dst_rect);
if (!(render_to_fbo = swapchain->render_to_fbo) if (!(render_to_fbo = swapchain->render_to_fbo)
&& (src_rect->left || src_rect->top && (src_rect->left || src_rect->top
|| src_rect->right != desc->backbuffer_width || src_rect->right != desc->backbuffer_width
|| src_rect->bottom != desc->backbuffer_height || src_rect->bottom != desc->backbuffer_height
|| dst_rect->left || dst_rect->top || dst_rect->left || dst_rect->top
|| dst_rect->right != desc->backbuffer_width || dst_rect->right != desc->backbuffer_width
|| dst_rect->bottom != desc->backbuffer_height)) || dst_rect->bottom != desc->backbuffer_height))
render_to_fbo = TRUE; render_to_fbo = TRUE;
/* Rendering to a window of different size, presenting partial rectangles, /* Rendering to a window of different size, presenting partial rectangles,
skipping to change at line 1060 skipping to change at line 1130
if (desc->swap_effect == WINED3D_SWAP_EFFECT_DISCARD || desc->swap_effect == WINED3D_SWAP_EFFECT_FLIP_DISCARD) if (desc->swap_effect == WINED3D_SWAP_EFFECT_DISCARD || desc->swap_effect == WINED3D_SWAP_EFFECT_FLIP_DISCARD)
vk_layout = VK_IMAGE_LAYOUT_UNDEFINED; vk_layout = VK_IMAGE_LAYOUT_UNDEFINED;
else else
vk_layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; vk_layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
wined3d_context_vk_image_barrier(context_vk, vk_command_buffer, wined3d_context_vk_image_barrier(context_vk, vk_command_buffer,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_TRANSFER_READ_BIT,
vk_access_mask_from_bind_flags(back_buffer_vk->t.resource.bind_flags ), vk_access_mask_from_bind_flags(back_buffer_vk->t.resource.bind_flags ),
vk_layout, back_buffer_vk->layout, vk_layout, back_buffer_vk->layout,
back_buffer_vk->vk_image, VK_IMAGE_ASPECT_COLOR_BIT); back_buffer_vk->vk_image, VK_IMAGE_ASPECT_COLOR_BIT);
back_buffer_vk->bind_mask = 0;
swapchain_vk->vk_semaphores[present_idx].command_buffer_id = context_vk->cur rent_command_buffer.id; swapchain_vk->vk_semaphores[present_idx].command_buffer_id = context_vk->cur rent_command_buffer.id;
wined3d_context_vk_submit_command_buffer(context_vk, wined3d_context_vk_submit_command_buffer(context_vk,
1, &swapchain_vk->vk_semaphores[present_idx].available, &wait_stage, 1, &swapchain_vk->vk_semaphores[present_idx].available, &wait_stage,
1, &swapchain_vk->vk_semaphores[present_idx].presentable); 1, &swapchain_vk->vk_semaphores[present_idx].presentable);
present_desc.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; present_desc.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
present_desc.pNext = NULL; present_desc.pNext = NULL;
present_desc.waitSemaphoreCount = 1; present_desc.waitSemaphoreCount = 1;
present_desc.pWaitSemaphores = &swapchain_vk->vk_semaphores[present_idx].pre sentable; present_desc.pWaitSemaphores = &swapchain_vk->vk_semaphores[present_idx].pre sentable;
skipping to change at line 1154 skipping to change at line 1225
struct wined3d_swapchain_vk *swapchain_vk = wined3d_swapchain_vk(swapchain); struct wined3d_swapchain_vk *swapchain_vk = wined3d_swapchain_vk(swapchain);
struct wined3d_texture *back_buffer = swapchain->back_buffers[0]; struct wined3d_texture *back_buffer = swapchain->back_buffers[0];
struct wined3d_context_vk *context_vk; struct wined3d_context_vk *context_vk;
context_vk = wined3d_context_vk(context_acquire(swapchain->device, back_buff er, 0)); context_vk = wined3d_context_vk(context_acquire(swapchain->device, back_buff er, 0));
wined3d_texture_load_location(back_buffer, 0, &context_vk->c, back_buffer->r esource.draw_binding); wined3d_texture_load_location(back_buffer, 0, &context_vk->c, back_buffer->r esource.draw_binding);
if (swapchain_vk->vk_swapchain) if (swapchain_vk->vk_swapchain)
wined3d_swapchain_vk_blit(swapchain_vk, context_vk, src_rect, dst_rect, swap_interval); wined3d_swapchain_vk_blit(swapchain_vk, context_vk, src_rect, dst_rect, swap_interval);
else
swapchain_blit_gdi(swapchain, &context_vk->c, src_rect, dst_rect);
wined3d_swapchain_vk_rotate(swapchain, context_vk); wined3d_swapchain_vk_rotate(swapchain, context_vk);
wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATI ON_DRAWABLE); wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATI ON_DRAWABLE);
wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~WINED3D_LOC ATION_DRAWABLE); wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~WINED3D_LOC ATION_DRAWABLE);
TRACE("Starting new frame.\n"); TRACE("Starting new frame.\n");
context_release(&context_vk->c); context_release(&context_vk->c);
} }
 End of changes. 4 change blocks. 
0 lines changed or deleted 80 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)