Changeset 42408 in vbox for trunk/src/VBox
- Timestamp:
- Jul 26, 2012 12:28:23 PM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/Makefile.kmk
r42309 r42408 223 223 VBOX_WITH_WDDM \ 224 224 VBOX_WINE_WITH_SINGLE_CONTEXT \ 225 IN_VBOXLIBWINE 225 IN_VBOXLIBWINE \ 226 VBOX_WINE_WITH_SHADER_CACHE 226 227 wined3dwddm_INCS = $(wined3d_INCS) \ 227 228 $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r42285 r42408 637 637 This->haveHardwareCursor = FALSE; 638 638 639 #ifdef VBOX_WINE_WITH_SHADER_CACHE 640 shader_chaches_term(This); 641 #endif 642 639 643 IWineD3D_Release(This->wined3d); 640 644 This->wined3d = NULL; … … 1329 1333 } 1330 1334 1335 #ifdef VBOX_WINE_WITH_SHADER_CACHE 1336 object = vertexshader_check_cached(This, object); 1337 #endif 1338 1331 1339 TRACE("Created vertex shader %p.\n", object); 1332 1340 *ppVertexShader = (IWineD3DVertexShader *)object; … … 1388 1396 return hr; 1389 1397 } 1398 1399 #ifdef VBOX_WINE_WITH_SHADER_CACHE 1400 object = pixelshader_check_cached(This, object); 1401 #endif 1390 1402 1391 1403 TRACE("Created pixel shader %p.\n", object); … … 7326 7338 device->blitter = adapter->blitter; 7327 7339 7340 #ifdef VBOX_WINE_WITH_SHADER_CACHE 7341 shader_chaches_init(device); 7342 #endif 7343 7328 7344 return WINED3D_OK; 7329 7345 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/shader.c
r37550 r42408 1572 1572 } 1573 1573 1574 #ifdef VBOX_WINE_WITH_SHADER_CACHE 1575 static void shader_chache_put(PVBOXEXT_HASHCACHE pCache, IWineD3DBaseShaderImpl *pShader); 1576 #endif 1577 1574 1578 static ULONG STDMETHODCALLTYPE vertexshader_Release(IWineD3DVertexShader *iface) 1575 1579 { … … 1581 1585 if (!refcount) 1582 1586 { 1587 #ifdef VBOX_WINE_WITH_SHADER_CACHE 1588 shader_chache_put(&((IWineD3DDeviceImpl*)shader->baseShader.device)->vshaderCache, (IWineD3DBaseShaderImpl*)shader); 1589 #else 1583 1590 shader_cleanup((IWineD3DBaseShader *)iface); 1584 1591 shader->baseShader.parent_ops->wined3d_object_destroyed(shader->baseShader.parent); 1585 1592 HeapFree(GetProcessHeap(), 0, shader); 1593 #endif 1586 1594 } 1587 1595 … … 1975 1983 if (!refcount) 1976 1984 { 1985 #ifdef VBOX_WINE_WITH_SHADER_CACHE 1986 shader_chache_put(&((IWineD3DDeviceImpl*)shader->baseShader.device)->pshaderCache, (IWineD3DBaseShaderImpl*)shader); 1987 #else 1977 1988 shader_cleanup((IWineD3DBaseShader *)iface); 1978 1989 shader->baseShader.parent_ops->wined3d_object_destroyed(shader->baseShader.parent); 1979 1990 HeapFree(GetProcessHeap(), 0, shader); 1991 #endif 1980 1992 } 1981 1993 … … 2311 2323 } 2312 2324 } 2325 2326 #ifdef VBOX_WINE_WITH_SHADER_CACHE 2327 2328 static void shader_reinit(struct IWineD3DBaseShaderClass *shader, IWineD3DDeviceImpl *device, 2329 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 2330 { 2331 shader->ref = 1; 2332 shader->device = (IWineD3DDevice *)device; 2333 shader->parent = parent; 2334 shader->parent_ops = parent_ops; 2335 list_add_head(&device->shaders, &shader->shader_list_entry); 2336 } 2337 2338 static DECLCALLBACK(uint32_t) shader_cache_hash(void *pvKey) 2339 { 2340 uint32_t u32Hash, i; 2341 DWORD *function; 2342 IWineD3DBaseShaderImpl *pShader = (IWineD3DBaseShaderImpl *)pvKey; 2343 if (pShader->baseShader.u32CacheDataInited) 2344 return pShader->baseShader.u32Hash; 2345 2346 u32Hash = pShader->baseShader.functionLength; 2347 function = pShader->baseShader.function; 2348 for (i = 0; i < pShader->baseShader.functionLength / 4; ++i) 2349 { 2350 u32Hash += *function++; 2351 } 2352 2353 for (i = 0; i < pShader->baseShader.functionLength % 4; ++i) 2354 { 2355 u32Hash += *((uint8_t*)function)++; 2356 } 2357 2358 pShader->baseShader.u32Hash = u32Hash; 2359 pShader->baseShader.u32CacheDataInited = TRUE; 2360 return pShader->baseShader.u32Hash; 2361 } 2362 2363 static DECLCALLBACK(bool) shader_cache_equal(void *pvKey1, void *pvKey2) 2364 { 2365 IWineD3DBaseShaderImpl *pShader1 = (IWineD3DBaseShaderImpl *)pvKey1; 2366 IWineD3DBaseShaderImpl *pShader2 = (IWineD3DBaseShaderImpl *)pvKey2; 2367 2368 if (pShader1 == pShader2) 2369 return TRUE; 2370 2371 if (pShader1->baseShader.functionLength != pShader2->baseShader.functionLength) 2372 return FALSE; 2373 2374 if (shader_cache_hash(pvKey1) != shader_cache_hash(pvKey2)) 2375 { 2376 #ifdef DEBUG_misha 2377 Assert(memcmp(pShader1->baseShader.function, pShader2->baseShader.function, pShader1->baseShader.functionLength)); 2378 #endif 2379 return FALSE; 2380 } 2381 2382 return !memcmp(pShader1->baseShader.function, pShader2->baseShader.function, pShader1->baseShader.functionLength); 2383 } 2384 2385 #define VBOX_SHADER_FROM_CACHE_ENTRY(_pEntry) RT_FROM_MEMBER(RT_FROM_MEMBER((_pEntry), IWineD3DBaseShaderClass, CacheEntry), IWineD3DBaseShaderImpl, baseShader) 2386 2387 static DECLCALLBACK(void) shader_cache_cleanup_entry(void *pvKey, struct VBOXEXT_HASHCACHE_ENTRY *pEntry) 2388 { 2389 IWineD3DBaseShaderImpl *pShader = VBOX_SHADER_FROM_CACHE_ENTRY(pEntry); 2390 shader_cleanup((IWineD3DBaseShader *)pShader); 2391 if (pShader->baseShader.parent) 2392 pShader->baseShader.parent_ops->wined3d_object_destroyed(pShader->baseShader.parent); 2393 HeapFree(GetProcessHeap(), 0, pShader); 2394 } 2395 2396 static void shader_chache_init(PVBOXEXT_HASHCACHE pCache) 2397 { 2398 VBoxExtCacheInit(pCache, 1024, shader_cache_hash, shader_cache_equal, shader_cache_cleanup_entry); 2399 } 2400 2401 static void shader_chache_term(PVBOXEXT_HASHCACHE pCache) 2402 { 2403 VBoxExtCacheTerm(pCache); 2404 } 2405 2406 static void shader_chache_put(PVBOXEXT_HASHCACHE pCache, IWineD3DBaseShaderImpl *pShader) 2407 { 2408 if (pShader->baseShader.parent) 2409 { 2410 pShader->baseShader.parent_ops->wined3d_object_destroyed(pShader->baseShader.parent); 2411 pShader->baseShader.parent = NULL; 2412 } 2413 2414 VBoxExtCachePut(pCache, pShader, &pShader->baseShader.CacheEntry); 2415 } 2416 2417 static IWineD3DBaseShaderImpl* shader_chache_get(PVBOXEXT_HASHCACHE pCache, IWineD3DBaseShaderImpl *pShader) 2418 { 2419 PVBOXEXT_HASHCACHE_ENTRY pEntry = VBoxExtCacheGet(pCache, pShader); 2420 IWineD3DBaseShaderImpl *pCachedShader; 2421 2422 if (!pEntry) 2423 return pShader; 2424 2425 Assert(0); 2426 2427 pCachedShader = VBOX_SHADER_FROM_CACHE_ENTRY(pEntry); 2428 shader_reinit(&pCachedShader->baseShader, (IWineD3DDeviceImpl *)pShader->baseShader.device, 2429 pShader->baseShader.parent, pShader->baseShader.parent_ops); 2430 pShader->baseShader.parent = NULL; 2431 /* we can not do a IWineD3DBaseShader_Release here since this would result in putting a shader to the cache */ 2432 shader_cleanup((IWineD3DBaseShader *)pShader); 2433 HeapFree(GetProcessHeap(), 0, pShader); 2434 return pCachedShader; 2435 } 2436 2437 IWineD3DVertexShaderImpl * vertexshader_check_cached(IWineD3DDeviceImpl *device, IWineD3DVertexShaderImpl *object) 2438 { 2439 return (IWineD3DVertexShaderImpl*)shader_chache_get(&device->vshaderCache, (IWineD3DBaseShaderImpl *)object); 2440 } 2441 2442 IWineD3DPixelShaderImpl * pixelshader_check_cached(IWineD3DDeviceImpl *device, IWineD3DPixelShaderImpl *object) 2443 { 2444 return (IWineD3DPixelShaderImpl*)shader_chache_get(&device->pshaderCache, (IWineD3DBaseShaderImpl *)object); 2445 } 2446 2447 void shader_chaches_init(IWineD3DDeviceImpl *device) 2448 { 2449 shader_chache_init(&device->vshaderCache); 2450 shader_chache_init(&device->pshaderCache); 2451 } 2452 2453 void shader_chaches_term(IWineD3DDeviceImpl *device) 2454 { 2455 shader_chache_term(&device->vshaderCache); 2456 shader_chache_term(&device->pshaderCache); 2457 } 2458 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxext.c
r42023 r42408 683 683 return S_OK; 684 684 } 685 686 687 /* hash map impl */ 688 static void vboxExtHashInitEntries(PVBOXEXT_HASHMAP pMap) 689 { 690 uint32_t i; 691 pMap->cEntries = 0; 692 for (i = 0; i < RT_ELEMENTS(pMap->aBuckets); ++i) 693 { 694 RTListInit(&pMap->aBuckets[i].EntryList); 695 } 696 } 697 698 void VBoxExtHashInit(PVBOXEXT_HASHMAP pMap, PFNVBOXEXT_HASHMAP_HASH pfnHash, PFNVBOXEXT_HASHMAP_EQUAL pfnEqual) 699 { 700 pMap->pfnHash = pfnHash; 701 pMap->pfnEqual = pfnEqual; 702 vboxExtHashInitEntries(pMap); 703 } 704 705 static DECLINLINE(uint32_t) vboxExtHashIdx(uint32_t u32Hash) 706 { 707 return u32Hash % VBOXEXT_HASHMAP_NUM_BUCKETS; 708 } 709 710 #define VBOXEXT_FOREACH_NODE(_pNode, _pList, _op) do { \ 711 PRTLISTNODE _pNode; \ 712 PRTLISTNODE __pNext; \ 713 for (_pNode = (_pList)->pNext; \ 714 _pNode != (_pList); \ 715 _pNode = __pNext) \ 716 { \ 717 __pNext = _pNode->pNext; /* <- the _pNode should not be referenced after the _op */ \ 718 _op \ 719 } \ 720 } while (0) 721 722 DECLINLINE(PVBOXEXT_HASHMAP_ENTRY) vboxExtHashSearchEntry(PVBOXEXT_HASHMAP pMap, void *pvKey) 723 { 724 uint32_t u32Hash = pMap->pfnHash(pvKey); 725 uint32_t u32HashIdx = vboxExtHashIdx(u32Hash); 726 PVBOXEXT_HASHMAP_BUCKET pBucket = &pMap->aBuckets[u32HashIdx]; 727 PVBOXEXT_HASHMAP_ENTRY pEntry; 728 VBOXEXT_FOREACH_NODE(pNode, &pBucket->EntryList, 729 pEntry = RT_FROM_MEMBER(pNode, VBOXEXT_HASHMAP_ENTRY, ListNode); 730 if (pEntry->u32Hash != u32Hash) 731 continue; 732 733 if (!pMap->pfnEqual(pvKey, pEntry->pvKey)) 734 continue; 735 return pEntry; 736 ); 737 return NULL; 738 } 739 740 void* VBoxExtHashRemoveEntry(PVBOXEXT_HASHMAP pMap, PVBOXEXT_HASHMAP_ENTRY pEntry) 741 { 742 RTListNodeRemove(&pEntry->ListNode); 743 --pMap->cEntries; 744 Assert(pMap->cEntries <= UINT32_MAX/2); 745 return pEntry->pvKey; 746 } 747 748 static void vboxExtHashPutEntry(PVBOXEXT_HASHMAP pMap, PVBOXEXT_HASHMAP_BUCKET pBucket, PVBOXEXT_HASHMAP_ENTRY pEntry) 749 { 750 RTListNodeInsertAfter(&pBucket->EntryList, &pEntry->ListNode); 751 ++pMap->cEntries; 752 } 753 754 PVBOXEXT_HASHMAP_ENTRY VBoxExtHashRemove(PVBOXEXT_HASHMAP pMap, void *pvKey) 755 { 756 PVBOXEXT_HASHMAP_ENTRY pEntry = vboxExtHashSearchEntry(pMap, pvKey); 757 if (!pEntry) 758 return NULL; 759 760 VBoxExtHashRemoveEntry(pMap, pEntry); 761 return pEntry; 762 } 763 764 PVBOXEXT_HASHMAP_ENTRY VBoxExtHashPut(PVBOXEXT_HASHMAP pMap, void *pvKey, PVBOXEXT_HASHMAP_ENTRY pEntry) 765 { 766 PVBOXEXT_HASHMAP_ENTRY pOldEntry = VBoxExtHashRemove(pMap, pvKey); 767 uint32_t u32Hash = pMap->pfnHash(pvKey); 768 uint32_t u32HashIdx = vboxExtHashIdx(u32Hash); 769 pEntry->pvKey = pvKey; 770 pEntry->u32Hash = u32Hash; 771 vboxExtHashPutEntry(pMap, &pMap->aBuckets[u32HashIdx], pEntry); 772 return pOldEntry; 773 } 774 775 776 PVBOXEXT_HASHMAP_ENTRY VBoxExtHashGet(PVBOXEXT_HASHMAP pMap, void *pvKey) 777 { 778 return vboxExtHashSearchEntry(pMap, pvKey); 779 } 780 781 void VBoxExtHashVisit(PVBOXEXT_HASHMAP pMap, PFNVBOXEXT_HASHMAP_VISITOR pfnVisitor, void *pvVisitor) 782 { 783 uint32_t iBucket = 0, iEntry = 0; 784 uint32_t cEntries = pMap->cEntries; 785 786 if (!cEntries) 787 return; 788 789 for (; ; ++iBucket) 790 { 791 PVBOXEXT_HASHMAP_ENTRY pEntry; 792 PVBOXEXT_HASHMAP_BUCKET pBucket = &pMap->aBuckets[iBucket]; 793 Assert(iBucket < RT_ELEMENTS(pMap->aBuckets)); 794 VBOXEXT_FOREACH_NODE(pNode, &pBucket->EntryList, 795 pEntry = RT_FROM_MEMBER(pNode, VBOXEXT_HASHMAP_ENTRY, ListNode); 796 if (!pfnVisitor(pMap, pEntry->pvKey, pEntry, pvVisitor)) 797 return; 798 799 if (++iEntry == cEntries) 800 return; 801 ); 802 } 803 804 /* should not be here! */ 805 AssertFailed(); 806 } 807 808 void VBoxExtHashCleanup(PVBOXEXT_HASHMAP pMap, PFNVBOXEXT_HASHMAP_VISITOR pfnVisitor, void *pvVisitor) 809 { 810 VBoxExtHashVisit(pMap, pfnVisitor, pvVisitor); 811 vboxExtHashInitEntries(pMap); 812 } 813 814 static DECLCALLBACK(bool) vboxExtCacheCleanupCb(struct VBOXEXT_HASHMAP *pMap, void *pvKey, struct VBOXEXT_HASHMAP_ENTRY *pValue, void *pvVisitor) 815 { 816 PVBOXEXT_HASHCACHE pCache = VBOXEXT_HASHCACHE_FROM_MAP(pMap); 817 PVBOXEXT_HASHCACHE_ENTRY pCacheEntry = VBOXEXT_HASHCACHE_ENTRY_FROM_MAP(pValue); 818 pCache->pfnCleanupEntry(pvKey, pCacheEntry); 819 return TRUE; 820 } 821 822 void VBoxExtCacheCleanup(PVBOXEXT_HASHCACHE pCache) 823 { 824 VBoxExtHashCleanup(&pCache->Map, vboxExtCacheCleanupCb, NULL); 825 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxext.h
r39648 r42408 20 20 # include <windows.h> 21 21 #endif 22 23 #include <iprt/list.h> 22 24 23 25 HRESULT VBoxExtCheckInit(); … … 45 47 HRESULT VBoxExtWndCreate(DWORD width, DWORD height, HWND *phWnd, HDC *phDC); 46 48 49 50 /* hashmap */ 51 typedef DECLCALLBACK(uint32_t) FNVBOXEXT_HASHMAP_HASH(void *pvKey); 52 typedef FNVBOXEXT_HASHMAP_HASH *PFNVBOXEXT_HASHMAP_HASH; 53 54 typedef DECLCALLBACK(bool) FNVBOXEXT_HASHMAP_EQUAL(void *pvKey1, void *pvKey2); 55 typedef FNVBOXEXT_HASHMAP_EQUAL *PFNVBOXEXT_HASHMAP_EQUAL; 56 57 typedef DECLCALLBACK(bool) FNVBOXEXT_HASHMAP_VISITOR(struct VBOXEXT_HASHMAP *pMap, void *pvKey, struct VBOXEXT_HASHMAP_ENTRY *pValue, void *pvVisitor); 58 typedef FNVBOXEXT_HASHMAP_VISITOR *PFNVBOXEXT_HASHMAP_VISITOR; 59 60 typedef struct VBOXEXT_HASHMAP_ENTRY 61 { 62 RTLISTNODE ListNode; 63 void *pvKey; 64 uint32_t u32Hash; 65 } VBOXEXT_HASHMAP_ENTRY, *PVBOXEXT_HASHMAP_ENTRY; 66 67 typedef struct VBOXEXT_HASHMAP_BUCKET 68 { 69 RTLISTNODE EntryList; 70 } VBOXEXT_HASHMAP_BUCKET, *PVBOXEXT_HASHMAP_BUCKET; 71 72 #define VBOXEXT_HASHMAP_NUM_BUCKETS 29 73 74 typedef struct VBOXEXT_HASHMAP 75 { 76 PFNVBOXEXT_HASHMAP_HASH pfnHash; 77 PFNVBOXEXT_HASHMAP_EQUAL pfnEqual; 78 uint32_t cEntries; 79 VBOXEXT_HASHMAP_BUCKET aBuckets[VBOXEXT_HASHMAP_NUM_BUCKETS]; 80 } VBOXEXT_HASHMAP, *PVBOXEXT_HASHMAP; 81 82 void VBoxExtHashInit(PVBOXEXT_HASHMAP pMap, PFNVBOXEXT_HASHMAP_HASH pfnHash, PFNVBOXEXT_HASHMAP_EQUAL pfnEqual); 83 PVBOXEXT_HASHMAP_ENTRY VBoxExtHashPut(PVBOXEXT_HASHMAP pMap, void *pvKey, PVBOXEXT_HASHMAP_ENTRY pEntry); 84 PVBOXEXT_HASHMAP_ENTRY VBoxExtHashGet(PVBOXEXT_HASHMAP pMap, void *pvKey); 85 PVBOXEXT_HASHMAP_ENTRY VBoxExtHashRemove(PVBOXEXT_HASHMAP pMap, void *pvKey); 86 void* VBoxExtHashRemoveEntry(PVBOXEXT_HASHMAP pMap, PVBOXEXT_HASHMAP_ENTRY pEntry); 87 void VBoxExtHashVisit(PVBOXEXT_HASHMAP pMap, PFNVBOXEXT_HASHMAP_VISITOR pfnVisitor, void *pvVisitor); 88 void VBoxExtHashCleanup(PVBOXEXT_HASHMAP pMap, PFNVBOXEXT_HASHMAP_VISITOR pfnVisitor, void *pvVisitor); 89 90 DECLINLINE(uint32_t) VBoxExtHashSize(PVBOXEXT_HASHMAP pMap) 91 { 92 return pMap->cEntries; 93 } 94 95 DECLINLINE(void*) VBoxExtHashEntryKey(PVBOXEXT_HASHMAP_ENTRY pEntry) 96 { 97 return pEntry->pvKey; 98 } 99 100 typedef DECLCALLBACK(void) FNVBOXEXT_HASHCACHE_CLEANUP_ENTRY(void *pvKey, struct VBOXEXT_HASHCACHE_ENTRY *pEntry); 101 typedef FNVBOXEXT_HASHCACHE_CLEANUP_ENTRY *PFNVBOXEXT_HASHCACHE_CLEANUP_ENTRY; 102 103 typedef struct VBOXEXT_HASHCACHE_ENTRY 104 { 105 VBOXEXT_HASHMAP_ENTRY MapEntry; 106 uint32_t u32Usage; 107 } VBOXEXT_HASHCACHE_ENTRY, *PVBOXEXT_HASHCACHE_ENTRY; 108 109 typedef struct VBOXEXT_HASHCACHE 110 { 111 VBOXEXT_HASHMAP Map; 112 uint32_t cMaxElements; 113 PFNVBOXEXT_HASHCACHE_CLEANUP_ENTRY pfnCleanupEntry; 114 } VBOXEXT_HASHCACHE, *PVBOXEXT_HASHCACHE; 115 116 #define VBOXEXT_HASHCACHE_FROM_MAP(_pMap) RT_FROM_MEMBER((_pMap), VBOXEXT_HASHCACHE, Map) 117 #define VBOXEXT_HASHCACHE_ENTRY_FROM_MAP(_pEntry) RT_FROM_MEMBER((_pEntry), VBOXEXT_HASHCACHE_ENTRY, MapEntry) 118 119 DECLINLINE(void) VBoxExtCacheInit(PVBOXEXT_HASHCACHE pCache, uint32_t cMaxElements, 120 PFNVBOXEXT_HASHMAP_HASH pfnHash, 121 PFNVBOXEXT_HASHMAP_EQUAL pfnEqual, 122 PFNVBOXEXT_HASHCACHE_CLEANUP_ENTRY pfnCleanupEntry) 123 { 124 VBoxExtHashInit(&pCache->Map, pfnHash, pfnEqual); 125 pCache->cMaxElements = cMaxElements; 126 pCache->pfnCleanupEntry = pfnCleanupEntry; 127 } 128 129 DECLINLINE(PVBOXEXT_HASHCACHE_ENTRY) VBoxExtCacheGet(PVBOXEXT_HASHCACHE pCache, void *pvKey) 130 { 131 PVBOXEXT_HASHMAP_ENTRY pEntry = VBoxExtHashRemove(&pCache->Map, pvKey); 132 return VBOXEXT_HASHCACHE_ENTRY_FROM_MAP(pEntry); 133 } 134 135 DECLINLINE(void) VBoxExtCachePut(PVBOXEXT_HASHCACHE pCache, void *pvKey, PVBOXEXT_HASHCACHE_ENTRY pEntry) 136 { 137 PVBOXEXT_HASHMAP_ENTRY pOldEntry = VBoxExtHashPut(&pCache->Map, pvKey, &pEntry->MapEntry); 138 PVBOXEXT_HASHCACHE_ENTRY pOld; 139 if (!pOldEntry) 140 return; 141 pOld = VBOXEXT_HASHCACHE_ENTRY_FROM_MAP(pOldEntry); 142 if (pOld != pEntry) 143 pCache->pfnCleanupEntry(pvKey, pOld); 144 } 145 146 void VBoxExtCacheCleanup(PVBOXEXT_HASHCACHE pCache); 147 148 DECLINLINE(void) VBoxExtCacheTerm(PVBOXEXT_HASHCACHE pCache) 149 { 150 VBoxExtCacheCleanup(pCache); 151 } 152 47 153 #endif /* #ifndef ___VBOXEXT_H__*/ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r42285 r42408 1801 1801 UINT numContexts; 1802 1802 1803 #ifdef VBOX_WINE_WITH_SHADER_CACHE 1804 VBOXEXT_HASHCACHE vshaderCache; 1805 VBOXEXT_HASHCACHE pshaderCache; 1806 #endif 1807 1803 1808 /* High level patch management */ 1804 1809 #define PATCHMAP_SIZE 43 … … 2929 2934 struct list shader_list_entry; 2930 2935 2936 #ifdef VBOX_WINE_WITH_SHADER_CACHE 2937 VBOXEXT_HASHCACHE_ENTRY CacheEntry; 2938 uint32_t u32CacheDataInited; 2939 uint32_t u32Hash; 2940 #endif 2931 2941 } IWineD3DBaseShaderClass; 2932 2942 … … 3095 3105 struct ps_compile_args *args) DECLSPEC_HIDDEN; 3096 3106 3107 #ifdef VBOX_WINE_WITH_SHADER_CACHE 3108 IWineD3DVertexShaderImpl * vertexshader_check_cached(IWineD3DDeviceImpl *device, IWineD3DVertexShaderImpl *object) DECLSPEC_HIDDEN; 3109 IWineD3DPixelShaderImpl * pixelshader_check_cached(IWineD3DDeviceImpl *device, IWineD3DPixelShaderImpl *object) DECLSPEC_HIDDEN; 3110 void shader_chaches_init(IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; 3111 void shader_chaches_term(IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; 3112 #endif 3113 3097 3114 /* sRGB correction constants */ 3098 3115 static const float srgb_cmp = 0.0031308f;
Note:
See TracChangeset
for help on using the changeset viewer.