@@ -363,8 +363,7 @@ ID3D11PixelShader* PixelShaderCache::GetColorCopyProgram(bool multisampled)
std::string buf = StringFromFormat(color_copy_program_code_msaa, g_ActiveConfig.iMultisamples);
s_ColorCopyProgram[1] = D3D::CompileAndCreatePixelShader(buf);
CHECK(s_ColorCopyProgram[1] != nullptr, "Create color copy MSAA pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ColorCopyProgram[1],
"color copy MSAA pixel shader");
D3D::SetDebugObjectName(s_ColorCopyProgram[1], "color copy MSAA pixel shader");
return s_ColorCopyProgram[1];
}
}
@@ -386,8 +385,7 @@ ID3D11PixelShader* PixelShaderCache::GetColorMatrixProgram(bool multisampled)
StringFromFormat(color_matrix_program_code_msaa, g_ActiveConfig.iMultisamples);
s_ColorMatrixProgram[1] = D3D::CompileAndCreatePixelShader(buf);
CHECK(s_ColorMatrixProgram[1] != nullptr, "Create color matrix MSAA pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ColorMatrixProgram[1],
"color matrix MSAA pixel shader");
D3D::SetDebugObjectName(s_ColorMatrixProgram[1], "color matrix MSAA pixel shader");
return s_ColorMatrixProgram[1];
}
}
@@ -408,8 +406,7 @@ ID3D11PixelShader* PixelShaderCache::GetDepthMatrixProgram(bool multisampled)
std::string buf = StringFromFormat(depth_matrix_program_msaa, g_ActiveConfig.iMultisamples);
s_DepthMatrixProgram[1] = D3D::CompileAndCreatePixelShader(buf);
CHECK(s_DepthMatrixProgram[1] != nullptr, "Create depth matrix MSAA pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_DepthMatrixProgram[1],
"depth matrix MSAA pixel shader");
D3D::SetDebugObjectName(s_DepthMatrixProgram[1], "depth matrix MSAA pixel shader");
return s_DepthMatrixProgram[1];
}
}
@@ -433,7 +430,7 @@ ID3D11PixelShader* PixelShaderCache::GetDepthResolveProgram()
std::string buf = StringFromFormat(depth_resolve_program, g_ActiveConfig.iMultisamples);
s_DepthResolveProgram = D3D::CompileAndCreatePixelShader(buf);
CHECK(s_DepthResolveProgram != nullptr, "Create depth matrix MSAA pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_DepthResolveProgram, "depth resolve pixel shader");
D3D::SetDebugObjectName(s_DepthResolveProgram, "depth resolve pixel shader");
return s_DepthResolveProgram;
}

@@ -476,33 +473,32 @@ void PixelShaderCache::Init()
D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE);
D3D::device->CreateBuffer(&cbdesc, nullptr, &pscbuf);
CHECK(pscbuf != nullptr, "Create pixel shader constant buffer");
D3D::SetDebugObjectName((ID3D11DeviceChild*)pscbuf,
"pixel shader constant buffer used to emulate the GX pipeline");
D3D::SetDebugObjectName(pscbuf, "pixel shader constant buffer used to emulate the GX pipeline");

// used when drawing clear quads
s_ClearProgram = D3D::CompileAndCreatePixelShader(clear_program_code);
CHECK(s_ClearProgram != nullptr, "Create clear pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ClearProgram, "clear pixel shader");
D3D::SetDebugObjectName(s_ClearProgram, "clear pixel shader");

// used for anaglyph stereoscopy
s_AnaglyphProgram = D3D::CompileAndCreatePixelShader(anaglyph_program_code);
CHECK(s_AnaglyphProgram != nullptr, "Create anaglyph pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_AnaglyphProgram, "anaglyph pixel shader");
D3D::SetDebugObjectName(s_AnaglyphProgram, "anaglyph pixel shader");

// used when copying/resolving the color buffer
s_ColorCopyProgram[0] = D3D::CompileAndCreatePixelShader(color_copy_program_code);
CHECK(s_ColorCopyProgram[0] != nullptr, "Create color copy pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ColorCopyProgram[0], "color copy pixel shader");
D3D::SetDebugObjectName(s_ColorCopyProgram[0], "color copy pixel shader");

// used for color conversion
s_ColorMatrixProgram[0] = D3D::CompileAndCreatePixelShader(color_matrix_program_code);
CHECK(s_ColorMatrixProgram[0] != nullptr, "Create color matrix pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ColorMatrixProgram[0], "color matrix pixel shader");
D3D::SetDebugObjectName(s_ColorMatrixProgram[0], "color matrix pixel shader");

// used for depth copy
s_DepthMatrixProgram[0] = D3D::CompileAndCreatePixelShader(depth_matrix_program);
CHECK(s_DepthMatrixProgram[0] != nullptr, "Create depth matrix pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_DepthMatrixProgram[0], "depth matrix pixel shader");
D3D::SetDebugObjectName(s_DepthMatrixProgram[0], "depth matrix pixel shader");

Clear();

@@ -208,7 +208,7 @@ TextureCache::TextureCache()
CD3D11_BUFFER_DESC(16, D3D11_BIND_CONSTANT_BUFFER, D3D11_USAGE_DEFAULT);
hr = D3D::device->CreateBuffer(&cbdesc, nullptr, &palette_uniform);
CHECK(SUCCEEDED(hr), "Create palette decoder constant buffer");
D3D::SetDebugObjectName((ID3D11DeviceChild*)palette_uniform,
D3D::SetDebugObjectName(palette_uniform,
"a constant buffer used in TextureCache::CopyRenderTargetToTexture");
}

@@ -264,7 +264,7 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy,
data.pSysMem = colmat;
HRESULT hr = D3D::device->CreateBuffer(&cbdesc, &data, &s_efbcopycbuf[cbuf_id]);
CHECK(SUCCEEDED(hr), "Create efb copy constant buffer %d", cbuf_id);
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_efbcopycbuf[cbuf_id],
D3D::SetDebugObjectName(s_efbcopycbuf[cbuf_id],
"a constant buffer used in TextureCache::CopyRenderTargetToTexture");
}
D3D::stateman->SetPixelConstants(s_efbcopycbuf[cbuf_id]);
@@ -46,7 +46,7 @@ void VertexManager::CreateDeviceObjects()
m_buffers[i] = nullptr;
CHECK(SUCCEEDED(D3D::device->CreateBuffer(&bufdesc, nullptr, &m_buffers[i])),
"Failed to create buffer.");
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_buffers[i], "Buffer of VertexManager");
D3D::SetDebugObjectName(m_buffers[i], "Buffer of VertexManager");
}

m_currentBuffer = 0;
@@ -141,8 +141,7 @@ void VertexShaderCache::Init()
D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE);
HRESULT hr = D3D::device->CreateBuffer(&cbdesc, nullptr, &vscbuf);
CHECK(hr == S_OK, "Create vertex shader constant buffer (size=%u)", cbsize);
D3D::SetDebugObjectName((ID3D11DeviceChild*)vscbuf,
"vertex shader constant buffer used to emulate the GX pipeline");
D3D::SetDebugObjectName(vscbuf, "vertex shader constant buffer used to emulate the GX pipeline");

D3DBlob* blob;
D3D::CompileVertexShader(simple_shader_code, &blob);
@@ -152,8 +151,8 @@ void VertexShaderCache::Init()
PanicAlert("Failed to create simple vertex shader or input layout at %s %d\n", __FILE__,
__LINE__);
blob->Release();
D3D::SetDebugObjectName((ID3D11DeviceChild*)SimpleVertexShader, "simple vertex shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)SimpleLayout, "simple input layout");
D3D::SetDebugObjectName(SimpleVertexShader, "simple vertex shader");
D3D::SetDebugObjectName(SimpleLayout, "simple input layout");

D3D::CompileVertexShader(clear_shader_code, &blob);
D3D::device->CreateInputLayout(clearelems, 2, blob->Data(), blob->Size(), &ClearLayout);
@@ -162,8 +161,8 @@ void VertexShaderCache::Init()
PanicAlert("Failed to create clear vertex shader or input layout at %s %d\n", __FILE__,
__LINE__);
blob->Release();
D3D::SetDebugObjectName((ID3D11DeviceChild*)ClearVertexShader, "clear vertex shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)ClearLayout, "clear input layout");
D3D::SetDebugObjectName(ClearVertexShader, "clear vertex shader");
D3D::SetDebugObjectName(ClearLayout, "clear input layout");

Clear();