void NINE_WINAPI NineBaseTexture9_GenerateMipSubLevels( struct NineBaseTexture9 *This ) { unsigned base_level = 0; unsigned last_level = This->base.info.last_level - This->managed.lod; unsigned first_layer = 0; unsigned last_layer; unsigned filter = This->mipfilter == D3DTEXF_POINT ? PIPE_TEX_FILTER_NEAREST : PIPE_TEX_FILTER_LINEAR; DBG("This=%p\n", This); if (This->base.pool == D3DPOOL_MANAGED) NineBaseTexture9_UploadSelf(This); if (!This->dirty_mip) return; if (This->managed.lod) { ERR("AUTOGENMIPMAP if level 0 is not resident not supported yet !\n"); return; } if (!This->view[0]) NineBaseTexture9_UpdateSamplerView(This, 0); last_layer = util_max_layer(This->view[0]->texture, base_level); nine_context_gen_mipmap(This->base.base.device, (struct NineUnknown *)This, This->base.resource, base_level, last_level, first_layer, last_layer, filter); This->dirty_mip = FALSE; }
void WINAPI NineBaseTexture9_GenerateMipSubLevels( struct NineBaseTexture9 *This ) { struct pipe_resource *resource = This->base.resource; unsigned base_level = 0; unsigned last_level = This->base.info.last_level - This->lod; unsigned first_layer = 0; unsigned last_layer; unsigned filter = This->mipfilter == D3DTEXF_POINT ? PIPE_TEX_FILTER_NEAREST : PIPE_TEX_FILTER_LINEAR; DBG("This=%p\n", This); if (This->base.pool == D3DPOOL_MANAGED) NineBaseTexture9_UploadSelf(This); if (!This->dirty_mip) return; if (This->lod) { ERR("AUTOGENMIPMAP if level 0 is not resident not supported yet !\n"); return; } if (!This->view[0]) NineBaseTexture9_UpdateSamplerView(This, 0); last_layer = util_max_layer(This->view[0]->texture, base_level); util_gen_mipmap(This->pipe, resource, resource->format, base_level, last_level, first_layer, last_layer, filter); This->dirty_mip = FALSE; NineDevice9_RestoreNonCSOState(This->base.base.device, ~0x3); }
void NINE_WINAPI NineBaseTexture9_PreLoad( struct NineBaseTexture9 *This ) { DBG("This=%p\n", This); if (This->base.pool == D3DPOOL_MANAGED) NineBaseTexture9_UploadSelf(This); }