d3d12: Fix warnings andnable warnings as errors.

This commit is contained in:
Vincent Lejeune 2015-12-23 17:17:39 +01:00
parent b41fcf3734
commit c4b3b967d9
3 changed files with 24 additions and 9 deletions

View file

@ -85,6 +85,9 @@
<Lib> <Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib> </Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<Lib> <Lib>
@ -92,16 +95,25 @@
<AdditionalDependencies /> <AdditionalDependencies />
<AdditionalLibraryDirectories /> <AdditionalLibraryDirectories />
</Lib> </Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Lib> <Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib> </Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Lib> <Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib> </Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<Lib> <Lib>
@ -109,6 +121,9 @@
<AdditionalDependencies /> <AdditionalDependencies />
<AdditionalLibraryDirectories /> <AdditionalLibraryDirectories />
</Lib> </Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Emu\RSX\D3D12\D3D12Utils.h" /> <ClInclude Include="Emu\RSX\D3D12\D3D12Utils.h" />

View file

@ -77,7 +77,7 @@ void D3D12GSRender::clear_surface(u32 arg)
if (arg & 0x1 || arg & 0x2) if (arg & 0x1 || arg & 0x2)
{ {
CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().depth_stencil_descriptor_heap->GetCPUDescriptorHandleForHeapStart()) CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().depth_stencil_descriptor_heap->GetCPUDescriptorHandleForHeapStart())
.Offset(get_current_resource_storage().depth_stencil_descriptor_heap_index * g_descriptor_stride_rtv); .Offset((INT)get_current_resource_storage().depth_stencil_descriptor_heap_index * g_descriptor_stride_rtv);
m_rtts.bind_depth_stencil(m_device.Get(), m_surface.depth_format, handle); m_rtts.bind_depth_stencil(m_device.Get(), m_surface.depth_format, handle);
get_current_resource_storage().depth_stencil_descriptor_heap_index++; get_current_resource_storage().depth_stencil_descriptor_heap_index++;
@ -97,7 +97,7 @@ void D3D12GSRender::clear_surface(u32 arg)
if (arg & 0xF0) if (arg & 0xF0)
{ {
CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().render_targets_descriptors_heap->GetCPUDescriptorHandleForHeapStart()) CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().render_targets_descriptors_heap->GetCPUDescriptorHandleForHeapStart())
.Offset(get_current_resource_storage().render_targets_descriptors_heap_index * g_descriptor_stride_rtv); .Offset((INT)get_current_resource_storage().render_targets_descriptors_heap_index * g_descriptor_stride_rtv);
size_t rtt_index = m_rtts.bind_render_targets(m_device.Get(), m_surface.color_format, handle); size_t rtt_index = m_rtts.bind_render_targets(m_device.Get(), m_surface.color_format, handle);
get_current_resource_storage().render_targets_descriptors_heap_index += rtt_index; get_current_resource_storage().render_targets_descriptors_heap_index += rtt_index;
for (unsigned i = 0; i < rtt_index; i++) for (unsigned i = 0; i < rtt_index; i++)
@ -251,11 +251,11 @@ size_t render_targets::bind_depth_stencil(ID3D12Device *device, u32 depth_format
void D3D12GSRender::set_rtt_and_ds(ID3D12GraphicsCommandList *command_list) void D3D12GSRender::set_rtt_and_ds(ID3D12GraphicsCommandList *command_list)
{ {
CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().render_targets_descriptors_heap->GetCPUDescriptorHandleForHeapStart()) CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().render_targets_descriptors_heap->GetCPUDescriptorHandleForHeapStart())
.Offset(get_current_resource_storage().render_targets_descriptors_heap_index * g_descriptor_stride_rtv); .Offset((INT)get_current_resource_storage().render_targets_descriptors_heap_index * g_descriptor_stride_rtv);
size_t num_rtt = m_rtts.bind_render_targets(m_device.Get(), m_surface.color_format, handle); size_t num_rtt = m_rtts.bind_render_targets(m_device.Get(), m_surface.color_format, handle);
get_current_resource_storage().render_targets_descriptors_heap_index += num_rtt; get_current_resource_storage().render_targets_descriptors_heap_index += num_rtt;
CD3DX12_CPU_DESCRIPTOR_HANDLE depth_stencil_handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().depth_stencil_descriptor_heap->GetCPUDescriptorHandleForHeapStart()) CD3DX12_CPU_DESCRIPTOR_HANDLE depth_stencil_handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(get_current_resource_storage().depth_stencil_descriptor_heap->GetCPUDescriptorHandleForHeapStart())
.Offset(get_current_resource_storage().depth_stencil_descriptor_heap_index * g_descriptor_stride_rtv); .Offset((INT)get_current_resource_storage().depth_stencil_descriptor_heap_index * g_descriptor_stride_rtv);
size_t num_ds = m_rtts.bind_depth_stencil(m_device.Get(), m_surface.depth_format, depth_stencil_handle); size_t num_ds = m_rtts.bind_depth_stencil(m_device.Get(), m_surface.depth_format, depth_stencil_handle);
get_current_resource_storage().depth_stencil_descriptor_heap_index += num_ds; get_current_resource_storage().depth_stencil_descriptor_heap_index += num_ds;
command_list->OMSetRenderTargets((UINT)num_rtt, num_rtt > 0 ? &handle : nullptr, !!num_rtt, command_list->OMSetRenderTargets((UINT)num_rtt, num_rtt > 0 ? &handle : nullptr, !!num_rtt,
@ -644,8 +644,8 @@ void D3D12GSRender::copy_render_targets_to_memory(void *buffer, u8 rtt)
void D3D12GSRender::copy_depth_buffer_to_memory(void *buffer) void D3D12GSRender::copy_depth_buffer_to_memory(void *buffer)
{ {
int clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16; unsigned clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16;
int clip_h = rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16; unsigned clip_h = rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16;
size_t row_pitch = align(clip_w * 4, 256); size_t row_pitch = align(clip_w * 4, 256);
@ -682,8 +682,8 @@ void D3D12GSRender::copy_depth_buffer_to_memory(void *buffer)
void D3D12GSRender::copy_stencil_buffer_to_memory(void *buffer) void D3D12GSRender::copy_stencil_buffer_to_memory(void *buffer)
{ {
int clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16; unsigned clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16;
int clip_h = rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16; unsigned clip_h = rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16;
size_t row_pitch = align(clip_w * 4, 256); size_t row_pitch = align(clip_w * 4, 256);

View file

@ -73,7 +73,7 @@ ComPtr<ID3D12Resource> upload_single_texture(
CHECK_HRESULT(device->CreateCommittedResource( CHECK_HRESULT(device->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT), &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT),
D3D12_HEAP_FLAG_NONE, D3D12_HEAP_FLAG_NONE,
&CD3DX12_RESOURCE_DESC::Tex2D(dxgi_format, (UINT)w, (UINT)h, depth, texture.mipmap()), &CD3DX12_RESOURCE_DESC::Tex2D(dxgi_format, (UINT)w, (UINT)h, (UINT)depth, texture.mipmap()),
D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COPY_DEST,
nullptr, nullptr,
IID_PPV_ARGS(result.GetAddressOf()) IID_PPV_ARGS(result.GetAddressOf())