[D3D12] ROV: Empty pixel shader for depth-only drawing
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define XENIA_GPU_D3D12_PIPELINE_CACHE_H_
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/xxhash/xxhash.h"
|
||||
|
||||
@@ -93,6 +94,10 @@ class PipelineCache {
|
||||
// All loaded shaders mapped by their guest hash key.
|
||||
std::unordered_map<uint64_t, D3D12Shader*> shader_map_;
|
||||
|
||||
// Empty depth-only pixel shader for writing to depth buffer via ROV when no
|
||||
// Xenos pixel shader provided.
|
||||
std::vector<uint8_t> depth_only_pixel_shader_;
|
||||
|
||||
// Hash state used to incrementally produce pipeline hashes during update.
|
||||
// By the time the full update pass has run the hash will represent the
|
||||
// current state in a way that can uniquely identify the produced
|
||||
|
||||
Reference in New Issue
Block a user