Changeset 101082 in vbox
- Timestamp:
- Sep 11, 2023 3:53:22 PM (15 months ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test/Makefile.kmk
r100055 r101082 48 48 PROGRAMS += VBoxD3D11 49 49 VBoxD3D11_TEMPLATE = VBoxR3Static 50 VBoxD3D11_CXXFLAGS += -wd4 458 -wd4668 -wd4838 -wd5029 -wd503950 VBoxD3D11_CXXFLAGS += -wd4305 -wd4458 -wd4668 -wd4838 -wd5029 -wd5039 51 51 VBoxD3D11_INCS += $(PATH_ROOT)/src/VBox/Devices/Graphics/shaders 52 52 VBoxD3D11_LIBS = d3d11.lib -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test/d3d11main.cpp
r100055 r101082 59 59 60 60 HWND mHwnd; 61 UINT mRTWidth; 62 UINT mRTHeight; 61 63 62 64 struct … … 93 95 miRenderMode(RenderModeStep), 94 96 mHwnd(0), 97 mRTWidth(0), 98 mRTHeight(0), 95 99 mSharedHandle(0), 96 100 mpRender(0) … … 280 284 HRESULT hr = S_OK; 281 285 286 RECT clientRect; 287 GetClientRect(mHwnd, &clientRect); 288 mRTWidth = clientRect.right; 289 mRTHeight = clientRect.bottom; 290 282 291 /* 283 292 * Render. … … 290 299 D3D11_TEXTURE2D_DESC texDesc; 291 300 RT_ZERO(texDesc); 292 texDesc.Width = 800;293 texDesc.Height = 600;301 texDesc.Width = mRTWidth; 302 texDesc.Height = mRTHeight; 294 303 texDesc.MipLevels = 1; 295 304 texDesc.ArraySize = 1; … … 311 320 HTEST(mRender.pRenderTarget->QueryInterface(__uuidof(IDXGIKeyedMutex), (LPVOID*)&mRender.pDXGIKeyedMutex)); 312 321 313 D3D11_TEXTURE2D_DESC depthStencilDesc; 314 depthStencilDesc.Width = 800; 315 depthStencilDesc.Height = 600; 316 depthStencilDesc.MipLevels = 1; 317 depthStencilDesc.ArraySize = 1; 318 depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; 319 depthStencilDesc.SampleDesc.Count = 1; 320 depthStencilDesc.SampleDesc.Quality = 0; 321 depthStencilDesc.Usage = D3D11_USAGE_DEFAULT; 322 depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; 323 depthStencilDesc.CPUAccessFlags = 0; 324 depthStencilDesc.MiscFlags = 0; 325 326 HTEST(mRender.pDevice->CreateTexture2D(&depthStencilDesc, 0, &mRender.pDepthStencilBuffer)); 327 HTEST(mRender.pDevice->CreateDepthStencilView(mRender.pDepthStencilBuffer, 0, &mRender.pDepthStencilView)); 322 if (mpRender->IsDepthStencilBufferRequired(this)) 323 { 324 D3D11_TEXTURE2D_DESC depthStencilDesc; 325 depthStencilDesc.Width = mRTWidth; 326 depthStencilDesc.Height = mRTHeight; 327 depthStencilDesc.MipLevels = 1; 328 depthStencilDesc.ArraySize = 1; 329 depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; 330 depthStencilDesc.SampleDesc.Count = 1; 331 depthStencilDesc.SampleDesc.Quality = 0; 332 depthStencilDesc.Usage = D3D11_USAGE_DEFAULT; 333 depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; 334 depthStencilDesc.CPUAccessFlags = 0; 335 depthStencilDesc.MiscFlags = 0; 336 337 HTEST(mRender.pDevice->CreateTexture2D(&depthStencilDesc, 0, &mRender.pDepthStencilBuffer)); 338 HTEST(mRender.pDevice->CreateDepthStencilView(mRender.pDepthStencilBuffer, 0, &mRender.pDepthStencilView)); 339 } 328 340 } 329 341 … … 334 346 mScreenViewport.TopLeftX = 0; 335 347 mScreenViewport.TopLeftY = 0; 336 mScreenViewport.Width = static_cast<float>( 800);337 mScreenViewport.Height = static_cast<float>( 600);348 mScreenViewport.Width = static_cast<float>(mRTWidth); 349 mScreenViewport.Height = static_cast<float>(mRTHeight); 338 350 mScreenViewport.MinDepth = 0.0f; 339 351 mScreenViewport.MaxDepth = 1.0f; … … 352 364 DXGI_SWAP_CHAIN_DESC sd; 353 365 RT_ZERO(sd); 354 sd.BufferDesc.Width = 800;355 sd.BufferDesc.Height = 600;366 sd.BufferDesc.Width = mRTWidth; 367 sd.BufferDesc.Height = mRTHeight; 356 368 sd.BufferDesc.RefreshRate.Numerator = 60; 357 369 sd.BufferDesc.RefreshRate.Denominator = 1; … … 370 382 HTEST(mOutput.pDxgiFactory->CreateSwapChain(mOutput.pDevice, &sd, &mOutput.pSwapChain)); 371 383 372 HTEST(mOutput.pSwapChain->ResizeBuffers(1, 800, 600, DXGI_FORMAT_B8G8R8A8_UNORM, 0));384 HTEST(mOutput.pSwapChain->ResizeBuffers(1, mRTWidth, mRTHeight, DXGI_FORMAT_B8G8R8A8_UNORM, 0)); 373 385 374 386 HTEST(mOutput.pDevice->OpenSharedResource(mSharedHandle, __uuidof(ID3D11Texture2D), (void**)&mOutput.pSharedTexture)); … … 762 774 * Use the shared texture from the output device. 763 775 */ 764 float cDstWidth = 800.0f;765 float cDstHeight = 600.0f;776 float cDstWidth = static_cast<float>(mRTWidth); 777 float cDstHeight = static_cast<float>(mRTHeight); 766 778 767 779 D3D11_RECT rectDst; 768 780 rectDst.left = 0; 769 781 rectDst.top = 0; 770 rectDst.right = 800;771 rectDst.bottom = 600;782 rectDst.right = mRTWidth; 783 rectDst.bottom = mRTHeight; 772 784 773 785 ID3D11ShaderResourceView *pShaderResourceView = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test/d3d11render.h
r98103 r101082 86 86 virtual HRESULT DoRender(D3D11DeviceProvider *pDP) = 0; 87 87 virtual void TimeAdvance(float dt) { (void)dt; return; } 88 virtual bool IsDepthStencilBufferRequired(D3D11DeviceProvider *pDP) { (void)pDP; return true; } 88 89 }; 89 90
Note:
See TracChangeset
for help on using the changeset viewer.