[D3D12] Pipeline debug name, DXBC norm16 vertex fix

This commit is contained in:
Triang3l 2018-09-16 15:57:22 +03:00
parent c9ffe98d21
commit 5f0df6d1fa
2 changed files with 20 additions and 3 deletions

View File

@ -19,6 +19,7 @@
#include "xenia/base/assert.h" #include "xenia/base/assert.h"
#include "xenia/base/logging.h" #include "xenia/base/logging.h"
#include "xenia/base/profiling.h" #include "xenia/base/profiling.h"
#include "xenia/base/string.h"
#include "xenia/gpu/d3d12/d3d12_command_processor.h" #include "xenia/gpu/d3d12/d3d12_command_processor.h"
#include "xenia/gpu/gpu_flags.h" #include "xenia/gpu/gpu_flags.h"
@ -692,7 +693,19 @@ PipelineCache::Pipeline* PipelineCache::GetPipeline(uint64_t hash_key) {
XELOGE("Failed to create graphics pipeline state"); XELOGE("Failed to create graphics pipeline state");
return nullptr; return nullptr;
} }
// TODO(Triang3l): Set the name for the pipeline, with shader hashes.
std::wstring name;
if (update_shader_stages_regs_.pixel_shader != nullptr) {
name = xe::format_string(
L"VS %.16I64X, PS %.16I64X, PL %.16I64X",
update_shader_stages_regs_.vertex_shader->ucode_data_hash(),
update_shader_stages_regs_.pixel_shader->ucode_data_hash(), hash_key);
} else {
name = xe::format_string(
L"VS %.16I64X, PL %.16I64X",
update_shader_stages_regs_.vertex_shader->ucode_data_hash(), hash_key);
}
state->SetName(name.c_str());
// Add to cache with the hash key for reuse. // Add to cache with the hash key for reuse.
Pipeline* pipeline = new Pipeline; Pipeline* pipeline = new Pipeline;

View File

@ -3017,8 +3017,9 @@ void DxbcShaderTranslator::ProcessVertexFetchInstruction(
extract_widths[3] = 16; extract_widths[3] = 16;
extract_offsets[1] = extract_offsets[3] = 16; extract_offsets[1] = extract_offsets[3] = 16;
extract_swizzle = 0b01010000; extract_swizzle = 0b01010000;
normalize_scales[0] = normalize_scales[1] = normalize_scales[0] = normalize_scales[1] = normalize_scales[2] =
instr.attributes.is_signed ? (1.0f / 32767.0f) : (1.0f / 65535.0f); normalize_scales[3] = instr.attributes.is_signed ? (1.0f / 32767.0f)
: (1.0f / 65535.0f);
break; break;
case VertexFormat::k_16_16_FLOAT: case VertexFormat::k_16_16_FLOAT:
extract_signed = false; extract_signed = false;
@ -3041,6 +3042,9 @@ void DxbcShaderTranslator::ProcessVertexFetchInstruction(
instr.attributes.is_signed ? (1.0f / 2147483647.0f) instr.attributes.is_signed ? (1.0f / 2147483647.0f)
: (1.0f / 4294967295.0f); : (1.0f / 4294967295.0f);
break; break;
default:
// 32-bit float.
break;
} }
// Extract components from packed data if needed. // Extract components from packed data if needed.