On 4 December 2017 at 20:37, Matteo Bruni mbruni@codeweavers.com wrote:
+void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view) +{
- struct wined3d_texture *texture = texture_from_resource(view->resource);
- unsigned int i, j, layer_count, level_count, base_level, max_level;
- const struct wined3d_gl_info *gl_info;
- struct wined3d_context *context;
- struct gl_texture *gl_tex;
- DWORD location;
- BOOL srgb;
- TRACE("view %p.\n", view);
- wined3d_from_cs(view->resource->device->cs);
- context = context_acquire(view->resource->device, NULL, 0);
- gl_info = context->gl_info;
- layer_count = view->desc.u.texture.layer_count;
- level_count = view->desc.u.texture.level_count;
- base_level = view->desc.u.texture.level_idx;
- max_level = base_level + level_count - 1;
- srgb = !!(texture->flags & WINED3D_TEXTURE_IS_SRGB);
The "!!" should be superfluous, strictly speaking.
- if (srgb)
texture->texture_srgb.base_level = base_level;
- else
texture->texture_rgb.base_level = base_level;
I.e., "gl_tex->base_level = base_level;"