Rename typeHint to typeCast

This commit is contained in:
baldurk
2019-10-30 16:33:44 +00:00
parent e6627542cf
commit 01344c7e83
39 changed files with 452 additions and 435 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ public:
CompType compType = m_Tex->format.compType;
if(compType == CompType::Typeless)
compType = display.typeHint;
compType = display.typeCast;
m_IsUint = (compType == CompType::UInt);
m_IsSint = (compType == CompType::SInt);
+25 -25
View File
@@ -113,7 +113,7 @@ int Following::GetFirstArraySlice(ICaptureContext &ctx)
CompType Following::GetTypeHint(ICaptureContext &ctx)
{
return GetBoundResource(ctx, arrayEl).typeHint;
return GetBoundResource(ctx, arrayEl).typeCast;
}
ResourceId Following::GetResourceId(ICaptureContext &ctx)
@@ -805,10 +805,10 @@ void TextureViewer::RT_UpdateVisualRange(IReplayController *)
bool uintTex = (tex.format.compType == CompType::UInt);
bool sintTex = (tex.format.compType == CompType::SInt);
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeHint == CompType::UInt)
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::UInt)
uintTex = true;
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeHint == CompType::SInt)
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::SInt)
sintTex = true;
if(m_TexDisplay.customShaderId != ResourceId())
@@ -887,10 +887,10 @@ void TextureViewer::UI_UpdateStatusText()
bool uintTex = (tex.format.compType == CompType::UInt);
bool sintTex = (tex.format.compType == CompType::SInt);
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeHint == CompType::UInt)
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::UInt)
uintTex = true;
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeHint == CompType::SInt)
if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::SInt)
sintTex = true;
if(m_TexDisplay.overlay == DebugOverlay::QuadOverdrawPass ||
@@ -1173,13 +1173,13 @@ void TextureViewer::UI_UpdateTextureDetails()
CompType viewCast = CompType::Typeless;
if(current.format.compType != m_TexDisplay.typeHint &&
m_TexDisplay.typeHint != CompType::Typeless && !yuv)
if(current.format.compType != m_TexDisplay.typeCast &&
m_TexDisplay.typeCast != CompType::Typeless && !yuv)
{
viewCast = m_TexDisplay.typeHint;
viewCast = m_TexDisplay.typeCast;
}
else if(current.format.compType == CompType::Typeless &&
m_TexDisplay.typeHint == CompType::Typeless && !yuv)
m_TexDisplay.typeCast == CompType::Typeless && !yuv)
{
// if it's a typeless texture and we don't have a hint, ensure the user knows it's being viewed
// as unorm as a fallback
@@ -1229,22 +1229,22 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
m_TextureSettings[m_TexDisplay.resourceId].minrange = ui->rangeHistogram->blackPoint();
m_TextureSettings[m_TexDisplay.resourceId].maxrange = ui->rangeHistogram->whitePoint();
if(m_TexDisplay.typeHint != CompType::Typeless)
m_TextureSettings[m_TexDisplay.resourceId].typeHint = m_TexDisplay.typeHint;
if(m_TexDisplay.typeCast != CompType::Typeless)
m_TextureSettings[m_TexDisplay.resourceId].typeCast = m_TexDisplay.typeCast;
}
m_TexDisplay.resourceId = tex.resourceId;
// interpret the texture according to the currently following type.
if(!currentTextureIsLocked())
m_TexDisplay.typeHint = m_Following.GetTypeHint(m_Ctx);
m_TexDisplay.typeCast = m_Following.GetTypeHint(m_Ctx);
else
m_TexDisplay.typeHint = CompType::Typeless;
m_TexDisplay.typeCast = CompType::Typeless;
// if there is no such type or it isn't being followed, use the last seen interpretation
if(m_TexDisplay.typeHint == CompType::Typeless &&
if(m_TexDisplay.typeCast == CompType::Typeless &&
m_TextureSettings.contains(m_TexDisplay.resourceId))
m_TexDisplay.typeHint = m_TextureSettings[m_TexDisplay.resourceId].typeHint;
m_TexDisplay.typeCast = m_TextureSettings[m_TexDisplay.resourceId].typeCast;
// try to maintain the pan in the new texture. If the new texture
// is approx an integer multiple of the old texture, just changing
@@ -1475,14 +1475,14 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
ui->flip_y->setChecked(false);
m_NoRangePaint = true;
UI_SetHistogramRange(texptr, m_TexDisplay.typeHint);
UI_SetHistogramRange(texptr, m_TexDisplay.typeCast);
m_NoRangePaint = false;
}
// reset the range if desired
if(m_Ctx.Config().TextureViewer_ResetRange)
{
UI_SetHistogramRange(texptr, m_TexDisplay.typeHint);
UI_SetHistogramRange(texptr, m_TexDisplay.typeCast);
}
}
@@ -1505,9 +1505,9 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
HighlightUsage();
}
void TextureViewer::UI_SetHistogramRange(const TextureDescription *tex, CompType typeHint)
void TextureViewer::UI_SetHistogramRange(const TextureDescription *tex, CompType typeCast)
{
if(tex != NULL && (tex->format.compType == CompType::SNorm || typeHint == CompType::SNorm))
if(tex != NULL && (tex->format.compType == CompType::SNorm || typeCast == CompType::SNorm))
ui->rangeHistogram->setRange(-1.0f, 1.0f);
else
ui->rangeHistogram->setRange(0.0f, 1.0f);
@@ -2164,7 +2164,7 @@ void TextureViewer::InitResourcePreview(ResourcePreview *prev, BoundResource res
if(m_Ctx.GetTexture(res.resourceId))
{
m_Ctx.Replay().AsyncInvoke([this, winData, res](IReplayController *) {
m_Output->AddThumbnail(winData, res.resourceId, res.typeHint,
m_Output->AddThumbnail(winData, res.resourceId, res.typeCast,
res.firstMip >= 0 ? res.firstMip : 0,
res.firstSlice >= 0 ? res.firstSlice : 0);
});
@@ -3322,7 +3322,7 @@ void TextureViewer::on_autoFit_mouseClicked(QMouseEvent *e)
void TextureViewer::on_reset01_clicked()
{
UI_SetHistogramRange(GetCurrentTexture(), m_TexDisplay.typeHint);
UI_SetHistogramRange(GetCurrentTexture(), m_TexDisplay.typeCast);
ui->autoFit->setChecked(false);
@@ -3369,9 +3369,9 @@ void TextureViewer::AutoFitRange()
{
fmt.compType = CompType::Float;
}
if(fmt.compType == CompType::Typeless && m_TexDisplay.typeHint == CompType::UInt)
if(fmt.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::UInt)
fmt.compType = CompType::UInt;
if(fmt.compType == CompType::Typeless && m_TexDisplay.typeHint == CompType::SInt)
if(fmt.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::SInt)
fmt.compType = CompType::SInt;
for(int i = 0; i < 4; i++)
@@ -3611,7 +3611,7 @@ void TextureViewer::on_saveTex_clicked()
// overwrite save params with current texture display settings
m_SaveConfig.resourceId = m_TexDisplay.resourceId;
m_SaveConfig.typeHint = m_TexDisplay.typeHint;
m_SaveConfig.typeCast = m_TexDisplay.typeCast;
m_SaveConfig.slice.sliceIndex = (int)m_TexDisplay.sliceFace;
m_SaveConfig.mip = (int)m_TexDisplay.mip;
@@ -3778,7 +3778,7 @@ void TextureViewer::on_pixelHistory_clicked()
m_Ctx.Replay().AsyncInvoke([this, texptr, x, y, hist, histWidget](IReplayController *r) {
rdcarray<PixelModification> history =
r->PixelHistory(texptr->resourceId, (uint32_t)x, (int32_t)y, m_TexDisplay.sliceFace,
m_TexDisplay.mip, m_TexDisplay.sampleIdx, m_TexDisplay.typeHint);
m_TexDisplay.mip, m_TexDisplay.sampleIdx, m_TexDisplay.typeCast);
GUIInvoke::call(this, [hist, histWidget, history] {
if(histWidget)
+3 -3
View File
@@ -105,7 +105,7 @@ struct TexSettings
slice = 0;
minrange = 0.0f;
maxrange = 1.0f;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
}
int displayType; // RGBA, RGBM, YUV Decode, Custom
@@ -115,7 +115,7 @@ struct TexSettings
bool depth, stencil;
int mip, slice;
float minrange, maxrange;
CompType typeHint;
CompType typeCast;
};
class TextureViewer : public QFrame, public ITextureViewer, public ICaptureViewer
@@ -228,7 +228,7 @@ private:
void UI_UpdateTextureDetails();
void UI_OnTextureSelectionChanged(bool newdraw);
void UI_SetHistogramRange(const TextureDescription *tex, CompType typeHint);
void UI_SetHistogramRange(const TextureDescription *tex, CompType typeCast);
void UI_UpdateChannels();
+6 -6
View File
@@ -235,7 +235,7 @@ struct BoundResource
dynamicallyUsed = true;
firstMip = -1;
firstSlice = -1;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
}
BoundResource(ResourceId id)
{
@@ -243,14 +243,14 @@ struct BoundResource
dynamicallyUsed = true;
firstMip = -1;
firstSlice = -1;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
}
BoundResource(const BoundResource &) = default;
bool operator==(const BoundResource &o) const
{
return resourceId == o.resourceId && firstMip == o.firstMip && firstSlice == o.firstSlice &&
typeHint == o.typeHint;
typeCast == o.typeCast;
}
bool operator<(const BoundResource &o) const
{
@@ -260,8 +260,8 @@ struct BoundResource
return firstMip < o.firstMip;
if(firstSlice != o.firstSlice)
return firstSlice < o.firstSlice;
if(typeHint != o.typeHint)
return typeHint < o.typeHint;
if(typeCast != o.typeCast)
return typeCast < o.typeCast;
return false;
}
DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the bound resource.");
@@ -278,7 +278,7 @@ scenarios where only a small sparse subset of bound resources are actually used.
int firstSlice;
DOCUMENT(
"For textures, a :class:`~renderdoc.CompType` hint for how to interpret typeless textures.");
CompType typeHint;
CompType typeCast;
};
DECLARE_REFLECTION_STRUCT(BoundResource);
+14 -4
View File
@@ -198,8 +198,13 @@ struct TextureDisplay
DOCUMENT("The :class:`ResourceId` of the texture to display.");
ResourceId resourceId;
DOCUMENT("An optional :class:`CompType` hint to use when displaying a typeless texture.");
CompType typeHint = CompType::Typeless;
DOCUMENT(R"(If possible interpret the texture with this type instead of its normal type.
If set to :data:`CompType.Typeless` then no cast is applied, otherwise where allowed the texture
data will be reinterpreted - e.g. from unsigned integers to floats, or to unsigned normalised
values.
)");
CompType typeCast = CompType::Typeless;
DOCUMENT("The value in each channel to map to the black point.");
float rangeMin = 0.0f;
@@ -407,8 +412,13 @@ struct TextureSave
DOCUMENT("The :class:`ResourceId` of the texture to save.");
ResourceId resourceId;
DOCUMENT("An optional :class:`CompType` hint to use when saving a typeless texture.");
CompType typeHint = CompType::Typeless;
DOCUMENT(R"(If possible interpret the texture with this type instead of its normal type.
If set to :data:`CompType.Typeless` then no cast is applied, otherwise where allowed the texture
data will be reinterpreted - e.g. from unsigned integers to floats, or to unsigned normalised
values.
)");
CompType typeCast = CompType::Typeless;
DOCUMENT("The :class:`FileType` to use when saving to the destination file.");
FileType destType = FileType::DDS;
+18 -18
View File
@@ -1020,7 +1020,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage)
val.resourceId = s.srvs[i].resourceResourceId;
val.firstMip = (int)s.srvs[i].firstMip;
val.firstSlice = (int)s.srvs[i].firstSlice;
val.typeHint = s.srvs[i].viewFormat.compType;
val.typeCast = s.srvs[i].viewFormat.compType;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1053,7 +1053,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage)
val.resourceId = bind.resourceId;
val.firstMip = (int)bind.firstMip;
val.firstSlice = (int)bind.firstSlice;
val.typeHint = bind.viewFormat.compType;
val.typeCast = bind.viewFormat.compType;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1073,7 +1073,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage)
val.resourceId = m_GL->textures[i].resourceId;
val.firstMip = (int)m_GL->textures[i].firstMip;
val.firstSlice = 0;
val.typeHint = CompType::Typeless;
val.typeCast = CompType::Typeless;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1118,7 +1118,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage)
val[i].dynamicallyUsed = bind.binds[i].dynamicallyUsed;
val[i].firstMip = (int)bind.binds[i].firstMip;
val[i].firstSlice = (int)bind.binds[i].firstSlice;
val[i].typeHint = bind.binds[i].viewFormat.compType;
val[i].typeCast = bind.binds[i].viewFormat.compType;
}
}
}
@@ -1151,7 +1151,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage)
val.resourceId = m_D3D11->computeShader.uavs[i].resourceResourceId;
val.firstMip = (int)m_D3D11->computeShader.uavs[i].firstMip;
val.firstSlice = (int)m_D3D11->computeShader.uavs[i].firstSlice;
val.typeHint = m_D3D11->computeShader.uavs[i].viewFormat.compType;
val.typeCast = m_D3D11->computeShader.uavs[i].viewFormat.compType;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1179,7 +1179,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage)
val.resourceId = m_D3D11->outputMerger.uavs[i].resourceResourceId;
val.firstMip = (int)m_D3D11->outputMerger.uavs[i].firstMip;
val.firstSlice = (int)m_D3D11->outputMerger.uavs[i].firstSlice;
val.typeHint = m_D3D11->outputMerger.uavs[i].viewFormat.compType;
val.typeCast = m_D3D11->outputMerger.uavs[i].viewFormat.compType;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1211,7 +1211,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage)
val.resourceId = bind.resourceId;
val.firstMip = (int)bind.firstMip;
val.firstSlice = (int)bind.firstSlice;
val.typeHint = bind.viewFormat.compType;
val.typeCast = bind.viewFormat.compType;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1229,7 +1229,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage)
val.resourceId = m_GL->images[i].resourceId;
val.firstMip = (int)m_GL->images[i].mipLevel;
val.firstSlice = (int)m_GL->images[i].slice;
val.typeHint = m_GL->images[i].imageFormat.compType;
val.typeCast = m_GL->images[i].imageFormat.compType;
ret.push_back(BoundResourceArray(key, {val}));
}
@@ -1272,7 +1272,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage)
val[i].dynamicallyUsed = bind.binds[i].dynamicallyUsed;
val[i].firstMip = (int)bind.binds[i].firstMip;
val[i].firstSlice = (int)bind.binds[i].firstSlice;
val[i].typeHint = bind.binds[i].viewFormat.compType;
val[i].typeCast = bind.binds[i].viewFormat.compType;
}
}
}
@@ -1293,7 +1293,7 @@ BoundResource PipeState::GetDepthTarget() const
ret.resourceId = m_D3D11->outputMerger.depthTarget.resourceResourceId;
ret.firstMip = (int)m_D3D11->outputMerger.depthTarget.firstMip;
ret.firstSlice = (int)m_D3D11->outputMerger.depthTarget.firstSlice;
ret.typeHint = m_D3D11->outputMerger.depthTarget.viewFormat.compType;
ret.typeCast = m_D3D11->outputMerger.depthTarget.viewFormat.compType;
return ret;
}
else if(IsCaptureD3D12())
@@ -1302,7 +1302,7 @@ BoundResource PipeState::GetDepthTarget() const
ret.resourceId = m_D3D12->outputMerger.depthTarget.resourceId;
ret.firstMip = (int)m_D3D12->outputMerger.depthTarget.firstMip;
ret.firstSlice = (int)m_D3D12->outputMerger.depthTarget.firstSlice;
ret.typeHint = m_D3D12->outputMerger.depthTarget.viewFormat.compType;
ret.typeCast = m_D3D12->outputMerger.depthTarget.viewFormat.compType;
return ret;
}
else if(IsCaptureGL())
@@ -1311,7 +1311,7 @@ BoundResource PipeState::GetDepthTarget() const
ret.resourceId = m_GL->framebuffer.drawFBO.depthAttachment.resourceId;
ret.firstMip = (int)m_GL->framebuffer.drawFBO.depthAttachment.mipLevel;
ret.firstSlice = (int)m_GL->framebuffer.drawFBO.depthAttachment.slice;
ret.typeHint = CompType::Typeless;
ret.typeCast = CompType::Typeless;
return ret;
}
else if(IsCaptureVK())
@@ -1325,7 +1325,7 @@ BoundResource PipeState::GetDepthTarget() const
ret.resourceId = fb.attachments[rp.depthstencilAttachment].imageResourceId;
ret.firstMip = (int)fb.attachments[rp.depthstencilAttachment].firstMip;
ret.firstSlice = (int)fb.attachments[rp.depthstencilAttachment].firstSlice;
ret.typeHint = fb.attachments[rp.depthstencilAttachment].viewFormat.compType;
ret.typeCast = fb.attachments[rp.depthstencilAttachment].viewFormat.compType;
return ret;
}
@@ -1350,7 +1350,7 @@ rdcarray<BoundResource> PipeState::GetOutputTargets() const
ret[i].resourceId = m_D3D11->outputMerger.renderTargets[i].resourceResourceId;
ret[i].firstMip = (int)m_D3D11->outputMerger.renderTargets[i].firstMip;
ret[i].firstSlice = (int)m_D3D11->outputMerger.renderTargets[i].firstSlice;
ret[i].typeHint = m_D3D11->outputMerger.renderTargets[i].viewFormat.compType;
ret[i].typeCast = m_D3D11->outputMerger.renderTargets[i].viewFormat.compType;
}
}
else if(IsCaptureD3D12())
@@ -1361,7 +1361,7 @@ rdcarray<BoundResource> PipeState::GetOutputTargets() const
ret[i].resourceId = m_D3D12->outputMerger.renderTargets[i].resourceId;
ret[i].firstMip = (int)m_D3D12->outputMerger.renderTargets[i].firstMip;
ret[i].firstSlice = (int)m_D3D12->outputMerger.renderTargets[i].firstSlice;
ret[i].typeHint = m_D3D12->outputMerger.renderTargets[i].viewFormat.compType;
ret[i].typeCast = m_D3D12->outputMerger.renderTargets[i].viewFormat.compType;
}
}
else if(IsCaptureGL())
@@ -1376,7 +1376,7 @@ rdcarray<BoundResource> PipeState::GetOutputTargets() const
ret[i].resourceId = m_GL->framebuffer.drawFBO.colorAttachments[db].resourceId;
ret[i].firstMip = (int)m_GL->framebuffer.drawFBO.colorAttachments[db].mipLevel;
ret[i].firstSlice = (int)m_GL->framebuffer.drawFBO.colorAttachments[db].slice;
ret[i].typeHint = CompType::Typeless;
ret[i].typeCast = CompType::Typeless;
}
}
}
@@ -1395,7 +1395,7 @@ rdcarray<BoundResource> PipeState::GetOutputTargets() const
ret[idx].resourceId = fb.attachments[rp.colorAttachments[i]].imageResourceId;
ret[idx].firstMip = (int)fb.attachments[rp.colorAttachments[i]].firstMip;
ret[idx].firstSlice = (int)fb.attachments[rp.colorAttachments[i]].firstSlice;
ret[idx].typeHint = fb.attachments[rp.colorAttachments[i]].viewFormat.compType;
ret[idx].typeCast = fb.attachments[rp.colorAttachments[i]].viewFormat.compType;
}
idx++;
@@ -1408,7 +1408,7 @@ rdcarray<BoundResource> PipeState::GetOutputTargets() const
ret[idx].resourceId = fb.attachments[rp.resolveAttachments[i]].imageResourceId;
ret[idx].firstMip = (int)fb.attachments[rp.resolveAttachments[i]].firstMip;
ret[idx].firstSlice = (int)fb.attachments[rp.resolveAttachments[i]].firstSlice;
ret[idx].typeHint = fb.attachments[rp.resolveAttachments[i]].viewFormat.compType;
ret[idx].typeCast = fb.attachments[rp.resolveAttachments[i]].viewFormat.compType;
}
idx++;
+10 -3
View File
@@ -740,12 +740,16 @@ Should only be called for texture outputs.
:param WindowingData window: A :class:`WindowingData` describing the native window.
:param ResourceId textureId: The texture ID to display in the thumbnail preview.
:param CompType typeCast: If possible interpret the texture with this type instead of its normal
type. If set to :data:`CompType.Typeless` then no cast is applied, otherwise where allowed the
texture data will be reinterpreted - e.g. from unsigned integers to floats, or to unsigned
normalised values.
:param int slice: The slice of the texture to display.
:param int mip: The mip of the texture to display.
:return: A boolean indicating if the thumbnail was successfully created.
:rtype: ``bool``
)");
virtual bool AddThumbnail(WindowingData window, ResourceId textureId, CompType typeHint,
virtual bool AddThumbnail(WindowingData window, ResourceId textureId, CompType typeCast,
uint32_t mip, uint32_t slice) = 0;
DOCUMENT(R"(Render to the window handle specified when the output was created.
@@ -1245,13 +1249,16 @@ only ever have one result (only one entry point per shader).
:param int slice: The slice of an array or 3D texture, or face of a cubemap texture.
:param int mip: The mip level to pick from.
:param int sampleIdx: The multi-sampled sample. Ignored if non-multisampled texture.
:param CompType typeHint: A hint on how to interpret textures that are typeless.
:param CompType typeCast: If possible interpret the texture with this type instead of its normal
type. If set to :data:`CompType.Typeless` then no cast is applied, otherwise where allowed the
texture data will be reinterpreted - e.g. from unsigned integers to floats, or to unsigned
normalised values.
:return: The list of pixel history events.
:rtype: ``list`` of :class:`PixelModification`
)");
virtual rdcarray<PixelModification> PixelHistory(ResourceId texture, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip, uint32_t sampleIdx,
CompType typeHint) = 0;
CompType typeCast) = 0;
DOCUMENT(R"(Retrieve a debugging trace from running a vertex shader.
+10 -10
View File
@@ -111,15 +111,15 @@ public:
m_Proxy->RenderHighlightBox(w, h, scale);
}
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval)
CompType typeCast, float *minval, float *maxval)
{
return m_Proxy->GetMinMax(m_TextureID, sliceFace, mip, sample, typeHint, minval, maxval);
return m_Proxy->GetMinMax(m_TextureID, sliceFace, mip, sample, typeCast, minval, maxval);
}
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram)
{
return m_Proxy->GetHistogram(m_TextureID, sliceFace, mip, sample, typeHint, minval, maxval,
return m_Proxy->GetHistogram(m_TextureID, sliceFace, mip, sample, typeCast, minval, maxval,
channels, histogram);
}
bool RenderTexture(TextureDisplay cfg)
@@ -129,9 +129,9 @@ public:
return m_Proxy->RenderTexture(cfg);
}
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
uint32_t sample, CompType typeHint, float pixel[4])
uint32_t sample, CompType typeCast, float pixel[4])
{
m_Proxy->PickPixel(m_TextureID, x, y, sliceFace, mip, sample, typeHint, pixel);
m_Proxy->PickPixel(m_TextureID, x, y, sliceFace, mip, sample, typeCast, pixel);
}
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
uint32_t x, uint32_t y)
@@ -154,10 +154,10 @@ public:
}
void FreeCustomShader(ResourceId id) { m_Proxy->FreeTargetResource(id); }
ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
m_CustomTexID =
m_Proxy->ApplyCustomShader(shader, m_TextureID, mip, arrayIdx, sampleIdx, typeHint);
m_Proxy->ApplyCustomShader(shader, m_TextureID, mip, arrayIdx, sampleIdx, typeCast);
return m_CustomTexID;
}
const std::vector<ResourceDescription> &GetResources() { return m_Resources; }
@@ -230,7 +230,7 @@ public:
RDCEraseEl(ret);
return ret;
}
ResourceId RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents)
{
@@ -250,7 +250,7 @@ public:
void FreeTargetResource(ResourceId id) {}
std::vector<PixelModification> PixelHistory(std::vector<EventUsage> events, ResourceId target,
uint32_t x, uint32_t y, uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
return std::vector<PixelModification>();
}
+11 -11
View File
@@ -1045,7 +1045,7 @@ MeshFormat ReplayProxy::GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint
template <typename ParamSerialiser, typename ReturnSerialiser>
ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser &paramser, ReturnSerialiser &retser,
ResourceId texid, CompType typeHint,
ResourceId texid, CompType typeCast,
FloatVector clearCol, DebugOverlay overlay,
uint32_t eventId,
const std::vector<uint32_t> &passEvents)
@@ -1057,7 +1057,7 @@ ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser &paramser, ReturnS
{
BEGIN_PARAMS();
SERIALISE_ELEMENT(texid);
SERIALISE_ELEMENT(typeHint);
SERIALISE_ELEMENT(typeCast);
SERIALISE_ELEMENT(overlay);
SERIALISE_ELEMENT(clearCol);
SERIALISE_ELEMENT(eventId);
@@ -1068,7 +1068,7 @@ ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser &paramser, ReturnS
{
REMOTE_EXECUTION();
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
ret = m_Remote->RenderOverlay(texid, typeHint, clearCol, overlay, eventId, passEvents);
ret = m_Remote->RenderOverlay(texid, typeCast, clearCol, overlay, eventId, passEvents);
}
SERIALISE_RETURN(ret);
@@ -1076,11 +1076,11 @@ ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser &paramser, ReturnS
return ret;
}
ResourceId ReplayProxy::RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId ReplayProxy::RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents)
{
PROXY_FUNCTION(RenderOverlay, texid, typeHint, clearCol, overlay, eventId, passEvents);
PROXY_FUNCTION(RenderOverlay, texid, typeCast, clearCol, overlay, eventId, passEvents);
}
template <typename ParamSerialiser, typename ReturnSerialiser>
@@ -1412,7 +1412,7 @@ template <typename ParamSerialiser, typename ReturnSerialiser>
std::vector<PixelModification> ReplayProxy::Proxied_PixelHistory(
ParamSerialiser &paramser, ReturnSerialiser &retser, std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx,
CompType typeHint)
CompType typeCast)
{
const ReplayProxyPacket expectedPacket = eReplayProxy_PixelHistory;
ReplayProxyPacket packet = eReplayProxy_PixelHistory;
@@ -1427,14 +1427,14 @@ std::vector<PixelModification> ReplayProxy::Proxied_PixelHistory(
SERIALISE_ELEMENT(slice);
SERIALISE_ELEMENT(mip);
SERIALISE_ELEMENT(sampleIdx);
SERIALISE_ELEMENT(typeHint);
SERIALISE_ELEMENT(typeCast);
END_PARAMS();
}
{
REMOTE_EXECUTION();
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
ret = m_Remote->PixelHistory(events, target, x, y, slice, mip, sampleIdx, typeHint);
ret = m_Remote->PixelHistory(events, target, x, y, slice, mip, sampleIdx, typeCast);
}
SERIALISE_RETURN(ret);
@@ -1445,9 +1445,9 @@ std::vector<PixelModification> ReplayProxy::Proxied_PixelHistory(
std::vector<PixelModification> ReplayProxy::PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
PROXY_FUNCTION(PixelHistory, events, target, x, y, slice, mip, sampleIdx, typeHint);
PROXY_FUNCTION(PixelHistory, events, target, x, y, slice, mip, sampleIdx, typeCast);
}
template <typename ParamSerialiser, typename ReturnSerialiser>
@@ -2411,7 +2411,7 @@ void ReplayProxy::RefreshPreviewWindow()
{
TextureDescription texInfo = m_Replay->GetTexture(cfg.resourceId);
cfg.typeHint = CompType::Typeless;
cfg.typeCast = CompType::Typeless;
cfg.rangeMin = 0.0f;
cfg.rangeMax = 1.0f;
cfg.flipY = false;
+10 -10
View File
@@ -246,14 +246,14 @@ public:
}
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval)
CompType typeCast, float *minval, float *maxval)
{
if(m_Proxy)
{
EnsureTexCached(texid, sliceFace, mip);
if(texid == ResourceId() || m_ProxyTextures[texid] == ResourceId())
return false;
return m_Proxy->GetMinMax(m_ProxyTextures[texid], sliceFace, mip, sample, typeHint, minval,
return m_Proxy->GetMinMax(m_ProxyTextures[texid], sliceFace, mip, sample, typeCast, minval,
maxval);
}
@@ -261,7 +261,7 @@ public:
}
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram)
{
if(m_Proxy)
@@ -269,7 +269,7 @@ public:
EnsureTexCached(texid, sliceFace, mip);
if(texid == ResourceId() || m_ProxyTextures[texid] == ResourceId())
return false;
return m_Proxy->GetHistogram(m_ProxyTextures[texid], sliceFace, mip, sample, typeHint, minval,
return m_Proxy->GetHistogram(m_ProxyTextures[texid], sliceFace, mip, sample, typeCast, minval,
maxval, channels, histogram);
}
@@ -300,7 +300,7 @@ public:
}
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
uint32_t sample, CompType typeHint, float pixel[4])
uint32_t sample, CompType typeCast, float pixel[4])
{
if(m_Proxy)
{
@@ -322,7 +322,7 @@ public:
y = (mipHeight - 1) - y;
}
m_Proxy->PickPixel(texture, x, y, sliceFace, mip, sample, typeHint, pixel);
m_Proxy->PickPixel(texture, x, y, sliceFace, mip, sample, typeCast, pixel);
}
}
@@ -434,7 +434,7 @@ public:
}
ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
if(m_Proxy)
{
@@ -443,7 +443,7 @@ public:
return ResourceId();
texid = m_ProxyTextures[texid];
ResourceId customResourceId =
m_Proxy->ApplyCustomShader(shader, texid, mip, arrayIdx, sampleIdx, typeHint);
m_Proxy->ApplyCustomShader(shader, texid, mip, arrayIdx, sampleIdx, typeCast);
m_LocalTextures.insert(customResourceId);
m_ProxyTextures[customResourceId] = customResourceId;
return customResourceId;
@@ -506,7 +506,7 @@ public:
IMPLEMENT_FUNCTION_PROXIED(MeshFormat, GetPostVSBuffers, uint32_t eventId, uint32_t instID,
uint32_t viewID, MeshDataStage stage);
IMPLEMENT_FUNCTION_PROXIED(ResourceId, RenderOverlay, ResourceId texid, CompType typeHint,
IMPLEMENT_FUNCTION_PROXIED(ResourceId, RenderOverlay, ResourceId texid, CompType typeCast,
FloatVector clearCol, DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents);
@@ -523,7 +523,7 @@ public:
IMPLEMENT_FUNCTION_PROXIED(std::vector<PixelModification>, PixelHistory,
std::vector<EventUsage> events, ResourceId target, uint32_t x,
uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx,
CompType typeHint);
CompType typeCast);
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace, DebugVertex, uint32_t eventId, uint32_t vertid,
uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset);
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace, DebugPixel, uint32_t eventId, uint32_t x, uint32_t y,
+4 -4
View File
@@ -115,7 +115,7 @@ public:
void FillCBuffer(ID3D11Buffer *buf, const void *data, size_t size);
TextureShaderDetails GetShaderDetails(ResourceId id, CompType typeHint, bool rawOutput);
TextureShaderDetails GetShaderDetails(ResourceId id, CompType typeCast, bool rawOutput);
void PixelHistoryCopyPixel(CopyPixelParams &params, uint32_t x, uint32_t y);
@@ -126,7 +126,7 @@ public:
struct CacheElem
{
CacheElem(ResourceId id_, CompType typeHint_, bool raw_)
: created(false), id(id_), typeHint(typeHint_), raw(raw_), srvResource(NULL)
: created(false), id(id_), typeCast(typeHint_), raw(raw_), srvResource(NULL)
{
srv[0] = srv[1] = NULL;
}
@@ -140,13 +140,13 @@ public:
bool created;
ResourceId id;
CompType typeHint;
CompType typeCast;
bool raw;
ID3D11Resource *srvResource;
ID3D11ShaderResourceView *srv[2];
};
CacheElem &GetCachedElem(ResourceId id, CompType typeHint, bool raw);
CacheElem &GetCachedElem(ResourceId id, CompType typeCast, bool raw);
private:
void InitCommonResources();
+2 -2
View File
@@ -38,11 +38,11 @@
#include "data/hlsl/hlsl_cbuffers.h"
ResourceId D3D11Replay::RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId D3D11Replay::RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents)
{
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeHint, false);
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeCast, false);
D3D11MarkerRegion renderoverlay(StringFormat::Fmt("RenderOverlay %d", overlay));
@@ -282,7 +282,7 @@ void D3D11DebugManager::PixelHistoryCopyPixel(CopyPixelParams &p, uint32_t x, ui
std::vector<PixelModification> D3D11Replay::PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
std::vector<PixelModification> history;
@@ -292,7 +292,7 @@ std::vector<PixelModification> D3D11Replay::PixelHistory(std::vector<EventUsage>
return history;
// cache the texture details of the destination texture that we're doing the pixel history on
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(target, typeHint, true);
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(target, typeCast, true);
if(details.texFmt == DXGI_FORMAT_UNKNOWN)
return history;
@@ -303,7 +303,7 @@ std::vector<PixelModification> D3D11Replay::PixelHistory(std::vector<EventUsage>
// Use the given type hint for typeless textures
details.texFmt = GetNonSRGBFormat(details.texFmt);
details.texFmt = GetTypedFormat(details.texFmt, typeHint);
details.texFmt = GetTypedFormat(details.texFmt, typeCast);
SCOPED_TIMER("D3D11DebugManager::PixelHistory");
+13 -13
View File
@@ -32,12 +32,12 @@
#include "data/hlsl/hlsl_cbuffers.h"
D3D11DebugManager::CacheElem &D3D11DebugManager::GetCachedElem(ResourceId id, CompType typeHint,
D3D11DebugManager::CacheElem &D3D11DebugManager::GetCachedElem(ResourceId id, CompType typeCast,
bool raw)
{
for(auto it = m_ShaderItemCache.begin(); it != m_ShaderItemCache.end(); ++it)
{
if(it->id == id && it->typeHint == typeHint && it->raw == raw)
if(it->id == id && it->typeCast == typeCast && it->raw == raw)
return *it;
}
@@ -48,11 +48,11 @@ D3D11DebugManager::CacheElem &D3D11DebugManager::GetCachedElem(ResourceId id, Co
m_ShaderItemCache.pop_back();
}
m_ShaderItemCache.push_front(CacheElem(id, typeHint, raw));
m_ShaderItemCache.push_front(CacheElem(id, typeCast, raw));
return m_ShaderItemCache.front();
}
TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType typeHint,
TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType typeCast,
bool rawOutput)
{
TextureShaderDetails details;
@@ -60,7 +60,7 @@ TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType
bool foundResource = false;
CacheElem &cache = GetCachedElem(id, typeHint, rawOutput);
CacheElem &cache = GetCachedElem(id, typeCast, rawOutput);
bool msaaDepth = false;
@@ -89,7 +89,7 @@ TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType
details.texArraySize = desc1d.ArraySize;
details.texMips = desc1d.MipLevels;
srvFormat = GetTypedFormat(details.texFmt, typeHint);
srvFormat = GetTypedFormat(details.texFmt, typeCast);
details.srvResource = wrapTex1D;
@@ -152,10 +152,10 @@ TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType
}
if(mode == TEXDISPLAY_DEPTH_TARGET || IsDepthFormat(details.texFmt) ||
IsDepthFormat(GetTypedFormat(details.texFmt, typeHint)))
IsDepthFormat(GetTypedFormat(details.texFmt, typeCast)))
{
details.texType = eTexType_Depth;
details.texFmt = GetTypedFormat(details.texFmt, typeHint);
details.texFmt = GetTypedFormat(details.texFmt, typeCast);
}
// backbuffer is always interpreted as SRGB data regardless of format specified:
@@ -179,7 +179,7 @@ TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType
details.texFmt = GetSRGBFormat(wrapTex2D->m_RealDescriptor->Format);
}
srvFormat = GetTypedFormat(details.texFmt, typeHint);
srvFormat = GetTypedFormat(details.texFmt, typeCast);
details.srvResource = wrapTex2D;
@@ -246,7 +246,7 @@ TextureShaderDetails D3D11DebugManager::GetShaderDetails(ResourceId id, CompType
details.texArraySize = 1;
details.texMips = desc3d.MipLevels;
srvFormat = GetTypedFormat(details.texFmt, typeHint);
srvFormat = GetTypedFormat(details.texFmt, typeCast);
details.srvResource = wrapTex3D;
@@ -504,7 +504,7 @@ bool D3D11Replay::RenderTextureInternal(TextureDisplay cfg, bool blendAlpha)
pixelData.FlipY = cfg.flipY ? 1 : 0;
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(cfg.resourceId, cfg.typeHint,
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(cfg.resourceId, cfg.typeCast,
cfg.rawOutput ? true : false);
int sampleIdx = (int)RDCCLAMP(cfg.sampleIdx, 0U, details.sampleCount - 1);
@@ -750,13 +750,13 @@ bool D3D11Replay::RenderTextureInternal(TextureDisplay cfg, bool blendAlpha)
int srvOffset = 0;
if(IsUIntFormat(details.texFmt) ||
(IsTypelessFormat(details.texFmt) && cfg.typeHint == CompType::UInt))
(IsTypelessFormat(details.texFmt) && cfg.typeCast == CompType::UInt))
{
pixelData.OutputDisplayFormat |= TEXDISPLAY_UINT_TEX;
srvOffset = 10;
}
if(IsIntFormat(details.texFmt) ||
(IsTypelessFormat(details.texFmt) && cfg.typeHint == CompType::SInt))
(IsTypelessFormat(details.texFmt) && cfg.typeCast == CompType::SInt))
{
pixelData.OutputDisplayFormat |= TEXDISPLAY_SINT_TEX;
srvOffset = 20;
+13 -13
View File
@@ -1591,13 +1591,13 @@ ResourceId D3D11Replay::GetLiveID(ResourceId id)
}
bool D3D11Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram)
{
if(minval >= maxval)
return false;
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeHint, true);
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeCast, true);
if(details.texFmt == DXGI_FORMAT_UNKNOWN)
return false;
@@ -1711,9 +1711,9 @@ bool D3D11Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mi
}
bool D3D11Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval)
CompType typeCast, float *minval, float *maxval)
{
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeHint, true);
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeCast, true);
if(details.texFmt == DXGI_FORMAT_UNKNOWN)
return false;
@@ -1748,7 +1748,7 @@ bool D3D11Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
int srvOffset = 0;
int intIdx = 0;
DXGI_FORMAT fmt = GetTypedFormat(details.texFmt, typeHint);
DXGI_FORMAT fmt = GetTypedFormat(details.texFmt, typeCast);
if(IsUIntFormat(fmt))
{
@@ -1966,7 +1966,7 @@ void D3D11Replay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip
texDisplay.rangeMin = params.blackPoint;
texDisplay.rangeMax = params.whitePoint;
texDisplay.resourceId = tex;
texDisplay.typeHint = params.typeHint;
texDisplay.typeCast = params.typeCast;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -2120,7 +2120,7 @@ void D3D11Replay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip
texDisplay.rangeMin = params.blackPoint;
texDisplay.rangeMax = params.whitePoint;
texDisplay.resourceId = tex;
texDisplay.typeHint = params.typeHint;
texDisplay.typeCast = params.typeCast;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -2286,7 +2286,7 @@ void D3D11Replay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip
texDisplay.rangeMin = params.blackPoint;
texDisplay.rangeMax = params.whitePoint;
texDisplay.resourceId = tex;
texDisplay.typeHint = params.typeHint;
texDisplay.typeCast = params.typeCast;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -3119,7 +3119,7 @@ uint32_t D3D11Replay::PickVertex(uint32_t eventId, int32_t width, int32_t height
}
void D3D11Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace,
uint32_t mip, uint32_t sample, CompType typeHint, float pixel[4])
uint32_t mip, uint32_t sample, CompType typeCast, float pixel[4])
{
D3D11RenderStateTracker tracker(m_pImmediateContext);
@@ -3158,7 +3158,7 @@ void D3D11Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t
texDisplay.rangeMax = 1.0f;
texDisplay.scale = 1.0f;
texDisplay.resourceId = texture;
texDisplay.typeHint = typeHint;
texDisplay.typeCast = typeCast;
texDisplay.rawOutput = true;
texDisplay.xOffset = -float(x << mip);
texDisplay.yOffset = -float(y << mip);
@@ -3243,9 +3243,9 @@ void D3D11Replay::CreateCustomShaderTex(uint32_t w, uint32_t h)
}
ResourceId D3D11Replay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip,
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint)
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeCast)
{
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeHint, false);
TextureShaderDetails details = GetDebugManager()->GetShaderDetails(texid, typeCast, false);
CreateCustomShaderTex(details.texWidth, details.texHeight);
@@ -3294,7 +3294,7 @@ ResourceId D3D11Replay::ApplyCustomShader(ResourceId shader, ResourceId texid, u
disp.yOffset = 0.0f;
disp.customShaderId = shader;
disp.resourceId = texid;
disp.typeHint = typeHint;
disp.typeCast = typeCast;
disp.backgroundColor = FloatVector(0, 0, 0, 1.0);
disp.hdrMultiplier = -1.0f;
disp.linearDisplayAsGamma = false;
+6 -6
View File
@@ -170,9 +170,9 @@ public:
ResourceId GetLiveID(ResourceId id);
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval);
CompType typeCast, float *minval, float *maxval);
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram);
MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_t viewID,
@@ -224,7 +224,7 @@ public:
std::vector<PixelModification> PixelHistory(std::vector<EventUsage> events, ResourceId target,
uint32_t x, uint32_t y, uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
@@ -232,11 +232,11 @@ public:
ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3]);
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
uint32_t sample, CompType typeHint, float pixel[4]);
uint32_t sample, CompType typeCast, float pixel[4]);
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
uint32_t x, uint32_t y);
ResourceId RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents);
@@ -244,7 +244,7 @@ public:
const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id,
std::string *errors);
ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
bool IsRenderOutput(ResourceId id);
+1 -1
View File
@@ -157,7 +157,7 @@ public:
D3D12_CPU_DESCRIPTOR_HANDLE GetUAVClearHandle(CBVUAVSRVSlot slot);
void PrepareTextureSampling(ID3D12Resource *resource, CompType typeHint, int &resType,
void PrepareTextureSampling(ID3D12Resource *resource, CompType typeCast, int &resType,
std::vector<D3D12_RESOURCE_BARRIER> &barriers);
MeshDisplayPipelines CacheMeshDisplayPipelines(const MeshFormat &primary,
+2 -2
View File
@@ -200,7 +200,7 @@ struct D3D12QuadOverdrawCallback : public D3D12DrawcallCallback
D3D12RenderState m_PrevState;
};
ResourceId D3D12Replay::RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId D3D12Replay::RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents)
{
@@ -216,7 +216,7 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, CompType typeHint, Float
std::vector<D3D12_RESOURCE_BARRIER> barriers;
int resType = 0;
GetDebugManager()->PrepareTextureSampling(resource, typeHint, resType, barriers);
GetDebugManager()->PrepareTextureSampling(resource, typeCast, resType, barriers);
D3D12_RESOURCE_DESC overlayTexDesc;
overlayTexDesc.Alignment = 0;
@@ -32,7 +32,7 @@
#include "data/hlsl/hlsl_cbuffers.h"
void D3D12DebugManager::PrepareTextureSampling(ID3D12Resource *resource, CompType typeHint,
void D3D12DebugManager::PrepareTextureSampling(ID3D12Resource *resource, CompType typeCast,
int &resType,
std::vector<D3D12_RESOURCE_BARRIER> &barriers)
{
@@ -41,7 +41,7 @@ void D3D12DebugManager::PrepareTextureSampling(ID3D12Resource *resource, CompTyp
D3D12_RESOURCE_DESC resourceDesc = resource->GetDesc();
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
srvDesc.Format = GetTypedFormat(resourceDesc.Format, typeHint);
srvDesc.Format = GetTypedFormat(resourceDesc.Format, typeCast);
srvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
if(resourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D)
@@ -457,7 +457,7 @@ bool D3D12Replay::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, Texture
std::vector<D3D12_RESOURCE_BARRIER> barriers;
int resType = 0;
GetDebugManager()->PrepareTextureSampling(resource, cfg.typeHint, resType, barriers);
GetDebugManager()->PrepareTextureSampling(resource, cfg.typeCast, resType, barriers);
pixelData.OutputDisplayFormat = resType;
+12 -12
View File
@@ -1702,7 +1702,7 @@ void D3D12Replay::RenderCheckerboard()
}
void D3D12Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace,
uint32_t mip, uint32_t sample, CompType typeHint, float pixel[4])
uint32_t mip, uint32_t sample, CompType typeCast, float pixel[4])
{
SetOutputDimensions(1, 1);
@@ -1721,7 +1721,7 @@ void D3D12Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t
texDisplay.rangeMax = 1.0f;
texDisplay.scale = 1.0f;
texDisplay.resourceId = texture;
texDisplay.typeHint = typeHint;
texDisplay.typeCast = typeCast;
texDisplay.rawOutput = true;
texDisplay.xOffset = -float(x << mip);
texDisplay.yOffset = -float(y << mip);
@@ -2252,7 +2252,7 @@ uint32_t D3D12Replay::PickVertex(uint32_t eventId, int32_t width, int32_t height
}
bool D3D12Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval)
CompType typeCast, float *minval, float *maxval)
{
ID3D12Resource *resource = m_pDevice->GetResourceList()[texid];
@@ -2296,7 +2296,7 @@ bool D3D12Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
int intIdx = 0;
DXGI_FORMAT fmt = GetTypedFormat(resourceDesc.Format, typeHint);
DXGI_FORMAT fmt = GetTypedFormat(resourceDesc.Format, typeCast);
if(IsUIntFormat(fmt))
intIdx = 1;
@@ -2310,7 +2310,7 @@ bool D3D12Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
std::vector<D3D12_RESOURCE_BARRIER> barriers;
int resType = 0;
GetDebugManager()->PrepareTextureSampling(resource, typeHint, resType, barriers);
GetDebugManager()->PrepareTextureSampling(resource, typeCast, resType, barriers);
{
ID3D12GraphicsCommandList *list = m_pDevice->GetNewList();
@@ -2430,7 +2430,7 @@ bool D3D12Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
}
bool D3D12Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram)
{
if(minval >= maxval)
@@ -2492,7 +2492,7 @@ bool D3D12Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mi
int intIdx = 0;
DXGI_FORMAT fmt = GetTypedFormat(resourceDesc.Format, typeHint);
DXGI_FORMAT fmt = GetTypedFormat(resourceDesc.Format, typeCast);
if(IsUIntFormat(fmt))
intIdx = 1;
@@ -2506,7 +2506,7 @@ bool D3D12Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mi
std::vector<D3D12_RESOURCE_BARRIER> barriers;
int resType = 0;
GetDebugManager()->PrepareTextureSampling(resource, typeHint, resType, barriers);
GetDebugManager()->PrepareTextureSampling(resource, typeCast, resType, barriers);
{
ID3D12GraphicsCommandList *list = m_pDevice->GetNewList();
@@ -3141,7 +3141,7 @@ void D3D12Replay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip
texDisplay.rangeMin = params.blackPoint;
texDisplay.rangeMax = params.whitePoint;
texDisplay.resourceId = tex;
texDisplay.typeHint = CompType::Typeless;
texDisplay.typeCast = CompType::Typeless;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -3568,7 +3568,7 @@ void D3D12Replay::BuildCustomShader(ShaderEncoding sourceEncoding, bytebuf sourc
}
ResourceId D3D12Replay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip,
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint)
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeCast)
{
ID3D12Resource *resource = m_pDevice->GetResourceList()[texid];
@@ -3644,7 +3644,7 @@ ResourceId D3D12Replay::ApplyCustomShader(ResourceId shader, ResourceId texid, u
disp.yOffset = 0.0f;
disp.customShaderId = shader;
disp.resourceId = texid;
disp.typeHint = typeHint;
disp.typeCast = typeCast;
disp.hdrMultiplier = -1.0f;
disp.linearDisplayAsGamma = false;
disp.mip = mip;
@@ -3669,7 +3669,7 @@ ResourceId D3D12Replay::ApplyCustomShader(ResourceId shader, ResourceId texid, u
std::vector<PixelModification> D3D12Replay::PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
return std::vector<PixelModification>();
}
+6 -6
View File
@@ -132,9 +132,9 @@ public:
ResourceId GetLiveID(ResourceId id);
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval);
CompType typeCast, float *minval, float *maxval);
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram);
MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_t viewID,
@@ -186,7 +186,7 @@ public:
std::vector<PixelModification> PixelHistory(std::vector<EventUsage> events, ResourceId target,
uint32_t x, uint32_t y, uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
@@ -194,11 +194,11 @@ public:
ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3]);
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
uint32_t sample, CompType typeHint, float pixel[4]);
uint32_t sample, CompType typeCast, float pixel[4]);
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
uint32_t x, uint32_t y);
ResourceId RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents);
@@ -206,7 +206,7 @@ public:
const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id,
std::string *errors);
ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
bool IsRenderOutput(ResourceId id);
+51 -51
View File
@@ -1083,7 +1083,7 @@ DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f)
return f;
}
DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f, CompType typeHint)
DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f, CompType typeCast)
{
switch(f)
{
@@ -1091,167 +1091,167 @@ DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f, CompType typeHint)
case DXGI_FORMAT_R8_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R8_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R8_SINT;
if(typeHint == CompType::SNorm)
if(typeCast == CompType::SNorm)
return DXGI_FORMAT_R8_SNORM;
return DXGI_FORMAT_R8_UNORM;
}
case DXGI_FORMAT_R8G8_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R8G8_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R8G8_SINT;
if(typeHint == CompType::SNorm)
if(typeCast == CompType::SNorm)
return DXGI_FORMAT_R8G8_SNORM;
return DXGI_FORMAT_R8G8_UNORM;
}
case DXGI_FORMAT_R8G8B8A8_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R8G8B8A8_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R8G8B8A8_SINT;
if(typeHint == CompType::SNorm)
if(typeCast == CompType::SNorm)
return DXGI_FORMAT_R8G8B8A8_SNORM;
if(typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNormSRGB)
return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
return DXGI_FORMAT_R8G8B8A8_UNORM;
}
case DXGI_FORMAT_R16_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R16_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R16_SINT;
if(typeHint == CompType::SNorm)
if(typeCast == CompType::SNorm)
return DXGI_FORMAT_R16_SNORM;
if(typeHint == CompType::Float)
if(typeCast == CompType::Float)
return DXGI_FORMAT_R16_FLOAT;
if(typeHint == CompType::Depth)
if(typeCast == CompType::Depth)
return DXGI_FORMAT_D16_UNORM;
return DXGI_FORMAT_R16_UNORM;
}
case DXGI_FORMAT_R16G16_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R16G16_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R16G16_SINT;
if(typeHint == CompType::SNorm)
if(typeCast == CompType::SNorm)
return DXGI_FORMAT_R16G16_SNORM;
if(typeHint == CompType::Float)
if(typeCast == CompType::Float)
return DXGI_FORMAT_R16G16_FLOAT;
return DXGI_FORMAT_R16G16_UNORM;
}
case DXGI_FORMAT_R16G16B16A16_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R16G16B16A16_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R16G16B16A16_SINT;
if(typeHint == CompType::SNorm)
if(typeCast == CompType::SNorm)
return DXGI_FORMAT_R16G16B16A16_SNORM;
if(typeHint == CompType::Float)
if(typeCast == CompType::Float)
return DXGI_FORMAT_R16G16B16A16_FLOAT;
return DXGI_FORMAT_R16G16B16A16_UNORM;
}
case DXGI_FORMAT_R32_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R32_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R32_SINT;
if(typeHint == CompType::Depth)
if(typeCast == CompType::Depth)
return DXGI_FORMAT_D32_FLOAT;
return DXGI_FORMAT_R32_FLOAT;
}
case DXGI_FORMAT_R32G32_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R32G32_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R32G32_SINT;
return DXGI_FORMAT_R32G32_FLOAT;
}
case DXGI_FORMAT_R32G32B32_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R32G32B32_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R32G32B32_SINT;
return DXGI_FORMAT_R32G32B32_FLOAT;
}
case DXGI_FORMAT_R32G32B32A32_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R32G32B32A32_UINT;
if(typeHint == CompType::SInt)
if(typeCast == CompType::SInt)
return DXGI_FORMAT_R32G32B32A32_SINT;
return DXGI_FORMAT_R32G32B32A32_FLOAT;
}
case DXGI_FORMAT_R32G8X24_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_X32_TYPELESS_G8X24_UINT;
if(typeHint == CompType::Depth)
if(typeCast == CompType::Depth)
return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
return DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS;
}
case DXGI_FORMAT_R24G8_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_X24_TYPELESS_G8_UINT;
if(typeHint == CompType::Depth)
if(typeCast == CompType::Depth)
return DXGI_FORMAT_D24_UNORM_S8_UINT;
return DXGI_FORMAT_R24_UNORM_X8_TYPELESS;
}
case DXGI_FORMAT_R10G10B10A2_TYPELESS:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return DXGI_FORMAT_R10G10B10A2_UINT;
return DXGI_FORMAT_R10G10B10A2_UNORM;
}
case DXGI_FORMAT_BC4_TYPELESS:
return typeHint == CompType::SNorm ? DXGI_FORMAT_BC4_SNORM : DXGI_FORMAT_BC4_UNORM;
return typeCast == CompType::SNorm ? DXGI_FORMAT_BC4_SNORM : DXGI_FORMAT_BC4_UNORM;
case DXGI_FORMAT_BC5_TYPELESS:
return typeHint == CompType::SNorm ? DXGI_FORMAT_BC5_SNORM : DXGI_FORMAT_BC5_UNORM;
return typeCast == CompType::SNorm ? DXGI_FORMAT_BC5_SNORM : DXGI_FORMAT_BC5_UNORM;
case DXGI_FORMAT_BC6H_TYPELESS:
return typeHint == CompType::SNorm ? DXGI_FORMAT_BC6H_SF16 : DXGI_FORMAT_BC6H_UF16;
return typeCast == CompType::SNorm ? DXGI_FORMAT_BC6H_SF16 : DXGI_FORMAT_BC6H_UF16;
// these formats have only one valid non-typeless format (ignoring SRGB)
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
return typeHint == CompType::UNormSRGB ? DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
return typeCast == CompType::UNormSRGB ? DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
: DXGI_FORMAT_B8G8R8A8_UNORM;
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
return typeHint == CompType::UNormSRGB ? DXGI_FORMAT_B8G8R8X8_UNORM_SRGB
return typeCast == CompType::UNormSRGB ? DXGI_FORMAT_B8G8R8X8_UNORM_SRGB
: DXGI_FORMAT_B8G8R8X8_UNORM;
case DXGI_FORMAT_BC1_TYPELESS:
return typeHint == CompType::UNormSRGB ? DXGI_FORMAT_BC1_UNORM_SRGB : DXGI_FORMAT_BC1_UNORM;
return typeCast == CompType::UNormSRGB ? DXGI_FORMAT_BC1_UNORM_SRGB : DXGI_FORMAT_BC1_UNORM;
case DXGI_FORMAT_BC2_TYPELESS:
return typeHint == CompType::UNormSRGB ? DXGI_FORMAT_BC2_UNORM_SRGB : DXGI_FORMAT_BC2_UNORM;
return typeCast == CompType::UNormSRGB ? DXGI_FORMAT_BC2_UNORM_SRGB : DXGI_FORMAT_BC2_UNORM;
case DXGI_FORMAT_BC3_TYPELESS:
return typeHint == CompType::UNormSRGB ? DXGI_FORMAT_BC3_UNORM_SRGB : DXGI_FORMAT_BC3_UNORM;
return typeCast == CompType::UNormSRGB ? DXGI_FORMAT_BC3_UNORM_SRGB : DXGI_FORMAT_BC3_UNORM;
case DXGI_FORMAT_BC7_TYPELESS:
return typeHint == CompType::UNormSRGB ? DXGI_FORMAT_BC7_UNORM_SRGB : DXGI_FORMAT_BC7_UNORM;
return typeCast == CompType::UNormSRGB ? DXGI_FORMAT_BC7_UNORM_SRGB : DXGI_FORMAT_BC7_UNORM;
default: break;
}
@@ -3001,10 +3001,10 @@ TEST_CASE("DXGI formats", "[format][d3d]")
{
// this format has special handling, so we skip it from the below Typeless/Typed check
CompType typeHint = fmt.compType;
CompType typeCast = fmt.compType;
DXGI_FORMAT typeless = GetTypelessFormat(f);
DXGI_FORMAT typed = GetTypedFormat(typeless, typeHint);
DXGI_FORMAT typed = GetTypedFormat(typeless, typeCast);
CHECK(typed == DXGI_FORMAT_R10G10B10A2_UNORM);
@@ -3013,11 +3013,11 @@ TEST_CASE("DXGI formats", "[format][d3d]")
if(!IsTypelessFormat(f))
{
CompType typeHint = fmt.compType;
CompType typeCast = fmt.compType;
DXGI_FORMAT original = f;
DXGI_FORMAT typeless = GetTypelessFormat(f);
DXGI_FORMAT typed = GetTypedFormat(typeless, typeHint);
DXGI_FORMAT typed = GetTypedFormat(typeless, typeCast);
if(fmt.SRGBCorrected())
typed = GetSRGBFormat(typed);
+8 -8
View File
@@ -1335,7 +1335,7 @@ void GLReplay::RestoreSamplerParams(GLenum target, GLuint texname, TextureSample
}
bool GLReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval)
CompType typeCast, float *minval, float *maxval)
{
auto &texDetails = m_pDriver->m_Textures[texid];
@@ -1350,12 +1350,12 @@ bool GLReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uin
Vec4u stencil[2] = {{0, 0, 0, 0}, {1, 1, 1, 1}};
bool success =
GetMinMax(texid, sliceFace, mip, sample, typeHint, false, &depth[0].x, &depth[1].x);
GetMinMax(texid, sliceFace, mip, sample, typeCast, false, &depth[0].x, &depth[1].x);
if(!success)
return false;
success = GetMinMax(texid, sliceFace, mip, sample, typeHint, true, (float *)&stencil[0].x,
success = GetMinMax(texid, sliceFace, mip, sample, typeCast, true, (float *)&stencil[0].x,
(float *)&stencil[1].x);
if(!success)
@@ -1386,11 +1386,11 @@ bool GLReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uin
return true;
}
return GetMinMax(texid, sliceFace, mip, sample, typeHint, false, minval, maxval);
return GetMinMax(texid, sliceFace, mip, sample, typeCast, false, minval, maxval);
}
bool GLReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, bool stencil, float *minval, float *maxval)
CompType typeCast, bool stencil, float *minval, float *maxval)
{
if(texid == ResourceId() || m_pDriver->m_Textures.find(texid) == m_pDriver->m_Textures.end())
return false;
@@ -1611,7 +1611,7 @@ bool GLReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uin
}
bool GLReplay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram)
{
if(minval >= maxval || texid == ResourceId())
@@ -2335,7 +2335,7 @@ uint32_t GLReplay::PickVertex(uint32_t eventId, int32_t width, int32_t height,
}
void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace,
uint32_t mip, uint32_t sample, CompType typeHint, float pixel[4])
uint32_t mip, uint32_t sample, CompType typeCast, float pixel[4])
{
WrappedOpenGL &drv = *m_pDriver;
@@ -2364,7 +2364,7 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sl
texDisplay.rangeMax = 1.0f;
texDisplay.scale = 1.0f;
texDisplay.resourceId = texture;
texDisplay.typeHint = typeHint;
texDisplay.typeCast = typeCast;
texDisplay.rawOutput = true;
texDisplay.xOffset = -float(x << mip);
texDisplay.yOffset = -float(y << mip);
+1 -1
View File
@@ -228,7 +228,7 @@ bool GLReplay::CreateOverlayProgram(GLuint Program, GLuint Pipeline, GLuint frag
return HasSPIRVShaders;
}
ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents)
{
+5 -5
View File
@@ -2381,7 +2381,7 @@ void GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip,
texDisplay.rangeMax = params.whitePoint;
texDisplay.scale = 1.0f;
texDisplay.resourceId = tex;
texDisplay.typeHint = CompType::Typeless;
texDisplay.typeCast = CompType::Typeless;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -2431,7 +2431,7 @@ void GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip,
texDisplay.rangeMax = params.whitePoint;
texDisplay.scale = 1.0f;
texDisplay.resourceId = tex;
texDisplay.typeHint = CompType::Typeless;
texDisplay.typeCast = CompType::Typeless;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -2774,7 +2774,7 @@ void GLReplay::BuildCustomShader(ShaderEncoding sourceEncoding, bytebuf source,
}
ResourceId GLReplay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip,
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint)
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeCast)
{
if(shader == ResourceId() || texid == ResourceId())
return ResourceId();
@@ -2805,7 +2805,7 @@ ResourceId GLReplay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint
disp.yOffset = 0.0f;
disp.customShaderId = shader;
disp.resourceId = texid;
disp.typeHint = typeHint;
disp.typeCast = typeCast;
disp.hdrMultiplier = -1.0f;
disp.linearDisplayAsGamma = false;
disp.mip = mip;
@@ -3362,7 +3362,7 @@ std::vector<EventUsage> GLReplay::GetUsage(ResourceId id)
std::vector<PixelModification> GLReplay::PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
GLNOTIMP("GLReplay::PixelHistory");
return std::vector<PixelModification>();
+7 -7
View File
@@ -150,9 +150,9 @@ public:
ResourceId GetLiveID(ResourceId id);
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval);
CompType typeCast, float *minval, float *maxval);
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram);
MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_t viewID,
@@ -201,7 +201,7 @@ public:
std::vector<PixelModification> PixelHistory(std::vector<EventUsage> events, ResourceId target,
uint32_t x, uint32_t y, uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
@@ -209,15 +209,15 @@ public:
ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3]);
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
uint32_t sample, CompType typeHint, float pixel[4]);
uint32_t sample, CompType typeCast, float pixel[4]);
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
uint32_t x, uint32_t y);
ResourceId RenderOverlay(ResourceId id, CompType typeHint, FloatVector clearCol,
ResourceId RenderOverlay(ResourceId id, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents);
ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
ResourceId CreateProxyTexture(const TextureDescription &templateTex);
void SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t mip, byte *data,
@@ -241,7 +241,7 @@ private:
rdcarray<ShaderVariable> &outvars, const bytebuf &data);
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, bool stencil, float *minval, float *maxval);
CompType typeCast, bool stencil, float *minval, float *maxval);
void CreateCustomShaderTex(uint32_t w, uint32_t h);
bool CreateOverlayProgram(GLuint Program, GLuint Pipeline, GLuint fragShader,
+1 -1
View File
@@ -396,7 +396,7 @@ void VulkanDebugManager::PatchLineStripIndexBuffer(const DrawcallDescription *dr
indexCount = (uint32_t)patchedIndices.size();
}
ResourceId VulkanReplay::RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
ResourceId VulkanReplay::RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents)
{
+2 -2
View File
@@ -111,7 +111,7 @@ struct EventInfo
std::vector<PixelModification> VulkanReplay::PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
VULKANNOTIMP("PixelHistory");
return std::vector<PixelModification>();
@@ -1156,7 +1156,7 @@ VkImageLayout VulkanDebugManager::GetImageLayout(ResourceId image, VkImageAspect
std::vector<PixelModification> VulkanReplay::PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
RDCDEBUG("PixelHistory: pixel: (%u, %u) with %u events", x, y, events.size());
std::vector<PixelModification> history;
+5 -5
View File
@@ -32,11 +32,11 @@
#include "data/glsl/glsl_ubos_cpp.h"
void VulkanReplay::CreateTexImageView(VkImage liveIm, const VulkanCreationInfo::Image &iminfo,
CompType typeHint, TextureDisplayViews &views)
CompType typeCast, TextureDisplayViews &views)
{
VkDevice dev = m_pDriver->GetDev();
if(views.typeHint != typeHint)
if(views.typeCast != typeCast)
{
// if the type hint has changed, recreate the image views
for(size_t i = 0; i < ARRAY_COUNT(views.views); i++)
@@ -46,9 +46,9 @@ void VulkanReplay::CreateTexImageView(VkImage liveIm, const VulkanCreationInfo::
}
}
views.typeHint = typeHint;
views.typeCast = typeCast;
VkFormat fmt = views.castedFormat = GetViewCastedFormat(iminfo.format, typeHint);
VkFormat fmt = views.castedFormat = GetViewCastedFormat(iminfo.format, typeCast);
// all types have at least views[0] populated, so if it's still there, we can just return
if(views.views[0] != VK_NULL_HANDLE)
@@ -169,7 +169,7 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
if(!layouts.isMemoryBound)
return false;
CreateTexImageView(liveIm, iminfo, cfg.typeHint, texviews);
CreateTexImageView(liveIm, iminfo, cfg.typeCast, texviews);
int displayformat = 0;
uint32_t descSetBinding = 0;
+13 -13
View File
@@ -720,7 +720,7 @@ std::string VulkanReplay::DisassembleShader(ResourceId pipeline, const ShaderRef
}
void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace,
uint32_t mip, uint32_t sample, CompType typeHint, float pixel[4])
uint32_t mip, uint32_t sample, CompType typeCast, float pixel[4])
{
int oldW = m_DebugWidth, oldH = m_DebugHeight;
@@ -750,7 +750,7 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_
texDisplay.rangeMax = 1.0f;
texDisplay.scale = 1.0f;
texDisplay.resourceId = texture;
texDisplay.typeHint = typeHint;
texDisplay.typeCast = typeCast;
texDisplay.rawOutput = true;
texDisplay.xOffset = -float(x << mip);
texDisplay.yOffset = -float(y << mip);
@@ -2122,7 +2122,7 @@ void VulkanReplay::FillCBufferVariables(ResourceId pipeline, ResourceId shader,
}
bool VulkanReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval)
CompType typeCast, float *minval, float *maxval)
{
ImageLayouts &layouts = m_pDriver->m_ImageLayouts[texid];
@@ -2136,12 +2136,12 @@ bool VulkanReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
Vec4u stencil[2] = {{0, 0, 0, 0}, {1, 1, 1, 1}};
bool success =
GetMinMax(texid, sliceFace, mip, sample, typeHint, false, &depth[0].x, &depth[1].x);
GetMinMax(texid, sliceFace, mip, sample, typeCast, false, &depth[0].x, &depth[1].x);
if(!success)
return false;
success = GetMinMax(texid, sliceFace, mip, sample, typeHint, true, (float *)&stencil[0].x,
success = GetMinMax(texid, sliceFace, mip, sample, typeCast, true, (float *)&stencil[0].x,
(float *)&stencil[1].x);
if(!success)
@@ -2157,11 +2157,11 @@ bool VulkanReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
return true;
}
return GetMinMax(texid, sliceFace, mip, sample, typeHint, false, minval, maxval);
return GetMinMax(texid, sliceFace, mip, sample, typeCast, false, minval, maxval);
}
bool VulkanReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, bool stencil, float *minval, float *maxval)
CompType typeCast, bool stencil, float *minval, float *maxval)
{
VkDevice dev = m_pDriver->GetDev();
VkCommandBuffer cmd = m_pDriver->GetNextCmd();
@@ -2178,7 +2178,7 @@ bool VulkanReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
if(!IsStencilFormat(iminfo.format))
stencil = false;
CreateTexImageView(liveIm, iminfo, typeHint, texviews);
CreateTexImageView(liveIm, iminfo, typeCast, texviews);
VkImageView liveImView = texviews.views[0];
@@ -2480,7 +2480,7 @@ bool VulkanReplay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip,
}
bool VulkanReplay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram)
{
if(minval >= maxval)
@@ -2503,7 +2503,7 @@ bool VulkanReplay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t m
if(IsStencilFormat(iminfo.format) && !channels[0] && channels[1] && !channels[2] && !channels[3])
stencil = true;
CreateTexImageView(liveIm, iminfo, typeHint, texviews);
CreateTexImageView(liveIm, iminfo, typeCast, texviews);
uint32_t descSetBinding = 0;
uint32_t intTypeIndex = 0;
@@ -3033,7 +3033,7 @@ void VulkanReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mi
texDisplay.rangeMax = params.whitePoint;
texDisplay.scale = 1.0f;
texDisplay.resourceId = tex;
texDisplay.typeHint = CompType::Typeless;
texDisplay.typeCast = CompType::Typeless;
texDisplay.rawOutput = false;
texDisplay.xOffset = 0;
texDisplay.yOffset = 0;
@@ -3815,7 +3815,7 @@ void VulkanReplay::FreeCustomShader(ResourceId id)
}
ResourceId VulkanReplay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip,
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint)
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeCast)
{
if(shader == ResourceId() || texid == ResourceId())
return ResourceId();
@@ -3836,7 +3836,7 @@ ResourceId VulkanReplay::ApplyCustomShader(ResourceId shader, ResourceId texid,
disp.yOffset = 0.0f;
disp.customShaderId = shader;
disp.resourceId = texid;
disp.typeHint = typeHint;
disp.typeCast = typeCast;
disp.hdrMultiplier = -1.0f;
disp.linearDisplayAsGamma = false;
disp.mip = mip;
+9 -9
View File
@@ -310,9 +310,9 @@ public:
std::vector<CounterResult> FetchCounters(const std::vector<GPUCounter> &counters);
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval);
CompType typeCast, float *minval, float *maxval);
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram);
void InitPostVSBuffers(uint32_t eventId);
@@ -361,7 +361,7 @@ public:
std::vector<PixelModification> PixelHistory(std::vector<EventUsage> events, ResourceId target,
uint32_t x, uint32_t y, uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
@@ -369,15 +369,15 @@ public:
ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3]);
void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip,
uint32_t sample, CompType typeHint, float pixel[4]);
uint32_t sample, CompType typeCast, float pixel[4]);
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
uint32_t x, uint32_t y);
ResourceId RenderOverlay(ResourceId cfg, CompType typeHint, FloatVector clearCol,
ResourceId RenderOverlay(ResourceId cfg, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents);
ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx,
uint32_t sampleIdx, CompType typeHint);
uint32_t sampleIdx, CompType typeCast);
ResourceId CreateProxyTexture(const TextureDescription &templateTex);
void SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t mip, byte *data,
@@ -427,7 +427,7 @@ private:
bool RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginInfo rpbegin, int flags);
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, bool stencil, float *minval, float *maxval);
CompType typeCast, bool stencil, float *minval, float *maxval);
VulkanDebugManager *GetDebugManager();
VulkanResourceManager *GetResourceManager();
@@ -517,7 +517,7 @@ private:
struct TextureDisplayViews
{
CompType typeHint;
CompType typeCast;
VkFormat castedFormat; // the format after applying the above type hint
// for a color/depth-only textures, views[0] is the view and views[1] and views[2] are NULL
@@ -717,7 +717,7 @@ private:
void CachePipelineExecutables(ResourceId pipeline);
void CreateTexImageView(VkImage liveIm, const VulkanCreationInfo::Image &iminfo,
CompType typeHint, TextureDisplayViews &views);
CompType typeCast, TextureDisplayViews &views);
void FillTimersAMD(uint32_t *eventStartID, uint32_t *sampleIndex, std::vector<uint32_t> *eventIDs);
+137 -137
View File
@@ -660,9 +660,9 @@ VkFormat GetDepthOnlyFormat(VkFormat f)
return f;
}
VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
VkFormat GetViewCastedFormat(VkFormat f, CompType typeCast)
{
if(typeHint == CompType::Typeless)
if(typeCast == CompType::Typeless)
return f;
switch(f)
@@ -671,9 +671,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R64G64B64A64_SINT:
case VK_FORMAT_R64G64B64A64_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R64G64B64A64_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R64G64B64A64_SINT;
else
return VK_FORMAT_R64G64B64A64_SFLOAT;
@@ -682,9 +682,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R64G64B64_SINT:
case VK_FORMAT_R64G64B64_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R64G64B64_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R64G64B64_SINT;
else
return VK_FORMAT_R64G64B64_SFLOAT;
@@ -693,9 +693,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R64G64_SINT:
case VK_FORMAT_R64G64_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R64G64_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R64G64_SINT;
else
return VK_FORMAT_R64G64_SFLOAT;
@@ -704,9 +704,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R64_SINT:
case VK_FORMAT_R64_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R64_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R64_SINT;
else
return VK_FORMAT_R64_SFLOAT;
@@ -715,9 +715,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R32G32B32A32_SINT:
case VK_FORMAT_R32G32B32A32_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R32G32B32A32_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R32G32B32A32_SINT;
else
return VK_FORMAT_R32G32B32A32_SFLOAT;
@@ -726,9 +726,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R32G32B32_SINT:
case VK_FORMAT_R32G32B32_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R32G32B32_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R32G32B32_SINT;
else
return VK_FORMAT_R32G32B32_SFLOAT;
@@ -737,9 +737,9 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R32G32_SINT:
case VK_FORMAT_R32G32_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R32G32_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R32G32_SINT;
else
return VK_FORMAT_R32G32_SFLOAT;
@@ -749,11 +749,11 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R32_SFLOAT:
case VK_FORMAT_D32_SFLOAT:
{
if(typeHint == CompType::UInt)
if(typeCast == CompType::UInt)
return VK_FORMAT_R32_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R32_SINT;
else if(typeHint == CompType::Depth)
else if(typeCast == CompType::Depth)
return VK_FORMAT_D32_SFLOAT;
else
return VK_FORMAT_R32_SFLOAT;
@@ -766,17 +766,17 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R16G16B16A16_SINT:
case VK_FORMAT_R16G16B16A16_SFLOAT:
{
if(typeHint == CompType::UNorm || typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNorm || typeCast == CompType::UNormSRGB)
return VK_FORMAT_R16G16B16A16_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R16G16B16A16_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R16G16B16A16_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R16G16B16A16_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R16G16B16A16_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R16G16B16A16_SINT;
else
return VK_FORMAT_R16G16B16A16_SFLOAT;
@@ -789,17 +789,17 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R16G16B16_SINT:
case VK_FORMAT_R16G16B16_SFLOAT:
{
if(typeHint == CompType::UNorm || typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNorm || typeCast == CompType::UNormSRGB)
return VK_FORMAT_R16G16B16_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R16G16B16_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R16G16B16_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R16G16B16_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R16G16B16_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R16G16B16_SINT;
else
return VK_FORMAT_R16G16B16_SFLOAT;
@@ -812,17 +812,17 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R16G16_SINT:
case VK_FORMAT_R16G16_SFLOAT:
{
if(typeHint == CompType::UNorm || typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNorm || typeCast == CompType::UNormSRGB)
return VK_FORMAT_R16G16_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R16G16_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R16G16_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R16G16_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R16G16_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R16G16_SINT;
else
return VK_FORMAT_R16G16_SFLOAT;
@@ -836,19 +836,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R16_SFLOAT:
case VK_FORMAT_D16_UNORM:
{
if(typeHint == CompType::UNorm || typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNorm || typeCast == CompType::UNormSRGB)
return VK_FORMAT_R16_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R16_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R16_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R16_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R16_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R16_SINT;
else if(typeHint == CompType::Depth)
else if(typeCast == CompType::Depth)
return VK_FORMAT_D16_UNORM;
else
return VK_FORMAT_R16_SFLOAT;
@@ -861,19 +861,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R8G8B8A8_SINT:
case VK_FORMAT_R8G8B8A8_SRGB:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_R8G8B8A8_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R8G8B8A8_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R8G8B8A8_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R8G8B8A8_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R8G8B8A8_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R8G8B8A8_SINT;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_R8G8B8A8_SRGB;
else
return VK_FORMAT_R8G8B8A8_UNORM;
@@ -886,19 +886,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_B8G8R8A8_SINT:
case VK_FORMAT_B8G8R8A8_SRGB:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_B8G8R8A8_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_B8G8R8A8_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_B8G8R8A8_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_B8G8R8A8_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_B8G8R8A8_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_B8G8R8A8_SINT;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_B8G8R8A8_SRGB;
else
return VK_FORMAT_B8G8R8A8_UNORM;
@@ -911,19 +911,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_A8B8G8R8_SINT_PACK32:
case VK_FORMAT_A8B8G8R8_SRGB_PACK32:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_A8B8G8R8_UNORM_PACK32;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_A8B8G8R8_SNORM_PACK32;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_A8B8G8R8_USCALED_PACK32;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_A8B8G8R8_SSCALED_PACK32;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_A8B8G8R8_UINT_PACK32;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_A8B8G8R8_SINT_PACK32;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_A8B8G8R8_SRGB_PACK32;
else
return VK_FORMAT_A8B8G8R8_UNORM_PACK32;
@@ -936,19 +936,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R8G8B8_SINT:
case VK_FORMAT_R8G8B8_SRGB:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_R8G8B8_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R8G8B8_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R8G8B8_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R8G8B8_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R8G8B8_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R8G8B8_SINT;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_R8G8B8_SRGB;
else
return VK_FORMAT_R8G8B8_UNORM;
@@ -961,19 +961,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_B8G8R8_SINT:
case VK_FORMAT_B8G8R8_SRGB:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_B8G8R8_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_B8G8R8_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_B8G8R8_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_B8G8R8_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_B8G8R8_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_B8G8R8_SINT;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_B8G8R8_SRGB;
else
return VK_FORMAT_B8G8R8_UNORM;
@@ -986,19 +986,19 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R8G8_SINT:
case VK_FORMAT_R8G8_SRGB:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_R8G8_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R8G8_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R8G8_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R8G8_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R8G8_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R8G8_SINT;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_R8G8_SRGB;
else
return VK_FORMAT_R8G8_UNORM;
@@ -1012,21 +1012,21 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_R8_SRGB:
case VK_FORMAT_S8_UINT:
{
if(typeHint == CompType::UNorm)
if(typeCast == CompType::UNorm)
return VK_FORMAT_R8_UNORM;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_R8_SNORM;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_R8_USCALED;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_R8_SSCALED;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_R8_UINT;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_R8_SINT;
else if(typeHint == CompType::UNormSRGB)
else if(typeCast == CompType::UNormSRGB)
return VK_FORMAT_R8_SRGB;
else if(typeHint == CompType::Depth)
else if(typeCast == CompType::Depth)
return VK_FORMAT_S8_UINT;
else
return VK_FORMAT_R8_UNORM;
@@ -1038,17 +1038,17 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_A2B10G10R10_UINT_PACK32:
case VK_FORMAT_A2B10G10R10_SINT_PACK32:
{
if(typeHint == CompType::UNorm || typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNorm || typeCast == CompType::UNormSRGB)
return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_A2B10G10R10_SNORM_PACK32;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_A2B10G10R10_USCALED_PACK32;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_A2B10G10R10_SSCALED_PACK32;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_A2B10G10R10_UINT_PACK32;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_A2B10G10R10_SINT_PACK32;
else
return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
@@ -1060,139 +1060,139 @@ VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint)
case VK_FORMAT_A2R10G10B10_UINT_PACK32:
case VK_FORMAT_A2R10G10B10_SINT_PACK32:
{
if(typeHint == CompType::UNorm || typeHint == CompType::UNormSRGB)
if(typeCast == CompType::UNorm || typeCast == CompType::UNormSRGB)
return VK_FORMAT_A2R10G10B10_UNORM_PACK32;
else if(typeHint == CompType::SNorm)
else if(typeCast == CompType::SNorm)
return VK_FORMAT_A2R10G10B10_SNORM_PACK32;
else if(typeHint == CompType::UScaled)
else if(typeCast == CompType::UScaled)
return VK_FORMAT_A2R10G10B10_USCALED_PACK32;
else if(typeHint == CompType::SScaled)
else if(typeCast == CompType::SScaled)
return VK_FORMAT_A2R10G10B10_SSCALED_PACK32;
else if(typeHint == CompType::UInt)
else if(typeCast == CompType::UInt)
return VK_FORMAT_A2R10G10B10_UINT_PACK32;
else if(typeHint == CompType::SInt)
else if(typeCast == CompType::SInt)
return VK_FORMAT_A2R10G10B10_SINT_PACK32;
else
return VK_FORMAT_A2R10G10B10_UNORM_PACK32;
}
case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_BC1_RGB_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_BC1_RGB_SRGB_BLOCK
: VK_FORMAT_BC1_RGB_UNORM_BLOCK;
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
case VK_FORMAT_BC1_RGBA_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_BC1_RGBA_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_BC1_RGBA_SRGB_BLOCK
: VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
case VK_FORMAT_BC4_UNORM_BLOCK:
case VK_FORMAT_BC4_SNORM_BLOCK:
return (typeHint == CompType::SNorm) ? VK_FORMAT_BC4_SNORM_BLOCK : VK_FORMAT_BC4_UNORM_BLOCK;
return (typeCast == CompType::SNorm) ? VK_FORMAT_BC4_SNORM_BLOCK : VK_FORMAT_BC4_UNORM_BLOCK;
case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK
: VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK
: VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK
: VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK;
case VK_FORMAT_EAC_R11_UNORM_BLOCK:
case VK_FORMAT_EAC_R11_SNORM_BLOCK:
return (typeHint == CompType::SNorm) ? VK_FORMAT_EAC_R11_SNORM_BLOCK
return (typeCast == CompType::SNorm) ? VK_FORMAT_EAC_R11_SNORM_BLOCK
: VK_FORMAT_EAC_R11_UNORM_BLOCK;
case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
return (typeHint == CompType::SNorm) ? VK_FORMAT_EAC_R11G11_SNORM_BLOCK
return (typeCast == CompType::SNorm) ? VK_FORMAT_EAC_R11G11_SNORM_BLOCK
: VK_FORMAT_EAC_R11G11_UNORM_BLOCK;
case VK_FORMAT_BC2_UNORM_BLOCK:
case VK_FORMAT_BC2_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_BC2_SRGB_BLOCK : VK_FORMAT_BC2_UNORM_BLOCK;
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_BC2_SRGB_BLOCK : VK_FORMAT_BC2_UNORM_BLOCK;
case VK_FORMAT_BC3_UNORM_BLOCK:
case VK_FORMAT_BC3_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_BC3_SRGB_BLOCK : VK_FORMAT_BC3_UNORM_BLOCK;
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_BC3_SRGB_BLOCK : VK_FORMAT_BC3_UNORM_BLOCK;
case VK_FORMAT_BC5_UNORM_BLOCK:
case VK_FORMAT_BC5_SNORM_BLOCK:
return (typeHint == CompType::SNorm) ? VK_FORMAT_BC5_SNORM_BLOCK : VK_FORMAT_BC5_UNORM_BLOCK;
return (typeCast == CompType::SNorm) ? VK_FORMAT_BC5_SNORM_BLOCK : VK_FORMAT_BC5_UNORM_BLOCK;
case VK_FORMAT_BC6H_UFLOAT_BLOCK:
case VK_FORMAT_BC6H_SFLOAT_BLOCK:
return (typeHint == CompType::SNorm) ? VK_FORMAT_BC6H_SFLOAT_BLOCK
return (typeCast == CompType::SNorm) ? VK_FORMAT_BC6H_SFLOAT_BLOCK
: VK_FORMAT_BC6H_UFLOAT_BLOCK;
case VK_FORMAT_BC7_UNORM_BLOCK:
case VK_FORMAT_BC7_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_BC7_SRGB_BLOCK : VK_FORMAT_BC7_UNORM_BLOCK;
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_BC7_SRGB_BLOCK : VK_FORMAT_BC7_UNORM_BLOCK;
case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_4x4_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_4x4_SRGB_BLOCK
: VK_FORMAT_ASTC_4x4_UNORM_BLOCK;
case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_5x4_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_5x4_SRGB_BLOCK
: VK_FORMAT_ASTC_5x4_UNORM_BLOCK;
case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_5x5_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_5x5_SRGB_BLOCK
: VK_FORMAT_ASTC_5x5_UNORM_BLOCK;
case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_6x5_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_6x5_SRGB_BLOCK
: VK_FORMAT_ASTC_6x5_UNORM_BLOCK;
case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_6x6_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_6x6_SRGB_BLOCK
: VK_FORMAT_ASTC_6x6_UNORM_BLOCK;
case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_8x5_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_8x5_SRGB_BLOCK
: VK_FORMAT_ASTC_8x5_UNORM_BLOCK;
case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_8x6_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_8x6_SRGB_BLOCK
: VK_FORMAT_ASTC_8x6_UNORM_BLOCK;
case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_8x8_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_8x8_SRGB_BLOCK
: VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x5_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x5_SRGB_BLOCK
: VK_FORMAT_ASTC_10x5_UNORM_BLOCK;
case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x6_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x6_SRGB_BLOCK
: VK_FORMAT_ASTC_10x6_UNORM_BLOCK;
case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x8_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x8_SRGB_BLOCK
: VK_FORMAT_ASTC_10x8_UNORM_BLOCK;
case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x10_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_10x10_SRGB_BLOCK
: VK_FORMAT_ASTC_10x10_UNORM_BLOCK;
case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_12x10_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_12x10_SRGB_BLOCK
: VK_FORMAT_ASTC_12x10_UNORM_BLOCK;
case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_ASTC_12x12_SRGB_BLOCK
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_ASTC_12x12_SRGB_BLOCK
: VK_FORMAT_ASTC_12x12_UNORM_BLOCK;
case VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:
case VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG
: VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG;
case VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:
case VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG
: VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG;
case VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:
case VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG
: VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG;
case VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:
case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:
return (typeHint == CompType::UNormSRGB) ? VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG
return (typeCast == CompType::UNormSRGB) ? VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG
: VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG;
// all other formats have no aliases so nothing to typecast
+1 -1
View File
@@ -1730,7 +1730,7 @@ uint32_t GetYUVPlaneCount(VkFormat f);
uint32_t GetYUVNumRows(VkFormat f, uint32_t height);
VkFormat GetYUVViewPlaneFormat(VkFormat f, uint32_t plane);
VkFormat GetDepthOnlyFormat(VkFormat f);
VkFormat GetViewCastedFormat(VkFormat f, CompType typeHint);
VkFormat GetViewCastedFormat(VkFormat f, CompType typeCast);
void GetYUVShaderParameters(VkFormat f, Vec4u &YUVDownsampleRate, Vec4u &YUVAChannels);
+6 -6
View File
@@ -958,7 +958,7 @@ bool ReplayController::SaveTexture(const TextureSave &saveData, const char *path
GetTextureDataParams params;
params.forDiskSave = true;
params.typeHint = sd.typeHint;
params.typeCast = sd.typeCast;
params.resolve = resolveSamples;
params.remap = remap;
params.blackPoint = sd.comp.blackPoint;
@@ -1285,7 +1285,7 @@ bool ReplayController::SaveTexture(const TextureSave &saveData, const char *path
ResourceFormat saveFmt = td.format;
// use typeCast to inform typeless saving, otherwise it will get lost
if(saveFmt.compType == CompType::Typeless)
saveFmt.compType = sd.typeHint;
saveFmt.compType = sd.typeCast;
ddsData.width = td.width;
ddsData.height = td.height;
@@ -1372,7 +1372,7 @@ bool ReplayController::SaveTexture(const TextureSave &saveData, const char *path
ResourceFormat saveFmt = td.format;
if(saveFmt.compType == CompType::Typeless)
saveFmt.compType = sd.typeHint;
saveFmt.compType = sd.typeCast;
if(saveFmt.compType == CompType::Typeless)
saveFmt.compType = saveFmt.compByteWidth == 4 ? CompType::Float : CompType::UNorm;
@@ -1555,7 +1555,7 @@ bool ReplayController::SaveTexture(const TextureSave &saveData, const char *path
rdcarray<PixelModification> ReplayController::PixelHistory(ResourceId target, uint32_t x,
uint32_t y, uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint)
uint32_t sampleIdx, CompType typeCast)
{
CHECK_REPLAY_THREAD();
@@ -1665,7 +1665,7 @@ rdcarray<PixelModification> ReplayController::PixelHistory(ResourceId target, ui
if(id == ResourceId())
return ret;
ret = m_pDevice->PixelHistory(events, id, x, y, slice, mip, sampleIdx, typeHint);
ret = m_pDevice->PixelHistory(events, id, x, y, slice, mip, sampleIdx, typeCast);
SetFrameEvent(m_EventID, true);
@@ -1834,7 +1834,7 @@ void ReplayController::ReplayLoop(WindowingData window, ResourceId texid)
d.mip = 0;
d.sampleIdx = ~0U;
d.overlay = DebugOverlay::NoOverlay;
d.typeHint = CompType::Typeless;
d.typeCast = CompType::Typeless;
d.hdrMultiplier = -1.0f;
d.linearDisplayAsGamma = true;
d.flipY = false;
+3 -3
View File
@@ -47,7 +47,7 @@ public:
rdcpair<int32_t, int32_t> GetDimensions();
void ClearThumbnails();
bool AddThumbnail(WindowingData window, ResourceId texID, CompType typeHint, uint32_t mip,
bool AddThumbnail(WindowingData window, ResourceId texID, CompType typeCast, uint32_t mip,
uint32_t slice);
void Display();
@@ -97,7 +97,7 @@ private:
uint32_t mip;
uint32_t slice;
uint64_t wndHandle;
CompType typeHint;
CompType typeCast;
uint64_t outputID;
bool dirty;
@@ -185,7 +185,7 @@ public:
ShaderReflection *GetShader(ResourceId pipeline, ResourceId shader, ShaderEntryPoint entry);
rdcarray<PixelModification> PixelHistory(ResourceId target, uint32_t x, uint32_t y, uint32_t slice,
uint32_t mip, uint32_t sampleIdx, CompType typeHint);
uint32_t mip, uint32_t sampleIdx, CompType typeCast);
ShaderDebugTrace *DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset,
uint32_t vertOffset);
ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive);
+1 -1
View File
@@ -44,7 +44,7 @@ template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, GetTextureDataParams &el)
{
SERIALISE_MEMBER(forDiskSave);
SERIALISE_MEMBER(typeHint);
SERIALISE_MEMBER(typeCast);
SERIALISE_MEMBER(resolve);
SERIALISE_MEMBER(remap);
SERIALISE_MEMBER(blackPoint);
+8 -8
View File
@@ -52,7 +52,7 @@ DECLARE_REFLECTION_ENUM(RemapTexture);
struct GetTextureDataParams
{
bool forDiskSave;
CompType typeHint;
CompType typeCast;
bool resolve;
RemapTexture remap;
float blackPoint;
@@ -60,7 +60,7 @@ struct GetTextureDataParams
GetTextureDataParams()
: forDiskSave(false),
typeHint(CompType::Typeless),
typeCast(CompType::Typeless),
resolve(false),
remap(RemapTexture::NoRemap),
blackPoint(0.0f),
@@ -157,7 +157,7 @@ public:
virtual std::vector<PixelModification> PixelHistory(std::vector<EventUsage> events,
ResourceId target, uint32_t x, uint32_t y,
uint32_t slice, uint32_t mip,
uint32_t sampleIdx, CompType typeHint) = 0;
uint32_t sampleIdx, CompType typeCast) = 0;
virtual ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset) = 0;
virtual ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
@@ -165,7 +165,7 @@ public:
virtual ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3]) = 0;
virtual ResourceId RenderOverlay(ResourceId texid, CompType typeHint, FloatVector clearCol,
virtual ResourceId RenderOverlay(ResourceId texid, CompType typeCast, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,
const std::vector<uint32_t> &passEvents) = 0;
@@ -202,9 +202,9 @@ public:
virtual void FlipOutputWindow(uint64_t id) = 0;
virtual bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float *minval, float *maxval) = 0;
CompType typeCast, float *minval, float *maxval) = 0;
virtual bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample,
CompType typeHint, float minval, float maxval, bool channels[4],
CompType typeCast, float minval, float maxval, bool channels[4],
std::vector<uint32_t> &histogram) = 0;
virtual ResourceId CreateProxyTexture(const TextureDescription &templateTex) = 0;
@@ -224,7 +224,7 @@ public:
ShaderStage type, ResourceId *id, std::string *errors) = 0;
virtual rdcarray<ShaderEncoding> GetCustomShaderEncodings() = 0;
virtual ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip,
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint) = 0;
uint32_t arrayIdx, uint32_t sampleIdx, CompType typeCast) = 0;
virtual void FreeCustomShader(ResourceId id) = 0;
virtual void RenderCheckerboard() = 0;
@@ -232,7 +232,7 @@ public:
virtual void RenderHighlightBox(float w, float h, float scale) = 0;
virtual void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace,
uint32_t mip, uint32_t sample, CompType typeHint, float pixel[4]) = 0;
uint32_t mip, uint32_t sample, CompType typeCast, float pixel[4]) = 0;
virtual uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height,
const MeshDisplay &cfg, uint32_t x, uint32_t y) = 0;
};
+20 -20
View File
@@ -177,7 +177,7 @@ void ReplayOutput::SetTextureDisplay(const TextureDisplay &o)
bool wasClearBeforeDraw = (m_RenderData.texDisplay.overlay == DebugOverlay::ClearBeforeDraw ||
m_RenderData.texDisplay.overlay == DebugOverlay::ClearBeforePass);
if(o.overlay != m_RenderData.texDisplay.overlay || o.typeHint != m_RenderData.texDisplay.typeHint ||
if(o.overlay != m_RenderData.texDisplay.overlay || o.typeCast != m_RenderData.texDisplay.typeCast ||
o.resourceId != m_RenderData.texDisplay.resourceId)
{
if(wasClearBeforeDraw)
@@ -273,7 +273,7 @@ void ReplayOutput::RefreshOverlay()
f.z = ConvertLinearToSRGB(f.z);
m_OverlayResourceId = m_pDevice->RenderOverlay(
m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId), m_RenderData.texDisplay.typeHint,
m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId), m_RenderData.texDisplay.typeCast,
f, m_RenderData.texDisplay.overlay, m_EventID, passEvents);
m_OverlayDirty = false;
}
@@ -328,7 +328,7 @@ bool ReplayOutput::SetPixelContext(WindowingData window)
return m_PixelContext.outputID != 0;
}
bool ReplayOutput::AddThumbnail(WindowingData window, ResourceId texID, CompType typeHint,
bool ReplayOutput::AddThumbnail(WindowingData window, ResourceId texID, CompType typeCast,
uint32_t mip, uint32_t slice)
{
CHECK_REPLAY_THREAD();
@@ -355,7 +355,7 @@ bool ReplayOutput::AddThumbnail(WindowingData window, ResourceId texID, CompType
{
m_Thumbnails[i].texture = texID;
m_Thumbnails[i].depthMode = depthMode;
m_Thumbnails[i].typeHint = typeHint;
m_Thumbnails[i].typeCast = typeCast;
m_Thumbnails[i].mip = mip;
m_Thumbnails[i].slice = slice;
m_Thumbnails[i].dirty = true;
@@ -368,7 +368,7 @@ bool ReplayOutput::AddThumbnail(WindowingData window, ResourceId texID, CompType
p.outputID = m_pDevice->MakeOutputWindow(window, false);
p.texture = texID;
p.depthMode = depthMode;
p.typeHint = typeHint;
p.typeCast = typeCast;
p.mip = mip;
p.slice = slice;
p.dirty = true;
@@ -389,7 +389,7 @@ rdcpair<PixelValue, PixelValue> ReplayOutput::GetMinMax()
ResourceId tex = m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId);
CompType typeHint = m_RenderData.texDisplay.typeHint;
CompType typeCast = m_RenderData.texDisplay.typeCast;
uint32_t slice = m_RenderData.texDisplay.sliceFace;
uint32_t mip = m_RenderData.texDisplay.mip;
uint32_t sample = m_RenderData.texDisplay.sampleIdx;
@@ -398,12 +398,12 @@ rdcpair<PixelValue, PixelValue> ReplayOutput::GetMinMax()
m_CustomShaderResourceId != ResourceId())
{
tex = m_CustomShaderResourceId;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
slice = 0;
sample = 0;
}
m_pDevice->GetMinMax(tex, slice, mip, sample, typeHint, &minval.floatValue[0],
m_pDevice->GetMinMax(tex, slice, mip, sample, typeCast, &minval.floatValue[0],
&maxval.floatValue[0]);
return make_rdcpair(minval, maxval);
@@ -417,7 +417,7 @@ rdcarray<uint32_t> ReplayOutput::GetHistogram(float minval, float maxval, bool c
ResourceId tex = m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId);
CompType typeHint = m_RenderData.texDisplay.typeHint;
CompType typeCast = m_RenderData.texDisplay.typeCast;
uint32_t slice = m_RenderData.texDisplay.sliceFace;
uint32_t mip = m_RenderData.texDisplay.mip;
uint32_t sample = m_RenderData.texDisplay.sampleIdx;
@@ -426,12 +426,12 @@ rdcarray<uint32_t> ReplayOutput::GetHistogram(float minval, float maxval, bool c
m_CustomShaderResourceId != ResourceId())
{
tex = m_CustomShaderResourceId;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
slice = 0;
sample = 0;
}
m_pDevice->GetHistogram(tex, slice, mip, sample, typeHint, minval, maxval, channels, hist);
m_pDevice->GetHistogram(tex, slice, mip, sample, typeCast, minval, maxval, channels, hist);
return hist;
}
@@ -448,13 +448,13 @@ PixelValue ReplayOutput::PickPixel(ResourceId tex, bool customShader, uint32_t x
if(tex == ResourceId())
return ret;
CompType typeHint = m_RenderData.texDisplay.typeHint;
CompType typeCast = m_RenderData.texDisplay.typeCast;
if(customShader && m_RenderData.texDisplay.customShaderId != ResourceId() &&
m_CustomShaderResourceId != ResourceId())
{
tex = m_CustomShaderResourceId;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
}
// for 'heatmap' type overlays, pick from the overlay texture
@@ -465,10 +465,10 @@ PixelValue ReplayOutput::PickPixel(ResourceId tex, bool customShader, uint32_t x
m_OverlayResourceId != ResourceId())
{
tex = m_OverlayResourceId;
typeHint = CompType::Typeless;
typeCast = CompType::Typeless;
}
m_pDevice->PickPixel(m_pDevice->GetLiveID(tex), x, y, sliceFace, mip, sample, typeHint,
m_pDevice->PickPixel(m_pDevice->GetLiveID(tex), x, y, sliceFace, mip, sample, typeCast,
ret.floatValue);
return ret;
@@ -731,7 +731,7 @@ void ReplayOutput::Display()
disp.sampleIdx = ~0U;
disp.customShaderId = ResourceId();
disp.resourceId = m_pDevice->GetLiveID(m_Thumbnails[i].texture);
disp.typeHint = m_Thumbnails[i].typeHint;
disp.typeCast = m_Thumbnails[i].typeCast;
disp.scale = -1.0f;
disp.rangeMin = 0.0f;
disp.rangeMax = 1.0f;
@@ -741,7 +741,7 @@ void ReplayOutput::Display()
disp.rawOutput = false;
disp.overlay = DebugOverlay::NoOverlay;
if(m_Thumbnails[i].typeHint == CompType::SNorm)
if(m_Thumbnails[i].typeCast == CompType::SNorm)
disp.rangeMin = -1.0f;
if(m_Thumbnails[i].depthMode)
@@ -794,10 +794,10 @@ void ReplayOutput::DisplayTex()
{
m_CustomShaderResourceId = m_pDevice->ApplyCustomShader(
m_RenderData.texDisplay.customShaderId, texDisplay.resourceId, texDisplay.mip,
texDisplay.sliceFace, texDisplay.sampleIdx, texDisplay.typeHint);
texDisplay.sliceFace, texDisplay.sampleIdx, texDisplay.typeCast);
texDisplay.resourceId = m_pDevice->GetLiveID(m_CustomShaderResourceId);
texDisplay.typeHint = CompType::Typeless;
texDisplay.typeCast = CompType::Typeless;
texDisplay.customShaderId = ResourceId();
texDisplay.sliceFace = 0;
}
@@ -835,7 +835,7 @@ void ReplayOutput::DisplayTex()
texDisplay.rangeMin = 0.0f;
texDisplay.rangeMax = 1.0f;
texDisplay.linearDisplayAsGamma = false;
texDisplay.typeHint = CompType::Typeless;
texDisplay.typeCast = CompType::Typeless;
m_pDevice->RenderTexture(texDisplay);
}
+1 -1
View File
@@ -65,7 +65,7 @@ void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_
d.mip = 0;
d.sampleIdx = ~0U;
d.overlay = DebugOverlay::NoOverlay;
d.typeHint = CompType::Typeless;
d.typeCast = CompType::Typeless;
d.customShaderId = ResourceId();
d.hdrMultiplier = -1.0f;
d.linearDisplayAsGamma = true;