20 #include "wine/port.h" 25 #define WINED3D_INITIAL_CS_SIZE 4096 409 #if defined(STAGING_CSMT) 457 swapchain =
op->swapchain;
460 if (
op->swap_interval && swapchain->
desc.swap_interval !=
op->swap_interval)
462 swapchain->
desc.swap_interval =
op->swap_interval;
466 swapchain->
swapchain_ops->swapchain_present(swapchain, &
op->src_rect, &
op->dst_rect,
op->flags);
469 for (
i = 0;
i < swapchain->
desc.backbuffer_count; ++
i)
478 const RECT *src_rect,
const RECT *dst_rect,
HWND dst_window_override,
522 op->rect_count,
op->rects, &
op->draw_rect,
op->flags, &
op->color,
op->depth,
op->stencil);
526 for (
i = 0;
i <
op->rt_count; ++
i)
528 if (
op->fb->render_targets[
i])
539 unsigned int rt_count =
cs->device->adapter->gl_info.limits.buffers;
564 if (
state->fb->render_targets[
i])
582 op->fb = (
void *)&
op->rects[1];
589 op->fb->render_targets[0] =
view;
590 op->fb->depth_stencil =
NULL;
596 op->fb->render_targets[0] =
NULL;
597 op->fb->depth_stencil =
view;
619 if (!(shader_mask & (1
u <<
i)))
631 for (
j = 0;
j <
shader->reg_maps.sampler_map.count; ++
j)
652 if (!(shader_mask & (1
u <<
i)))
664 for (
j = 0;
j <
shader->reg_maps.sampler_map.count; ++
j)
686 if (!
shader->reg_maps.uav_resource_info[
i].type)
706 if (!
shader->reg_maps.uav_resource_info[
i].type)
723 if (
op->parameters.indirect)
739 unsigned int group_count_x,
unsigned int group_count_y,
unsigned int group_count_z)
746 op->parameters.indirect =
FALSE;
747 op->parameters.u.direct.group_count_x = group_count_x;
748 op->parameters.u.direct.group_count_y = group_count_y;
749 op->parameters.u.direct.group_count_z = group_count_z;
764 op->parameters.indirect =
TRUE;
765 op->parameters.u.indirect.buffer =
buffer;
766 op->parameters.u.indirect.offset =
offset;
779 int load_base_vertex_idx;
784 load_base_vertex_idx =
op->parameters.u.direct.base_vertex_idx;
786 load_base_vertex_idx = 0;
788 if (
state->load_base_vertex_index != load_base_vertex_idx)
790 state->load_base_vertex_index = load_base_vertex_idx;
794 if (
state->gl_primitive_type !=
op->primitive_type)
798 state->gl_primitive_type =
op->primitive_type;
800 state->gl_patch_vertices =
op->patch_vertex_count;
804 if (
op->parameters.indirect)
810 if (
op->parameters.indexed)
814 if (
state->streams[
i].buffer)
819 if (
state->stream_output[
i].buffer)
827 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
829 if (
state->fb->render_targets[
i])
832 if (
state->fb->depth_stencil)
848 if (
state->streams[
i].buffer)
853 if (
state->stream_output[
i].buffer)
861 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
863 if (
state->fb->render_targets[
i])
866 if (
state->fb->depth_stencil)
874 int base_vertex_idx,
unsigned int start_idx,
unsigned int index_count,
875 unsigned int start_instance,
unsigned int instance_count,
BOOL indexed)
885 op->parameters.indirect =
FALSE;
886 op->parameters.u.direct.base_vertex_idx = base_vertex_idx;
887 op->parameters.u.direct.start_idx = start_idx;
888 op->parameters.u.direct.index_count = index_count;
889 op->parameters.u.direct.start_instance = start_instance;
890 op->parameters.u.direct.instance_count = instance_count;
891 op->parameters.indexed = indexed;
909 op->parameters.indirect =
TRUE;
910 op->parameters.u.indirect.buffer =
buffer;
911 op->parameters.u.indirect.offset =
offset;
912 op->parameters.indexed = indexed;
926 context->gl_info->gl_ops.gl.p_glFlush();
938 cs->queries_flushed =
TRUE;
945 cs->state.predicate =
op->predicate;
946 cs->state.predicate_value =
op->value;
965 cs->state.viewport =
op->viewport;
984 cs->state.scissor_rect =
op->rect;
1003 cs->fb.render_targets[
op->view_idx] =
op->view;
1026 if ((prev =
cs->state.fb->depth_stencil))
1038 cs->fb.depth_stencil =
op->view;
1040 if (!prev != !
op->view)
1049 else if (prev && prev->
format->depth_bias_scale !=
op->view->format->depth_bias_scale)
1072 cs->state.vertex_declaration =
op->declaration;
1153 stream = &
cs->state.stream_output[
op->stream_idx];
1185 prev =
cs->state.index_buffer;
1186 cs->state.index_buffer =
op->buffer;
1187 cs->state.index_format =
op->format_id;
1188 cs->state.index_offset =
op->offset;
1217 prev =
cs->state.cb[
op->type][
op->cb_idx];
1218 cs->state.cb[
op->type][
op->cb_idx] =
op->buffer;
1250 prev =
cs->state.textures[
op->stage];
1251 cs->state.textures[
op->stage] =
op->texture;
1257 unsigned int old_fmt_flags = prev ? prev->
resource.format_flags : 0;
1258 unsigned int new_fmt_flags =
op->texture->resource.format_flags;
1261 op->texture->sampler =
op->stage;
1263 if (!prev ||
op->texture->target != prev->
target 1269 if (!prev &&
op->stage < d3d_info->
limits.ffp_blend_stages)
1279 new_use_color_key =
TRUE;
1290 TRACE(
"Searching for other stages the texture is bound to.\n");
1293 if (
cs->state.textures[
i] == prev)
1295 TRACE(
"Texture is also bound to stage %u.\n",
i);
1302 if (!
op->texture &&
op->stage < d3d_info->
limits.ffp_blend_stages)
1309 old_use_color_key =
TRUE;
1314 if (new_use_color_key != old_use_color_key)
1317 if (new_use_color_key)
1338 prev =
cs->state.shader_resource_view[
op->type][
op->view_idx];
1339 cs->state.shader_resource_view[
op->type][
op->view_idx] =
op->view;
1371 prev =
cs->state.unordered_access_view[
op->pipeline][
op->view_idx];
1372 cs->state.unordered_access_view[
op->pipeline][
op->view_idx] =
op->view;
1379 if (
op->view &&
op->initial_count != ~0
u)
1404 cs->state.sampler[
op->type][
op->sampler_idx] =
op->sampler;
1429 cs->state.shader[
op->type] =
op->shader;
1453 cs->state.blend_state =
op->state;
1472 cs->state.rasterizer_state =
op->state;
1483 op->state = rasterizer_state;
1492 cs->state.render_states[
op->state] =
op->value;
1512 cs->state.texture_states[
op->stage][
op->state] =
op->value;
1534 cs->state.sampler_states[
op->sampler_idx][
op->state] =
op->value;
1556 cs->state.transforms[
op->state] =
op->matrix;
1578 cs->state.clip_planes[
op->plane_idx] =
op->plane;
1604 texture->async.dst_blt_color_key =
op->color_key;
1609 texture->async.dst_overlay_color_key =
op->color_key;
1621 texture->async.src_blt_color_key =
op->color_key;
1626 texture->async.src_overlay_color_key =
op->color_key;
1681 cs->state.material =
op->material;
1700 unsigned int light_idx, hash_idx;
1702 light_idx =
op->light.OriginalIndex;
1706 TRACE(
"Adding new light.\n");
1707 if (!(light_info = heap_alloc_zero(
sizeof(*light_info))))
1709 ERR(
"Failed to allocate light info.\n");
1719 if (light_info->
glIndex != -1)
1730 light_info->
cutoff =
op->light.cutoff;
1753 ERR(
"Light doesn't exist.\n");
1757 prev_idx = light_info->
glIndex;
1759 if (light_info->
glIndex != prev_idx)
1801 unsigned int start_idx,
unsigned int count,
const void *
constants)
1809 device->shader_backend->shader_update_float_vertex_constants(
device, start_idx,
count);
1811 device->shader_backend->shader_update_float_pixel_constants(
device, start_idx,
count);
1870 op->callback(
op->object);
1997 op->sub_resource_idx,
op->map_desc,
op->box,
op->flags);
2060 op->src_box.right -
op->src_box.left);
2066 RECT dst_rect, src_rect;
2070 dst_surface = dst_texture->
sub_resources[
op->dst_sub_resource_idx].u.surface;
2071 src_surface = src_texture->
sub_resources[
op->src_sub_resource_idx].u.surface;
2072 SetRect(&dst_rect,
op->dst_box.left,
op->dst_box.top,
op->dst_box.right,
op->dst_box.bottom);
2073 SetRect(&src_rect,
op->src_box.left,
op->src_box.top,
op->src_box.right,
op->src_box.bottom);
2076 &src_rect,
op->flags, &
op->fx,
op->filter)))
2077 FIXME(
"Blit failed.\n");
2082 unsigned int level, update_w, update_h, update_d;
2089 FIXME(
"Flags %#x not implemented for %s resources.\n",
2096 FIXME(
"Format conversion not implemented for %s resources.\n",
2101 update_w =
op->dst_box.right -
op->dst_box.left;
2102 update_h =
op->dst_box.bottom -
op->dst_box.top;
2103 update_d =
op->dst_box.back -
op->dst_box.front;
2104 if (
op->src_box.right -
op->src_box.left != update_w
2105 ||
op->src_box.bottom -
op->src_box.top != update_h
2106 ||
op->src_box.back -
op->src_box.front != update_d)
2108 FIXME(
"Stretching not implemented for %s resources.\n",
2113 if (
op->src_box.left ||
op->src_box.top ||
op->src_box.front)
2115 FIXME(
"Source box %s not supported for %s resources.\n",
2128 ERR(
"Failed to load source sub-resource into %s.\n",
2144 ERR(
"Failed to load destination sub-resource.\n");
2151 &row_pitch, &slice_pitch);
2167 if (
op->src_resource)
2221 ERR(
"Failed to load buffer location.\n");
2237 addr.buffer_object = 0;
2238 addr.addr =
op->data.data;
2241 if (!
box->left && !
box->top && !
box->front
2249 box, &
addr,
op->data.row_pitch,
op->data.slice_pitch);
2261 unsigned int sub_resource_idx,
const struct wined3d_box *
box,
const void *
data,
unsigned int row_pitch,
2262 unsigned int slice_pitch)
2265 #if defined(STAGING_CSMT) 2266 size_t data_size,
size;
2275 data_size += (
box->back -
box->front - 1) * slice_pitch;
2278 data_size += (
box->bottom -
box->top - 1) * row_pitch;
2281 data_size += (
box->right -
box->left) *
resource->format->byte_count;
2284 data_size =
box->right -
box->left;
2299 op->data.row_pitch = row_pitch;
2300 op->data.slice_pitch = slice_pitch;
2301 op->data.data =
op->copy_data;
2318 op->data.row_pitch = row_pitch;
2319 op->data.slice_pitch = slice_pitch;
2325 #if !defined(STAGING_CSMT) 2336 unsigned int sub_resource_idx,
i;
2417 op->buffer = dst_buffer;
2511 #if defined(STAGING_CSMT) 2520 if (
size > (
cs->data_size -
cs->end))
2525 new_size =
max(
size,
cs->data_size * 2);
2533 cs->data_size = new_size;
2534 cs->start =
cs->end = 0;
2535 cs->data = new_data;
2540 return (
BYTE *)
cs->data +
cs->start;
2551 cs->start =
cs->end;
2555 ERR(
"Invalid opcode %#x.\n", opcode);
2571 #if defined(STAGING_CSMT) 2572 wined3d_cs_st_check_space,
2610 #if defined(STAGING_CSMT) 2614 size_t header_size, packet_size, remaining;
2617 size = (
size + header_size - 1) & ~(header_size - 1);
2620 remaining = queue_size -
queue->head;
2621 return (remaining >= packet_size);
2628 size_t header_size, packet_size, remaining;
2632 size = (
size + header_size - 1) & ~(header_size - 1);
2636 ERR(
"Packet size %lu >= queue size %u.\n",
2641 remaining = queue_size -
queue->head;
2642 if (remaining < packet_size)
2644 size_t nop_size = remaining - header_size;
2647 TRACE(
"Inserting a nop for %lu + %lu bytes.\n",
2648 (
unsigned long)header_size, (
unsigned long)nop_size);
2674 if (new_pos <
tail && new_pos)
2677 TRACE(
"Waiting for free space. Head %u, tail %u, packet size %lu.\n",
2678 head,
tail, (
unsigned long)packet_size);
2686 #if defined(STAGING_CSMT) 2690 return wined3d_cs_st_check_space(
cs,
size, queue_id);
2692 return wined3d_cs_queue_check_space(&
cs->queue[queue_id],
size);
2712 while (
cs->queue[queue_id].head != *(
volatile LONG *)&
cs->queue[queue_id].tail)
2718 #if defined(STAGING_CSMT) 2719 wined3d_cs_mt_check_space,
2765 unsigned int spin_count = 0;
2769 unsigned int poll = 0;
2772 TRACE(
"Started.\n");
2810 ERR(
"Invalid opcode %#x.\n", opcode);
2824 TRACE(
"Stopped.\n");
2833 if (!(
cs = heap_alloc_zero(
sizeof(*
cs))))
2853 ERR(
"Failed to create command stream event.\n");
2861 ERR(
"Failed to get wined3d module handle.\n");
2869 ERR(
"Failed to create wined3d command stream thread.\n");
2892 ERR(
"Closing event failed.\n");
struct wined3d_unordered_access_view * view
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
struct wined3d_resource * src_resource
#define STATE_TEXTURESTAGE(stage, num)
enum wined3d_shader_type type
enum wined3d_cs_op opcode
struct wined3d_buffer * buffer
#define WINED3D_TS_WORLD_MATRIX(index)
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, UINT view_idx, struct wined3d_shader_resource_view *view)
struct wined3d_texture * front_buffer
void(* callback)(void *object)
void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, enum wined3d_texture_stage_state state, DWORD value)
#define STATE_ACTIVELIGHT(a)
#define WINED3D_CKEY_DST_OVERLAY
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
GLint GLint GLsizei width
enum wined3d_cs_op opcode
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
struct wined3d_fb_state * fb
void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture)
void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view)
static void wined3d_cs_exec_unmap(struct wined3d_cs *cs, const void *data)
enum wined3d_cs_op opcode
NTSYSAPI ULONG NTAPI RtlIsCriticalSectionLockedByThread(_In_ PRTL_CRITICAL_SECTION CriticalSection)
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
enum wined3d_sampler_state state
static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view)
enum wined3d_shader_type type
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
#define WINED3D_BLT_SYNCHRONOUS
enum wined3d_cs_op opcode
struct outqueuenode * tail
enum wined3d_cs_op opcode
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, struct wined3d_rendertarget_view *view)
static void wined3d_cs_queue_submit(struct wined3d_cs_queue *queue, struct wined3d_cs *cs)
coclass MSXML2::XSLTemplate40 object
void wined3d_cs_emit_copy_uav_counter(struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav)
static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data)
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location)
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, struct wined3d_rasterizer_state *rasterizer_state)
struct outqueuenode * head
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
#define WINED3D_CKEY_SRC_BLT
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
enum wined3d_texture_stage_state state
struct wined3d_query * query
enum wined3d_cs_op opcode
enum wined3d_cs_op opcode
static void wined3d_cs_st_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id)
static void wined3d_from_cs(const struct wined3d_cs *cs)
struct list poll_list_entry
GLuint GLuint GLsizei count
struct wined3d_texture * texture
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_box *box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch)
struct wined3d_vertex_declaration * declaration
#define STATE_SCISSORRECT
static BOOL can_use_texture_swizzle(const struct wined3d_gl_info *gl_info, const struct wined3d_format *format)
void wined3d_cs_emit_dispatch_indirect(struct wined3d_cs *cs, struct wined3d_buffer *buffer, unsigned int offset)
void wined3d_cs_emit_set_blend_state(struct wined3d_cs *cs, struct wined3d_blend_state *state)
unsigned int initial_count
enum wined3d_pipeline pipeline
static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
struct wined3d_dispatch_parameters parameters
struct wined3d_blend_state * state
#define WINED3DFMT_FLAG_BLOCKS
static void wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
struct wined3d_color_key color_key
void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
#define STATE_STREAM_OUTPUT
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
static void(*const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data)
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value)
#define STATE_INDEXBUFFER
static void wined3d_resource_acquire(struct wined3d_resource *resource)
static BOOL is_same_fixup(struct color_fixup_desc f1, struct color_fixup_desc f2)
#define InterlockedCompareExchange
const char * debug_box(const struct wined3d_box *box)
#define WINED3D_LOCATION_BUFFER
WINE_DEFAULT_DEBUG_CHANNEL(d3d)
#define STATE_CLIPPLANE(a)
enum wined3d_cs_op opcode
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
struct wined3d_resource resource
struct wined3d_rasterizer_state * state
enum wined3d_cs_op opcode
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags)
void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture, unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch)
static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
static void wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
#define STATE_BASEVERTEXINDEX
enum wined3d_cs_op opcode
struct wined3d_texture ** back_buffers
enum wined3d_cs_op opcode
enum wined3d_cs_op opcode
static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline, unsigned int view_idx, struct wined3d_unordered_access_view *view, unsigned int initial_count)
static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id)
void dispatch_compute(struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_dispatch_parameters *parameters)
struct wined3d_texture * texture
static void * heap_realloc(void *mem, size_t len)
struct wined3d_resource resource
void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_view *view, struct wined3d_buffer *buffer, unsigned int offset, struct wined3d_context *context)
static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
static void * heap_alloc(size_t len)
#define WINED3D_CS_QUERY_POLL_INTERVAL
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
#define WINED3DCLEAR_STENCIL
struct wined3d_light_info light
static void wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
struct wined3d_light_info * wined3d_state_get_light(const struct wined3d_state *state, unsigned int idx)
GLint GLfloat GLint stencil
void wined3d_cs_destroy(struct wined3d_cs *cs)
static void wined3d_resource_wait_idle(struct wined3d_resource *resource)
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx)
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
#define STATE_TRANSFORM(a)
static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
const struct wined3d_box * box
static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
#define WINED3DCLEAR_ZBUFFER
struct wined3d_uvec4 clear_value
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
struct wined3d_unordered_access_view * view
static const struct wined3d_cs_ops wined3d_cs_mt_ops
#define MAX_COMBINED_SAMPLERS
unsigned int src_sub_resource_idx
static void wined3d_cs_exec_copy_uav_counter(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, UINT cb_idx, struct wined3d_buffer *buffer)
void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shader_resource_view *view)
#define WINED3DISSUE_BEGIN
static void wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data)
unsigned int sub_resource_idx
struct wined3d_texture::wined3d_texture_async async
static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
enum wined3d_cs_op opcode
const char * wined3d_debug_location(DWORD location)
HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
wined3d_texture_filter_type
#define LIGHTMAP_HASHFUNC(x)
void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, UINT sampler_idx, struct wined3d_sampler *sampler)
static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id)
static struct wined3d_surface * wined3d_rendertarget_view_get_surface(const struct wined3d_rendertarget_view *view)
static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *data)
#define WINED3D_CKEY_SRC_OVERLAY
struct wined3d_resource * resource
static void acquire_compute_pipeline_resources(const struct wined3d_state *state)
BOOL supported[WINED3D_GL_EXT_COUNT]
struct wined3d_swapchain_desc desc
unsigned int sub_resource_idx
static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane)
enum wined3d_cs_op opcode
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
static void wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed)
void wined3d_cs_emit_flush(struct wined3d_cs *cs)
struct wined3d_draw_parameters parameters
enum wined3d_cs_op opcode
enum wined3d_push_constants type
void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_view *view, unsigned int value)
static void wined3d_cs_exec_set_blend_state(struct wined3d_cs *cs, const void *data)
enum wined3d_cs_op opcode
enum wined3d_cs_op opcode
struct wined3d_vec4 plane
struct wined3d_resource * resource
void context_release(struct wined3d_context *context)
static void wined3d_cs_exec_unload_resource(struct wined3d_cs *cs, const void *data)
void state_cleanup(struct wined3d_state *state)
static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value)
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z)
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
DWORD WINAPI GetCurrentThreadId(VOID)
void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, const struct wined3d_matrix *matrix)
static void wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data)
void wined3d_buffer_upload_data(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_box *box, const void *data)
struct wined3d_box src_box
#define WINED3D_CS_SPIN_COUNT
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static void wined3d_cs_wait_event(struct wined3d_cs *cs)
#define MAX_UNORDERED_ACCESS_VIEWS
const struct wined3d_format * format
void CDECL wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window)
GLenum GLuint GLint GLint layer
struct wined3d_resource * resource
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
enum wined3d_cs_op opcode
enum wined3d_shader_type type
enum wined3d_cs_op opcode
static void wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data)
void wined3d_unordered_access_view_clear_uint(struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, struct wined3d_context *context)
void wined3d_cs_emit_clear_unordered_access_view_uint(struct wined3d_cs *cs, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
wined3d_texture_stage_state
static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location)
enum wined3d_cs_op opcode
static BOOL wined3d_cs_queue_is_empty(const struct wined3d_cs *cs, const struct wined3d_cs_queue *queue)
struct wined3d_resource * resource
struct wined3d_buffer * buffer
enum wined3d_cs_op opcode
static void wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
static void wined3d_cs_mt_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants)
unsigned int cs_multithreaded
struct wined3d_rendertarget_view * view
static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
int poll(struct pollfd *ufds, int nfds, int timeout)
struct wined3d_box dst_box
enum wined3d_cs_op opcode
enum wined3d_cs_op opcode
#define WINED3D_SHADER_CONST_VS_B
enum wined3d_cs_op opcode
static void wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data)
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light)
enum wined3d_cs_op opcode
struct wined3d_texture * texture
enum wined3d_cs_op opcode
#define WINED3D_SHADER_CONST_PS_I
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count, struct wined3d_buffer *buffer, unsigned int offset, BOOL indexed)
void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int layer)
static void wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
static void wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data)
static void acquire_graphics_pipeline_resources(const struct wined3d_state *state, BOOL indexed, const struct wined3d_gl_info *gl_info)
static DWORD WINAPI wined3d_cs_run(void *ctx)
GLint GLint GLsizei GLsizei GLsizei depth
struct wined3d_resource * resource
enum wined3d_cs_op opcode
enum wined3d_cs_op opcode
static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
#define STATE_UNORDERED_ACCESS_VIEW_BINDING(a)
GLenum const GLvoid * addr
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD swap_interval, DWORD flags)
#define InterlockedDecrement
enum wined3d_format_id format_id
struct wined3d_rendertarget_view * view
#define WINED3D_TEXTURE_DISCARD
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, WORD flags, const struct wined3d_color_key *color_key)
#define WINED3DCLEAR_TARGET
#define memcpy(s1, s2, n)
static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
static void release_shader_resources(const struct wined3d_state *state, unsigned int shader_mask)
enum wined3d_cs_op opcode
static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
struct wined3d_unordered_access_view * view
GLsizei const GLfloat * value
enum wined3d_cs_op opcode
static void * wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
static void wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data)
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING
enum wined3d_cs_op opcode
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define WINED3D_SHADER_CONST_VS_F