For APIs with proper separate sampler objects use debug names. Refs #273

This commit is contained in:
baldurk
2016-05-26 23:51:09 +02:00
parent e99660bebc
commit 1914a8a029
9 changed files with 61 additions and 3 deletions
+3
View File
@@ -137,6 +137,7 @@ struct D3D11PipelineState
{
Sampler()
: Samp(),
customSamplerName(false),
UseBorder(false),
UseComparison(false),
MaxAniso(0),
@@ -147,6 +148,8 @@ struct D3D11PipelineState
BorderColor[0] = BorderColor[1] = BorderColor[2] = BorderColor[3] = 0.0f;
}
ResourceId Samp;
rdctype::str SamplerName;
bool32 customSamplerName;
rdctype::str AddressU, AddressV, AddressW;
float BorderColor[4];
rdctype::str Comparison;
+19
View File
@@ -45,10 +45,29 @@ struct VulkanPipelineState
struct BindingElement
{
BindingElement()
: customSamplerName(false),
baseMip(0),
baseLayer(0),
offset(0),
size(0),
mipBias(0.0f),
maxAniso(0.0f),
compareEnable(false),
minlod(0.0f),
maxlod(0.0f),
borderEnable(false),
unnormalized(false)
{
}
ResourceId view; // bufferview, imageview, attachmentview
ResourceId res; // buffer, image, attachment
ResourceId sampler;
rdctype::str SamplerName;
bool32 customSamplerName;
// image views
uint32_t baseMip;
uint32_t baseLayer;
+7 -2
View File
@@ -351,6 +351,8 @@ template <>
void Serialiser::Serialise(const char *name, D3D11PipelineState::ShaderStage::Sampler &el)
{
Serialise("", el.Samp);
Serialise("", el.SamplerName);
Serialise("", el.customSamplerName);
Serialise("", el.AddressU);
Serialise("", el.AddressV);
Serialise("", el.AddressW);
@@ -364,7 +366,7 @@ void Serialiser::Serialise(const char *name, D3D11PipelineState::ShaderStage::Sa
Serialise("", el.MinLOD);
Serialise("", el.MipLODBias);
SIZE_CHECK(D3D11PipelineState::ShaderStage::Sampler, 128);
SIZE_CHECK(D3D11PipelineState::ShaderStage::Sampler, 152);
}
template <>
@@ -731,6 +733,9 @@ void Serialiser::Serialise(
Serialise("", el.res);
Serialise("", el.sampler);
Serialise("", el.SamplerName);
Serialise("", el.customSamplerName);
Serialise("", el.baseMip);
Serialise("", el.baseLayer);
@@ -753,7 +758,7 @@ void Serialiser::Serialise(
Serialise("", el.border);
Serialise("", el.unnormalized);
SIZE_CHECK(VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement, 216);
SIZE_CHECK(VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement, 240);
};
template <>
+9
View File
@@ -609,6 +609,15 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
if(samp.Samp != ResourceId())
{
samp.SamplerName = GetDebugName(src.Samplers[s]);
samp.customSamplerName = true;
if(samp.SamplerName.count == 0)
{
samp.customSamplerName = false;
samp.SamplerName = StringFormat::Fmt("Sampler %llu", samp.Samp);
}
D3D11_SAMPLER_DESC desc;
src.Samplers[s]->GetDesc(&desc);
+10
View File
@@ -3426,8 +3426,18 @@ void VulkanReplay::SavePipelineState()
dst.bindings[b].binds[a];
const VulkanCreationInfo::Sampler &sampl = c.m_Sampler[el.sampler];
ResourceId liveId = el.sampler;
el.sampler = rm->GetOriginalID(el.sampler);
el.customSamplerName = true;
el.SamplerName = m_pDriver->m_CreationInfo.m_Names[liveId];
if(el.SamplerName.count == 0)
{
el.customSamplerName = false;
el.SamplerName = StringFormat::Fmt("Sampler %llu", el.sampler);
}
// sampler info
el.mag = ToStr::Get(sampl.magFilter);
el.min = ToStr::Get(sampl.minFilter);
@@ -156,6 +156,11 @@ namespace renderdoc
public class Sampler
{
public ResourceId Samp;
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
public string SamplerName;
public bool customSamplerName;
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
public string AddressU, AddressV, AddressW;
[CustomMarshalAs(CustomUnmanagedType.FixedArray, FixedLength = 4)]
@@ -56,6 +56,10 @@ namespace renderdoc
public ResourceId res;
public ResourceId sampler;
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
public string SamplerName;
public bool customSamplerName;
public UInt32 baseMip;
public UInt32 baseLayer;
@@ -409,6 +409,9 @@ namespace renderdocui.Windows.PipelineState
if (shaderInput != null && shaderInput.name.Length > 0)
slotname += ": " + shaderInput.name;
if (s.customSamplerName)
slotname += "(" + s.SamplerName + ")";
string borderColor = s.BorderColor[0].ToString() + ", " +
s.BorderColor[1].ToString() + ", " +
s.BorderColor[2].ToString() + ", " +
@@ -308,7 +308,7 @@ namespace renderdocui.Windows.PipelineState
lod += String.Format(" Bias {0}", descriptor.mipBias);
return new object[] {
"", bindset, slotname, "Sampler", "Sampler " + descriptor.sampler.ToString(),
"", bindset, slotname, "Sampler", descriptor.SamplerName,
addressing,
filter,
lod