d3d12; Fix swizzle for B8 texture format

Fix menu in guided fate paradox for WARP
This commit is contained in:
vlj 2015-06-13 19:43:46 +02:00 committed by Vincent Lejeune
parent 41577b5018
commit e36c4f75e0

View file

@ -441,7 +441,7 @@ size_t D3D12GSRender::UploadTextures()
std::unordered_map<u32, ID3D12Resource* >::const_iterator ItRTT = m_rtts.m_renderTargets.find(texaddr); std::unordered_map<u32, ID3D12Resource* >::const_iterator ItRTT = m_rtts.m_renderTargets.find(texaddr);
std::unordered_map<u32, ID3D12Resource* >::const_iterator ItCache = m_texturesCache.find(texaddr); std::unordered_map<u32, ID3D12Resource* >::const_iterator ItCache = m_texturesCache.find(texaddr);
bool isRenderTarget = false; bool isRenderTarget = false;
if (ItRTT != m_rtts.m_renderTargets.end()) /* if (ItRTT != m_rtts.m_renderTargets.end())
{ {
vramTexture = ItRTT->second; vramTexture = ItRTT->second;
isRenderTarget = true; isRenderTarget = true;
@ -450,7 +450,7 @@ size_t D3D12GSRender::UploadTextures()
{ {
vramTexture = ItCache->second; vramTexture = ItCache->second;
} }
else else*/
{ {
// Upload at each iteration to take advantage of overlapping transfer // Upload at each iteration to take advantage of overlapping transfer
ID3D12GraphicsCommandList *commandList; ID3D12GraphicsCommandList *commandList;
@ -480,9 +480,9 @@ size_t D3D12GSRender::UploadTextures()
break; break;
case CELL_GCM_TEXTURE_B8: case CELL_GCM_TEXTURE_B8:
srvDesc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING( srvDesc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1, D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0,
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2, D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0,
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3, D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0,
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0); D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0);
break; break;
case CELL_GCM_TEXTURE_A1R5G5B5: case CELL_GCM_TEXTURE_A1R5G5B5:
@ -565,7 +565,6 @@ size_t D3D12GSRender::UploadTextures()
srvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; srvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
break; break;
} }
D3D12_CPU_DESCRIPTOR_HANDLE Handle = getCurrentResourceStorage().m_textureDescriptorsHeap->GetCPUDescriptorHandleForHeapStart(); D3D12_CPU_DESCRIPTOR_HANDLE Handle = getCurrentResourceStorage().m_textureDescriptorsHeap->GetCPUDescriptorHandleForHeapStart();
Handle.ptr += (getCurrentResourceStorage().m_currentTextureIndex + usedTexture) * m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); Handle.ptr += (getCurrentResourceStorage().m_currentTextureIndex + usedTexture) * m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
m_device->CreateShaderResourceView(vramTexture, &srvDesc, Handle); m_device->CreateShaderResourceView(vramTexture, &srvDesc, Handle);