[GPU] Get unclipped draw height by running VS on the CPU

This commit is contained in:
Triang3l
2022-04-28 22:25:25 +03:00
parent b2b1d7b518
commit 0fd578cafd
12 changed files with 1866 additions and 53 deletions

View File

@@ -847,7 +847,8 @@ bool D3D12CommandProcessor::SetupContext() {
// Initialize the render target cache before configuring binding - need to
// know if using rasterizer-ordered views for the bindless root signature.
render_target_cache_ = std::make_unique<D3D12RenderTargetCache>(
*register_file_, *this, trace_writer_, bindless_resources_used_);
*register_file_, *memory_, trace_writer_, *this,
bindless_resources_used_);
if (!render_target_cache_->Initialize()) {
XELOGE("Failed to initialize the render target cache");
return false;
@@ -2147,7 +2148,7 @@ bool D3D12CommandProcessor::IssueDraw(xenos::PrimitiveType primitive_type,
: 0;
if (!render_target_cache_->Update(is_rasterization_done,
normalized_depth_control,
normalized_color_mask)) {
normalized_color_mask, *vertex_shader)) {
return false;
}

View File

@@ -1251,10 +1251,10 @@ void D3D12RenderTargetCache::BeginSubmission() {
bool D3D12RenderTargetCache::Update(
bool is_rasterization_done, reg::RB_DEPTHCONTROL normalized_depth_control,
uint32_t shader_writes_color_targets) {
uint32_t shader_writes_color_targets, const Shader& vertex_shader) {
if (!RenderTargetCache::Update(is_rasterization_done,
normalized_depth_control,
shader_writes_color_targets)) {
shader_writes_color_targets, vertex_shader)) {
return false;
}
switch (GetPath()) {

View File

@@ -43,10 +43,10 @@ class D3D12CommandProcessor;
class D3D12RenderTargetCache final : public RenderTargetCache {
public:
D3D12RenderTargetCache(const RegisterFile& register_file,
const Memory& memory, TraceWriter& trace_writer,
D3D12CommandProcessor& command_processor,
TraceWriter& trace_writer,
bool bindless_resources_used)
: RenderTargetCache(register_file),
: RenderTargetCache(register_file, memory, &trace_writer),
command_processor_(command_processor),
trace_writer_(trace_writer),
bindless_resources_used_(bindless_resources_used) {}
@@ -65,7 +65,8 @@ class D3D12RenderTargetCache final : public RenderTargetCache {
bool Update(bool is_rasterization_done,
reg::RB_DEPTHCONTROL normalized_depth_control,
uint32_t shader_writes_color_targets) override;
uint32_t shader_writes_color_targets,
const Shader& vertex_shader) override;
void InvalidateCommandListRenderTargets() {
are_current_command_list_render_targets_valid_ = false;