34#define WINED3D_MAX_FBO_ENTRIES 64
35#define WINED3D_ALL_LAYERS (~0u)
43 switch (primitive_type)
92 TRACE(
"context_gl %p, target %#x, fbo %u.\n", context_gl,
target, fbo);
130 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
151 gl_info->
fbo_ops.glDeleteFramebuffers(1, &fbo);
182 if (!gl_info->
fbo_ops.glFramebufferTexture)
184 FIXME(
"OpenGL implementation doesn't support glFramebufferTexture().\n");
194 if (!gl_info->
fbo_ops.glFramebufferTextureLayer)
196 FIXME(
"OpenGL implementation doesn't support glFramebufferTextureLayer().\n");
249 TRACE(
"Attach depth stencil 0.\n");
305 const char *tex_type_str =
NULL;
318 if (gl_info->
limits.samples > 1)
323 FIXME(
" %s: renderbuffer %d, %dx%d, %d samples, format %#x.\n",
333 if (gl_info->
gl_ops.ext.p_glGetTextureParameteriv)
339 if (texture_type[
i].
target == tex_target)
341 tex_type_str = texture_type[
i].str;
354 tex_type_str =
"cube";
360 if (!gl_info->
supported[texture_type[
i].extension])
363 gl_info->
gl_ops.gl.p_glGetIntegerv(texture_type[
i].
binding, &old_texture);
364 while (gl_info->
gl_ops.gl.p_glGetError());
367 if (!gl_info->
gl_ops.gl.p_glGetError())
369 tex_target = texture_type[
i].target;
370 tex_type_str = texture_type[
i].str;
373 gl_info->
gl_ops.gl.p_glBindTexture(texture_type[
i].
target, old_texture);
378 FIXME(
"Cannot find type of texture %d.\n",
name);
383 if (gl_info->
gl_ops.ext.p_glGetTextureParameteriv)
400 gl_info->
gl_ops.gl.p_glBindTexture(tex_target, old_texture);
403 FIXME(
" %s: %s texture %d, %dx%d, %d samples, format %#x.\n",
430 TRACE(
"FBO complete.\n");
440 ERR(
"FBO 0 is incomplete, driver bug?\n");
447 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
478 if (new_mask == *current_mask)
484 *current_mask = new_mask;
499 key->objects[
idx].object = 0;
500 key->objects[
idx].target = 0;
505 if (render_target->
gl_view.name)
509 key->objects[
idx].level = 0;
518 key->objects[
idx].target = 0;
520 key->rb_namespace |= 1 <<
idx;
525 key->objects[
idx].level = sub_resource_idx % texture_gl->
t.level_count;
526 key->objects[
idx].layer = sub_resource_idx / texture_gl->
t.level_count;
543 key->objects[
idx].target = 0;
545 key->rb_namespace |= 1 <<
idx;
550 key->objects[
idx].target = 0;
552 key->rb_namespace |= 1 <<
idx;
564 key->rb_namespace = 0;
642 struct wined3d_fbo_entry_key fbo_key;
643 unsigned int i, ds_level, rt_level;
660 WARN(
"Depth stencil is smaller than the primary color buffer, disabling.\n");
663 else if (ds_texture->
resource.multisample_type != rt_texture->
resource.multisample_type
664 || (ds_texture->
resource.multisample_type
665 && ds_texture->
resource.multisample_quality != rt_texture->
resource.multisample_quality))
667 WARN(
"Color multisample type %u and quality %u, depth stencil has %u and %u, disabling ds buffer.\n",
668 rt_texture->
resource.multisample_type, rt_texture->
resource.multisample_quality,
669 ds_texture->
resource.multisample_type, ds_texture->
resource.multisample_quality);
675 context_gl, ds_level, &render_targets[0]);
686 const char *resource_type;
688 TRACE(
"Dumping FBO attachments:\n");
689 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
697 resource_type =
"buffer";
705 resource_type =
"texture";
708 TRACE(
" Color attachment %u: %p, %u format %s, %s %u, %ux%u, %u samples.\n",
710 fbo_key.rb_namespace & (1 << (
i + 1)) ?
"renderbuffer" : resource_type,
720 resource_type =
"buffer";
728 resource_type =
"texture";
731 TRACE(
" Depth attachment: %p, %u format %s, %s %u, %ux%u, %u samples.\n",
733 fbo_key.rb_namespace & (1 << 0) ?
"renderbuffer" : resource_type,
740 if (
memcmp(&fbo_key, &
entry->key,
sizeof(fbo_key)))
772 GLuint read_binding, draw_binding;
796 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
799 &
entry->key.objects[
i + 1],
entry->key.rb_namespace & (1 << (
i + 1)));
862 context_gl->
blit_targets[0].sub_resource_idx = rt_sub_resource_idx;
893 TRACE(
"Allocated occlusion query %u in context %p.\n",
query->id, context_gl);
897 WARN(
"Occlusion queries not supported, not allocating query id.\n");
902 query->context_gl = context_gl;
917 ERR(
"Failed to grow free list, leaking query %u in context %p.\n",
query->id, context_gl);
939 TRACE(
"Allocated sync object in context %p.\n", context_gl);
946 TRACE(
"Allocated fence %u in context %p.\n", fence->
object.
id, context_gl);
953 TRACE(
"Allocated fence %u in context %p.\n", fence->
object.
id, context_gl);
957 WARN(
"Fences not supported, not allocating fence.\n");
977 ERR(
"Failed to grow free list, leaking fence %u in context %p.\n", fence->
object.
id, context_gl);
999 TRACE(
"Allocated timestamp query %u in context %p.\n",
query->id, context_gl);
1002 query->context_gl = context_gl;
1017 ERR(
"Failed to grow free list, leaking query %u in context %p.\n",
query->id, context_gl);
1038 TRACE(
"Allocated SO statistics queries %u, %u in context %p.\n",
1042 query->context_gl = context_gl;
1057 ERR(
"Failed to grow free list, leaking GL queries %u, %u in context %p.\n",
1080 query->context_gl = context_gl;
1095 ERR(
"Failed to grow free list, leaking GL queries in context %p.\n", context_gl);
1109 for (
i = 0;
i <
device->context_count; ++
i)
1117 for (
j = 0;
j < gl_info->
limits.buffers + 1; ++
j)
1120 && !(
entry->key.rb_namespace & (1 <<
j)) == !rb_namespace)
1153 for (
i = 0;
i < gl_info->
limits.buffers + 1; ++
i)
1155 if (texture_gl->texture_rgb.name ==
entry->key.objects[
i].object
1158 TRACE(
"Updated texture %p is bound as attachment %u to the current FBO.\n", texture_gl,
i);
1179 ERR(
"Failed to restore pixel format %d on window %p.\n",
1187 ERR(
"Unable to restore pixel format %d on window %p.\n",
1225 ERR(
"wglSetPixelFormatWINE failed to set pixel format %d on device context %p.\n",
1237 ERR(
"Unable to set pixel format %d on device context %p. Already using format %d.\n",
1244 WARN(
"Failed to set pixel format %d on device context %p, last error %#lx.\n",
1266 TRACE(
"context_gl %p.\n", context_gl);
1270 WARN(
"Failed to set pixel format %d on device context %p.\n",
1277 WARN(
"Failed to make GL context %p current on device context %p, last error %#lx.\n",
1279 context_gl->
valid = 0;
1280 WARN(
"Trying fallback to the backup window.\n");
1282 if (context_gl->
c.destroyed)
1284 FIXME(
"Unable to get backup dc for destroyed context %p.\n", context_gl);
1296 TRACE(
"Using backup DC %p.\n", context_gl->
dc);
1302 ERR(
"Failed to set pixel format %d on device context %p.\n",
1310 ERR(
"Fallback to backup window (dc %p) failed too, last error %#lx.\n",
1316 context_gl->
valid = 1;
1327 ERR(
"Failed to restore GL context %p on device context %p, last error %#lx.\n",
1335 if (!context_gl->
c.swapchain)
1338 if (context_gl->
window == context_gl->
c.swapchain->win_handle)
1341 TRACE(
"Updating context %p window from %p to %p.\n",
1342 context_gl, context_gl->
window, context_gl->
c.swapchain->win_handle);
1347 context_gl->
window = context_gl->
c.swapchain->win_handle;
1351 context_gl->
valid = 1;
1356 ERR(
"Failed to get a device context for window %p.\n", context_gl->
window);
1357 context_gl->
valid = 0;
1408 gl_info->
gl_ops.gl.p_glFinish();
1423 for (
i = 0;
i <
context_gl->free_pipeline_statistics_query_count; ++
i)
1475 if (context_gl->
valid)
1483 if (context_gl->
valid)
1490 if (context_gl->
valid)
1497 if (context_gl->
valid)
1518 if (context_gl->
valid)
1525 if (!context_gl->
valid)
1532 if (!context_gl->
valid)
1543 ERR(
"Failed to disable GL context.\n");
1550 ERR(
"Failed to delete GL context %p, last error %#x.\n", context_gl->
gl_ctx,
err);
1575 if (old == context_gl)
1577 TRACE(
"Already using D3D context %p.\n", context_gl);
1583 if (old->
c.destroyed)
1585 TRACE(
"Switching away from destroyed context %p.\n", old);
1595 TRACE(
"Flushing context %p before switching to %p.\n", old, context_gl);
1596 gl_info->
gl_ops.gl.p_glFlush();
1604 if (!context_gl->
valid)
1606 ERR(
"Trying to make invalid context %p current.\n", context_gl);
1610 TRACE(
"Switching to D3D context %p, GL context %p, device context %p.\n",
1611 context_gl, context_gl->
gl_ctx, context_gl->
dc);
1614 context_gl->
c.current = 1;
1618 TRACE(
"Clearing current D3D context.\n");
1622 ERR(
"Failed to clear current GL context, last error %#x.\n",
err);
1633 TRACE(
"Releasing context %p, level %u.\n", context_gl, context_gl->
level);
1637 if (!context_gl->
level)
1638 WARN(
"Context %p is not active.\n", context_gl);
1640 WARN(
"Context %p is not the current context.\n", context_gl);
1643 if (!--context_gl->
level)
1655 if (context_gl->
c.destroy_delayed)
1657 TRACE(
"Destroying context %p.\n", context_gl);
1665 TRACE(
"Entering context %p, level %u.\n", context_gl, context_gl->
level + 1);
1667 if (!context_gl->
level++)
1672 if (current_gl && (!current_context || current_context->
gl_ctx != current_gl))
1674 TRACE(
"Another GL context (%p on device context %p) is already current.\n",
1682 int current = context_gl->
gl_info->gl_ops.wgl.p_wglGetPixelFormat(context_gl->
dc);
1696 unsigned int current_value;
1701 TRACE(
"device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x, swap_effect_copy %#x.\n",
1706 for (
i = 0;
i < cfg_count; ++
i)
1753 if (
value > current_value)
1756 current_value =
value;
1762 ERR(
"Trying to locate a compatible pixel format because an exact match failed.\n");
1779 ERR(
"Can't find a suitable pixel format.\n");
1784 TRACE(
"Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s.\n",
1796 for (
i = 0;
i < gl_info->
limits.combined_samplers; ++
i)
1844 ERR(
">>>>>>> %s (%#x) from %s @ %s / %u.\n",
1846 err = gl_info->
gl_ops.gl.p_glGetError();
1884 unsigned int ctx_attrib_idx = 0;
1885 GLint ctx_attribs[7], ctx_flags = 0;
1896 ctx_attribs[ctx_attrib_idx++] = ctx_flags;
1898 ctx_attribs[ctx_attrib_idx] = 0;
1900 if (!(
ctx = gl_info->p_wglCreateContextAttribsARB(
hdc, share_ctx, ctx_attribs)))
1907 ctx_attribs[ctx_attrib_idx - 1] = ctx_flags;
1913 ctx_attribs[ctx_attrib_idx++] = ctx_flags;
1914 ctx_attribs[ctx_attrib_idx] = 0;
1916 if (!(
ctx = gl_info->p_wglCreateContextAttribsARB(
hdc, share_ctx, ctx_attribs)))
1917 WARN(
"Failed to create a WGL context with wglCreateContextAttribsARB, last error %#lx.\n",
1933 unsigned int target_bind_flags;
1935 bool swap_effect_copy;
1943 target_bind_flags =
target->bind_flags;
1960 context_gl->
dc, colour_format, ds_format,
false, swap_effect_copy);
1964 ERR(
"Failed to choose pixel format.\n");
1976 ERR(
"Failed to set pixel format %d on device context %p.\n", context_gl->
pixel_format, context_gl->
dc);
1981 WARN(
"Failed to set pixel format %d on device context %p, trying backup DC.\n",
1987 ERR(
"Failed to retrieve the backup device context.\n");
1996 if (gl_info->p_wglCreateContextAttribsARB)
2000 ERR(
"Failed to create a WGL context.\n");
2009 ERR(
"Failed to create a WGL context.\n");
2016 ERR(
"wglShareLists(%p, %p) failed, last error %#lx.\n", share_ctx,
ctx,
GetLastError());
2026 context_gl->
valid = 1;
2041 TRACE(
"context_gl %p, swapchain %p.\n", context_gl, swapchain_gl);
2047 context_gl->
gl_info = gl_info;
2054 TRACE(
"Swapchain is created on the desktop window, trying backup device context.\n");
2058 WARN(
"Failed to retrieve device context, trying swapchain backup.\n");
2060 if (!context_gl->
dc)
2064 ERR(
"Failed to retrieve a device context.\n");
2091 ERR(
"Unexpected texture unit base index %u.\n",
base);
2103 ERR(
"Unexpected texture unit base index %u.\n",
base);
2126 ERR(
"Cannot activate context to set up defaults.\n");
2163 TRACE(
"Setting up the screen\n");
2168 checkGLcall(
"glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);");
2171 checkGLcall(
"glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);");
2174 checkGLcall(
"glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);");
2186 checkGLcall(
"glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);");
2188 checkGLcall(
"glPixelStorei(GL_UNPACK_ALIGNMENT, 1);");
2195 for (
i = 1;
i < gl_info->
limits.ffp_textures; ++
i)
2200 checkGLcall(
"glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, ...");
2214 static const char dummy_program[] =
2216 "MOV result.color, fragment.color.primary;\n"
2239 for (
i = 0;
i < gl_info->
limits.ffp_textures; ++
i)
2243 checkGLcall(
"glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)");
2250 checkGLcall(
"glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT)");
2266 checkGLcall(
"enable GL_PRIMITIVE_RESTART_FIXED_INDEX");
2270 FIXME(
"OpenGL implementation does not support GL_PRIMITIVE_RESTART_FIXED_INDEX.\n");
2277 checkGLcall(
"enable seamless cube map filtering");
2289 gl_info->
gl_ops.gl.p_glScissor(0, 0, 0, 0);
2294 gl_info->
gl_ops.gl.p_glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
2295 gl_info->
gl_ops.gl.p_glClearDepth(1.0f);
2296 gl_info->
gl_ops.gl.p_glClearStencil(0);
2312 TRACE(
"Destroying context %p.\n", context_gl);
2319 if (context_gl->
level)
2321 TRACE(
"Delaying destruction of context %p.\n", context_gl);
2322 context_gl->
c.destroy_delayed = 1;
2324 context_gl->
c.swapchain =
NULL;
2325 context_gl->
c.device =
NULL;
2337 gl_info =
malloc(
sizeof(*gl_info));
2338 *gl_info = *context_gl->
gl_info;
2339 context_gl->
gl_info = gl_info;
2340 context_gl->
c.destroyed = 1;
2355 if (!shader_version)
2362 if (shader_version->
major >= 4)
2368 switch (shader_version->
type)
2379 ERR(
"Unhandled shader type %#x.\n", shader_version->
type);
2411 unsigned int clip_distance_count,
i;
2412 uint32_t disable_mask, current_mask;
2414 clip_distance_count = gl_info->
limits.user_clip_distances;
2415 disable_mask = ~enable_mask;
2418 current_mask = context_gl->
c.clip_distance_mask;
2419 context_gl->
c.clip_distance_mask = enable_mask;
2421 enable_mask &= ~current_mask;
2427 disable_mask &= current_mask;
2428 while (disable_mask)
2438 return rt_mask & (1u << 31);
2443 return rt_mask & ~(1u << 31);
2481 gl_info->
gl_ops.gl.p_glDrawBuffer(draw_buffers[0]);
2521 if (old_texture_type !=
target)
2523 switch (old_texture_type)
2559 ERR(
"Unexpected texture target %#x.\n", old_texture_type);
2574 for (
i = 0;
i < context_gl->
submitted.fence_count; ++
i)
2586 if (
i != context_gl->
submitted.fence_count - 1)
2603 struct wined3d_retired_block_gl *
r, *
blocks;
2616 if (
r->fence_id >
id)
2639 for (
i = 0;
i < context_gl->
submitted.fence_count; ++
i)
2641 if (context_gl->
submitted.fences[
i].id !=
id)
2661 ERR(
"Failed to grow submitted command buffer array.\n");
2666 ERR(
"Failed to create fence, hr %#lx.\n",
hr);
2684 struct wined3d_retired_block_gl *
r;
2703 r->fence_id = fence_id;
2714 TRACE(
"context_gl %p, pool %u, size %Iu.\n", context_gl,
pool,
size);
2731 TRACE(
"Created buffer object %u.\n",
id);
2742 TRACE(
"chunk %p, gl_buffer %u, map_ptr %p.\n", chunk_gl, chunk_gl->
gl_buffer, chunk_gl->
c.map_ptr);
2746 if (!chunk_gl->
c.map_ptr)
2758 if (!chunk_gl->
c.map_ptr)
2761 ERR(
"Failed to map chunk memory.\n");
2768 ++chunk_gl->
c.map_count;
2769 map_ptr = chunk_gl->
c.map_ptr;
2781 TRACE(
"chunk_gl %p, context_gl %p.\n", chunk_gl, context_gl);
2785 if (!--chunk_gl->
c.map_count)
2789 chunk_gl->
c.map_ptr =
NULL;
2813 bo_user->
valid =
false;
2823 ERR(
"Failed to create new buffer object.\n");
2826 if (context_gl->
c.d3d_info->fences)
2835 return bo->
b.map_ptr;
2842 ERR(
"Failed to map chunk.\n");
2843 return bo->
b.map_ptr;
2846 gl_info = context_gl->
gl_info;
2888 return bo->
b.map_ptr;
2895 if (context_gl->
c.d3d_info->persistent_map
2898 TRACE(
"Not unmapping BO %p.\n", bo);
2906 if (bo->
b.client_map_count)
2909 assert(context_gl->
c.d3d_info->persistent_map);
2910 TRACE(
"BO %p is still in use by a client thread; not unmapping.\n", bo);
2913 bo->
b.map_ptr =
NULL;
2938 if (!(bo =
data->buffer_object))
2943 ERR(
"Failed to map bo.\n");
2951 unsigned int range_count,
const struct wined3d_range *ranges)
2957 if (!
data->buffer_object ||
data->buffer_object->coherent)
2961 gl_info = context_gl->
gl_info;
2968 for (
i = 0;
i < range_count; ++
i)
2976 for (
i = 0;
i < range_count; ++
i)
2993 if (!
data->buffer_object)
3022 BYTE *dst_ptr, *src_ptr;
3025 gl_info = context_gl->
gl_info;
3029 if (dst_bo && src_bo)
3036 for (
i = 0;
i < range_count; ++
i)
3052 for (
i = 0;
i < range_count; ++
i)
3059 else if (!dst_bo && src_bo)
3062 for (
i = 0;
i < range_count; ++
i)
3070 else if (dst_bo && !src_bo)
3081 for (
i = 0;
i < range_count; ++
i)
3092 for (
i = 0;
i < range_count; ++
i)
3102 TRACE(
"context_gl %p, bo %p.\n", context_gl, bo);
3132 TRACE(
"Destroying GL buffer %u.\n", bo->
id);
3162 TRACE(
"Setting up context %p for blitting.\n",
context);
3164 gl_info = context_gl->
gl_info;
3172 gl_info->
gl_ops.gl.p_glViewport(0, 0, rt_size.
cx, rt_size.
cy);
3180 TRACE(
"Context is already set up for blitting, nothing to do.\n");
3221 gl_info->
gl_ops.gl.p_glViewport(0, 0, rt_size.
cx, rt_size.
cy);
3240 for (
i = 0;
i < rt_count; ++
i)
3260 || rt_count != gl_info->
limits.buffers)
3266 WARN(
"Invalid render target config, need at least one attachment.\n");
3273 for (
i = 0;
i < rt_count; ++
i)
3280 context_gl->
blit_targets[
i].sub_resource_idx = rtv_gl->
v.sub_resource_idx;
3284 rt_mask |= (1u <<
i);
3297 rt_count ? rts[0]->
resource->draw_binding : 0, dsv ? dsv->
resource->draw_binding : 0);
3313 for (
i = 0;
i < rt_count; ++
i)
3316 rt_mask |= (1u <<
i);
3326 if (rt_mask != *cur_mask)
3329 *cur_mask = rt_mask;
3335 context_gl->
c.last_was_blit =
FALSE;
3336 context_gl->
c.last_was_ffp_blit =
FALSE;
3365 unsigned int rt_mask,
mask;
3368 rt_mask = ps ? ps->
reg_maps.rt_mask : 1;
3370 if (
state->blend_state &&
state->blend_state->dual_source)
3378 rt_mask &= ~(1u <<
i);
3391 TRACE(
"context_gl %p, texture %p, sub_resource_idx %u, location %s.\n",
3414 if (rt_mask != *cur_mask)
3417 *cur_mask = rt_mask;
3433 DWORD color_location = 0;
3437 for (
unsigned int i = 0;
i < context_gl->
gl_info->limits.buffers; ++
i)
3445 context_gl->
blit_targets[
i].sub_resource_idx = view_gl->
v.sub_resource_idx;
3446 context_gl->
blit_targets[
i].layer_count = view_gl->
v.layer_count;
3448 if (!color_location)
3449 color_location = view_gl->
v.resource->draw_binding;
3465 if (rt_mask != *cur_mask)
3468 *cur_mask = rt_mask;
3477 TRACE(
"Mapping stage %u to unit %u.\n", stage,
unit);
3501 if (
vs &&
vs->reg_maps.shader_version.major >= 4)
3511 context->fixed_function_usage_map = 0;
3538 context->fixed_function_usage_map |= (1u <<
i);
3542 context->fixed_function_usage_map |= (1u << (
i + 1));
3546 if (i < context->lowest_disabled_stage)
3557 context->lowest_disabled_stage =
i;
3568 unsigned int i, tex;
3571 ffu_map = context_gl->
c.fixed_function_usage_map;
3618 if (i < d3d_info->ffp_fragment_caps.max_blend_stages)
3637 if (!ps_resource_info)
3641 || !(context_gl->
c.fixed_function_usage_map & (1u << current_mapping));
3645 return !ps_resource_info[current_mapping].
type;
3670 if (vs_resource_info[
i].
type)
3689 WARN(
"Couldn't find a free texture unit for vertex sampler %u.\n",
i);
3731 if (rt_mask != *cur_mask)
3734 *cur_mask = rt_mask;
3742 unsigned int bind_idx, shader_sampler_count,
base,
count,
i;
3747 const unsigned int *tex_unit_map;
3754 uint32_t ffu_map = context_gl->
c.fixed_function_usage_map;
3771 WARN(
"No resource view bound at index %u.\n",
i);
3786 shader_sampler_count =
shader->reg_maps.sampler_map.count;
3787 if (shader_sampler_count >
count)
3788 FIXME(
"Shader %p needs %u samplers, but only %u are supported.\n",
3797 bind_idx = tex_unit_map[bind_idx];
3836 if (
shader->reg_maps.uav_resource_info[
i].type)
3837 WARN(
"No unordered access view bound at index %u.\n",
i);
3845 texture_name = view_gl->
gl_view.name;
3852 level = view_gl->
v.desc.u.texture.level_idx;
3856 FIXME(
"Unsupported buffer unordered access view.\n");
3879 if (!
resource->rtv_bind_count_device)
3904 if (!(shader_mask & (1u <<
i)))
3911 uint32_t ffu_map = context_gl->
c.fixed_function_usage_map;
3922 &context_gl->
c,
sampler->desc.srgb_decode);
3937 if (!
buffer->bo_user.valid)
3941 for (
j = 0;
j <
shader->reg_maps.sampler_map.count; ++
j)
3949 context_gl->
c.uses_fbo_attached_resources = 1;
3967 srgb =
sampler->desc.srgb_decode;
3984 context_gl->
c.uses_uavs = 0;
3991 if (!(
view = views[
i]))
4013 context_gl->
c.uses_uavs = 1;
4033 if (!
buffer->bo_user.valid)
4046 unsigned int i,
base;
4049 context->uses_fbo_attached_resources = 0;
4055 FIXME(
"OpenGL implementation does not support framebuffers with no attachments.\n");
4087 if (!
buffer->bo_user.valid)
4108 if (indexed &&
state->index_buffer)
4112 if (
context->stream_info.all_vbo)
4115 if (!
buffer->bo_user.valid)
4140 if (
context->update_shader_resource_bindings)
4144 context->update_shader_resource_bindings = 0;
4145 if (gl_info->
limits.combined_samplers == gl_info->
limits.graphics_samplers)
4146 context->update_compute_shader_resource_bindings = 1;
4149 if (
context->update_unordered_access_view_bindings)
4154 context->update_unordered_access_view_bindings = 0;
4155 context->update_compute_unordered_access_view_bindings = 1;
4162 context->constant_update_mask = 0;
4175 unsigned int state_id,
i;
4183 unsigned int dirty_mask = context_gl->
c.dirty_compute_states[
i];
4190 state_id +=
sizeof(*context_gl->
c.dirty_compute_states) *
CHAR_BIT;
4192 memset(context_gl->
c.dirty_compute_states, 0,
sizeof(*context_gl->
c.dirty_compute_states));
4194 device->shader_backend->shader_apply_compute_state(
device->shader_priv, &context_gl->
c,
state);
4196 if (context_gl->
c.update_compute_shader_resource_bindings)
4199 context_gl->
c.update_compute_shader_resource_bindings = 0;
4200 if (gl_info->
limits.combined_samplers == gl_info->
limits.graphics_samplers)
4201 context_gl->
c.update_shader_resource_bindings = 1;
4204 if (context_gl->
c.update_compute_unordered_access_view_bindings)
4209 context_gl->
c.update_compute_unordered_access_view_bindings = 0;
4210 context_gl->
c.update_unordered_access_view_bindings = 1;
4223 context_gl->
c.last_was_blit =
FALSE;
4224 context_gl->
c.last_was_ffp_blit =
FALSE;
4232 if (context_gl->
c.transform_feedback_active)
4236 context_gl->
c.transform_feedback_active = 0;
4237 context_gl->
c.transform_feedback_paused = 0;
4245 if (!context_gl->
c.transform_feedback_active || context_gl->
c.transform_feedback_paused)
4252 context_gl->
c.transform_feedback_paused = 1;
4256 WARN(
"Cannot pause transform feedback operations.\n");
4265 if (context_gl->
c.current_rt.texture ==
texture
4266 && context_gl->
c.current_rt.sub_resource_idx == sub_resource_idx)
4271 if (!context_gl->
c.current_rt.texture)
4277 const struct wined3d_format *old = context_gl->
c.current_rt.texture->resource.format;
4280 if (old->
id !=
new->id)
4289 context_gl->
c.current_rt.texture =
texture;
4290 context_gl->
c.current_rt.sub_resource_idx = sub_resource_idx;
4299 TRACE(
"Switching context_gl %p from swapchain %p to swapchain %p.\n",
4300 context_gl, context_gl->
c.swapchain,
texture->swapchain);
4301 context_gl->
c.swapchain =
texture->swapchain;
4305 if (!context_gl->
valid)
4311 ERR(
"Failed to activate the new context.\n");
4325 TRACE(
"device %p, texture %p, sub_resource_idx %u.\n",
device,
texture, sub_resource_idx);
4327 if (current_context && current_context->
c.destroyed)
4328 current_context =
NULL;
4333 && current_context->
c.device ==
device)
4335 texture = current_context->
c.current_rt.texture;
4336 sub_resource_idx = current_context->
c.current_rt.sub_resource_idx;
4346 sub_resource_idx = 0;
4350 if (current_context && current_context->
c.current_rt.texture ==
texture)
4352 context_gl = current_context;
4356 TRACE(
"Rendering onscreen.\n");
4363 TRACE(
"Rendering offscreen.\n");
4367 if (current_context && current_context->
c.device ==
device)
4368 context_gl = current_context;
4375 return &context_gl->
c;
4386 device = context_gl->
c.device;
4389 if (context_gl->
c.current_rt.texture)
4392 context_gl->
c.current_rt.sub_resource_idx);
4397 if (acquired_context != &context_gl->
c)
4398 ERR(
"Acquired context %p instead of %p.\n", acquired_context, &context_gl->
c);
4409 if (!context_gl->
valid)
4412 WARN(
"Invalid context, skipping dispatch.\n");
4420 FIXME(
"OpenGL implementation does not support compute shaders.\n");
4454 const struct wined3d_state *
state,
const void *idx_data,
unsigned int idx_size,
int base_vertex_idx,
4455 unsigned int start_idx,
unsigned int count,
unsigned int start_instance,
unsigned int instance_count)
4461 unsigned int instanced_elements[
ARRAY_SIZE(
si->elements)];
4463 unsigned int instanced_element_count = 0;
4469 indices = (
const char *)idx_data + idx_size * start_idx;
4471 if (!instance_count)
4493 FIXME(
"Start instance (%u) not supported.\n", start_instance);
4501 GL_EXTCALL(glDrawArraysInstancedBaseInstance(
mode, start_idx,
count, instance_count, start_instance));
4514 indices, instance_count, base_vertex_idx, start_instance));
4515 checkGLcall(
"glDrawElementsInstancedBaseVertexBaseInstance");
4521 indices, instance_count, base_vertex_idx));
4542 FIXME(
"Non-indexed instanced drawing is not supported.\n");
4548 if (!(
si->use_map & (1u <<
i)))
4552 instanced_elements[instanced_element_count++] =
i;
4555 for (
i = 0;
i < instance_count; ++
i)
4558 for (
j = 0;
j < instanced_element_count; ++
j)
4561 unsigned int element_idx;
4564 element_idx = instanced_elements[
j];
4567 if (
element->data.buffer_object)
4596 FIXME(
"OpenGL implementation does not support indirect draws.\n");
4606 if (
state->index_offset)
4607 FIXME(
"Ignoring index offset %u.\n",
state->index_offset);
4624 switch (gl_primitive_type)
4643 return gl_primitive_type;
4657 bool rasterizer_discard =
false;
4658 unsigned int i, idx_size = 0;
4659 const void *idx_data =
NULL;
4667 TRACE(
"base_vertex_idx %d, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
4677 FIXME(
"Buffer render targets not implemented.\n");
4686 if (!context_gl->
valid)
4689 WARN(
"Invalid context, skipping draw.\n");
4692 gl_info = context_gl->
gl_info;
4697 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
4733 WARN(
"Unable to apply draw state, skipping draw.\n");
4737 if (dsv && (!
state->depth_stencil_state ||
state->depth_stencil_state->writes_ds))
4753 idx_data = index_buffer->
resource.heap_memory;
4756 idx_data = (
const BYTE *)idx_data +
state->index_offset;
4772 rasterizer_discard =
true;
4775 if (
context->transform_feedback_paused)
4779 context->transform_feedback_paused = 0;
4781 else if (!
context->transform_feedback_active)
4784 ?
shader->u.gs.output_type :
state->primitive_type;
4788 context->transform_feedback_active = 1;
4798 if (
context->uses_fbo_attached_resources)
4800 static unsigned int fixme_once;
4813 FIXME(
"Sampling attached render targets is not supported.\n");
4815 WARN(
"Sampling attached render targets is not supported, skipping draw.\n");
4840 if (rasterizer_discard)
4848 TRACE(
"Draw completed.\n");
4856 if (
element->data.buffer_object)
4870 context_gl->
c.numbered_array_mask &= ~(1u <<
i);
4899 static unsigned int once;
4902 FIXME(
"More than the supported %u vertex attributes are in use.\n", gl_info->
limits.vertex_attribs);
4905 for (
i = 0;
i < gl_info->
limits.vertex_attribs; ++
i)
4913 if (
context->numbered_array_mask & (1u <<
i))
4916 GL_EXTCALL(glVertexAttrib4f(
i, 0.0f, 0.0f, 0.0f, 0.0f));
4936 if (
context->numbered_array_mask & (1u <<
i))
4947 unsigned int format_attrs = format_gl->
f.attrs;
4950 if (current_bo != bo)
4974 if (!(
context->numbered_array_mask & (1u <<
i)))
4977 context->numbered_array_mask |= (1u <<
i);
4987 if (
element->data.buffer_object)
4990 if (
context->numbered_array_mask & (1u <<
i))
4993 switch (format_gl->
f.id)
5015 c |= (*
src & 0xff0000u) >> 16;
5016 c |= (*
src & 0xffu) << 16;
5049 FIXME(
"Unsure about WINED3DDECLTYPE_UDEC3.\n");
5053 FIXME(
"Unsure about WINED3DDECLTYPE_DEC3N.\n");
5085 ERR(
"Unexpected declaration in stride 0 attributes.\n");
5126 unsigned int sub_resource_idx,
const RECT *src_rect,
const RECT *dst_rect,
5142 level = sub_resource_idx % texture_gl->
t.level_count;
5153 quad[0].x = dst_rect->
left * 2.0f /
w - 1.0f;
5154 quad[0].y = dst_rect->
top * 2.0f /
h - 1.0f;
5155 quad[0].texcoord =
info.texcoords[0];
5157 quad[1].x = dst_rect->
right * 2.0f /
w - 1.0f;
5158 quad[1].y = dst_rect->
top * 2.0f /
h - 1.0f;
5159 quad[1].texcoord =
info.texcoords[1];
5161 quad[2].x = dst_rect->
left * 2.0f /
w - 1.0f;
5163 quad[2].texcoord =
info.texcoords[2];
5165 quad[3].x = dst_rect->
right * 2.0f /
w - 1.0f;
5167 quad[3].texcoord =
info.texcoords[3];
5202 gl_info->
gl_ops.gl.p_glEnd();
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static void context_gl_load_unordered_access_resources(struct wined3d_context_gl *context_gl, const struct wined3d_shader *shader, struct wined3d_unordered_access_view *const *views)
static void wined3d_context_gl_reuse_fbo_entry(struct wined3d_context_gl *context_gl, GLenum target, const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location, struct fbo_entry *entry)
static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context_gl)
void context_set_tls_idx(DWORD idx)
void wined3d_context_gl_free_fence(struct wined3d_fence *fence)
static void wined3d_device_gl_free_memory(struct wined3d_device_gl *device_gl, struct wined3d_allocator_block *block)
static uint32_t wined3d_context_gl_generate_rt_mask_no_fbo(const struct wined3d_context_gl *context_gl, struct wined3d_resource *rt)
static void wined3d_context_gl_attach_depth_stencil_fbo(struct wined3d_context_gl *context_gl, GLenum fbo_target, const struct wined3d_fbo_resource *resource, BOOL rb_namespace, uint32_t flags)
void wined3d_context_gl_destroy_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo)
static void * wined3d_bo_gl_map(struct wined3d_bo_gl *bo, struct wined3d_context_gl *context_gl, uint32_t flags)
void wined3d_context_gl_free_timestamp_query(struct wined3d_timestamp_query *query)
void wined3d_context_gl_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query)
static void context_update_fixed_function_usage_map(struct wined3d_context *context, const struct wined3d_state *state)
BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl)
void wined3d_context_gl_free_so_statistics_query(struct wined3d_so_statistics_query *query)
static void wined3d_context_gl_draw_primitive_arrays(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, const void *idx_data, unsigned int idx_size, int base_vertex_idx, unsigned int start_idx, unsigned int count, unsigned int start_instance, unsigned int instance_count)
static void wined3d_context_gl_enter(struct wined3d_context_gl *context_gl)
void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t enable_mask)
static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
static void wined3d_context_gl_map_stage(struct wined3d_context_gl *context_gl, unsigned int stage, unsigned int unit)
void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name)
void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl)
static void wined3d_context_gl_bind_unordered_access_views(struct wined3d_context_gl *context_gl, const struct wined3d_shader *shader, struct wined3d_unordered_access_view *const *views)
static void context_attach_depth_stencil_rb(const struct wined3d_gl_info *gl_info, GLenum fbo_target, uint32_t flags, GLuint rb)
static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size)
static int context_choose_pixel_format(const struct wined3d_device *device, HDC hdc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format, bool aux_buffers, bool swap_effect_copy)
static void wined3d_context_gl_destroy_allocator_block(struct wined3d_context_gl *context_gl, struct wined3d_allocator_block *block, uint64_t fence_id)
static void wined3d_context_gl_unload_numbered_arrays(struct wined3d_context_gl *context_gl)
static void wined3d_allocator_chunk_gl_unmap(struct wined3d_allocator_chunk_gl *chunk_gl, struct wined3d_context_gl *context_gl)
void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device)
static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *context_gl)
struct wined3d_context_gl * wined3d_context_gl_reacquire(struct wined3d_context_gl *context_gl)
void wined3d_context_gl_alloc_pipeline_statistics_query(struct wined3d_context_gl *context_gl, struct wined3d_pipeline_statistics_query *query)
static void wined3d_context_gl_activate(struct wined3d_context_gl *context_gl, struct wined3d_texture *texture, unsigned int sub_resource_idx)
static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *context_gl)
void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HDC dc, HGLRC gl_ctx)
static void wined3d_context_gl_apply_fbo_entry(struct wined3d_context_gl *context_gl, GLenum target, struct fbo_entry *entry)
static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, GLenum target, GLenum attachment)
static GLenum draw_buffer_from_rt_mask(DWORD rt_mask)
void wined3d_context_gl_alloc_occlusion_query(struct wined3d_context_gl *context_gl, struct wined3d_occlusion_query *query)
static struct fbo_entry * wined3d_context_gl_create_fbo_entry(const struct wined3d_context_gl *context_gl, const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
static BOOL context_debug_output_enabled(const struct wined3d_gl_info *gl_info)
BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int rt_count, const struct wined3d_fb_state *fb)
void wined3d_context_gl_alloc_so_statistics_query(struct wined3d_context_gl *context_gl, struct wined3d_so_statistics_query *query)
HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wined3d_swapchain_gl *swapchain_gl)
void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, unsigned int range_count, const struct wined3d_range *ranges, uint32_t map_flags)
void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *context_gl, const struct wined3d_stream_info *stream_info, const struct wined3d_state *state)
static void apply_texture_blit_state(const struct wined3d_gl_info *gl_info, struct gl_texture *texture, GLenum target, unsigned int level, enum wined3d_texture_filter_type filter)
static void wined3d_context_gl_map_psamplers(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
static void wined3d_context_gl_attach_surface_fbo(struct wined3d_context_gl *context_gl, GLenum fbo_target, unsigned int idx, const struct wined3d_fbo_resource *resource, BOOL rb_namespace)
void context_gl_apply_texture_draw_state(struct wined3d_context_gl *context_gl, struct wined3d_texture *texture, unsigned int sub_resource_idx, unsigned int location)
static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info, GLenum target)
static void wined3d_context_gl_setup_target(struct wined3d_context_gl *context_gl, struct wined3d_texture *texture, unsigned int sub_resource_idx)
struct wined3d_context * wined3d_context_gl_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
const unsigned int * wined3d_context_gl_get_tex_unit_mapping(const struct wined3d_context_gl *context_gl, const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count)
static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static void wined3d_context_gl_get_rt_size(const struct wined3d_context_gl *context_gl, SIZE *size)
static void wined3d_context_gl_destroy_fbo_entry(struct wined3d_context_gl *context_gl, struct fbo_entry *entry)
static void context_gl_load_stream_output_buffers(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static BOOL wined3d_context_gl_unit_free_for_vs(const struct wined3d_context_gl *context_gl, const struct wined3d_shader_resource_info *ps_resource_info, unsigned int unit)
static void wined3d_context_gl_enum_fbo_entries(const struct wined3d_device *device, GLuint name, BOOL rb_namespace, context_fbo_entry_func_t *callback)
#define WINED3D_ALL_LAYERS
static void wined3d_context_gl_pause_transform_feedback(struct wined3d_context_gl *context_gl, BOOL force)
void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *context_gl)
static void wined3d_context_gl_bind_fbo(struct wined3d_context_gl *context_gl, GLenum target, GLuint fbo)
void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_gl)
static void wined3d_context_gl_cleanup_resources(struct wined3d_context_gl *context_gl)
static void WINE_GLAPI wined3d_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, void *ctx)
static void flush_bo_ranges(struct wined3d_context_gl *context_gl, const struct wined3d_const_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
struct wined3d_context_gl * wined3d_context_gl_get_current(void)
void wined3d_context_gl_wait_command_fence(struct wined3d_context_gl *context_gl, uint64_t id)
static DWORD wined3d_context_tls_idx
static BOOL is_rt_mask_onscreen(DWORD rt_mask)
static void wined3d_context_gl_set_fbo_key_for_render_target(const struct wined3d_context_gl *context_gl, struct wined3d_fbo_entry_key *key, unsigned int idx, const struct wined3d_rendertarget_info *render_target, DWORD location)
static BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state, BOOL indexed)
static void wined3d_context_gl_apply_compute_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device, const struct wined3d_state *state)
void() context_fbo_entry_func_t(struct wined3d_context_gl *context_gl, struct fbo_entry *entry)
static void context_invalidate_texture_stage(struct wined3d_context *context, DWORD stage)
static DWORD context_generate_rt_mask(GLenum buffer)
static void wined3d_context_gl_apply_draw_buffers(struct wined3d_context_gl *context_gl, uint32_t rt_mask)
GLuint wined3d_context_gl_allocate_vram_chunk_buffer(struct wined3d_context_gl *context_gl, unsigned int pool, size_t size)
void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
static BOOL have_framebuffer_attachment(unsigned int rt_count, struct wined3d_rendertarget_view *const *rts, const struct wined3d_rendertarget_view *ds)
static void wined3d_context_gl_update_tex_unit_map(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static void wined3d_context_gl_bind_shader_resources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, enum wined3d_shader_type shader_type)
void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl)
static BOOL wined3d_context_gl_create_wgl_ctx(struct wined3d_context_gl *context_gl, struct wined3d_swapchain_gl *swapchain_gl, BOOL *new_drawable)
#define WINED3D_MAX_FBO_ENTRIES
static void wined3d_context_gl_queue_fbo_entry_destruction(struct wined3d_context_gl *context_gl, struct fbo_entry *entry)
static bool use_ffp_ps(const struct wined3d_state *state)
static BOOL wined3d_context_gl_restore_pixel_format(struct wined3d_context_gl *context_gl)
static uint32_t find_draw_buffers_mask(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static void wined3d_context_gl_update_window(struct wined3d_context_gl *context_gl)
void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx)
void dispatch_compute(struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_dispatch_parameters *parameters)
static void wined3d_context_gl_destroy_fbo(struct wined3d_context_gl *context_gl, GLuint fbo)
static void wined3d_bo_gl_unmap(struct wined3d_bo_gl *bo, struct wined3d_context_gl *context_gl)
void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void wined3d_context_gl_release(struct wined3d_context_gl *context_gl)
void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *query)
static void wined3d_context_gl_attach_gl_texture_fbo(struct wined3d_context_gl *context_gl, GLenum fbo_target, GLenum attachment, const struct wined3d_fbo_resource *resource)
void * wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, size_t size, uint32_t flags)
void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target)
static void wined3d_context_gl_apply_fbo_state(struct wined3d_context_gl *context_gl, GLenum target, const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
static void wined3d_context_gl_generate_fbo_key(const struct wined3d_context_gl *context_gl, struct wined3d_fbo_entry_key *key, const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
static void wined3d_context_gl_unload_numbered_array(struct wined3d_context_gl *context_gl, unsigned int i)
static void wined3d_context_gl_poll_fences(struct wined3d_context_gl *context_gl)
static void wined3d_context_gl_map_vsamplers(struct wined3d_context_gl *context_gl, BOOL ps, const struct wined3d_state *state)
void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name)
void wined3d_context_gl_alloc_fence(struct wined3d_context_gl *context_gl, struct wined3d_fence *fence)
void wined3d_context_gl_apply_fbo_state_explicit(struct wined3d_context_gl *context_gl, GLenum target, struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location)
static bool is_resource_rtv_bound(const struct wined3d_state *state, const struct wined3d_resource *resource)
static struct fbo_entry * wined3d_context_gl_find_fbo_entry(struct wined3d_context_gl *context_gl, GLenum target, const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
DWORD context_get_tls_idx(void)
void wined3d_context_gl_alloc_timestamp_query(struct wined3d_context_gl *context_gl, struct wined3d_timestamp_query *query)
void context_gl_resource_released(struct wined3d_device *device, GLuint name, BOOL rb_namespace)
void wined3d_context_gl_flush_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_const_bo_address *data, size_t size)
static DWORD context_generate_rt_mask_from_resource(struct wined3d_resource *resource)
void wined3d_check_gl_call(const struct wined3d_gl_info *gl_info, const char *file, unsigned int line, const char *name)
void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_draw_parameters *parameters)
static const void * get_vertex_attrib_pointer(const struct wined3d_stream_info_element *element, const struct wined3d_state *state)
static void * wined3d_allocator_chunk_gl_map(struct wined3d_allocator_chunk_gl *chunk_gl, struct wined3d_context_gl *context_gl)
GLenum wined3d_context_gl_get_offscreen_gl_buffer(const struct wined3d_context_gl *context_gl)
static void context_gl_load_shader_resources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int shader_mask)
static void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer)
void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl, const struct wined3d_gl_info *gl_info, unsigned int unit)
float float_16_to_32(const unsigned short in)
static const struct @282 state_table[]
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, uint32_t location)
void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state)
void wined3d_buffer_acquire_bo_for_write(struct wined3d_buffer *buffer, struct wined3d_context *context)
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, uint32_t location)
void * wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context)
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
void context_invalidate_state(struct wined3d_context *context, unsigned int state_id)
void wined3d_context_cleanup(struct wined3d_context *context)
void wined3d_context_init(struct wined3d_context *context, struct wined3d_swapchain *swapchain)
void context_update_stream_info(struct wined3d_context *context, const struct wined3d_state *state)
GLbitfield wined3d_device_gl_get_memory_type_flags(unsigned int memory_type_idx)
HDC wined3d_device_gl_get_backup_dc(struct wined3d_device_gl *device_gl)
void device_invalidate_state(const struct wined3d_device *device, unsigned int state_id)
void device_context_remove(struct wined3d_device *device, struct wined3d_context *context)
bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, struct wined3d_context_gl *context_gl, GLsizeiptr size, GLenum binding, GLenum usage, bool coherent, GLbitfield flags, struct wined3d_bo_gl *bo)
void wined3d_fence_issue(struct wined3d_fence *fence, struct wined3d_device *device)
void wined3d_fence_destroy(struct wined3d_fence *fence)
HRESULT wined3d_fence_create(struct wined3d_device *device, struct wined3d_fence **fence)
enum wined3d_fence_result wined3d_fence_test(const struct wined3d_fence *fence, struct wined3d_device *device, uint32_t flags)
enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence, struct wined3d_device *device)
GLbitfield wined3d_resource_gl_map_flags(const struct wined3d_bo_gl *bo, DWORD d3d_flags)
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags)
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, unsigned int level, const struct wined3d_rendertarget_info *rt)
void texture2d_get_blt_info(const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *rect, struct wined3d_blt_info *info)
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
void wined3d_release_dc(HWND window, HDC dc)
const char * debug_d3dformat(enum wined3d_format_id format_id)
void wined3d_gl_limits_get_texture_unit_range(const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count)
const char * wined3d_debug_location(uint32_t location)
const char * debug_const_bo_address(const struct wined3d_const_bo_address *address)
const char * debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
const struct wined3d_format * wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
const char * debug_bo_address(const struct wined3d_bo_address *address)
const char * debug_fboattachment(GLenum attachment)
const char * debug_glerror(GLenum error)
void wined3d_allocator_block_free(struct wined3d_allocator_block *block)
const char * debug_fbostatus(GLenum status)
void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_view *view, uint32_t location)
void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_access_view *view, uint32_t location)
void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl *view_gl, unsigned int unit, struct wined3d_sampler_gl *sampler_gl, struct wined3d_context_gl *context_gl)
void wined3d_unordered_access_view_gl_update(struct wined3d_unordered_access_view_gl *uav_gl, struct wined3d_context_gl *context_gl)
void wined3d_shader_resource_view_gl_update(struct wined3d_shader_resource_view_gl *srv_gl, struct wined3d_context_gl *context_gl)
void wined3d_rendertarget_view_invalidate_location(struct wined3d_rendertarget_view *view, uint32_t location)
const char * wine_dbg_sprintf(const char *format,...)
static __inline const char * debugstr_an(const char *s, int n)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
static void restore_dc(GpGraphics *graphics, HDC hdc, INT state)
LPVOID WINAPI TlsGetValue(IN DWORD Index)
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
static void depth_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define GL_TEXTURE_MIN_FILTER
GLAPI void GLAPIENTRY glEnable(GLenum cap)
#define GL_TEXTURE_WRAP_S
#define GL_TEXTURE_CUBE_MAP
#define GL_UNSIGNED_SHORT
GLint GLint GLint GLint GLint x
#define GL_TEXTURE_BASE_LEVEL
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
#define GL_TEXTURE_MAX_LEVEL
#define GL_PACK_ALIGNMENT
GLuint GLuint GLsizei GLenum type
#define GL_TEXTURE_HEIGHT
GLint GLint GLint GLint GLint GLint y
#define GL_LIGHT_MODEL_LOCAL_VIEWER
#define GL_UNPACK_ALIGNMENT
#define GL_COLOR_BUFFER_BIT
#define GL_TEXTURE_ENV_MODE
#define GL_TEXTURE_INTERNAL_FORMAT
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define GL_TEXTURE_BINDING_CUBE_MAP
GLdouble GLdouble GLdouble r
#define GL_STENCIL_BUFFER_BIT
#define GL_TEXTURE_WRAP_T
#define GL_TEXTURE_MAG_FILTER
GLAPI void GLAPIENTRY glDisable(GLenum cap)
#define GL_TRIANGLE_STRIP
GLint GLint GLsizei width
#define GL_LIGHT_MODEL_COLOR_CONTROL
#define GL_SEPARATE_SPECULAR_COLOR
GLuint GLuint GLsizei GLenum const GLvoid * indices
#define GL_TEXTURE_BINDING_2D
GLAPI void GLAPIENTRY glActiveTexture(GLenum texture)
#define GL_DEPTH_BUFFER_BIT
#define GL_TEXTURE_BINDING_1D
GLdouble GLdouble GLdouble GLdouble q
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
#define GL_SKIP_DECODE_EXT
#define GL_POINT_SPRITE_ARB
#define GL_ATOMIC_COUNTER_BUFFER
#define GL_RENDERBUFFER_SAMPLES
#define GL_TEXTURE_BINDING_1D_ARRAY
#define GL_COPY_WRITE_BUFFER
#define GL_RENDERBUFFER_WIDTH
#define GL_PROGRAM_FORMAT_ASCII_ARB
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB
#define GL_FRAGMENT_PROGRAM_ARB
#define GL_MAP_FLUSH_EXPLICIT_BIT
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
#define GL_DEBUG_TYPE_PORTABILITY_ARB
#define GL_FRAMEBUFFER_SRGB
#define GL_LINES_ADJACENCY
#define GL_COLOR_ATTACHMENT0
#define GL_RASTERIZER_DISCARD
#define GL_TEXTURE_SRGB_DECODE_EXT
#define GL_TEXTURE_SHADER_NV
#define GL_TRIANGLE_STRIP_ADJACENCY_ARB
#define GL_TEXTURE_CUBE_MAP_SEAMLESS
#define GL_TRIANGLE_STRIP_ADJACENCY
#define GL_ALL_BARRIER_BITS
#define GL_DEBUG_TYPE_PERFORMANCE_ARB
GLenum GLuint GLint GLenum face
#define GL_MAP_UNSYNCHRONIZED_BIT
#define GL_TEXTURE_BUFFER
#define GL_FIRST_VERTEX_CONVENTION_EXT
#define GL_RENDERBUFFER_HEIGHT
#define GL_PREVIOUS_TEXTURE_INPUT_NV
#define GL_LINE_STRIP_ADJACENCY_ARB
#define GL_FRAMEBUFFER_COMPLETE
#define GL_DRAW_FRAMEBUFFER
#define GL_TEXTURE_BINDING_2D_ARRAY
#define GL_TEXTURE_1D_ARRAY
#define GL_CLIP_DISTANCE0
GLuint GLsizei GLsizei * length
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
#define GL_TRIANGLES_ADJACENCY
#define GL_LINE_STRIP_ADJACENCY
#define GL_TEXTURE_2D_MULTISAMPLE
#define GL_DEBUG_TYPE_ERROR_ARB
#define GL_FIRST_VERTEX_CONVENTION
#define GL_READ_FRAMEBUFFER
#define GL_LINES_ADJACENCY_ARB
#define GL_TRIANGLES_ADJACENCY_ARB
#define GL_TEXTURE_SAMPLES
#define GL_DEPTH_ATTACHMENT
GLuint GLdouble GLdouble GLint GLint order
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
#define GL_TEXTURE_CUBE_MAP_ARRAY
#define GL_COORD_REPLACE_ARB
#define GL_RENDERBUFFER_INTERNAL_FORMAT
#define GL_ELEMENT_ARRAY_BUFFER
#define GL_TEXTURE_2D_ARRAY
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE
GLubyte GLubyte GLubyte GLubyte w
#define GL_PATCH_VERTICES
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
#define GL_STENCIL_ATTACHMENT
#define GL_DRAW_INDIRECT_BUFFER
#define GL_POINT_SPRITE_COORD_ORIGIN
GLfloat GLfloat GLfloat GLfloat h
#define GL_COPY_READ_BUFFER
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY
#define GL_PIXEL_UNPACK_BUFFER
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 i
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
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
LOCAL struct ga_flags * gl_flags
#define memcpy(s1, s2, n)
struct task_struct * current
static IPrintDialogCallback callback
static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos)
static RPC_BINDING_HANDLE binding
static HGLRC(WINAPI *pwglCreateContextAttribsARB)(HDC hDC
png_const_structrp png_const_inforp int * unit
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND WINAPI WindowFromDC(_In_ HDC hDC)
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
static void quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
static PIXELFORMATDESCRIPTOR pfd
struct wined3d_pixel_format * pixel_formats
unsigned int pixel_format_count
struct wined3d_gl_info gl_info
struct wined3d_allocator_chunk c
struct wined3d_allocator_block * memory
uint64_t command_fence_id
struct wined3d_bo * buffer_object
struct wined3d_resource resource
SIZE_T free_so_statistics_query_size
union wined3d_gl_pipeline_statistics_query * free_pipeline_statistics_queries
unsigned int free_so_statistics_query_count
union wined3d_gl_fence_object * free_fences
SIZE_T free_occlusion_query_size
struct list occlusion_queries
struct fbo_entry * current_fbo
unsigned int free_occlusion_query_count
unsigned int active_texture
SIZE_T free_timestamp_query_size
GLuint * free_occlusion_queries
unsigned int free_fence_count
unsigned int rev_tex_unit_map[MAX_GL_FRAGMENT_SAMPLERS+WINED3D_MAX_VERTEX_SAMPLERS]
GLuint * free_timestamp_queries
unsigned int fbo_entry_count
unsigned int tex_unit_map[WINED3D_MAX_COMBINED_SAMPLERS]
uint32_t draw_buffers_mask
struct list pipeline_statistics_queries
unsigned int free_timestamp_query_count
unsigned int free_pipeline_statistics_query_count
struct wined3d_context_gl::@345 submitted
struct list so_statistics_queries
struct list fbo_destroy_list
uint32_t internal_format_set
const struct wined3d_gl_info * gl_info
struct wined3d_rendertarget_info blit_targets[WINED3D_MAX_RENDER_TARGETS]
uint32_t default_attrib_value_set
union wined3d_gl_so_statistics_query * free_so_statistics_queries
SIZE_T free_pipeline_statistics_query_size
struct list timestamp_queries
unsigned int sub_resource_idx
struct fragment_caps ffp_fragment_caps
uint32_t wined3d_creation_flags
uint64_t completed_fence_id
SIZE_T retired_block_count
struct wined3d_device_gl::wined3d_retired_block_gl * retired_blocks
uint64_t current_fence_id
struct wined3d_dummy_textures dummy_textures
SIZE_T retired_blocks_size
struct wined3d_allocator allocator
unsigned int group_count_y
unsigned int group_count_x
unsigned int group_count_z
struct wined3d_rendertarget_view * depth_stencil
struct wined3d_rendertarget_view * render_targets[WINED3D_MAX_RENDER_TARGETS]
union wined3d_gl_fence_object object
struct wined3d_context_gl * context_gl
wined3d_generic_attrib_func generic[WINED3D_FFP_EMIT_COUNT]
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
struct wined3d_ffp_attrib_ops ffp_attrib_ops
struct wined3d_gl_limits limits
unsigned int selected_gl_version
struct wined3d_fbo_ops fbo_ops
struct wined3d_context_gl * context_gl
union wined3d_gl_pipeline_statistics_query u
struct wined3d_context_gl * context_gl
struct wined3d_gl_view gl_view
unsigned int sub_resource_idx
struct wined3d_resource * resource
struct wined3d_rendertarget_view v
struct wined3d_gl_view gl_view
struct wined3d_resource * resource
const struct wined3d_format * format
unsigned int sub_resource_idx
enum wined3d_resource_type type
const struct wined3d_format * format
enum wined3d_shader_resource_type type
struct wined3d_bo_user bo_user
enum wined3d_shader_type type
struct wined3d_pixel_shader ps
struct wined3d_shader_reg_maps reg_maps
struct wined3d_context_gl * context_gl
union wined3d_gl_so_statistics_query u
struct wined3d_swapchain s
struct wined3d_texture ** back_buffers
struct wined3d_texture * front_buffer
const struct wined3d_renderbuffer_entry * current_renderbuffer
struct gl_texture texture_rgb texture_srgb
struct wined3d_swapchain * swapchain
struct wined3d_resource resource
struct wined3d_context_gl * context_gl
struct wined3d_bo_gl counter_bo
struct wined3d_unordered_access_view v
struct wined3d_bo_user bo_user
struct wined3d_gl_view gl_view
#define new(TYPE, numElems)
#define FIELD_OFFSET(t, f)
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
HDC WINAPI wglGetCurrentDC(void)
HGLRC WINAPI wglGetCurrentContext(void)
HGLRC WINAPI wglCreateContext(HDC hdc)
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
BOOL WINAPI wglShareLists(HGLRC hglrcSrc, HGLRC hglrcDst)
#define WGL_CONTEXT_MINOR_VERSION_ARB
#define GL_DEBUG_TYPE_PORTABILITY
#define GL_PRIMITIVE_RESTART_FIXED_INDEX
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR
#define GL_MAP_COHERENT_BIT
#define GL_MAP_PERSISTENT_BIT
#define GL_TEXTURE_TARGET
#define WGL_CONTEXT_MAJOR_VERSION_ARB
#define GL_DYNAMIC_STORAGE_BIT
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR
#define WGL_CONTEXT_DEBUG_BIT_ARB
#define WGL_TYPE_RGBA_ARB
#define WGL_CONTEXT_FLAGS_ARB
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
#define GL_DEBUG_TYPE_ERROR
#define GL_DEBUG_OUTPUT_SYNCHRONOUS
#define GL_FRAMEBUFFER_DEFAULT_HEIGHT
#define WGL_SWAP_COPY_ARB
#define GL_DISPATCH_INDIRECT_BUFFER
#define GL_FRAMEBUFFER_DEFAULT_LAYERS
#define GL_FRAMEBUFFER_DEFAULT_SAMPLES
#define GL_FRAMEBUFFER_DEFAULT_WIDTH
#define GL_NEGATIVE_ONE_TO_ONE
#define GL_DEBUG_TYPE_PERFORMANCE
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
ssize_t adapter_adjust_mapped_memory(struct wined3d_adapter *adapter, ssize_t size)
struct wined3d_context_gl * wined3d_swapchain_gl_get_context(struct wined3d_swapchain_gl *swapchain_gl)
#define WINED3D_MAX_COMBINED_SAMPLERS
@ WINED3D_RS_SRGBWRITEENABLE
@ WINED3D_RS_ALPHATESTENABLE
@ WINED3D_PT_LINESTRIP_ADJ
@ WINED3D_PT_TRIANGLELIST_ADJ
@ WINED3D_PT_LINELIST_ADJ
@ WINED3D_PT_TRIANGLESTRIP_ADJ
@ WINED3D_PT_TRIANGLESTRIP
@ WINED3D_PT_TRIANGLELIST
static int wined3d_bit_scan(unsigned int *x)
@ WINED3D_SWAP_EFFECT_COPY
@ WINED3D_SWAP_EFFECT_COPY_VSYNC
@ WINED3D_RTYPE_TEXTURE_2D
#define WINED3DTA_SELECTMASK
#define WINED3D_MAX_VIEWPORTS
#define WINED3D_MAX_RENDER_TARGETS
#define WINED3DSTREAMSOURCE_INSTANCEDATA
#define WINED3D_NO_PRIMITIVE_RESTART
#define WINED3D_MAX_FRAGMENT_SAMPLERS
wined3d_texture_filter_type
@ WINED3DFMT_R16G16_UNORM
@ WINED3DFMT_R10G10B10X2_UINT
@ WINED3DFMT_R32G32_FLOAT
@ WINED3DFMT_R16G16_SNORM
@ WINED3DFMT_B8G8R8A8_UNORM
@ WINED3DFMT_R16G16B16A16_SINT
@ WINED3DFMT_R32G32B32_FLOAT
@ WINED3DFMT_R16G16B16A16_FLOAT
@ WINED3DFMT_R8G8B8A8_UNORM
@ WINED3DFMT_R16G16B16A16_UNORM
@ WINED3DFMT_R16G16_FLOAT
@ WINED3DFMT_R8G8B8A8_UINT
@ WINED3DFMT_R10G10B10X2_SNORM
@ WINED3DFMT_R32G32B32A32_FLOAT
@ WINED3DFMT_R16G16B16A16_SNORM
@ WINED3D_PIPELINE_COMPUTE
@ WINED3D_PIPELINE_GRAPHICS
@ WINED3D_TOP_SELECT_ARG1
@ WINED3D_TOP_MULTIPLY_ADD
@ WINED3D_TOP_BUMPENVMAP_LUMINANCE
@ WINED3D_TOP_SELECT_ARG2
#define WINED3D_BIND_DEPTH_STENCIL
#define WINED3D_MAP_DISCARD
@ WINED3D_SHADER_TYPE_PIXEL
@ WINED3D_SHADER_TYPE_GEOMETRY
@ WINED3D_SHADER_TYPE_GRAPHICS_COUNT
@ WINED3D_SHADER_TYPE_COMPUTE
@ WINED3D_SHADER_TYPE_VERTEX
@ WINED3D_SHADER_TYPE_COUNT
#define WINED3D_MAP_NOOVERWRITE
#define WINED3D_HIGHEST_TEXTURE_STATE
#define WINED3D_MAX_FFP_TEXTURES
#define WINED3D_MAX_VERTEX_SAMPLERS
#define WINED3D_LEGACY_CUBEMAP_FILTERING
#define WINED3DTA_TEXTURE
#define WINED3D_FBO_ENTRY_FLAG_STENCIL
static GLenum wined3d_texture_gl_get_sub_resource_target(const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx)
@ ARB_TEXTURE_BUFFER_OBJECT
@ ARB_DRAW_ELEMENTS_BASE_VERTEX
@ APPLE_FLUSH_BUFFER_RANGE
@ WGL_WINE_PIXEL_FORMAT_PASSTHROUGH
@ EXT_TEXTURE_SRGB_DECODE
@ ARB_VERTEX_BUFFER_OBJECT
@ ARB_TEXTURE_MULTISAMPLE
@ ARB_FRAMEBUFFER_NO_ATTACHMENTS
@ WINED3D_GL_LEGACY_CONTEXT
@ ARB_TRANSFORM_FEEDBACK2
@ ARB_TEXTURE_CUBE_MAP_ARRAY
static GLenum wined3d_gl_mag_filter(enum wined3d_texture_filter_type mag_filter)
static void wined3d_allocator_chunk_gl_unlock(struct wined3d_allocator_chunk_gl *chunk_gl)
#define WINED3D_FBO_ENTRY_FLAG_DEPTH
static void wined3d_device_gl_allocator_lock(struct wined3d_device_gl *device_gl)
static void wined3d_context_gl_reference_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo_gl)
static void wined3d_device_gl_allocator_unlock(struct wined3d_device_gl *device_gl)
static GLuint wined3d_bo_gl_id(struct wined3d_bo *bo)
static void wined3d_allocator_chunk_gl_lock(struct wined3d_allocator_chunk_gl *chunk_gl)
static GLenum wined3d_gl_min_mip_filter(enum wined3d_texture_filter_type min_filter, enum wined3d_texture_filter_type mip_filter)
static GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl, const struct wined3d_context *context, bool srgb)
#define WINED3D_FBO_ENTRY_FLAG_ATTACHED
static void wined3d_context_gl_reference_buffer(struct wined3d_context_gl *context_gl, struct wined3d_buffer *buffer)
#define STATE_DEPTH_STENCIL
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
static bool wined3d_context_is_graphics_state_dirty(const struct wined3d_context *context, unsigned int state_id)
static bool isStateDirty(const struct wined3d_context *context, unsigned int state_id)
#define STATE_CONSTANT_BUFFER(a)
#define WINED3D_LOCATION_TEXTURE_SRGB
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
static void wined3d_device_bo_map_lock(struct wined3d_device *device)
static BOOL use_transform_feedback(const struct wined3d_state *state)
#define MAKEDWORD_VERSION(maj, min)
#define STATE_STREAM_OUTPUT
static BOOL use_vs(const struct wined3d_state *state)
static void wined3d_device_bo_map_unlock(struct wined3d_device *device)
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
static bool wined3d_state_uses_depth_buffer(const struct wined3d_state *state)
#define WINED3D_FORMAT_ATTR_INTEGER
#define MAX_PERSISTENT_MAPPED_BYTES
#define WINED3D_LOCATION_BUFFER
#define MAX_UNORDERED_ACCESS_VIEWS
#define WINED3D_LOCATION_RB_RESOLVED
static void context_release(struct wined3d_context *context)
#define WINED3D_SAMPLER_DEFAULT
static void wined3d_buffer_validate_user(struct wined3d_buffer *buffer)
static uint32_t wined3d_mask_from_size(unsigned int size)
#define WINED3D_ALLOCATOR_CHUNK_SIZE
#define STATE_SCISSORRECT
static BOOL is_rasterization_disabled(const struct wined3d_shader *geometry_shader)
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING
#define WINED3D_LOCATION_TEXTURE_RGB
#define STATE_COMPUTE_OFFSET
#define WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING
#define WINED3D_FORMAT_ATTR_NORMALISED
static BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info, const struct wined3d_state *state, const struct wined3d_fb_state *fb)
#define WINED3D_LOCATION_DRAWABLE
static BOOL use_ps(const struct wined3d_state *state)
static void wined3d_from_cs(const struct wined3d_cs *cs)
#define STATE_TEXTURESTAGE(stage, num)
#define WINED3D_RETIRED_BO_SIZE_THRESHOLD
#define STATE_INDEXBUFFER
#define WINED3D_LOCATION_RB_MULTISAMPLE
static struct wined3d_context * context_acquire(struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
static unsigned int wined3d_blend_state_get_writemask(const struct wined3d_blend_state *state, unsigned int index)
#define STATE_FRAMEBUFFER
#define WINED3D_UNMAPPED_STAGE
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
int WINAPI GetPixelFormat(_In_ HDC)
int WINAPI ChoosePixelFormat(_In_ HDC hdc, _In_ const PIXELFORMATDESCRIPTOR *ppfd)
BOOL WINAPI SetPixelFormat(_In_ HDC, _In_ int, _In_ const PIXELFORMATDESCRIPTOR *)
#define PFD_SUPPORT_OPENGL
#define PFD_DRAW_TO_WINDOW
static unsigned int block