[D3D12] ROV: Empty pixel shader for depth-only drawing

This commit is contained in:
Triang3l
2018-10-16 14:02:43 +03:00
parent 6e9964b43e
commit 2d56c9ae30
4 changed files with 560 additions and 440 deletions

View File

@@ -15,6 +15,7 @@
#include <cinttypes>
#include <cmath>
#include <cstring>
#include <utility>
#include "xenia/base/assert.h"
#include "xenia/base/logging.h"
@@ -42,6 +43,11 @@ PipelineCache::PipelineCache(D3D12CommandProcessor* command_processor,
edram_rov_used_(edram_rov_used) {
shader_translator_ = std::make_unique<DxbcShaderTranslator>(edram_rov_used_);
if (edram_rov_used_) {
depth_only_pixel_shader_ =
std::move(shader_translator_->CreateDepthOnlyPixelShader());
}
// Set pipeline state description values we never change.
// Zero out tessellation, stream output, blend state and formats for render
// targets 4+, node mask, cached PSO, flags and other things.
@@ -325,8 +331,13 @@ PipelineCache::UpdateStatus PipelineCache::UpdateShaderStages(
update_desc_.PS.pShaderBytecode = pixel_shader->translated_binary().data();
update_desc_.PS.BytecodeLength = pixel_shader->translated_binary().size();
} else {
update_desc_.PS.pShaderBytecode = nullptr;
update_desc_.PS.BytecodeLength = 0;
if (edram_rov_used_) {
update_desc_.PS.pShaderBytecode = depth_only_pixel_shader_.data();
update_desc_.PS.BytecodeLength = depth_only_pixel_shader_.size();
} else {
update_desc_.PS.pShaderBytecode = nullptr;
update_desc_.PS.BytecodeLength = 0;
}
}
switch (primitive_type) {
case PrimitiveType::kPointList: