1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +01:00

[d3d9] Return specific image view from GetSampleView

Lets us have pick the sRGB-ness of the view in one place. Needed
for the next patch.
This commit is contained in:
Philip Rebohle 2020-01-17 17:37:15 +01:00 committed by Philip Rebohle
parent 905d69e77b
commit 296aacb23e
2 changed files with 4 additions and 4 deletions

View File

@ -331,8 +331,8 @@ namespace dxvk {
bool SetDirty(UINT Subresource, bool value) { return std::exchange(m_dirty[Subresource], value); }
void MarkAllDirty() { for (uint32_t i = 0; i < m_dirty.size(); i++) m_dirty[i] = true; }
const D3D9ColorView& GetSampleView() const {
return m_sampleView;
const Rc<DxvkImageView>& GetSampleView(bool srgb) const {
return m_sampleView.Pick(srgb);
}
VkImageLayout DetermineRenderTargetLayout() const {

View File

@ -4058,7 +4058,7 @@ namespace dxvk {
void D3D9DeviceEx::GenerateMips(
D3D9CommonTexture* pResource) {
EmitCs([
cImageView = pResource->GetSampleView().Color
cImageView = pResource->GetSampleView(false)
] (DxvkContext* ctx) {
ctx->generateMipmaps(cImageView);
});
@ -5289,7 +5289,7 @@ namespace dxvk {
cColorSlot = colorSlot,
cDepthSlot = depthSlot,
cDepth = commonTex->IsShadow(),
cImageView = commonTex->GetSampleView().Pick(srgb)
cImageView = commonTex->GetSampleView(srgb)
](DxvkContext* ctx) {
ctx->bindResourceView(cColorSlot, !cDepth ? cImageView : nullptr, nullptr);
ctx->bindResourceView(cDepthSlot, cDepth ? cImageView : nullptr, nullptr);