44 { 1.0f, 1.0f, 1.0f, 0.0f },
45 { 0.0f, 0.0f, 0.0f, 0.0f },
46 { 0.0f, 0.0f, 0.0f, 0.0f },
60 switch (primitive_type)
104 switch (primitive_type)
154 ERR(
"Failed to grow the context array.\n");
159 device->contexts = new_array;
171 for (
i = 0;
i <
device->context_count; ++
i)
182 ERR(
"Context %p doesn't exist in context array.\n",
context);
186 if (!--
device->context_count)
196 ERR(
"Failed to shrink context array. Oh well.\n");
200 device->contexts = new_array;
204 const RECT *draw_rect,
const RECT *clear_rect)
217 if (clear_rect && (clear_rect->
left > 0 || clear_rect->
top > 0
234 UINT drawable_width, drawable_height;
248 WARN(
"Invalid context, skipping clear.\n");
261 for (
i = 0;
i < rt_count; ++
i)
270 draw_rect, rect_count ? clear_rect :
NULL))
279 render_offscreen =
context->render_offscreen;
286 render_offscreen =
TRUE;
312 WARN(
"Failed to apply clear state, skipping clear.\n");
324 gl_info->
gl_ops.gl.p_glStencilMask(~0
U);
342 for (
i = 0;
i < rt_count; ++
i)
352 FIXME(
"Not supported on buffer resources.\n");
364 WARN(
"Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB "
365 "support, this might cause graphical issues.\n");
371 corrected_color.
r =
min(
max(corrected_color.
r, 0.0f), 1.0f);
376 corrected_color.
g =
min(
max(corrected_color.
g, 0.0f), 1.0f);
381 corrected_color.
b =
min(
max(corrected_color.
b, 0.0f), 1.0f);
382 color = &corrected_color;
395 if (render_offscreen)
397 gl_info->
gl_ops.gl.p_glScissor(draw_rect->
left, draw_rect->
top,
402 gl_info->
gl_ops.gl.p_glScissor(draw_rect->
left, drawable_height - draw_rect->
bottom,
406 gl_info->
gl_ops.gl.p_glClear(clear_mask);
414 for (
i = 0;
i < rect_count; ++
i)
419 TRACE(
"clear_rect[%u] %s, current_rect %s.\n",
i,
428 TRACE(
"Rectangle with negative dimensions, ignoring.\n");
432 if (render_offscreen)
434 gl_info->
gl_ops.gl.p_glScissor(current_rect.
left, current_rect.
top,
439 gl_info->
gl_ops.gl.p_glScissor(current_rect.
left, drawable_height - current_rect.
bottom,
444 gl_info->
gl_ops.gl.p_glClear(clear_mask);
450 &&
target->container->swapchain &&
target->container->swapchain->front_buffer ==
target->container))
451 gl_info->
gl_ops.gl.p_glFlush();
460 TRACE(
"%p increasing refcount to %u.\n",
device, refcount);
485 ERR(
"Something's still holding the recording stateblock.\n");
500 ERR(
"Device released with resources still bound.\n");
504 ERR(
"Leftover resource %p with type %s (%#x).\n",
510 ERR(
"Context array not freed!\n");
511 if (
device->hardwareCursor)
513 device->hardwareCursor = 0;
530 return device->swapchain_count;
535 TRACE(
"device %p, swapchain_idx %u.\n",
device, swapchain_idx);
537 if (swapchain_idx >=
device->swapchain_count)
539 WARN(
"swapchain_idx %u >= swapchain_count %u.\n",
540 swapchain_idx,
device->swapchain_count);
544 return device->swapchains[swapchain_idx];
570 desc.multisample_quality = 0;
573 desc.width = bm.bmWidth;
574 desc.height = bm.bmHeight;
581 ERR(
"Wine logo requested, but failed to create texture, hr %#x.\n",
hr);
591 BitBlt(dcs, 0, 0, bm.bmWidth, bm.bmHeight, dcb, 0, 0,
SRCCOPY);
624 TRACE(
"Dummy 1D texture given name %u.\n",
textures->tex_1d);
630 TRACE(
"Dummy 2D texture given name %u.\n",
textures->tex_2d);
638 TRACE(
"Dummy rectangle texture given name %u.\n",
textures->tex_rect);
647 TRACE(
"Dummy 3D texture given name %u.\n",
textures->tex_3d);
656 TRACE(
"Dummy cube texture given name %u.\n",
textures->tex_cube);
667 DWORD cube_array_data[6];
670 TRACE(
"Dummy cube array texture given name %u.\n",
textures->tex_cube_array);
673 cube_array_data[
i] =
color;
682 TRACE(
"Dummy 1D array texture given name %u.\n",
textures->tex_1d_array);
688 TRACE(
"Dummy 2D array texture given name %u.\n",
textures->tex_2d_array);
704 TRACE(
"Dummy buffer texture given name %u.\n",
textures->tex_buffer);
713 TRACE(
"Dummy multisample texture given name %u.\n",
textures->tex_2d_ms);
717 gl_info->
gl_ops.gl.p_glGenTextures(1, &
textures->tex_2d_ms_array);
718 TRACE(
"Dummy multisample array texture given name %u.\n",
textures->tex_2d_ms_array);
729 WARN(
"ARB_clear_texture is currently required to clear dummy multisample textures.\n");
763 gl_info->
gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->
tex_cube);
766 gl_info->
gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->
tex_3d);
769 gl_info->
gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->
tex_rect);
771 gl_info->
gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->
tex_2d);
772 gl_info->
gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->
tex_1d);
776 memset(dummy_textures, 0,
sizeof(*dummy_textures));
792 desc.lod_bias = 0.0f;
793 desc.min_lod = -1000.0f;
794 desc.max_lod = 1000.0f;
795 desc.mip_base_level = 0;
796 desc.max_anisotropy = 1;
809 ERR(
"Failed to create default sampler, hr %#x.\n",
hr);
822 ERR(
"Failed to create null sampler, hr %#x.\n",
hr);
855 BOOL filter_messages;
858 TRACE(
"Setting up window %p for fullscreen mode.\n",
window);
862 ERR(
"Changing the window style for window %p, but another style (%08x, %08x) is already stored.\n",
872 TRACE(
"Old style was %08x, %08x, setting to %08x, %08x.\n",
875 filter_messages =
device->filter_messages;
882 device->filter_messages = filter_messages;
886 const RECT *window_rect)
889 BOOL filter_messages;
908 TRACE(
"Restoring window style of window %p to %08x, %08x.\n",
911 filter_messages =
device->filter_messages;
931 device->filter_messages = filter_messages;
944 ERR(
"Failed to register window %p.\n",
window);
964 BOOL ds_enable = swapchain->
desc.enable_auto_depth_stencil;
967 for (
i = 0;
i <
device->adapter->gl_info.limits.buffers; ++
i)
971 if (
device->back_buffer_view)
1002 while (
device->context_count)
1004 if (
device->contexts[0]->swapchain)
1026 device->adapter->vertex_pipe,
device->adapter->fragment_pipe)))
1028 ERR(
"Failed to allocate shader private data, hr %#x.\n",
hr);
1034 ERR(
"Failed to create CPU blitter.\n");
1055 if (!
device->swapchains[0]->num_contexts)
1064 static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
1066 DWORD clear_flags = 0;
1069 TRACE(
"device %p, swapchain_desc %p.\n",
device, swapchain_desc);
1071 if (
device->d3d_initialized)
1079 TRACE(
"Creating implicit swapchain.\n");
1081 swapchain_desc, &swapchain)))
1083 WARN(
"Failed to create implicit swapchain.\n");
1093 view_desc.
flags = 0;
1095 view_desc.
u.
texture.level_count = 1;
1097 view_desc.
u.
texture.layer_count = 1;
1101 ERR(
"Failed to create rendertarget view, hr %#x.\n",
hr);
1106 device->swapchain_count = 1;
1109 ERR(
"Out of memory!\n");
1112 device->swapchains[0] = swapchain;
1118 device->contexts[0]->last_was_rhw = 0;
1120 TRACE(
"All defaults now set up.\n");
1138 device->swapchain_count = 0;
1139 if (
device->back_buffer_view)
1153 TRACE(
"device %p, swapchain_desc %p.\n",
device, swapchain_desc);
1156 TRACE(
"Creating implicit swapchain\n");
1157 hr =
device->device_parent->ops->create_swapchain(
device->device_parent,
1158 swapchain_desc, &swapchain);
1161 WARN(
"Failed to create implicit swapchain\n");
1165 device->swapchain_count = 1;
1168 ERR(
"Out of memory!\n");
1171 device->swapchains[0] = swapchain;
1175 ERR(
"Failed to create CPU blitter.\n");
1177 device->swapchain_count = 0;
1201 if (!
device->d3d_initialized)
1206 if (
device->logo_texture)
1208 if (
device->cursor_texture)
1215#if defined(STAGING_CSMT)
1220 if (
device->fb.depth_stencil)
1224 TRACE(
"Releasing depth/stencil view %p.\n",
view);
1230 if (
device->auto_depth_stencil_view)
1236 ERR(
"Something's still holding the auto depth/stencil view (%p).\n",
view);
1239 for (
i = 0;
i <
device->adapter->gl_info.limits.buffers; ++
i)
1243 if (
device->back_buffer_view)
1249 for (
i = 0;
i <
device->swapchain_count; ++
i)
1251 TRACE(
"Releasing the implicit swapchain %u.\n",
i);
1253 FIXME(
"Something's still holding the implicit swapchain.\n");
1258 device->swapchain_count = 0;
1271 for (
i = 0;
i <
device->swapchain_count; ++
i)
1273 TRACE(
"Releasing the implicit swapchain %u.\n",
i);
1275 FIXME(
"Something's still holding the implicit swapchain.\n");
1280 device->swapchain_count = 0;
1327 TRACE(
"Emulating 0x%s bytes. 0x%s used, returning 0x%s left.\n",
1345 WARN(
"Invalid stream output %u.\n",
idx);
1350 prev_buffer =
stream->buffer;
1369 WARN(
"Invalid stream output %u.\n",
idx);
1375 return device->state.stream_output[
idx].buffer;
1384 TRACE(
"device %p, stream_idx %u, buffer %p, offset %u, stride %u.\n",
1389 WARN(
"Stream index %u out of range.\n", stream_idx);
1394 WARN(
"Offset %u is not 4 byte aligned.\n",
offset);
1399 prev_buffer =
stream->buffer;
1402 device->recording->changed.streamSource |= 1u << stream_idx;
1404 if (prev_buffer ==
buffer
1408 TRACE(
"Application is setting the old values over, nothing to do.\n");
1433 TRACE(
"device %p, stream_idx %u, buffer %p, offset %p, stride %p.\n",
1438 WARN(
"Stream index %u out of range.\n", stream_idx);
1454 UINT old_flags, old_freq;
1456 TRACE(
"device %p, stream_idx %u, divider %#x.\n",
device, stream_idx, divider);
1461 WARN(
"INSTANCEDATA and INDEXEDDATA were set, returning D3DERR_INVALIDCALL.\n");
1466 WARN(
"INSTANCEDATA used on stream 0, returning D3DERR_INVALIDCALL.\n");
1471 WARN(
"Divider is 0, returning D3DERR_INVALIDCALL.\n");
1476 old_flags =
stream->flags;
1477 old_freq =
stream->frequency;
1480 stream->frequency = divider & 0x7fffff;
1483 device->recording->changed.streamFreq |= 1u << stream_idx;
1484 else if (
stream->frequency != old_freq ||
stream->flags != old_flags)
1495 TRACE(
"device %p, stream_idx %u, divider %p.\n",
device, stream_idx, divider);
1500 TRACE(
"Returning %#x.\n", *divider);
1508 TRACE(
"device %p, state %s, matrix %p.\n",
1518 TRACE(
"Recording... not performing anything.\n");
1519 device->recording->changed.transform[d3dts >> 5] |= 1u << (d3dts & 0x1f);
1532 TRACE(
"The application is setting the same matrix over again.\n");
1562 WARN(
"Unhandled transform state %#x.\n",
state);
1594 switch (
light->type)
1601 if (
light->attenuation0 < 0.0f ||
light->attenuation1 < 0.0f ||
light->attenuation2 < 0.0f)
1603 WARN(
"Attenuation is negative, returning WINED3DERR_INVALIDCALL.\n");
1614 WARN(
"Light type out of range, returning WINED3DERR_INVALIDCALL\n");
1620 TRACE(
"Adding new light\n");
1621 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1625 object->glIndex = -1;
1626 object->OriginalIndex = light_idx;
1630 TRACE(
"Light %u setting to type %#x, diffuse %s, specular %s, ambient %s, "
1631 "position {%.8e, %.8e, %.8e}, direction {%.8e, %.8e, %.8e}, "
1632 "range %.8e, falloff %.8e, theta %.8e, phi %.8e.\n",
1640 object->OriginalParms = *
light;
1642 switch (
light->type)
1646 object->position.x =
light->position.x;
1647 object->position.y =
light->position.y;
1648 object->position.z =
light->position.z;
1649 object->position.w = 1.0f;
1650 object->cutoff = 180.0f;
1656 object->direction.x = -
light->direction.x;
1657 object->direction.y = -
light->direction.y;
1658 object->direction.z = -
light->direction.z;
1659 object->direction.w = 0.0f;
1660 object->exponent = 0.0f;
1661 object->cutoff = 180.0f;
1666 object->position.x =
light->position.x;
1667 object->position.y =
light->position.y;
1668 object->position.z =
light->position.z;
1669 object->position.w = 1.0f;
1672 object->direction.x =
light->direction.x;
1673 object->direction.y =
light->direction.y;
1674 object->direction.z =
light->direction.z;
1675 object->direction.w = 0.0f;
1683 if (!
light->falloff)
1690 object->exponent = 0.0f;
1697 object->exponent = -0.3f /
logf(
cosf(rho / 2));
1700 if (
object->exponent > 128.0f)
1701 object->exponent = 128.0f;
1708 object->position.x =
light->position.x;
1709 object->position.y =
light->position.y;
1710 object->position.z =
light->position.z;
1711 object->position.w = 1.0f;
1715 FIXME(
"Unrecognized light type %#x.\n",
light->type);
1733 TRACE(
"Light information requested but light not defined\n");
1750 TRACE(
"Light enabled requested but light not defined, so defining one!\n");
1755 FIXME(
"Adding default lights has failed dismally\n");
1775 TRACE(
"Light enabled state requested but light not defined.\n");
1788 if (plane_idx >=
device->adapter->gl_info.limits.user_clip_distances)
1790 TRACE(
"Application has requested clipplane this device doesn't support.\n");
1795 device->recording->changed.clipplane |= 1u << plane_idx;
1799 TRACE(
"Application is setting old values over, nothing to do.\n");
1803 device->update_state->clip_planes[plane_idx] = *
plane;
1816 if (plane_idx >=
device->adapter->gl_info.limits.user_clip_distances)
1818 TRACE(
"Application has requested clipplane this device doesn't support.\n");
1830 FIXME(
"device %p, clip_status %p stub!\n",
device, clip_status);
1841 FIXME(
"device %p, clip_status %p stub!\n",
device, clip_status);
1851 TRACE(
"device %p, material %p.\n",
device, material);
1853 device->update_state->material = *material;
1863 TRACE(
"device %p, material %p.\n",
device, material);
1865 *material =
device->state.material;
1879 unsigned int prev_offset;
1881 TRACE(
"device %p, buffer %p, format %s, offset %u.\n",
1884 prev_buffer =
device->update_state->index_buffer;
1885 prev_format =
device->update_state->index_format;
1886 prev_offset =
device->update_state->index_offset;
1914 return device->state.index_buffer;
1919 TRACE(
"device %p, base_index %d.\n",
device, base_index);
1921 device->update_state->base_vertex_index = base_index;
1928 return device->state.base_vertex_index;
1933 TRACE(
"device %p, viewport %p.\n",
device, viewport);
1934 TRACE(
"x %.8e, y %.8e, w %.8e, h %.8e, min_z %.8e, max_z %.8e.\n",
1937 device->update_state->viewport = *viewport;
1942 TRACE(
"Recording... not performing anything\n");
1952 TRACE(
"device %p, viewport %p.\n",
device, viewport);
1954 *viewport =
device->state.viewport;
1964 if (!(dst_texture =
state->textures[0]))
1966 dst_resource = &dst_texture->
resource;
1969 if (!(src_view =
state->fb->depth_stencil))
1980 TRACE(
"device %p, blend_state %p.\n",
device, blend_state);
1982 prev =
device->update_state->blend_state;
1983 if (prev == blend_state)
1988 device->update_state->blend_state = blend_state;
1998 return device->state.blend_state;
2006 TRACE(
"device %p, rasterizer_state %p.\n",
device, rasterizer_state);
2008 prev =
device->update_state->rasterizer_state;
2009 if (prev == rasterizer_state)
2012 if (rasterizer_state)
2014 device->update_state->rasterizer_state = rasterizer_state;
2024 return device->state.rasterizer_state;
2036 WARN(
"Unhandled render state %#x.\n",
state);
2046 TRACE(
"Recording... not performing anything.\n");
2047 device->recording->changed.renderState[
state >> 5] |= 1u << (
state & 0x1f);
2053 TRACE(
"Application is setting the old value over, nothing to do.\n");
2059 TRACE(
"RESZ multisampled depth buffer resolve triggered.\n");
2076 TRACE(
"device %p, sampler_idx %u, state %s, value %#x.\n",
2084 WARN(
"Invalid sampler %u.\n", sampler_idx);
2094 TRACE(
"Recording... not performing anything.\n");
2095 device->recording->changed.samplerState[sampler_idx] |= 1u <<
state;
2101 TRACE(
"Application is setting the old value over, nothing to do.\n");
2111 TRACE(
"device %p, sampler_idx %u, state %s.\n",
2119 WARN(
"Invalid sampler %u.\n", sampler_idx);
2123 return device->state.sampler_states[sampler_idx][
state];
2131 device->recording->changed.scissorRect =
TRUE;
2135 TRACE(
"App is setting the old scissor rectangle over, nothing to do.\n");
2142 TRACE(
"Recording... not performing anything.\n");
2165 device->recording->changed.vertexDecl =
TRUE;
2183 return device->state.vertex_declaration;
2193 device->recording->changed.vertexShader =
TRUE;
2221 WARN(
"Invalid constant buffer index %u.\n",
idx);
2250 WARN(
"Invalid constant buffer index %u.\n",
idx);
2271 WARN(
"Invalid view index %u.\n",
idx);
2275 prev =
device->update_state->shader_resource_view[
type][
idx];
2301 WARN(
"Invalid view index %u.\n",
idx);
2323 WARN(
"Invalid sampler index %u.\n",
idx);
2352 WARN(
"Invalid sampler index %u.\n",
idx);
2371 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2388 for (
i = start_idx;
i <
count + start_idx; ++
i)
2389 device->recording->changed.vertexShaderConstantsB |= (1u <<
i);
2402 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2420 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2437 for (
i = start_idx;
i <
count + start_idx; ++
i)
2438 device->recording->changed.vertexShaderConstantsI |= (1u <<
i);
2451 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2469 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2473 ||
count > d3d_info->
limits.vs_uniform_count - start_idx)
2484 memset(&
device->recording->changed.vs_consts_f[start_idx], 1,
2485 count *
sizeof(*
device->recording->changed.vs_consts_f));
2497 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2501 ||
count > d3d_info->
limits.vs_uniform_count - start_idx)
2516 device->recording->changed.pixelShader =
TRUE;
2586 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2603 for (
i = start_idx;
i <
count + start_idx; ++
i)
2604 device->recording->changed.pixelShaderConstantsB |= (1u <<
i);
2617 TRACE(
"device %p, start_idx %u, count %u,constants %p.\n",
2635 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2652 for (
i = start_idx;
i <
count + start_idx; ++
i)
2653 device->recording->changed.pixelShaderConstantsI |= (1u <<
i);
2666 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2685 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2689 ||
count > d3d_info->
limits.ps_uniform_count - start_idx)
2700 memset(&
device->recording->changed.ps_consts_f[start_idx], 1,
2701 count *
sizeof(*
device->recording->changed.ps_consts_f));
2713 TRACE(
"device %p, start_idx %u, count %u, constants %p.\n",
2717 ||
count > d3d_info->
limits.ps_uniform_count - start_idx)
3001 unsigned int initial_count)
3007 WARN(
"Invalid UAV index %u.\n",
idx);
3011 prev =
device->update_state->unordered_access_view[pipeline][
idx];
3012 if (uav == prev && initial_count == ~0
u)
3017 device->update_state->unordered_access_view[pipeline][
idx] = uav;
3029 WARN(
"Invalid UAV index %u.\n",
idx);
3033 return device->state.unordered_access_view[pipeline][
idx];
3039 TRACE(
"device %p, idx %u, uav %p, initial_count %#x.\n",
device,
idx, uav, initial_count);
3055 TRACE(
"device %p, idx %u, uav %p, initial_count %#x.\n",
device,
idx, uav, initial_count);
3069#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
3087 WARN(
" lighting state not saved yet... Some strange stuff may happen !\n");
3092 ERR(
"Source has no position mask\n");
3110 FIXME(
"Clipping is broken and disabled for now\n");
3117 box.left = dwDestIndex * vertex_size;
3118 box.right =
box.left + dwCount * vertex_size;
3121 WARN(
"Failed to map buffer, hr %#x.\n",
hr);
3124 dest_ptr = map_desc.
data;
3130 TRACE(
"View mat:\n");
3131 TRACE(
"%.8e %.8e %.8e %.8e\n", view_mat.
_11, view_mat.
_12, view_mat.
_13, view_mat.
_14);
3132 TRACE(
"%.8e %.8e %.8e %.8e\n", view_mat.
_21, view_mat.
_22, view_mat.
_23, view_mat.
_24);
3133 TRACE(
"%.8e %.8e %.8e %.8e\n", view_mat.
_31, view_mat.
_32, view_mat.
_33, view_mat.
_34);
3134 TRACE(
"%.8e %.8e %.8e %.8e\n", view_mat.
_41, view_mat.
_42, view_mat.
_43, view_mat.
_44);
3136 TRACE(
"Proj mat:\n");
3137 TRACE(
"%.8e %.8e %.8e %.8e\n", proj_mat.
_11, proj_mat.
_12, proj_mat.
_13, proj_mat.
_14);
3138 TRACE(
"%.8e %.8e %.8e %.8e\n", proj_mat.
_21, proj_mat.
_22, proj_mat.
_23, proj_mat.
_24);
3139 TRACE(
"%.8e %.8e %.8e %.8e\n", proj_mat.
_31, proj_mat.
_32, proj_mat.
_33, proj_mat.
_34);
3140 TRACE(
"%.8e %.8e %.8e %.8e\n", proj_mat.
_41, proj_mat.
_42, proj_mat.
_43, proj_mat.
_44);
3142 TRACE(
"World mat:\n");
3143 TRACE(
"%.8e %.8e %.8e %.8e\n", world_mat.
_11, world_mat.
_12, world_mat.
_13, world_mat.
_14);
3144 TRACE(
"%.8e %.8e %.8e %.8e\n", world_mat.
_21, world_mat.
_22, world_mat.
_23, world_mat.
_24);
3145 TRACE(
"%.8e %.8e %.8e %.8e\n", world_mat.
_31, world_mat.
_32, world_mat.
_33, world_mat.
_34);
3146 TRACE(
"%.8e %.8e %.8e %.8e\n", world_mat.
_41, world_mat.
_42, world_mat.
_43, world_mat.
_44);
3150 TRACE(
"viewport x %.8e, y %.8e, width %.8e, height %.8e, min_z %.8e, max_z %.8e.\n",
3158 for (
i = 0;
i < dwCount;
i+= 1) {
3159 unsigned int tex_index;
3165 const float *
p = (
const float *)(
element->data.addr +
i *
element->stride);
3167 TRACE(
"In: ( %06.2f %06.2f %06.2f )\n",
p[0],
p[1],
p[2]);
3173 rhw = (
p[0] *
mat._14) + (
p[1] *
mat._24) + (
p[2] *
mat._34) +
mat._44;
3175 TRACE(
"x=%f y=%f z=%f rhw=%f\n",
x,
y,
z, rhw);
3196 (
x <= rhw +
eps) && (
y <= rhw +
eps ) && (
z <= rhw +
eps) &&
3234 TRACE(
"Vertex got clipped\n");
3247 TRACE(
"Writing (%f %f %f) %f\n",
x,
y,
z, rhw);
3250 ( (
float *) dest_ptr)[0] =
x;
3251 ( (
float *) dest_ptr)[1] =
y;
3252 ( (
float *) dest_ptr)[2] =
z;
3253 ( (
float *) dest_ptr)[3] = rhw;
3255 dest_ptr += 3 *
sizeof(
float);
3258 dest_ptr +=
sizeof(
float);
3262 dest_ptr +=
sizeof(
DWORD);
3269 FIXME(
"Didn't expect the destination to have a normal\n");
3282 ERR(
"No diffuse color in source, but destination has one\n");
3286 *( (
DWORD *) dest_ptr) = 0xffffffff;
3287 dest_ptr +=
sizeof(
DWORD);
3305 ERR(
"No specular color in source, but destination has one\n");
3309 *(
DWORD *)dest_ptr = 0xff000000;
3310 dest_ptr +=
sizeof(
DWORD);
3318 for (tex_index = 0; tex_index < numTextures; ++tex_index)
3321 const float *tex_coord = (
const float *)(
element->data.addr +
i *
element->stride);
3324 ERR(
"No source texture, but destination requests one\n");
3353 TRACE(
"device %p, src_start_idx %u, dst_idx %u, vertex_count %u, "
3354 "dst_buffer %p, declaration %p, flags %#x, dst_fvf %#x.\n",
3359 FIXME(
"Output vertex declaration not implemented yet.\n");
3381 box.left = src_start_idx *
e->stride;
3384 ERR(
"Failed to map resource.\n");
3385 e->data.buffer_object = 0;
3399 ERR(
"Failed to unmap resource.\n");
3411 TRACE(
"device %p, stage %u, state %s, value %#x.\n",
3416 WARN(
"Invalid state %#x passed.\n",
state);
3420 if (stage >= d3d_info->
limits.ffp_blend_stages)
3422 WARN(
"Attempting to set stage %u which is higher than the max stage %u, ignoring.\n",
3423 stage, d3d_info->
limits.ffp_blend_stages - 1);
3432 TRACE(
"Recording... not performing anything.\n");
3433 device->recording->changed.textureState[stage] |= 1u <<
state;
3440 TRACE(
"Application is setting the old value over, nothing to do.\n");
3450 TRACE(
"device %p, stage %u, state %s.\n",
3455 WARN(
"Invalid state %#x passed.\n",
state);
3459 return device->state.texture_states[stage][
state];
3475 WARN(
"Ignoring invalid stage %u.\n", stage);
3481 WARN(
"Rejecting attempt to set scratch texture.\n");
3486 device->recording->changed.textures |= 1u << stage;
3488 prev =
device->update_state->textures[stage];
3489 TRACE(
"Previous texture %p.\n", prev);
3493 TRACE(
"App is setting the same texture again, nothing to do.\n");
3519 WARN(
"Ignoring invalid stage %u.\n", stage);
3523 return device->state.textures[stage];
3533 device->create_parms.device_type, caps);
3546 TRACE(
"device %p, swapchain_idx %u, mode %p, rotation %p.\n",
3569 device->recording = stateblock;
3572 TRACE(
"Recording stateblock %p.\n", stateblock);
3582 TRACE(
"device %p, stateblock %p.\n",
device, stateblock);
3586 WARN(
"Not recording.\n");
3597 TRACE(
"Returning stateblock %p.\n", *stateblock);
3610 WARN(
"Already in scene, returning WINED3DERR_INVALIDCALL.\n");
3623 WARN(
"Not in scene, returning WINED3DERR_INVALIDCALL.\n");
3636 TRACE(
"device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n",
3639 if (!rect_count && rects)
3641 WARN(
"Rects is %p, but rect_count is 0, ignoring clear\n", rects);
3650 WARN(
"Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
3656 if (
ds->width <
device->fb.render_targets[0]->width
3657 ||
ds->height <
device->fb.render_targets[0]->height)
3659 WARN(
"Silently ignoring depth and target clear with mismatching sizes\n");
3677 prev =
device->update_state->predicate;
3680 FIXME(
"Predicated rendering not implemented.\n");
3683 device->update_state->predicate = predicate;
3697 return device->state.predicate;
3701 unsigned int group_count_x,
unsigned int group_count_y,
unsigned int group_count_z)
3703 TRACE(
"device %p, group_count_x %u, group_count_y %u, group_count_z %u.\n",
3704 device, group_count_x, group_count_y, group_count_z);
3720 TRACE(
"device %p, primitive_type %s, patch_vertex_count %u.\n",
3724 device->state.gl_patch_vertices = patch_vertex_count;
3730 TRACE(
"device %p, primitive_type %p, patch_vertex_count %p.\n",
3731 device, primitive_type, patch_vertex_count);
3734 if (patch_vertex_count)
3735 *patch_vertex_count =
device->state.gl_patch_vertices;