Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
We now use 16-bit floats instead of 32, since it's using up too much …
Browse files Browse the repository at this point in the history
…VRAM (my laptop lags soo much)
  • Loading branch information
Nielsbishere committed Apr 8, 2019
1 parent 3790979 commit ad0a90b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/engine_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ namespace wr
PipelineDescription::ComputeShader(std::nullopt),
PipelineDescription::RootSignature(root_signatures::basic),
PipelineDescription::DSVFormat(Format::D32_FLOAT),
PipelineDescription::RTVFormats({ Format::R32G32B32A32_FLOAT, Format::R32G32B32A32_FLOAT }),
PipelineDescription::NumRTVFormats(3),
PipelineDescription::RTVFormats({ Format::R16G16B16A16_FLOAT, Format::R16G16B16A16_FLOAT }),
PipelineDescription::NumRTVFormats(2),
PipelineDescription::Type(PipelineType::GRAPHICS_PIPELINE),
PipelineDescription::CullMode(CullMode::CULL_NONE),
PipelineDescription::Depth(true),
Expand All @@ -245,7 +245,7 @@ namespace wr
PipelineDescription::ComputeShader(shaders::deferred_composition_cs),
PipelineDescription::RootSignature(root_signatures::deferred_composition),
PipelineDescription::DSVFormat(Format::UNKNOWN),
PipelineDescription::RTVFormats({ Format::R32G32B32A32_FLOAT }),
PipelineDescription::RTVFormats({ Format::R16G16B16A16_FLOAT }),
PipelineDescription::NumRTVFormats(1),
PipelineDescription::Type(PipelineType::COMPUTE_PIPELINE),
PipelineDescription::CullMode(CullMode::CULL_BACK),
Expand Down Expand Up @@ -276,7 +276,7 @@ namespace wr
PipelineDescription::ComputeShader(std::nullopt),
PipelineDescription::RootSignature(root_signatures::cubemap_conversion),
PipelineDescription::DSVFormat(Format::UNKNOWN),
PipelineDescription::RTVFormats({ Format::R32G32B32A32_FLOAT }),
PipelineDescription::RTVFormats({ Format::R16G16B16A16_FLOAT }),
PipelineDescription::NumRTVFormats(1),
PipelineDescription::Type(PipelineType::GRAPHICS_PIPELINE),
PipelineDescription::CullMode(CullMode::CULL_NONE),
Expand All @@ -292,7 +292,7 @@ namespace wr
PipelineDescription::ComputeShader(std::nullopt),
PipelineDescription::RootSignature(root_signatures::cubemap_convolution),
PipelineDescription::DSVFormat(Format::UNKNOWN),
PipelineDescription::RTVFormats({ Format::R32G32B32A32_FLOAT }),
PipelineDescription::RTVFormats({ Format::R16G16B16A16_FLOAT }),
PipelineDescription::NumRTVFormats(1),
PipelineDescription::Type(PipelineType::GRAPHICS_PIPELINE),
PipelineDescription::CullMode(CullMode::CULL_NONE),
Expand Down
4 changes: 2 additions & 2 deletions src/render_tasks/d3d12_cubemap_convolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace wr
data.in_radiance = pred_data.out_cubemap;
data.out_pref_env_map = pred_data.out_pref_env;

skybox_node->m_irradiance = skybox_node->m_skybox.value().m_pool->CreateCubemap("ConvolutedMap", 128, 128, 1, wr::Format::R32G32B32A32_FLOAT, true);;
skybox_node->m_irradiance = skybox_node->m_skybox.value().m_pool->CreateCubemap("ConvolutedMap", 128, 128, 1, wr::Format::R16G16B16A16_FLOAT, true);;

data.out_irradiance = skybox_node->m_irradiance.value();

Expand Down Expand Up @@ -210,7 +210,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::NON_PIXEL_SHADER_RESOURCE),
RenderTargetProperties::CreateDSVBuffer(true),
RenderTargetProperties::DSVFormat(Format::D32_FLOAT),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(1),
RenderTargetProperties::Clear(true),
RenderTargetProperties::ClearDepth(true),
Expand Down
4 changes: 2 additions & 2 deletions src/render_tasks/d3d12_deferred_composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ namespace wr
// Output UAV
{
auto rtv_out_uav_handle = data.out_srv_uav_allocation.GetDescriptorHandle(COMPILATION_EVAL(rs_layout::GetHeapLoc(params::deferred_composition, params::DeferredCompositionE::OUTPUT)));
std::vector<Format> formats = { Format::R32G32B32A32_FLOAT };
std::vector<Format> formats = { Format::R16G16B16A16_FLOAT };
d3d12::CreateUAVFromRTV(render_target, rtv_out_uav_handle, 1, formats.data());
}

Expand Down Expand Up @@ -281,7 +281,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::COPY_SOURCE),
RenderTargetProperties::CreateDSVBuffer(false),
RenderTargetProperties::DSVFormat(Format::UNKNOWN),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(1),
RenderTargetProperties::Clear(false),
RenderTargetProperties::ClearDepth(false),
Expand Down
2 changes: 1 addition & 1 deletion src/render_tasks/d3d12_deferred_main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::NON_PIXEL_SHADER_RESOURCE),
RenderTargetProperties::CreateDSVBuffer(true),
RenderTargetProperties::DSVFormat(Format::D32_FLOAT),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT, Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT, Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(2),
RenderTargetProperties::Clear(true),
RenderTargetProperties::ClearDepth(true),
Expand Down
6 changes: 3 additions & 3 deletions src/render_tasks/d3d12_equirect_to_cubemap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ namespace wr

data.in_equirect = skybox_node->m_hdr;

skybox_node->m_skybox = skybox_node->m_hdr.m_pool->CreateCubemap("Skybox", 3840, 3840, 0, wr::Format::R32G32B32A32_FLOAT, true);
skybox_node->m_skybox = skybox_node->m_hdr.m_pool->CreateCubemap("Skybox", 1024, 1024, 0, wr::Format::R16G16B16A16_FLOAT, true);

skybox_node->m_prefiltered_env_map = skybox_node->m_hdr.m_pool->CreateCubemap("FilteredEnvMap", 512, 512, 5, wr::Format::R32G32B32A32_FLOAT, true);
skybox_node->m_prefiltered_env_map = skybox_node->m_hdr.m_pool->CreateCubemap("FilteredEnvMap", 512, 512, 5, wr::Format::R16G16B16A16_FLOAT, true);

data.out_cubemap = skybox_node->m_skybox.value();
data.out_pref_env = skybox_node->m_prefiltered_env_map.value();
Expand Down Expand Up @@ -300,7 +300,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::NON_PIXEL_SHADER_RESOURCE),
RenderTargetProperties::CreateDSVBuffer(true),
RenderTargetProperties::DSVFormat(Format::D32_FLOAT),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(1),
RenderTargetProperties::Clear(true),
RenderTargetProperties::ClearDepth(true),
Expand Down
2 changes: 1 addition & 1 deletion src/render_tasks/d3d12_path_tracer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::COPY_SOURCE),
RenderTargetProperties::CreateDSVBuffer(false),
RenderTargetProperties::DSVFormat(Format::UNKNOWN),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(1),
RenderTargetProperties::Clear(false),
RenderTargetProperties::ClearDepth(false),
Expand Down
2 changes: 1 addition & 1 deletion src/render_tasks/d3d12_raytracing_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::COPY_SOURCE),
RenderTargetProperties::CreateDSVBuffer(false),
RenderTargetProperties::DSVFormat(Format::UNKNOWN),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(1),
RenderTargetProperties::Clear(false),
RenderTargetProperties::ClearDepth(false),
Expand Down
2 changes: 1 addition & 1 deletion src/render_tasks/d3d12_rt_hybrid_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ namespace wr
RenderTargetProperties::FinishedResourceState(ResourceState::COPY_SOURCE),
RenderTargetProperties::CreateDSVBuffer(false),
RenderTargetProperties::DSVFormat(Format::UNKNOWN),
RenderTargetProperties::RTVFormats({ Format::R32G32B32A32_FLOAT }),
RenderTargetProperties::RTVFormats({ Format::R16G16B16A16_FLOAT }),
RenderTargetProperties::NumRTVFormats(1),
RenderTargetProperties::Clear(false),
RenderTargetProperties::ClearDepth(false),
Expand Down

0 comments on commit ad0a90b

Please # to comment.