resource state fixes for visibility rendering
This commit is contained in:
@@ -695,10 +695,16 @@ namespace wi
|
||||
);
|
||||
wi::renderer::UpdateRenderData(visibility_main, frameCB, cmd);
|
||||
|
||||
GPUBarrier barriers[] = {
|
||||
uint32_t num_barriers = 1;
|
||||
GPUBarrier barriers[2] = {
|
||||
GPUBarrier::Image(&debugUAV, debugUAV.desc.layout, ResourceState::UNORDERED_ACCESS),
|
||||
};
|
||||
device->Barrier(barriers, arraysize(barriers), cmd);
|
||||
if (visibility_shading_in_compute)
|
||||
{
|
||||
num_barriers = 2;
|
||||
barriers[1] = GPUBarrier::Image(&rtMain, rtMain.desc.layout, ResourceState::SHADER_RESOURCE_COMPUTE); // prepares transition for discard in dx12
|
||||
}
|
||||
device->Barrier(barriers, num_barriers, cmd);
|
||||
|
||||
});
|
||||
|
||||
@@ -1254,7 +1260,7 @@ namespace wi
|
||||
RenderPassImage rp[] = {
|
||||
RenderPassImage::RenderTarget(
|
||||
&rtMain_render,
|
||||
RenderPassImage::LoadOp::DONTCARE
|
||||
visibility_shading_in_compute ? RenderPassImage::LoadOp::LOAD : RenderPassImage::LoadOp::DONTCARE
|
||||
),
|
||||
RenderPassImage::DepthStencil(
|
||||
&depthBuffer_Main,
|
||||
|
||||
+10
-13
@@ -9248,11 +9248,12 @@ void Visibility_Surface(
|
||||
|
||||
BindCommonResources(cmd);
|
||||
|
||||
barrier_stack.push_back(GPUBarrier::Image(&output, output.desc.layout, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_normals, res.texture_normals.desc.layout, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_roughness, res.texture_roughness.desc.layout, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_0, ResourceState::SHADER_RESOURCE, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_1, ResourceState::SHADER_RESOURCE, ResourceState::UNORDERED_ACCESS));
|
||||
// First, do a bunch of resource discards to initialize texture metadata:
|
||||
barrier_stack.push_back(GPUBarrier::Image(&output, ResourceState::UNDEFINED, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_normals, ResourceState::UNDEFINED, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_roughness, ResourceState::UNDEFINED, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_0, ResourceState::UNDEFINED, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_1, ResourceState::UNDEFINED, ResourceState::UNORDERED_ACCESS));
|
||||
barrier_stack_flush(cmd);
|
||||
|
||||
device->BindResource(&res.binned_tiles, 0, cmd);
|
||||
@@ -9338,8 +9339,8 @@ void Visibility_Shade(
|
||||
|
||||
BindCommonResources(cmd);
|
||||
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_0, ResourceState::UNORDERED_ACCESS, ResourceState::SHADER_RESOURCE));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_1, ResourceState::UNORDERED_ACCESS, ResourceState::SHADER_RESOURCE));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_0, ResourceState::UNORDERED_ACCESS, res.texture_payload_0.desc.layout));
|
||||
barrier_stack.push_back(GPUBarrier::Image(&res.texture_payload_1, ResourceState::UNORDERED_ACCESS, res.texture_payload_1.desc.layout));
|
||||
barrier_stack_flush(cmd);
|
||||
|
||||
device->BindResource(&res.binned_tiles, 0, cmd);
|
||||
@@ -9357,12 +9358,8 @@ void Visibility_Shade(
|
||||
device->DispatchIndirect(&res.bins, i * sizeof(ShaderTypeBin) + offsetof(ShaderTypeBin, dispatchX), cmd);
|
||||
}
|
||||
|
||||
{
|
||||
GPUBarrier barriers[] = {
|
||||
GPUBarrier::Image(&output, ResourceState::UNORDERED_ACCESS, output.desc.layout),
|
||||
};
|
||||
device->Barrier(barriers, arraysize(barriers), cmd);
|
||||
}
|
||||
barrier_stack.push_back(GPUBarrier::Image(&output, ResourceState::UNORDERED_ACCESS, output.desc.layout));
|
||||
barrier_stack_flush(cmd);
|
||||
|
||||
wi::profiler::EndRange(range);
|
||||
device->EventEnd(cmd);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 71;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 167;
|
||||
const int revision = 168;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user