28 #include "wine/port.h" 45 #define WINED3D_MAX_FBO_ENTRIES 64 46 #define WINED3D_ALL_LAYERS (~0u) 60 if (
context->fbo_read_binding == fbo)
return;
61 context->fbo_read_binding = fbo;
65 if (
context->fbo_draw_binding == fbo)
return;
66 context->fbo_draw_binding = fbo;
70 if (
context->fbo_read_binding == fbo
71 &&
context->fbo_draw_binding == fbo)
return;
72 context->fbo_read_binding = fbo;
73 context->fbo_draw_binding = fbo;
90 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
111 gl_info->
fbo_ops.glDeleteFramebuffers(1, &fbo);
142 if (!gl_info->
fbo_ops.glFramebufferTexture)
144 FIXME(
"OpenGL implementation doesn't support glFramebufferTexture().\n");
154 if (!gl_info->
fbo_ops.glFramebufferTextureLayer)
156 FIXME(
"OpenGL implementation doesn't support glFramebufferTextureLayer().\n");
209 TRACE(
"Attach depth stencil 0.\n");
266 const char *tex_type_str;
279 if (gl_info->
limits.samples > 1)
284 FIXME(
" %s: renderbuffer %d, %dx%d, %d samples, format %#x.\n",
294 if (gl_info->
gl_ops.ext.p_glGetTextureParameteriv)
300 if (texture_type[
i].
target == tex_target)
302 tex_type_str = texture_type[
i].str;
315 tex_type_str =
"cube";
323 if (!gl_info->
supported[texture_type[
i].extension])
326 gl_info->
gl_ops.gl.p_glGetIntegerv(texture_type[
i].binding, &old_texture);
327 while (gl_info->
gl_ops.gl.p_glGetError());
330 if (!gl_info->
gl_ops.gl.p_glGetError())
332 tex_target = texture_type[
i].target;
333 tex_type_str = texture_type[
i].str;
336 gl_info->
gl_ops.gl.p_glBindTexture(texture_type[
i].
target, old_texture);
341 FIXME(
"Cannot find type of texture %d.\n",
name);
346 if (gl_info->
gl_ops.ext.p_glGetTextureParameteriv)
363 gl_info->
gl_ops.gl.p_glBindTexture(tex_target, old_texture);
366 FIXME(
" %s: %s texture %d, %dx%d, %d samples, format %#x.\n",
393 TRACE(
"FBO complete.\n");
403 ERR(
"FBO 0 is incomplete, driver bug?\n");
410 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
444 key->objects[
idx].object = 0;
445 key->objects[
idx].target = 0;
450 if (render_target->
gl_view.name)
454 key->objects[
idx].level = 0;
460 if (
texture->current_renderbuffer)
462 key->objects[
idx].object =
texture->current_renderbuffer->id;
463 key->objects[
idx].target = 0;
465 key->rb_namespace |= 1 <<
idx;
470 key->objects[
idx].level = sub_resource_idx %
texture->level_count;
471 key->objects[
idx].layer = sub_resource_idx /
texture->level_count;
488 key->objects[
idx].target = 0;
490 key->rb_namespace |= 1 <<
idx;
495 key->objects[
idx].target = 0;
497 key->rb_namespace |= 1 <<
idx;
509 key->rb_namespace = 0;
585 struct wined3d_fbo_entry_key fbo_key;
586 unsigned int i, ds_level, rt_level;
602 WARN(
"Depth stencil is smaller than the primary color buffer, disabling.\n");
603 depth_stencil = &ds_null;
605 else if (ds_texture->
resource.multisample_type != rt_texture->
resource.multisample_type
606 || ds_texture->
resource.multisample_quality != rt_texture->
resource.multisample_quality)
608 WARN(
"Color multisample type %u and quality %u, depth stencil has %u and %u, disabling ds buffer.\n",
609 rt_texture->
resource.multisample_type, rt_texture->
resource.multisample_quality,
610 ds_texture->
resource.multisample_type, ds_texture->
resource.multisample_quality);
611 depth_stencil = &ds_null;
625 const char *resource_type;
627 TRACE(
"Dumping FBO attachments:\n");
628 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
636 resource_type =
"buffer";
644 resource_type =
"texture";
647 TRACE(
" Color attachment %u: %p, %u format %s, %s %u, %ux%u, %u samples.\n",
649 fbo_key.rb_namespace & (1 << (
i + 1)) ?
"renderbuffer" : resource_type,
659 resource_type =
"buffer";
667 resource_type =
"texture";
670 TRACE(
" Depth attachment: %p, %u format %s, %s %u, %ux%u, %u samples.\n",
672 fbo_key.rb_namespace & (1 << 0) ?
"renderbuffer" : resource_type,
679 if (
memcmp(&fbo_key, &
entry->key,
sizeof(fbo_key)))
708 GLuint read_binding, draw_binding;
717 read_binding =
context->fbo_read_binding;
718 draw_binding =
context->fbo_draw_binding;
732 for (
i = 0;
i < gl_info->
limits.buffers; ++
i)
735 entry->key.rb_namespace & (1 << (
i + 1)));
782 render_targets, depth_stencil, color_location, ds_location);
797 context->blit_targets[0].resource = rt;
798 context->blit_targets[0].sub_resource_idx = rt_sub_resource_idx;
799 context->blit_targets[0].layer_count = 1;
817 if (
context->free_occlusion_query_count)
832 WARN(
"Occlusion queries not supported, not allocating query id.\n");
849 &
context->free_occlusion_query_size,
context->free_occlusion_query_count + 1,
850 sizeof(*
context->free_occlusion_queries)))
852 ERR(
"Failed to grow free list, leaking query %u in context %p.\n",
query->id,
context);
874 TRACE(
"Allocated sync object in context %p.\n",
context);
892 WARN(
"Fences not supported, not allocating fence.\n");
910 sizeof(*
context->free_fences)))
912 ERR(
"Failed to grow free list, leaking fence %u in context %p.\n", fence->
object.
id,
context);
924 if (
context->free_timestamp_query_count)
948 &
context->free_timestamp_query_size,
context->free_timestamp_query_count + 1,
949 sizeof(*
context->free_timestamp_queries)))
951 ERR(
"Failed to grow free list, leaking query %u in context %p.\n",
query->id,
context);
963 if (
context->free_so_statistics_query_count)
972 TRACE(
"Allocated SO statistics queries %u, %u in context %p.\n",
988 &
context->free_so_statistics_query_size,
context->free_so_statistics_query_count + 1,
989 sizeof(*
context->free_so_statistics_queries)))
991 ERR(
"Failed to grow free list, leaking GL queries %u, %u in context %p.\n",
1004 if (
context->free_pipeline_statistics_query_count)
1006 query->u =
context->free_pipeline_statistics_queries[--
context->free_pipeline_statistics_query_count];
1026 &
context->free_pipeline_statistics_query_size,
context->free_pipeline_statistics_query_count + 1,
1027 sizeof(*
context->free_pipeline_statistics_queries)))
1029 ERR(
"Failed to grow free list, leaking GL queries in context %p.\n",
context);
1033 context->free_pipeline_statistics_queries[
context->free_pipeline_statistics_query_count++] =
query->u;
1043 for (
i = 0;
i <
device->context_count; ++
i)
1051 for (
j = 0;
j < gl_info->
limits.buffers + 1; ++
j)
1054 && !(
entry->key.rb_namespace & (1 <<
j)) == !rb_namespace)
1074 if (!
device->d3d_initialized)
1077 for (
i = 0;
i <
device->context_count; ++
i)
1084 context->current_rt.sub_resource_idx = 0;
1103 for (
i = 0;
i < gl_info->
limits.buffers + 1; ++
i)
1105 if (
texture->texture_rgb.name ==
entry->key.objects[
i].object
1106 ||
texture->texture_srgb.name ==
entry->key.objects[
i].object)
1108 TRACE(
"Updated texture %p is bound as attachment %u to the current FBO.\n",
texture,
i);
1129 ERR(
"wglSetPixelFormatWINE failed to restore pixel format %d on window %p.\n",
1154 if (
private &&
context->hdc_has_format)
1168 WARN(
"Failed to set pixel format %d on device context %p, last error %#x.\n",
1188 ERR(
"wglSetPixelFormatWINE failed to set pixel format %d on device context %p.\n",
1209 ERR(
"Unable to set pixel format %d on device context %p. Already using format %d.\n",
1226 WARN(
"Failed to set pixel format %d on device context %p.\n",
1233 WARN(
"Failed to make GL context %p current on device context %p, last error %#x.\n",
1236 WARN(
"Trying fallback to the backup window.\n");
1244 FIXME(
"Unable to get backup dc for destroyed context %p.\n", ctx);
1260 ERR(
"Failed to set pixel format %d on device context %p.\n",
1268 ERR(
"Fallback to backup window (dc %p) failed too, last error %#x.\n",
1284 ERR(
"Failed to restore GL context %p on device context %p, last error %#x.\n",
1298 TRACE(
"Updating context %p window from %p to %p.\n",
1312 ERR(
"Failed to get a device context for window %p.\n",
context->win_handle);
1333 if (restore_ctx ==
context->glCtx)
1403 if (
context->dummy_arbfp_prog)
1410 for (
i = 0;
i <
context->free_so_statistics_query_count; ++
i)
1419 for (
i = 0;
i <
context->free_pipeline_statistics_query_count; ++
i)
1434 for (
i = 0;
i <
context->free_fence_count; ++
i)
1441 for (
i = 0;
i <
context->free_fence_count; ++
i)
1448 for (
i = 0;
i <
context->free_fence_count; ++
i)
1473 ERR(
"Failed to disable GL context.\n");
1481 ERR(
"wglDeleteContext(%p) failed, last error %#x.\n",
context->glCtx,
err);
1506 TRACE(
"Already using D3D context %p.\n", ctx);
1514 TRACE(
"Switching away from destroyed context %p.\n", old);
1524 TRACE(
"Flushing context %p before switching to %p.\n", old, ctx);
1525 gl_info->
gl_ops.gl.p_glFlush();
1535 ERR(
"Trying to make invalid context %p current\n", ctx);
1539 TRACE(
"Switching to D3D context %p, GL context %p, device context %p.\n", ctx, ctx->
glCtx, ctx->
hdc);
1546 TRACE(
"Clearing current D3D context.\n");
1550 ERR(
"Failed to clear current GL context, last error %#x.\n",
err);
1568 WARN(
"Context %p is not the current context.\n",
context);
1577 TRACE(
"Restoring GL context %p on device context %p.\n",
context->restore_ctx,
context->restore_dc);
1596 if (
context->current_rt.texture !=
texture ||
context->current_rt.sub_resource_idx != sub_resource_idx)
1614 if (current_gl && (!current_context || current_context->
glCtx != current_gl))
1616 TRACE(
"Another GL context (%p on device context %p) is already current.\n",
1618 context->restore_ctx = current_gl;
1657 unsigned int cfg_count =
device->adapter->cfg_count;
1658 unsigned int current_value;
1663 TRACE(
"device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x.\n",
1668 for (
i = 0;
i < cfg_count; ++
i)
1713 if (
value > current_value)
1716 current_value =
value;
1722 ERR(
"Trying to locate a compatible pixel format because an exact match failed.\n");
1739 ERR(
"Can't find a suitable pixel format.\n");
1744 TRACE(
"Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s.\n",
1756 for (
i = 0;
i < gl_info->
limits.combined_samplers; ++
i)
1807 ERR(
">>>>>>> %s (%#x) from %s @ %s / %u.\n",
1809 err = gl_info->
gl_ops.gl.p_glGetError();
1847 unsigned int ctx_attrib_idx = 0;
1848 GLint ctx_attribs[7], ctx_flags = 0;
1859 ctx_attribs[ctx_attrib_idx++] = ctx_flags;
1861 ctx_attribs[ctx_attrib_idx] = 0;
1863 if (!(ctx = gl_info->p_wglCreateContextAttribsARB(
hdc, share_ctx, ctx_attribs)))
1870 ctx_attribs[ctx_attrib_idx - 1] = ctx_flags;
1876 ctx_attribs[ctx_attrib_idx++] = ctx_flags;
1877 ctx_attribs[ctx_attrib_idx] = 0;
1879 if (!(ctx = gl_info->p_wglCreateContextAttribsARB(
hdc, share_ctx, ctx_attribs)))
1880 WARN(
"Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n",
1896 HGLRC ctx, share_ctx;
1905 if (!(
ret = heap_alloc_zero(
sizeof(*
ret))))
1908 ret->free_timestamp_query_size = 4;
1910 sizeof(*
ret->free_timestamp_queries))))
1914 ret->free_occlusion_query_size = 4;
1916 sizeof(*
ret->free_occlusion_queries))))
1920 ret->free_fence_size = 4;
1932 if (!
device->shader_backend->shader_allocate_context_data(
ret))
1934 ERR(
"Failed to allocate shader backend context data.\n");
1937 if (!
device->adapter->fragment_pipe->allocate_context_data(
ret))
1939 ERR(
"Failed to allocate fragment pipeline context data.\n");
1955 ERR(
"Unexpected texture unit base index %u.\n",
base);
1967 ERR(
"Unexpected texture unit base index %u.\n",
base);
1978 sizeof(*
ret->texture_type))))
1983 WARN(
"Failed to retrieve device context, trying swapchain backup.\n");
1989 ERR(
"Failed to retrieve a device context.\n");
1994 color_format =
target->resource.format;
1995 target_usage =
target->resource.usage;
2043 ERR(
"Failed to set pixel format %d on device context %p.\n",
ret->pixel_format,
ret->hdc);
2049 if (
gl_info->p_wglCreateContextAttribsARB)
2058 ERR(
"Failed to create a WGL context.\n");
2065 ERR(
"wglShareLists(%p, %p) failed, last error %#x.\n", share_ctx, ctx,
GetLastError());
2068 ERR(
"wglDeleteContext(%p) failed, last error %#x.\n", ctx,
GetLastError());
2075 ERR(
"Failed to add the newly created context to the context list\n");
2078 ERR(
"wglDeleteContext(%p) failed, last error %#x.\n", ctx,
GetLastError());
2096 ret->current_rt.sub_resource_idx = 0;
2110 ERR(
"Cannot activate context to set up defaults.\n");
2114 ERR(
"wglDeleteContext(%p) failed, last error %#x.\n", ctx,
GetLastError());
2148 TRACE(
"Setting up the screen\n");
2153 checkGLcall(
"glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);");
2156 checkGLcall(
"glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);");
2159 checkGLcall(
"glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);");
2171 checkGLcall(
"glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);");
2173 checkGLcall(
"glPixelStorei(GL_UNPACK_ALIGNMENT, 1);");
2180 for (
i = 1;
i <
gl_info->limits.textures; ++
i)
2185 checkGLcall(
"glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, ...");
2199 static const char dummy_program[] =
2201 "MOV result.color, fragment.color.primary;\n" 2210 for (
i = 0;
i <
gl_info->limits.textures; ++
i)
2214 checkGLcall(
"glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)");
2231 checkGLcall(
"enable GL_PRIMITIVE_RESTART_FIXED_INDEX");
2235 FIXME(
"OpenGL implementation does not support GL_PRIMITIVE_RESTART_FIXED_INDEX.\n");
2242 checkGLcall(
"enable seamless cube map filtering");
2246 device->shader_backend->shader_init_context_state(
ret);
2257 if (
device->dummy_textures.tex_2d)
2261 gl_info->gl_ops.gl.p_glScissor(0, 0, 0, 0);
2264 TRACE(
"Created context %p.\n",
ret);
2271 device->shader_backend->shader_free_context_data(
ret);
2272 device->adapter->fragment_pipe->free_context_data(
ret);
2293 TRACE(
"Delaying destruction of context %p.\n",
context);
2330 if (!shader_version)
2337 if (shader_version->
major >= 4)
2343 switch (shader_version->
type)
2354 ERR(
"Unhandled shader type %#x.\n", shader_version->
type);
2386 unsigned int clip_distance_count = gl_info->
limits.user_clip_distances;
2387 unsigned int i, disable_mask, current_mask;
2389 disable_mask = ~enable_mask;
2390 enable_mask &= (1
u << clip_distance_count) - 1;
2391 disable_mask &= (1
u << clip_distance_count) - 1;
2392 current_mask =
context->clip_distance_mask;
2393 context->clip_distance_mask = enable_mask;
2395 enable_mask &= ~current_mask;
2401 disable_mask &= current_mask;
2402 while (disable_mask)
2412 return rt_mask & (1
u << 31);
2417 return rt_mask & ~(1
u << 31);
2457 gl_info->
gl_ops.gl.p_glDrawBuffer(draw_buffers[0]);
2462 ERR(
"Unexpected draw buffers mask with backbuffer ORM.\n");
2476 if (new_mask == *current_mask)
2482 *current_mask = new_mask;
2519 if (old_texture_type !=
target)
2521 switch (old_texture_type)
2560 ERR(
"Unexpected texture target %#x.\n", old_texture_type);
2575 if (!
data->buffer_object)
2603 if (!
data->buffer_object)
2618 BYTE *dst_ptr, *src_ptr;
2622 if (
dst->buffer_object &&
src->buffer_object)
2643 else if (!
dst->buffer_object &&
src->buffer_object)
2649 else if (
dst->buffer_object && !
src->buffer_object)
2663 if (
context->render_offscreen == offscreen)
2677 context->render_offscreen = offscreen;
2683 if (existing == required)
2704 if (
context->render_offscreen || !depth_stencil)
return;
2710 WARN(
"Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
2715 ERR(
"Failed to load location.\n");
2752 DWORD rt_mask, *cur_mask;
2756 TRACE(
"Setting up context %p for blitting.\n",
context);
2760 if (
context->render_offscreen)
2785 if (rt_mask != *cur_mask)
2788 *cur_mask = rt_mask;
2803 gl_info->
gl_ops.gl.p_glViewport(0, 0, rt_size.
cx, rt_size.
cy);
2812 TRACE(
"Context is already set up for blitting, nothing to do.\n");
2870 gl_info->
gl_ops.gl.p_glViewport(0, 0, rt_size.
cx, rt_size.
cy);
2887 2.0 /
w, 0.0, 0.0, 0.0,
2888 0.0, 2.0 /
h, 0.0, 0.0,
2890 -1.0, -1.0, -1.0, 1.0,
2894 gl_info->
gl_ops.gl.p_glLoadMatrixd(projection);
2905 ERR(
"Applying fixed-function state without legacy context support.\n");
2907 if (
context->last_was_ffp_blit)
2925 for (
i = gl_info->
limits.textures - 1;
i > 0 ; --
i)
2961 gl_info->
gl_ops.gl.p_glLoadIdentity();
2965 gl_info->
gl_ops.gl.p_glLoadIdentity();
2992 for (
i = 0;
i < rt_count; ++
i)
3008 DWORD rt_mask = 0, *cur_mask;
3012 || rt_count != gl_info->
limits.buffers)
3016 WARN(
"Invalid render target config, need at least one attachment.\n");
3029 for (
i = 0;
i < rt_count; ++
i)
3039 rt_mask |= (1
u <<
i);
3051 rt_count ? rts[0]->
resource->draw_binding : 0,
3052 dsv ? dsv->
resource->draw_binding : 0);
3074 for (
i = 0;
i < rt_count; ++
i)
3077 rt_mask |= (1
u <<
i);
3087 if (rt_mask != *cur_mask)
3090 *cur_mask = rt_mask;
3133 else if (!
context->render_offscreen)
3141 rt_mask =
ps ?
ps->reg_maps.rt_mask : 1;
3143 rt_mask &=
context->d3d_info->valid_dual_rt_mask;
3145 rt_mask &=
context->d3d_info->valid_rt_mask;
3153 rt_mask &= ~(1
u <<
i);
3164 DWORD color_location = 0;
3171 if (!
context->render_offscreen)
3181 for (
i = 0;
i <
context->gl_info->limits.buffers; ++
i)
3191 if (!color_location)
3209 if (rt_mask != *cur_mask)
3212 *cur_mask = rt_mask;
3222 TRACE(
"Mapping stage %u to unit %u.\n", stage,
unit);
3245 context->fixed_function_usage_map = 0;
3269 context->fixed_function_usage_map |= (1
u <<
i);
3273 context->fixed_function_usage_map |= (1
u << (
i + 1));
3276 if (i < context->lowest_disabled_stage)
3287 context->lowest_disabled_stage =
i;
3298 unsigned int i, tex;
3301 ffu_map =
context->fixed_function_usage_map;
3303 if (d3d_info->
limits.ffp_textures == d3d_info->
limits.ffp_blend_stages
3304 ||
context->lowest_disabled_stage <= d3d_info->
limits.ffp_textures)
3306 for (
i = 0; ffu_map; ffu_map >>= 1, ++
i)
3323 for (
i = 0; ffu_map; ffu_map >>= 1, ++
i)
3328 if (
context->tex_unit_map[
i] != tex)
3352 if (i < d3d_info->limits.ffp_blend_stages)
3371 if (!ps_resource_info)
3374 return current_mapping >=
MAX_TEXTURES || !(
context->fixed_function_usage_map & (1
u << current_mapping));
3378 return !ps_resource_info[current_mapping].
type;
3402 if (vs_resource_info[
i].
type)
3421 WARN(
"Couldn't find a free texture unit for vertex sampler %u.\n",
i);
3455 DWORD rt_mask, *cur_mask;
3461 if (rt_mask != *cur_mask)
3464 *cur_mask = rt_mask;
3536 stride_used =
FALSE;
3554 if (!generic_attributes && !
element->ffp_valid)
3556 WARN(
"Skipping unsupported fixed function element of format %s and usage %s.\n",
3558 stride_used =
FALSE;
3568 TRACE(
"Load %s array %u [usage %s, usage_idx %u, " 3569 "input_slot %u, offset %u, stride %u, format %s, class %s, step_rate %u].\n",
3570 use_vshader ?
"shader":
"fixed function",
idx,
3587 if (!
element->instance_data_step_rate)
3588 FIXME(
"Instance step rate 0 not implemented.\n");
3618 context->buffer_fence_count = 0;
3639 if (
state->load_base_vertex_index < 0)
3641 WARN_(d3d_perf)(
"load_base_vertex_index is < 0 (%d), not using VBOs.\n",
3642 state->load_base_vertex_index);
3643 element->data.buffer_object = 0;
3646 FIXME(
"System memory vertex data load offset is negative!\n");
3656 if (!
element->data.buffer_object)
3675 if (
state->vertex_declaration->half_float_conv_needed)
3677 TRACE(
"Using immediate mode draw with vertex shaders for FLOAT16 conversion.\n");
3731 for (
i = 0; ffu_map; ffu_map >>= 1, ++
i)
3740 unsigned int shader_mask)
3749 if (!(shader_mask & (1
u <<
i)))
3761 for (
j = 0;
j <
shader->reg_maps.sampler_map.count; ++
j)
3779 unsigned int bind_idx, shader_sampler_count,
base,
count,
i;
3785 const DWORD *tex_unit_map;
3793 shader_sampler_count =
shader->reg_maps.sampler_map.count;
3794 if (shader_sampler_count >
count)
3795 FIXME(
"Shader %p needs %u samplers, but only %u are supported.\n",
3804 bind_idx = tex_unit_map[bind_idx];
3835 if (!(
view = views[
i]))
3869 if (!(
view = views[
i]))
3871 if (
shader->reg_maps.uav_resource_info[
i].type)
3872 WARN(
"No unordered access view bound at index %u.\n",
i);
3877 if (
view->gl_view.name)
3879 texture_name =
view->gl_view.name;
3890 FIXME(
"Unsupported buffer unordered access view.\n");
3896 view->format->glInternal));
3898 if (
view->counter_bo)
3934 FIXME(
"OpenGL implementation does not support framebuffers with no attachments.\n");
3976 if (
state->index_buffer)
3978 if (
context->stream_info.all_vbo)
3984 for (
i = 0;
i <
context->numDirtyEntries; ++
i)
3999 if (
context->constant_update_mask)
4002 context->constant_update_mask = 0;
4005 if (
context->update_shader_resource_bindings)
4009 context->update_shader_resource_bindings = 0;
4010 if (gl_info->
limits.combined_samplers == gl_info->
limits.graphics_samplers)
4011 context->update_compute_shader_resource_bindings = 1;
4014 if (
context->update_unordered_access_view_bindings)
4019 context->update_unordered_access_view_bindings = 0;
4020 context->update_compute_unordered_access_view_bindings = 1;
4040 unsigned int state_id,
i;
4048 unsigned int dirty_mask =
context->dirty_compute_states[
i];
4064 if (
context->update_compute_shader_resource_bindings)
4067 context->update_compute_shader_resource_bindings = 0;
4068 if (gl_info->
limits.combined_samplers == gl_info->
limits.graphics_samplers)
4069 context->update_shader_resource_bindings = 1;
4072 if (
context->update_compute_unordered_access_view_bindings)
4077 context->update_compute_unordered_access_view_bindings = 0;
4078 context->update_unordered_access_view_bindings = 1;
4100 return shader->u.gs.so_desc.element_count;
4106 if (
context->transform_feedback_active)
4110 context->transform_feedback_active = 0;
4111 context->transform_feedback_paused = 0;
4119 if (!
context->transform_feedback_active ||
context->transform_feedback_paused)
4126 context->transform_feedback_paused = 1;