Changeset 43360 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
- Timestamp:
- Sep 19, 2012 5:49:07 PM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp
r43334 r43360 427 427 HRESULT hr = E_FAIL; 428 428 IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice); 429 if (pRc->RcDesc.fFlags.ZBuffer) 430 { 431 for (UINT i = 0; i < pRc->cAllocations; ++i) 432 { 433 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 434 IDirect3DSurface9 *pD3D9Surf; 435 hr = pDevice9If->CreateDepthStencilSurface(pAllocation->SurfDesc.width, 436 pAllocation->SurfDesc.height, 437 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 438 vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType), 439 pRc->RcDesc.MultisampleQuality, 440 TRUE /* @todo: BOOL Discard */, 441 &pD3D9Surf, 442 NULL /*HANDLE* pSharedHandle*/); 443 Assert(hr == S_OK); 444 if (hr == S_OK) 445 { 446 Assert(pD3D9Surf); 447 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 448 pAllocation->pD3DIf = pD3D9Surf; 449 } 450 else 451 { 452 for (UINT j = 0; j < i; ++j) 453 { 454 pRc->aAllocations[j].pD3DIf->Release(); 455 } 456 break; 457 } 458 } 459 460 if (SUCCEEDED(hr)) 461 { 462 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 463 { 464 vboxDispD3DIfSurfSynchMem(pRc); 465 } 466 } 467 } 468 else if (pRc->RcDesc.fFlags.VertexBuffer) 469 { 470 for (UINT i = 0; i < pRc->cAllocations; ++i) 471 { 472 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 473 IDirect3DVertexBuffer9 *pD3D9VBuf; 474 hr = pDevice9If->CreateVertexBuffer(pAllocation->SurfDesc.width, 475 vboxDDI2D3DUsage(pRc->RcDesc.fFlags), 476 pRc->RcDesc.Fvf, 477 vboxDDI2D3DPool(pRc->RcDesc.enmPool), 478 &pD3D9VBuf, 479 NULL /*HANDLE* pSharedHandle*/); 480 Assert(hr == S_OK); 481 if (hr == S_OK) 482 { 483 Assert(pD3D9VBuf); 484 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_VERTEXBUFFER; 485 pAllocation->pD3DIf = pD3D9VBuf; 486 } 487 else 488 { 489 for (UINT j = 0; j < i; ++j) 490 { 491 pRc->aAllocations[j].pD3DIf->Release(); 492 } 493 break; 494 } 495 } 496 497 if (SUCCEEDED(hr)) 498 { 499 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 500 { 501 vboxDispD3DIfSurfSynchMem(pRc); 502 } 503 } 504 } 505 else if (pRc->RcDesc.fFlags.IndexBuffer) 506 { 507 for (UINT i = 0; i < pRc->cAllocations; ++i) 508 { 509 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 510 IDirect3DIndexBuffer9 *pD3D9IBuf; 511 hr = pDevice9If->CreateIndexBuffer(pAllocation->SurfDesc.width, 512 vboxDDI2D3DUsage(pRc->RcDesc.fFlags), 513 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 514 vboxDDI2D3DPool(pRc->RcDesc.enmPool), 515 &pD3D9IBuf, 516 NULL /*HANDLE* pSharedHandle*/ 517 ); 518 Assert(hr == S_OK); 519 if (hr == S_OK) 520 { 521 Assert(pD3D9IBuf); 522 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_INDEXBUFFER; 523 pAllocation->pD3DIf = pD3D9IBuf; 524 } 525 else 526 { 527 for (UINT j = 0; j < i; ++j) 528 { 529 pRc->aAllocations[j].pD3DIf->Release(); 530 } 531 break; 532 } 533 } 534 535 if (SUCCEEDED(hr)) 536 { 537 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 538 { 539 vboxDispD3DIfSurfSynchMem(pRc); 540 } 541 } 542 } 543 else if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags)) 429 430 if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags)) 544 431 { 545 432 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0]; … … 777 664 } 778 665 } 666 else if (pRc->RcDesc.fFlags.ZBuffer) 667 { 668 for (UINT i = 0; i < pRc->cAllocations; ++i) 669 { 670 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 671 IDirect3DSurface9 *pD3D9Surf; 672 hr = pDevice9If->CreateDepthStencilSurface(pAllocation->SurfDesc.width, 673 pAllocation->SurfDesc.height, 674 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 675 vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType), 676 pRc->RcDesc.MultisampleQuality, 677 TRUE /* @todo: BOOL Discard */, 678 &pD3D9Surf, 679 NULL /*HANDLE* pSharedHandle*/); 680 Assert(hr == S_OK); 681 if (hr == S_OK) 682 { 683 Assert(pD3D9Surf); 684 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 685 pAllocation->pD3DIf = pD3D9Surf; 686 } 687 else 688 { 689 for (UINT j = 0; j < i; ++j) 690 { 691 pRc->aAllocations[j].pD3DIf->Release(); 692 } 693 break; 694 } 695 } 696 697 if (SUCCEEDED(hr)) 698 { 699 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 700 { 701 vboxDispD3DIfSurfSynchMem(pRc); 702 } 703 } 704 } 705 else if (pRc->RcDesc.fFlags.VertexBuffer) 706 { 707 for (UINT i = 0; i < pRc->cAllocations; ++i) 708 { 709 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 710 IDirect3DVertexBuffer9 *pD3D9VBuf; 711 hr = pDevice9If->CreateVertexBuffer(pAllocation->SurfDesc.width, 712 vboxDDI2D3DUsage(pRc->RcDesc.fFlags), 713 pRc->RcDesc.Fvf, 714 vboxDDI2D3DPool(pRc->RcDesc.enmPool), 715 &pD3D9VBuf, 716 NULL /*HANDLE* pSharedHandle*/); 717 Assert(hr == S_OK); 718 if (hr == S_OK) 719 { 720 Assert(pD3D9VBuf); 721 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_VERTEXBUFFER; 722 pAllocation->pD3DIf = pD3D9VBuf; 723 } 724 else 725 { 726 for (UINT j = 0; j < i; ++j) 727 { 728 pRc->aAllocations[j].pD3DIf->Release(); 729 } 730 break; 731 } 732 } 733 734 if (SUCCEEDED(hr)) 735 { 736 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 737 { 738 vboxDispD3DIfSurfSynchMem(pRc); 739 } 740 } 741 } 742 else if (pRc->RcDesc.fFlags.IndexBuffer) 743 { 744 for (UINT i = 0; i < pRc->cAllocations; ++i) 745 { 746 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 747 IDirect3DIndexBuffer9 *pD3D9IBuf; 748 hr = pDevice9If->CreateIndexBuffer(pAllocation->SurfDesc.width, 749 vboxDDI2D3DUsage(pRc->RcDesc.fFlags), 750 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 751 vboxDDI2D3DPool(pRc->RcDesc.enmPool), 752 &pD3D9IBuf, 753 NULL /*HANDLE* pSharedHandle*/ 754 ); 755 Assert(hr == S_OK); 756 if (hr == S_OK) 757 { 758 Assert(pD3D9IBuf); 759 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_INDEXBUFFER; 760 pAllocation->pD3DIf = pD3D9IBuf; 761 } 762 else 763 { 764 for (UINT j = 0; j < i; ++j) 765 { 766 pRc->aAllocations[j].pD3DIf->Release(); 767 } 768 break; 769 } 770 } 771 772 if (SUCCEEDED(hr)) 773 { 774 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 775 { 776 vboxDispD3DIfSurfSynchMem(pRc); 777 } 778 } 779 } 779 780 else 780 781 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.h
r43236 r43360 104 104 case VBOXDISP_D3DIFTYPE_CUBE_TEXTURE: 105 105 { 106 Assert(0);107 106 IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pD3DIf; 108 107 IDirect3DSurface9 *pSurfaceLevel; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r43340 r43360 5030 5030 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hZBuffer; 5031 5031 IDirect3DSurface9 *pD3D9Surf = NULL; 5032 HRESULT hr = S_OK; 5032 5033 if (pRc) 5033 5034 { 5034 5035 VBOXVDBG_CHECK_SMSYNC(pRc); 5035 5036 Assert(pRc->cAllocations == 1); 5036 Assert(pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE); 5037 pD3D9Surf = (IDirect3DSurface9*)pRc->aAllocations[0].pD3DIf; 5038 Assert(pD3D9Surf); 5039 } 5040 HRESULT hr = pDevice9If->SetDepthStencilSurface(pD3D9Surf); 5041 Assert(hr == S_OK); 5037 hr = VBoxD3DIfSurfGet(pRc, 0, &pD3D9Surf); 5038 if (FAILED(hr)) 5039 WARN(("VBoxD3DIfSurfGet failed, hr (0x%x)",hr)); 5040 else 5041 Assert(pD3D9Surf); 5042 } 5043 5044 if (SUCCEEDED(hr)) 5045 { 5046 hr = pDevice9If->SetDepthStencilSurface(pD3D9Surf); 5047 if (SUCCEEDED(hr)) 5048 hr = S_OK; 5049 else 5050 WARN(("VBoxD3DIfSurfGet failed, hr (0x%x)",hr)); 5051 5052 if (pD3D9Surf) 5053 pD3D9Surf->Release(); 5054 } 5055 5042 5056 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 5043 5057 return hr;
Note:
See TracChangeset
for help on using the changeset viewer.