diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2014-03-09 21:14:26 +0100 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2014-03-09 21:14:26 +0100 |
| commit | d802d392811be44d34ae9cd23f616db93e54c50f (patch) | |
| tree | f9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/VideoBackends/D3D/Render.cpp | |
| parent | f28116b7da6aac6069084596dc4dbf866bdebfd8 (diff) | |
clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/Render.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 23467f2406..3b987fe7f7 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -44,14 +44,14 @@ static u32 s_LastAA = 0; static Television s_television; -ID3D11Buffer* access_efb_cbuf = NULL; -ID3D11BlendState* clearblendstates[4] = {NULL}; -ID3D11DepthStencilState* cleardepthstates[3] = {NULL}; -ID3D11BlendState* resetblendstate = NULL; -ID3D11DepthStencilState* resetdepthstate = NULL; -ID3D11RasterizerState* resetraststate = NULL; +ID3D11Buffer* access_efb_cbuf = nullptr; +ID3D11BlendState* clearblendstates[4] = {nullptr}; +ID3D11DepthStencilState* cleardepthstates[3] = {nullptr}; +ID3D11BlendState* resetblendstate = nullptr; +ID3D11DepthStencilState* resetdepthstate = nullptr; +ID3D11RasterizerState* resetraststate = nullptr; -static ID3D11Texture2D* s_screenshot_texture = NULL; +static ID3D11Texture2D* s_screenshot_texture = nullptr; // GX pipeline state @@ -145,7 +145,7 @@ void SetupDeviceObjects() CHECK(hr==S_OK, "Create rasterizer state for Renderer::ResetAPIState"); D3D::SetDebugObjectName((ID3D11DeviceChild*)resetraststate, "rasterizer state for Renderer::ResetAPIState"); - s_screenshot_texture = NULL; + s_screenshot_texture = nullptr; } // Kill off all device objects @@ -172,7 +172,7 @@ void TeardownDeviceObjects() void CreateScreenshotTexture(const TargetRectangle& rc) { D3D11_TEXTURE2D_DESC scrtex_desc = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_R8G8B8A8_UNORM, rc.GetWidth(), rc.GetHeight(), 1, 1, 0, D3D11_USAGE_STAGING, D3D11_CPU_ACCESS_READ|D3D11_CPU_ACCESS_WRITE); - HRESULT hr = D3D::device->CreateTexture2D(&scrtex_desc, NULL, &s_screenshot_texture); + HRESULT hr = D3D::device->CreateTexture2D(&scrtex_desc, nullptr, &s_screenshot_texture); CHECK(hr==S_OK, "Create screenshot staging texture"); D3D::SetDebugObjectName((ID3D11DeviceChild*)s_screenshot_texture, "staging screenshot texture"); } @@ -385,7 +385,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, 1.f, 1.f); D3D::context->RSSetViewports(1, &vp); D3D::context->PSSetConstantBuffers(0, 1, &access_efb_cbuf); - D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBDepthReadTexture()->GetRTV(), NULL); + D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBDepthReadTexture()->GetRTV(), nullptr); D3D::SetPointCopySampler(); D3D::drawShadedTexQuad(FramebufferManager::GetEFBDepthTexture()->GetSRV(), &RectToLock, @@ -464,7 +464,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) // TODO: The first five PE registers may change behavior of EFB pokes, this isn't implemented, yet. ResetAPIState(); - D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), NULL); + D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), nullptr); D3D::drawColorQuad(rgbaColor, (float)RectToLock.left * 2.f / (float)Renderer::GetTargetWidth() - 1.f, - (float)RectToLock.top * 2.f / (float)Renderer::GetTargetHeight() + 1.f, (float)RectToLock.right * 2.f / (float)Renderer::GetTargetWidth() - 1.f, @@ -570,7 +570,7 @@ void Renderer::ReinterpretPixelData(unsigned int convtype) D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)g_renderer->GetTargetWidth(), (float)g_renderer->GetTargetHeight()); D3D::context->RSSetViewports(1, &vp); - D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTempTexture()->GetRTV(), NULL); + D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTempTexture()->GetRTV(), nullptr); D3D::SetPointCopySampler(); D3D::drawShadedTexQuad(FramebufferManager::GetEFBColorTexture()->GetSRV(), &source, g_renderer->GetTargetWidth(), g_renderer->GetTargetHeight(), pixel_shader, VertexShaderCache::GetSimpleVertexShader(), VertexShaderCache::GetSimpleInputLayout()); @@ -770,7 +770,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl if (Height > (s_backbuffer_height - Y)) Height = s_backbuffer_height - Y; D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)X, (float)Y, (float)Width, (float)Height); D3D::context->RSSetViewports(1, &vp); - D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), NULL); + D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), nullptr); float ClearColor[4] = { 0.f, 0.f, 0.f, 1.f }; D3D::context->ClearRenderTargetView(D3D::GetBackBuffer()->GetRTV(), ClearColor); @@ -999,7 +999,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl s_LastEFBScale = g_ActiveConfig.iEFBScale; CalculateTargetSize(s_backbuffer_width, s_backbuffer_height); - D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), NULL); + D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), nullptr); delete g_framebuffer_manager; g_framebuffer_manager = new FramebufferManager; @@ -1089,7 +1089,7 @@ void Renderer::ApplyState(bool bUseDstAlpha) if (FAILED(hr)) PanicAlert("Fail %s %d, stage=%d\n", __FILE__, __LINE__, stage); else D3D::SetDebugObjectName((ID3D11DeviceChild*)samplerstate[stage], "sampler state used to emulate the GX pipeline"); } - // else samplerstate[stage] = NULL; + // else samplerstate[stage] = nullptr; } D3D::context->PSSetSamplers(0, 8, samplerstate); for (unsigned int stage = 0; stage < 8; stage++) @@ -1107,13 +1107,13 @@ void Renderer::ApplyState(bool bUseDstAlpha) D3D::context->PSSetConstantBuffers(0, 1, &PixelShaderCache::GetConstantBuffer()); D3D::context->VSSetConstantBuffers(0, 1, &VertexShaderCache::GetConstantBuffer()); - D3D::context->PSSetShader(PixelShaderCache::GetActiveShader(), NULL, 0); - D3D::context->VSSetShader(VertexShaderCache::GetActiveShader(), NULL, 0); + D3D::context->PSSetShader(PixelShaderCache::GetActiveShader(), nullptr, 0); + D3D::context->VSSetShader(VertexShaderCache::GetActiveShader(), nullptr, 0); } void Renderer::RestoreState() { - ID3D11ShaderResourceView* shader_resources[8] = { NULL }; + ID3D11ShaderResourceView* shader_resources[8] = { nullptr }; D3D::context->PSSetShaderResources(0, 8, shader_resources); D3D::stateman->PopBlendState(); |
