/* Do not call while under the GL lock. */ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB srgb) { struct wined3d_device *device = texture->resource.device; struct wined3d_context *context = NULL; BOOL srgb_was_toggled = FALSE; unsigned int i; TRACE("texture %p, srgb %#x.\n", texture, srgb); if (!device->isInDraw) context = context_acquire(device, NULL); else if (texture->bind_count > 0) { BOOL texture_srgb = texture->flags & WINED3D_TEXTURE_IS_SRGB; BOOL sampler_srgb = texture_srgb_mode(texture, srgb); srgb_was_toggled = !texture_srgb != !sampler_srgb; if (srgb_was_toggled) { if (sampler_srgb) texture->flags |= WINED3D_TEXTURE_IS_SRGB; else texture->flags &= ~WINED3D_TEXTURE_IS_SRGB; } } /* If the texture is marked dirty or the sRGB sampler setting has changed * since the last load then reload the volumes. */ if (texture->texture_rgb.dirty) { for (i = 0; i < texture->level_count; ++i) { volume_load(volume_from_resource(texture->sub_resources[i]), i, texture->flags & WINED3D_TEXTURE_IS_SRGB); } } else if (srgb_was_toggled) { for (i = 0; i < texture->level_count; ++i) { struct wined3d_volume *volume = volume_from_resource(texture->sub_resources[i]); volume_add_dirty_box(volume, NULL); volume_load(volume, i, texture->flags & WINED3D_TEXTURE_IS_SRGB); } } else { TRACE("Texture %p not dirty, nothing to do.\n", texture); } if (context) context_release(context); /* No longer dirty */ texture->texture_rgb.dirty = FALSE; }
int main(int argc, char **argv) { int32_t ch, index, excl_index; const char *name; bool load_default, exclusive; load_default = true; exclusive = false; index = 0; while (1) { if ((ch = getopt_long_only(argc, argv, "", opt_field, &index)) < 0) break; switch (ch) { case OPT_LOG: log_load(optarg); break; case OPT_CONFIG: config_load(optarg); load_default = false; break; case OPT_EXCL: if (exclusive) error("Cannot use --%s with --%s", opt_field[index].name, opt_field[excl_index].name); exclusive = true; excl_index = index; case OPT_NRML: name = opt_field[index].name; if (opt_field[index].has_arg) config_set(name, optarg); else config_set(name, "true"); break; case OPT_VERSION: version(); return 1; case OPT_HELP: default: usage(); return 1; } } if (load_default) config_default(); mt_init(); store_load(); bucket_load(); crypt_load(); volume_load(); return 0; }
/* Do not call while under the GL lock. */ static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB srgb) { IWineD3DDeviceImpl *device = texture->resource.device; struct wined3d_context *context = NULL; BOOL srgb_mode = texture->baseTexture.is_srgb; BOOL srgb_was_toggled = FALSE; unsigned int i; TRACE("texture %p, srgb %#x.\n", texture, srgb); if (!device->isInDraw) context = context_acquire(device, NULL); else if (texture->baseTexture.bindCount > 0) { srgb_mode = device->stateBlock->state.sampler_states[texture->baseTexture.sampler][WINED3DSAMP_SRGBTEXTURE]; srgb_was_toggled = texture->baseTexture.is_srgb != srgb_mode; texture->baseTexture.is_srgb = srgb_mode; } /* If the texture is marked dirty or the srgb sampler setting has changed * since the last load then reload the volumes. */ if (texture->baseTexture.texture_rgb.dirty) { for (i = 0; i < texture->baseTexture.level_count; ++i) { volume_load(volume_from_resource(texture->baseTexture.sub_resources[i]), i, srgb_mode); } } else if (srgb_was_toggled) { for (i = 0; i < texture->baseTexture.level_count; ++i) { IWineD3DVolumeImpl *volume = volume_from_resource(texture->baseTexture.sub_resources[i]); volume_add_dirty_box(volume, NULL); volume_load(volume, i, srgb_mode); } } else { TRACE("Texture %p not dirty, nothing to do.\n", texture); } if (context) context_release(context); /* No longer dirty */ texture->baseTexture.texture_rgb.dirty = FALSE; }
static Eina_Bool volume_timer(void *data) { char buf[4096]; volume_load(); volumes_load_timer = NULL; if (volumes_file_mon) ecore_file_monitor_del(volumes_file_mon); snprintf(buf, sizeof(buf), "%s/volumes", config); volumes_file_mon = ecore_file_monitor_add(buf, volume_file_change, NULL); return EINA_FALSE; }