mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-01 11:25:48 +00:00
Remove nested structs from GL pipeline state and move to namespace
This commit is contained in:
@@ -536,7 +536,7 @@ void CaptureContext::CloseLogfile()
|
||||
|
||||
CurD3D11PipelineState = D3D11Pipe::State();
|
||||
CurD3D12PipelineState = D3D12PipelineState();
|
||||
CurGLPipelineState = GLPipelineState();
|
||||
CurGLPipelineState = GLPipe::State();
|
||||
CurVulkanPipelineState = VulkanPipelineState();
|
||||
CurPipelineState.SetStates(m_APIProps, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
|
||||
D3D11Pipe::State CurD3D11PipelineState;
|
||||
D3D12PipelineState CurD3D12PipelineState;
|
||||
GLPipelineState CurGLPipelineState;
|
||||
GLPipe::State CurGLPipelineState;
|
||||
VulkanPipelineState CurVulkanPipelineState;
|
||||
CommonPipelineState CurPipelineState;
|
||||
|
||||
|
||||
@@ -726,15 +726,15 @@ QVector<VertexInputAttribute> CommonPipelineState::GetVertexInputs()
|
||||
for(uint32_t c = 0; c < compCount; c++)
|
||||
{
|
||||
if(compType == CompType::Float)
|
||||
ret[a].GenericValue.value_f[c] = attrs[i].GenericValue.f[c];
|
||||
ret[a].GenericValue.value_f[c] = attrs[i].GenericValue.value_f[c];
|
||||
else if(compType == CompType::UInt)
|
||||
ret[a].GenericValue.value_u[c] = attrs[i].GenericValue.u[c];
|
||||
ret[a].GenericValue.value_u[c] = attrs[i].GenericValue.value_u[c];
|
||||
else if(compType == CompType::SInt)
|
||||
ret[a].GenericValue.value_i[c] = attrs[i].GenericValue.i[c];
|
||||
ret[a].GenericValue.value_i[c] = attrs[i].GenericValue.value_i[c];
|
||||
else if(compType == CompType::UScaled)
|
||||
ret[a].GenericValue.value_f[c] = (float)attrs[i].GenericValue.u[c];
|
||||
ret[a].GenericValue.value_f[c] = (float)attrs[i].GenericValue.value_u[c];
|
||||
else if(compType == CompType::SScaled)
|
||||
ret[a].GenericValue.value_f[c] = (float)attrs[i].GenericValue.i[c];
|
||||
ret[a].GenericValue.value_f[c] = (float)attrs[i].GenericValue.value_i[c];
|
||||
}
|
||||
|
||||
ret[a].PerInstance = false;
|
||||
@@ -858,7 +858,7 @@ void CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx,
|
||||
}
|
||||
else if(IsLogGL())
|
||||
{
|
||||
const GLPipelineState::Shader &s = GetGLStage(stage);
|
||||
const GLPipe::Shader &s = GetGLStage(stage);
|
||||
|
||||
if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count)
|
||||
{
|
||||
@@ -868,7 +868,7 @@ void CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx,
|
||||
s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint].bind;
|
||||
if(uboIdx >= 0 && uboIdx < m_GL->UniformBuffers.count)
|
||||
{
|
||||
GLPipelineState::Buffer &b = m_GL->UniformBuffers[uboIdx];
|
||||
GLPipe::Buffer &b = m_GL->UniformBuffers[uboIdx];
|
||||
|
||||
buf = b.Resource;
|
||||
ByteOffset = b.Offset;
|
||||
|
||||
@@ -82,7 +82,7 @@ class CommonPipelineState
|
||||
public:
|
||||
CommonPipelineState() {}
|
||||
void SetStates(APIProperties props, D3D11Pipe::State *d3d11, D3D12PipelineState *d3d12,
|
||||
GLPipelineState *gl, VulkanPipelineState *vk)
|
||||
GLPipe::State *gl, VulkanPipelineState *vk)
|
||||
{
|
||||
m_APIProps = props;
|
||||
m_D3D11 = d3d11;
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
private:
|
||||
D3D11Pipe::State *m_D3D11 = NULL;
|
||||
D3D12PipelineState *m_D3D12 = NULL;
|
||||
GLPipelineState *m_GL = NULL;
|
||||
GLPipe::State *m_GL = NULL;
|
||||
VulkanPipelineState *m_Vulkan = NULL;
|
||||
APIProperties m_APIProps;
|
||||
|
||||
@@ -215,7 +215,7 @@ private:
|
||||
return m_D3D12->m_CS;
|
||||
}
|
||||
|
||||
const GLPipelineState::Shader &GetGLStage(ShaderStage stage)
|
||||
const GLPipe::Shader &GetGLStage(ShaderStage stage)
|
||||
{
|
||||
if(stage == ShaderStage::Vertex)
|
||||
return m_GL->m_VS;
|
||||
|
||||
@@ -412,7 +412,7 @@ bool GLPipelineStateViewer::showNode(bool usedSlot, bool filledSlot)
|
||||
return false;
|
||||
}
|
||||
|
||||
const GLPipelineState::Shader *GLPipelineStateViewer::stageForSender(QWidget *widget)
|
||||
const GLPipe::Shader *GLPipelineStateViewer::stageForSender(QWidget *widget)
|
||||
{
|
||||
if(!m_Ctx.LogLoaded())
|
||||
return NULL;
|
||||
@@ -532,14 +532,14 @@ void GLPipelineStateViewer::clearState()
|
||||
ui->stencils->clear();
|
||||
}
|
||||
|
||||
void GLPipelineStateViewer::setShaderState(const GLPipelineState::Shader &stage, QLabel *shader,
|
||||
void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel *shader,
|
||||
RDTreeWidget *textures, RDTreeWidget *samplers,
|
||||
RDTreeWidget *ubos, RDTreeWidget *subs,
|
||||
RDTreeWidget *readwrites)
|
||||
{
|
||||
ShaderReflection *shaderDetails = stage.ShaderDetails;
|
||||
const ShaderBindpointMapping &mapping = stage.BindpointMapping;
|
||||
const GLPipelineState &state = m_Ctx.CurGLPipelineState;
|
||||
const GLPipe::State &state = m_Ctx.CurGLPipelineState;
|
||||
|
||||
const QIcon &action = Icons::action();
|
||||
const QIcon &action_hover = Icons::action_hover();
|
||||
@@ -584,8 +584,8 @@ void GLPipelineStateViewer::setShaderState(const GLPipelineState::Shader &stage,
|
||||
|
||||
for(int i = 0; i < state.Textures.count; i++)
|
||||
{
|
||||
const GLPipelineState::Texture &r = state.Textures[i];
|
||||
const GLPipelineState::Sampler &s = state.Samplers[i];
|
||||
const GLPipe::Texture &r = state.Textures[i];
|
||||
const GLPipe::Sampler &s = state.Samplers[i];
|
||||
|
||||
const ShaderResource *shaderInput = NULL;
|
||||
const BindpointMap *map = NULL;
|
||||
@@ -760,7 +760,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipelineState::Shader &stage,
|
||||
const ConstantBlock &shaderCBuf = shaderDetails->ConstantBlocks[i];
|
||||
int bindPoint = stage.BindpointMapping.ConstantBlocks[i].bind;
|
||||
|
||||
const GLPipelineState::Buffer *b = NULL;
|
||||
const GLPipe::Buffer *b = NULL;
|
||||
|
||||
if(bindPoint >= 0 && bindPoint < state.UniformBuffers.count)
|
||||
b = &state.UniformBuffers[bindPoint];
|
||||
@@ -851,8 +851,8 @@ void GLPipelineStateViewer::setShaderState(const GLPipelineState::Shader &stage,
|
||||
|
||||
GLReadWriteType readWriteType = GetGLReadWriteType(res);
|
||||
|
||||
const GLPipelineState::Buffer *bf = NULL;
|
||||
const GLPipelineState::ImageLoadStore *im = NULL;
|
||||
const GLPipe::Buffer *bf = NULL;
|
||||
const GLPipe::ImageLoadStore *im = NULL;
|
||||
ResourceId id;
|
||||
|
||||
if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < state.Images.count)
|
||||
@@ -980,8 +980,8 @@ void GLPipelineStateViewer::setShaderState(const GLPipelineState::Shader &stage,
|
||||
readwrites->parentWidget()->setVisible(!stage.Subroutines.empty());
|
||||
}
|
||||
|
||||
QString GLPipelineStateViewer::MakeGenericValueString(
|
||||
uint32_t compCount, CompType compType, const GLPipelineState::VertexInput::VertexAttribute &val)
|
||||
QString GLPipelineStateViewer::MakeGenericValueString(uint32_t compCount, CompType compType,
|
||||
const GLPipe::VertexAttribute &val)
|
||||
{
|
||||
QString ret = "";
|
||||
if(compCount == 1)
|
||||
@@ -996,21 +996,21 @@ QString GLPipelineStateViewer::MakeGenericValueString(
|
||||
if(compType == CompType::UInt)
|
||||
{
|
||||
for(uint32_t i = 0; i < compCount; i++)
|
||||
ret = ret.arg(val.GenericValue.u[i]);
|
||||
ret = ret.arg(val.GenericValue.value_u[i]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
else if(compType == CompType::SInt)
|
||||
{
|
||||
for(uint32_t i = 0; i < compCount; i++)
|
||||
ret = ret.arg(val.GenericValue.i[i]);
|
||||
ret = ret.arg(val.GenericValue.value_i[i]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(uint32_t i = 0; i < compCount; i++)
|
||||
ret = ret.arg(val.GenericValue.f[i]);
|
||||
ret = ret.arg(val.GenericValue.value_f[i]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1048,7 +1048,7 @@ void GLPipelineStateViewer::setState()
|
||||
return;
|
||||
}
|
||||
|
||||
const GLPipelineState &state = m_Ctx.CurGLPipelineState;
|
||||
const GLPipe::State &state = m_Ctx.CurGLPipelineState;
|
||||
const FetchDrawcall *draw = m_Ctx.CurDrawcall();
|
||||
|
||||
bool showDisabled = ui->showDisabled->isChecked();
|
||||
@@ -1072,7 +1072,7 @@ void GLPipelineStateViewer::setState()
|
||||
ui->viAttrs->clear();
|
||||
{
|
||||
int i = 0;
|
||||
for(const GLPipelineState::VertexInput::VertexAttribute &a : state.m_VtxIn.attributes)
|
||||
for(const GLPipe::VertexAttribute &a : state.m_VtxIn.attributes)
|
||||
{
|
||||
bool filledSlot = true;
|
||||
bool usedSlot = false;
|
||||
@@ -1236,7 +1236,7 @@ void GLPipelineStateViewer::setState()
|
||||
|
||||
for(int i = 0; i < state.m_VtxIn.vbuffers.count; i++)
|
||||
{
|
||||
const GLPipelineState::VertexInput::VertexBuffer &v = state.m_VtxIn.vbuffers[i];
|
||||
const GLPipe::VB &v = state.m_VtxIn.vbuffers[i];
|
||||
|
||||
bool filledSlot = (v.Buffer != ResourceId());
|
||||
bool usedSlot = (usedBindings[i]);
|
||||
@@ -1361,8 +1361,8 @@ void GLPipelineStateViewer::setState()
|
||||
int prev = 0;
|
||||
for(int i = 0; i < state.m_Rasterizer.Viewports.count; i++)
|
||||
{
|
||||
const GLPipelineState::Rasterizer::Viewport &v1 = state.m_Rasterizer.Viewports[prev];
|
||||
const GLPipelineState::Rasterizer::Viewport &v2 = state.m_Rasterizer.Viewports[i];
|
||||
const GLPipe::Viewport &v1 = state.m_Rasterizer.Viewports[prev];
|
||||
const GLPipe::Viewport &v2 = state.m_Rasterizer.Viewports[i];
|
||||
|
||||
if(v1.Width != v2.Width || v1.Height != v2.Height || v1.Left != v2.Left ||
|
||||
v1.Bottom != v2.Bottom || v1.MinDepth != v2.MinDepth || v1.MaxDepth != v2.MaxDepth)
|
||||
@@ -1392,7 +1392,7 @@ void GLPipelineStateViewer::setState()
|
||||
// handle the last batch (the loop above leaves the last batch un-added)
|
||||
if(prev < state.m_Rasterizer.Viewports.count)
|
||||
{
|
||||
const GLPipelineState::Rasterizer::Viewport &v1 = state.m_Rasterizer.Viewports[prev];
|
||||
const GLPipe::Viewport &v1 = state.m_Rasterizer.Viewports[prev];
|
||||
|
||||
// must display at least one viewport - otherwise if they are
|
||||
// all empty we get an empty list - we want a nice obvious
|
||||
@@ -1431,8 +1431,8 @@ void GLPipelineStateViewer::setState()
|
||||
int prev = 0;
|
||||
for(int i = 0; i < state.m_Rasterizer.Scissors.count; i++)
|
||||
{
|
||||
const GLPipelineState::Rasterizer::Scissor &s1 = state.m_Rasterizer.Scissors[prev];
|
||||
const GLPipelineState::Rasterizer::Scissor &s2 = state.m_Rasterizer.Scissors[i];
|
||||
const GLPipe::Scissor &s1 = state.m_Rasterizer.Scissors[prev];
|
||||
const GLPipe::Scissor &s2 = state.m_Rasterizer.Scissors[i];
|
||||
|
||||
if(s1.Width != s2.Width || s1.Height != s2.Height || s1.Left != s2.Left ||
|
||||
s1.Bottom != s2.Bottom || s1.Enabled != s2.Enabled)
|
||||
@@ -1466,7 +1466,7 @@ void GLPipelineStateViewer::setState()
|
||||
// handle the last batch (the loop above leaves the last batch un-added)
|
||||
if(prev < state.m_Rasterizer.Scissors.count)
|
||||
{
|
||||
const GLPipelineState::Rasterizer::Scissor &s1 = state.m_Rasterizer.Scissors[prev];
|
||||
const GLPipe::Scissor &s1 = state.m_Rasterizer.Scissors[prev];
|
||||
|
||||
if(s1.Enabled || ui->showEmpty->isChecked())
|
||||
{
|
||||
@@ -1604,7 +1604,7 @@ void GLPipelineStateViewer::setState()
|
||||
for(int db : state.m_FB.m_DrawFBO.DrawBuffers)
|
||||
{
|
||||
ResourceId p;
|
||||
const GLPipelineState::FrameBuffer::Attachment *r = NULL;
|
||||
const GLPipe::Attachment *r = NULL;
|
||||
|
||||
if(db >= 0 && db < state.m_FB.m_DrawFBO.Color.count)
|
||||
{
|
||||
@@ -1772,7 +1772,7 @@ void GLPipelineStateViewer::setState()
|
||||
bool logic = !state.m_FB.m_Blending.Blends[0].LogicOp.empty();
|
||||
|
||||
int i = 0;
|
||||
for(const GLPipelineState::FrameBuffer::BlendState::RTBlend &blend : state.m_FB.m_Blending.Blends)
|
||||
for(const GLPipe::Blend &blend : state.m_FB.m_Blending.Blends)
|
||||
{
|
||||
bool filledSlot = (blend.Enabled || targets[i]);
|
||||
bool usedSlot = (targets[i]);
|
||||
@@ -1939,7 +1939,7 @@ QString GLPipelineStateViewer::formatMembers(int indent, const QString &namepref
|
||||
|
||||
void GLPipelineStateViewer::resource_itemActivated(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
const GLPipelineState::Shader *stage = stageForSender(item->treeWidget());
|
||||
const GLPipe::Shader *stage = stageForSender(item->treeWidget());
|
||||
|
||||
if(stage == NULL)
|
||||
return;
|
||||
@@ -2037,7 +2037,7 @@ void GLPipelineStateViewer::resource_itemActivated(QTreeWidgetItem *item, int co
|
||||
|
||||
void GLPipelineStateViewer::ubo_itemActivated(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
const GLPipelineState::Shader *stage = stageForSender(item->treeWidget());
|
||||
const GLPipe::Shader *stage = stageForSender(item->treeWidget());
|
||||
|
||||
if(stage == NULL)
|
||||
return;
|
||||
@@ -2100,7 +2100,7 @@ void GLPipelineStateViewer::highlightIABind(int slot)
|
||||
{
|
||||
int idx = ((slot + 1) * 21) % 32; // space neighbouring colours reasonably distinctly
|
||||
|
||||
const GLPipelineState::VertexInput &VI = m_Ctx.CurGLPipelineState.m_VtxIn;
|
||||
const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState.m_VtxIn;
|
||||
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f);
|
||||
|
||||
@@ -2151,7 +2151,7 @@ void GLPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e)
|
||||
|
||||
vertex_leave(NULL);
|
||||
|
||||
const GLPipelineState::VertexInput &VI = m_Ctx.CurGLPipelineState.m_VtxIn;
|
||||
const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState.m_VtxIn;
|
||||
|
||||
if(idx.isValid())
|
||||
{
|
||||
@@ -2244,7 +2244,7 @@ void GLPipelineStateViewer::on_pipeFlow_stageSelected(int index)
|
||||
|
||||
void GLPipelineStateViewer::shaderView_clicked()
|
||||
{
|
||||
const GLPipelineState::Shader *stage = stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
const GLPipe::Shader *stage = stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
|
||||
if(stage == NULL || stage->Object == ResourceId())
|
||||
return;
|
||||
@@ -2265,7 +2265,7 @@ void GLPipelineStateViewer::shaderView_clicked()
|
||||
void GLPipelineStateViewer::shaderEdit_clicked()
|
||||
{
|
||||
QWidget *sender = qobject_cast<QWidget *>(QObject::sender());
|
||||
const GLPipelineState::Shader *stage = stageForSender(sender);
|
||||
const GLPipe::Shader *stage = stageForSender(sender);
|
||||
|
||||
if(!stage || stage->Object == ResourceId())
|
||||
return;
|
||||
@@ -2300,7 +2300,7 @@ void GLPipelineStateViewer::shaderEdit_clicked()
|
||||
|
||||
void GLPipelineStateViewer::shaderSave_clicked()
|
||||
{
|
||||
const GLPipelineState::Shader *stage = stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
const GLPipe::Shader *stage = stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
|
||||
if(stage == NULL)
|
||||
return;
|
||||
|
||||
@@ -83,10 +83,10 @@ private:
|
||||
};
|
||||
|
||||
QString MakeGenericValueString(uint32_t compCount, CompType compType,
|
||||
const GLPipelineState::VertexInput::VertexAttribute &val);
|
||||
const GLPipe::VertexAttribute &val);
|
||||
GLReadWriteType GetGLReadWriteType(ShaderResource res);
|
||||
|
||||
void setShaderState(const GLPipelineState::Shader &stage, QLabel *shader, RDTreeWidget *tex,
|
||||
void setShaderState(const GLPipe::Shader &stage, QLabel *shader, RDTreeWidget *tex,
|
||||
RDTreeWidget *samp, RDTreeWidget *ubo, RDTreeWidget *sub, RDTreeWidget *rw);
|
||||
void clearShaderState(QLabel *shader, RDTreeWidget *tex, RDTreeWidget *samp, RDTreeWidget *ubo,
|
||||
RDTreeWidget *sub, RDTreeWidget *rw);
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
|
||||
QString formatMembers(int indent, const QString &nameprefix,
|
||||
const rdctype::array<ShaderConstant> &vars);
|
||||
const GLPipelineState::Shader *stageForSender(QWidget *widget);
|
||||
const GLPipe::Shader *stageForSender(QWidget *widget);
|
||||
|
||||
bool showNode(bool usedSlot, bool filledSlot);
|
||||
|
||||
|
||||
+379
-348
@@ -25,384 +25,415 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
struct GLPipelineState
|
||||
#include "data_types.h"
|
||||
|
||||
namespace GLPipe
|
||||
{
|
||||
GLPipelineState() {}
|
||||
struct VertexInput
|
||||
struct VertexAttribute
|
||||
{
|
||||
VertexAttribute() : BufferSlot(0), RelativeOffset(0) {}
|
||||
bool32 Enabled;
|
||||
ResourceFormat Format;
|
||||
|
||||
PixelValue GenericValue;
|
||||
|
||||
uint32_t BufferSlot;
|
||||
uint32_t RelativeOffset;
|
||||
};
|
||||
|
||||
struct VB
|
||||
{
|
||||
VB() : Buffer(), Stride(0), Offset(0), Divisor(0) {}
|
||||
ResourceId Buffer;
|
||||
uint32_t Stride;
|
||||
uint32_t Offset;
|
||||
uint32_t Divisor;
|
||||
};
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
VertexInput() : ibuffer(), primitiveRestart(false), restartIndex(0), provokingVertexLast(false) {}
|
||||
rdctype::array<VertexAttribute> attributes;
|
||||
|
||||
rdctype::array<VB> vbuffers;
|
||||
|
||||
ResourceId ibuffer;
|
||||
bool32 primitiveRestart;
|
||||
uint32_t restartIndex;
|
||||
|
||||
bool32 provokingVertexLast;
|
||||
};
|
||||
|
||||
struct Shader
|
||||
{
|
||||
Shader()
|
||||
: Object(),
|
||||
customShaderName(false),
|
||||
customProgramName(false),
|
||||
PipelineActive(false),
|
||||
customPipelineName(false),
|
||||
ShaderDetails(NULL),
|
||||
stage(ShaderStage::Vertex)
|
||||
{
|
||||
VertexInput() : ibuffer(), primitiveRestart(false), restartIndex(0), provokingVertexLast(false)
|
||||
{
|
||||
}
|
||||
}
|
||||
ResourceId Object;
|
||||
|
||||
struct VertexAttribute
|
||||
{
|
||||
VertexAttribute() : BufferSlot(0), RelativeOffset(0) {}
|
||||
bool32 Enabled;
|
||||
ResourceFormat Format;
|
||||
rdctype::str ShaderName;
|
||||
bool32 customShaderName;
|
||||
|
||||
union
|
||||
{
|
||||
float f[4];
|
||||
uint32_t u[4];
|
||||
int32_t i[4];
|
||||
} GenericValue;
|
||||
rdctype::str ProgramName;
|
||||
bool32 customProgramName;
|
||||
|
||||
uint32_t BufferSlot;
|
||||
uint32_t RelativeOffset;
|
||||
};
|
||||
rdctype::array<VertexAttribute> attributes;
|
||||
bool32 PipelineActive;
|
||||
rdctype::str PipelineName;
|
||||
bool32 customPipelineName;
|
||||
|
||||
struct VertexBuffer
|
||||
{
|
||||
VertexBuffer() : Buffer(), Stride(0), Offset(0), Divisor(0) {}
|
||||
ResourceId Buffer;
|
||||
uint32_t Stride;
|
||||
uint32_t Offset;
|
||||
uint32_t Divisor;
|
||||
};
|
||||
rdctype::array<VertexBuffer> vbuffers;
|
||||
ShaderReflection *ShaderDetails;
|
||||
ShaderBindpointMapping BindpointMapping;
|
||||
|
||||
ResourceId ibuffer;
|
||||
bool32 primitiveRestart;
|
||||
uint32_t restartIndex;
|
||||
ShaderStage stage;
|
||||
|
||||
bool32 provokingVertexLast;
|
||||
} m_VtxIn;
|
||||
rdctype::array<uint32_t> Subroutines;
|
||||
};
|
||||
|
||||
struct Shader
|
||||
struct FixedVertexProcessing
|
||||
{
|
||||
FixedVertexProcessing() : discard(0), clipOriginLowerLeft(0), clipNegativeOneToOne(0)
|
||||
{
|
||||
Shader()
|
||||
: Object(),
|
||||
customShaderName(false),
|
||||
customProgramName(false),
|
||||
PipelineActive(false),
|
||||
customPipelineName(false),
|
||||
ShaderDetails(NULL),
|
||||
stage(ShaderStage::Vertex)
|
||||
{
|
||||
}
|
||||
ResourceId Object;
|
||||
defaultInnerLevel[0] = defaultInnerLevel[1] = 0.0f;
|
||||
defaultOuterLevel[0] = defaultOuterLevel[1] = defaultOuterLevel[2] = defaultOuterLevel[3] = 0.0f;
|
||||
clipPlanes[0] = clipPlanes[1] = clipPlanes[2] = clipPlanes[3] = clipPlanes[4] = clipPlanes[5] =
|
||||
clipPlanes[6] = clipPlanes[7] = 0;
|
||||
}
|
||||
|
||||
rdctype::str ShaderName;
|
||||
bool32 customShaderName;
|
||||
float defaultInnerLevel[2];
|
||||
float defaultOuterLevel[4];
|
||||
bool32 discard;
|
||||
|
||||
rdctype::str ProgramName;
|
||||
bool32 customProgramName;
|
||||
bool32 clipPlanes[8];
|
||||
bool32 clipOriginLowerLeft;
|
||||
bool32 clipNegativeOneToOne;
|
||||
};
|
||||
|
||||
bool32 PipelineActive;
|
||||
rdctype::str PipelineName;
|
||||
bool32 customPipelineName;
|
||||
|
||||
ShaderReflection *ShaderDetails;
|
||||
ShaderBindpointMapping BindpointMapping;
|
||||
|
||||
ShaderStage stage;
|
||||
|
||||
rdctype::array<uint32_t> Subroutines;
|
||||
} m_VS, m_TCS, m_TES, m_GS, m_FS, m_CS;
|
||||
|
||||
struct FixedVertexProcessing
|
||||
struct Texture
|
||||
{
|
||||
Texture() : Resource(), FirstSlice(0), ResType(TextureDim::Unknown), DepthReadChannel(-1)
|
||||
{
|
||||
FixedVertexProcessing() : discard(0), clipOriginLowerLeft(0), clipNegativeOneToOne(0)
|
||||
{
|
||||
defaultInnerLevel[0] = defaultInnerLevel[1] = 0.0f;
|
||||
defaultOuterLevel[0] = defaultOuterLevel[1] = defaultOuterLevel[2] = defaultOuterLevel[3] =
|
||||
0.0f;
|
||||
clipPlanes[0] = clipPlanes[1] = clipPlanes[2] = clipPlanes[3] = clipPlanes[4] =
|
||||
clipPlanes[5] = clipPlanes[6] = clipPlanes[7] = 0;
|
||||
}
|
||||
Swizzle[0] = TextureSwizzle::Red;
|
||||
Swizzle[1] = TextureSwizzle::Green;
|
||||
Swizzle[2] = TextureSwizzle::Blue;
|
||||
Swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
ResourceId Resource;
|
||||
uint32_t FirstSlice;
|
||||
uint32_t HighestMip;
|
||||
TextureDim ResType;
|
||||
|
||||
float defaultInnerLevel[2];
|
||||
float defaultOuterLevel[4];
|
||||
bool32 discard;
|
||||
TextureSwizzle Swizzle[4];
|
||||
int32_t DepthReadChannel;
|
||||
};
|
||||
|
||||
bool32 clipPlanes[8];
|
||||
bool32 clipOriginLowerLeft;
|
||||
bool32 clipNegativeOneToOne;
|
||||
} m_VtxProcess;
|
||||
|
||||
struct Texture
|
||||
struct Sampler
|
||||
{
|
||||
Sampler()
|
||||
: Samp(),
|
||||
UseBorder(false),
|
||||
UseComparison(false),
|
||||
SeamlessCube(false),
|
||||
MaxAniso(0.0f),
|
||||
MaxLOD(0.0f),
|
||||
MinLOD(0.0f),
|
||||
MipLODBias(0.0f)
|
||||
{
|
||||
Texture() : Resource(), FirstSlice(0), ResType(TextureDim::Unknown), DepthReadChannel(-1)
|
||||
{
|
||||
Swizzle[0] = TextureSwizzle::Red;
|
||||
Swizzle[1] = TextureSwizzle::Green;
|
||||
Swizzle[2] = TextureSwizzle::Blue;
|
||||
Swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
ResourceId Resource;
|
||||
uint32_t FirstSlice;
|
||||
uint32_t HighestMip;
|
||||
TextureDim ResType;
|
||||
BorderColor[0] = BorderColor[1] = BorderColor[2] = BorderColor[3] = 0.0f;
|
||||
}
|
||||
ResourceId Samp;
|
||||
rdctype::str AddressS, AddressT, AddressR;
|
||||
float BorderColor[4];
|
||||
rdctype::str Comparison;
|
||||
rdctype::str MinFilter;
|
||||
rdctype::str MagFilter;
|
||||
bool32 UseBorder;
|
||||
bool32 UseComparison;
|
||||
bool32 SeamlessCube;
|
||||
float MaxAniso;
|
||||
float MaxLOD;
|
||||
float MinLOD;
|
||||
float MipLODBias;
|
||||
};
|
||||
|
||||
struct Buffer
|
||||
{
|
||||
Buffer() : Resource(), Offset(0), Size(0) {}
|
||||
ResourceId Resource;
|
||||
uint64_t Offset;
|
||||
uint64_t Size;
|
||||
};
|
||||
|
||||
struct ImageLoadStore
|
||||
{
|
||||
ImageLoadStore()
|
||||
: Resource(),
|
||||
Level(0),
|
||||
Layered(false),
|
||||
Layer(0),
|
||||
ResType(TextureDim::Unknown),
|
||||
readAllowed(false),
|
||||
writeAllowed(false)
|
||||
{
|
||||
}
|
||||
ResourceId Resource;
|
||||
uint32_t Level;
|
||||
bool32 Layered;
|
||||
uint32_t Layer;
|
||||
TextureDim ResType;
|
||||
bool32 readAllowed;
|
||||
bool32 writeAllowed;
|
||||
ResourceFormat Format;
|
||||
};
|
||||
|
||||
struct Feedback
|
||||
{
|
||||
Feedback() : Active(false), Paused(false)
|
||||
{
|
||||
Offset[0] = Offset[1] = Offset[2] = Offset[3] = 0;
|
||||
Size[0] = Size[1] = Size[2] = Size[3] = 0;
|
||||
}
|
||||
|
||||
ResourceId Obj;
|
||||
ResourceId BufferBinding[4];
|
||||
uint64_t Offset[4];
|
||||
uint64_t Size[4];
|
||||
bool32 Active;
|
||||
bool32 Paused;
|
||||
};
|
||||
|
||||
struct Viewport
|
||||
{
|
||||
Viewport() : Left(0.0f), Bottom(0.0f), Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f)
|
||||
{
|
||||
}
|
||||
float Left, Bottom;
|
||||
float Width, Height;
|
||||
double MinDepth, MaxDepth;
|
||||
};
|
||||
|
||||
struct Scissor
|
||||
{
|
||||
Scissor() : Left(0), Bottom(0), Width(0), Height(0), Enabled(false) {}
|
||||
int32_t Left, Bottom;
|
||||
int32_t Width, Height;
|
||||
bool32 Enabled;
|
||||
};
|
||||
|
||||
struct RasterizerState
|
||||
{
|
||||
RasterizerState()
|
||||
: fillMode(FillMode::Solid),
|
||||
cullMode(CullMode::NoCull),
|
||||
FrontCCW(false),
|
||||
DepthBias(0),
|
||||
SlopeScaledDepthBias(0.0f),
|
||||
OffsetClamp(0.0f),
|
||||
DepthClamp(false),
|
||||
MultisampleEnable(false),
|
||||
SampleShading(false),
|
||||
SampleMask(false),
|
||||
SampleMaskValue(~0U),
|
||||
SampleCoverage(false),
|
||||
SampleCoverageInvert(false),
|
||||
SampleCoverageValue(1.0f),
|
||||
SampleAlphaToCoverage(false),
|
||||
SampleAlphaToOne(false),
|
||||
MinSampleShadingRate(0.0f),
|
||||
ProgrammablePointSize(false),
|
||||
PointSize(1.0f),
|
||||
LineWidth(1.0f),
|
||||
PointFadeThreshold(0.0f),
|
||||
PointOriginUpperLeft(false)
|
||||
{
|
||||
}
|
||||
FillMode fillMode;
|
||||
CullMode cullMode;
|
||||
bool32 FrontCCW;
|
||||
float DepthBias;
|
||||
float SlopeScaledDepthBias;
|
||||
float OffsetClamp;
|
||||
bool32 DepthClamp;
|
||||
|
||||
bool32 MultisampleEnable;
|
||||
bool32 SampleShading;
|
||||
bool32 SampleMask;
|
||||
uint32_t SampleMaskValue;
|
||||
bool32 SampleCoverage;
|
||||
bool32 SampleCoverageInvert;
|
||||
float SampleCoverageValue;
|
||||
bool32 SampleAlphaToCoverage;
|
||||
bool32 SampleAlphaToOne;
|
||||
float MinSampleShadingRate;
|
||||
|
||||
bool32 ProgrammablePointSize;
|
||||
float PointSize;
|
||||
float LineWidth;
|
||||
float PointFadeThreshold;
|
||||
bool32 PointOriginUpperLeft;
|
||||
};
|
||||
|
||||
struct Rasterizer
|
||||
{
|
||||
rdctype::array<Viewport> Viewports;
|
||||
|
||||
rdctype::array<Scissor> Scissors;
|
||||
|
||||
RasterizerState m_State;
|
||||
};
|
||||
|
||||
struct DepthState
|
||||
{
|
||||
DepthState()
|
||||
: DepthEnable(false), DepthWrites(false), DepthBounds(false), NearBound(0), FarBound(0)
|
||||
{
|
||||
}
|
||||
bool32 DepthEnable;
|
||||
rdctype::str DepthFunc;
|
||||
bool32 DepthWrites;
|
||||
bool32 DepthBounds;
|
||||
double NearBound, FarBound;
|
||||
};
|
||||
|
||||
struct StencilOp
|
||||
{
|
||||
StencilOp() : Ref(0), ValueMask(0), WriteMask(0) {}
|
||||
rdctype::str FailOp;
|
||||
rdctype::str DepthFailOp;
|
||||
rdctype::str PassOp;
|
||||
rdctype::str Func;
|
||||
uint32_t Ref;
|
||||
uint32_t ValueMask;
|
||||
uint32_t WriteMask;
|
||||
};
|
||||
|
||||
struct StencilState
|
||||
{
|
||||
StencilState() : StencilEnable(false) {}
|
||||
bool32 StencilEnable;
|
||||
|
||||
StencilOp m_FrontFace, m_BackFace;
|
||||
};
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment() : Obj(), Layer(0), Mip(0)
|
||||
{
|
||||
Swizzle[0] = TextureSwizzle::Red;
|
||||
Swizzle[1] = TextureSwizzle::Green;
|
||||
Swizzle[2] = TextureSwizzle::Blue;
|
||||
Swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
ResourceId Obj;
|
||||
uint32_t Layer;
|
||||
uint32_t Mip;
|
||||
TextureSwizzle Swizzle[4];
|
||||
};
|
||||
|
||||
struct FBO
|
||||
{
|
||||
FBO() : Obj(), Depth(), Stencil(), ReadBuffer(0) {}
|
||||
ResourceId Obj;
|
||||
rdctype::array<Attachment> Color;
|
||||
Attachment Depth;
|
||||
Attachment Stencil;
|
||||
|
||||
rdctype::array<int32_t> DrawBuffers;
|
||||
int32_t ReadBuffer;
|
||||
};
|
||||
|
||||
struct BlendOp
|
||||
{
|
||||
rdctype::str Source;
|
||||
rdctype::str Destination;
|
||||
rdctype::str Operation;
|
||||
};
|
||||
|
||||
struct Blend
|
||||
{
|
||||
Blend() : Enabled(false), WriteMask(0) {}
|
||||
BlendOp m_Blend, m_AlphaBlend;
|
||||
|
||||
rdctype::str LogicOp;
|
||||
|
||||
bool32 Enabled;
|
||||
byte WriteMask;
|
||||
};
|
||||
|
||||
struct BlendState
|
||||
{
|
||||
BlendState() { BlendFactor[0] = BlendFactor[1] = BlendFactor[2] = BlendFactor[3] = 0.0f; }
|
||||
rdctype::array<Blend> Blends;
|
||||
|
||||
float BlendFactor[4];
|
||||
};
|
||||
|
||||
struct FrameBuffer
|
||||
{
|
||||
FrameBuffer() : FramebufferSRGB(false), Dither(false) {}
|
||||
bool32 FramebufferSRGB;
|
||||
bool32 Dither;
|
||||
|
||||
FBO m_DrawFBO, m_ReadFBO;
|
||||
|
||||
BlendState m_Blending;
|
||||
};
|
||||
|
||||
struct Hints
|
||||
{
|
||||
Hints()
|
||||
: Derivatives(QualityHint::DontCare),
|
||||
LineSmooth(QualityHint::DontCare),
|
||||
PolySmooth(QualityHint::DontCare),
|
||||
TexCompression(QualityHint::DontCare),
|
||||
LineSmoothEnabled(0),
|
||||
PolySmoothEnabled(0)
|
||||
{
|
||||
}
|
||||
|
||||
QualityHint Derivatives;
|
||||
QualityHint LineSmooth;
|
||||
QualityHint PolySmooth;
|
||||
QualityHint TexCompression;
|
||||
bool32 LineSmoothEnabled;
|
||||
bool32 PolySmoothEnabled;
|
||||
};
|
||||
|
||||
struct State
|
||||
{
|
||||
State() {}
|
||||
VertexInput m_VtxIn;
|
||||
|
||||
Shader m_VS, m_TCS, m_TES, m_GS, m_FS, m_CS;
|
||||
|
||||
FixedVertexProcessing m_VtxProcess;
|
||||
|
||||
TextureSwizzle Swizzle[4];
|
||||
int32_t DepthReadChannel;
|
||||
};
|
||||
rdctype::array<Texture> Textures;
|
||||
|
||||
struct Sampler
|
||||
{
|
||||
Sampler()
|
||||
: Samp(),
|
||||
UseBorder(false),
|
||||
UseComparison(false),
|
||||
SeamlessCube(false),
|
||||
MaxAniso(0.0f),
|
||||
MaxLOD(0.0f),
|
||||
MinLOD(0.0f),
|
||||
MipLODBias(0.0f)
|
||||
{
|
||||
BorderColor[0] = BorderColor[1] = BorderColor[2] = BorderColor[3] = 0.0f;
|
||||
}
|
||||
ResourceId Samp;
|
||||
rdctype::str AddressS, AddressT, AddressR;
|
||||
float BorderColor[4];
|
||||
rdctype::str Comparison;
|
||||
rdctype::str MinFilter;
|
||||
rdctype::str MagFilter;
|
||||
bool32 UseBorder;
|
||||
bool32 UseComparison;
|
||||
bool32 SeamlessCube;
|
||||
float MaxAniso;
|
||||
float MaxLOD;
|
||||
float MinLOD;
|
||||
float MipLODBias;
|
||||
};
|
||||
rdctype::array<Sampler> Samplers;
|
||||
|
||||
struct Buffer
|
||||
{
|
||||
Buffer() : Resource(), Offset(0), Size(0) {}
|
||||
ResourceId Resource;
|
||||
uint64_t Offset;
|
||||
uint64_t Size;
|
||||
};
|
||||
rdctype::array<Buffer> AtomicBuffers;
|
||||
rdctype::array<Buffer> UniformBuffers;
|
||||
rdctype::array<Buffer> ShaderStorageBuffers;
|
||||
|
||||
struct ImageLoadStore
|
||||
{
|
||||
ImageLoadStore()
|
||||
: Resource(),
|
||||
Level(0),
|
||||
Layered(false),
|
||||
Layer(0),
|
||||
ResType(TextureDim::Unknown),
|
||||
readAllowed(false),
|
||||
writeAllowed(false)
|
||||
{
|
||||
}
|
||||
ResourceId Resource;
|
||||
uint32_t Level;
|
||||
bool32 Layered;
|
||||
uint32_t Layer;
|
||||
TextureDim ResType;
|
||||
bool32 readAllowed;
|
||||
bool32 writeAllowed;
|
||||
ResourceFormat Format;
|
||||
};
|
||||
rdctype::array<ImageLoadStore> Images;
|
||||
|
||||
struct Feedback
|
||||
{
|
||||
Feedback() : Active(false), Paused(false)
|
||||
{
|
||||
Offset[0] = Offset[1] = Offset[2] = Offset[3] = 0;
|
||||
Size[0] = Size[1] = Size[2] = Size[3] = 0;
|
||||
}
|
||||
Feedback m_Feedback;
|
||||
|
||||
ResourceId Obj;
|
||||
ResourceId BufferBinding[4];
|
||||
uint64_t Offset[4];
|
||||
uint64_t Size[4];
|
||||
bool32 Active;
|
||||
bool32 Paused;
|
||||
} m_Feedback;
|
||||
Rasterizer m_Rasterizer;
|
||||
|
||||
struct Rasterizer
|
||||
{
|
||||
struct Viewport
|
||||
{
|
||||
Viewport()
|
||||
: Left(0.0f), Bottom(0.0f), Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f)
|
||||
{
|
||||
}
|
||||
float Left, Bottom;
|
||||
float Width, Height;
|
||||
double MinDepth, MaxDepth;
|
||||
};
|
||||
rdctype::array<Viewport> Viewports;
|
||||
DepthState m_DepthState;
|
||||
|
||||
struct Scissor
|
||||
{
|
||||
Scissor() : Left(0), Bottom(0), Width(0), Height(0), Enabled(false) {}
|
||||
int32_t Left, Bottom;
|
||||
int32_t Width, Height;
|
||||
bool32 Enabled;
|
||||
};
|
||||
rdctype::array<Scissor> Scissors;
|
||||
StencilState m_StencilState;
|
||||
|
||||
struct RasterizerState
|
||||
{
|
||||
RasterizerState()
|
||||
: fillMode(FillMode::Solid),
|
||||
cullMode(CullMode::NoCull),
|
||||
FrontCCW(false),
|
||||
DepthBias(0),
|
||||
SlopeScaledDepthBias(0.0f),
|
||||
OffsetClamp(0.0f),
|
||||
DepthClamp(false),
|
||||
MultisampleEnable(false),
|
||||
SampleShading(false),
|
||||
SampleMask(false),
|
||||
SampleMaskValue(~0U),
|
||||
SampleCoverage(false),
|
||||
SampleCoverageInvert(false),
|
||||
SampleCoverageValue(1.0f),
|
||||
SampleAlphaToCoverage(false),
|
||||
SampleAlphaToOne(false),
|
||||
MinSampleShadingRate(0.0f),
|
||||
ProgrammablePointSize(false),
|
||||
PointSize(1.0f),
|
||||
LineWidth(1.0f),
|
||||
PointFadeThreshold(0.0f),
|
||||
PointOriginUpperLeft(false)
|
||||
{
|
||||
}
|
||||
FillMode fillMode;
|
||||
CullMode cullMode;
|
||||
bool32 FrontCCW;
|
||||
float DepthBias;
|
||||
float SlopeScaledDepthBias;
|
||||
float OffsetClamp;
|
||||
bool32 DepthClamp;
|
||||
FrameBuffer m_FB;
|
||||
|
||||
bool32 MultisampleEnable;
|
||||
bool32 SampleShading;
|
||||
bool32 SampleMask;
|
||||
uint32_t SampleMaskValue;
|
||||
bool32 SampleCoverage;
|
||||
bool32 SampleCoverageInvert;
|
||||
float SampleCoverageValue;
|
||||
bool32 SampleAlphaToCoverage;
|
||||
bool32 SampleAlphaToOne;
|
||||
float MinSampleShadingRate;
|
||||
|
||||
bool32 ProgrammablePointSize;
|
||||
float PointSize;
|
||||
float LineWidth;
|
||||
float PointFadeThreshold;
|
||||
bool32 PointOriginUpperLeft;
|
||||
} m_State;
|
||||
} m_Rasterizer;
|
||||
|
||||
struct DepthState
|
||||
{
|
||||
DepthState()
|
||||
: DepthEnable(false), DepthWrites(false), DepthBounds(false), NearBound(0), FarBound(0)
|
||||
{
|
||||
}
|
||||
bool32 DepthEnable;
|
||||
rdctype::str DepthFunc;
|
||||
bool32 DepthWrites;
|
||||
bool32 DepthBounds;
|
||||
double NearBound, FarBound;
|
||||
} m_DepthState;
|
||||
|
||||
struct StencilState
|
||||
{
|
||||
StencilState() : StencilEnable(false) {}
|
||||
bool32 StencilEnable;
|
||||
|
||||
struct StencilOp
|
||||
{
|
||||
StencilOp() : Ref(0), ValueMask(0), WriteMask(0) {}
|
||||
rdctype::str FailOp;
|
||||
rdctype::str DepthFailOp;
|
||||
rdctype::str PassOp;
|
||||
rdctype::str Func;
|
||||
uint32_t Ref;
|
||||
uint32_t ValueMask;
|
||||
uint32_t WriteMask;
|
||||
} m_FrontFace, m_BackFace;
|
||||
} m_StencilState;
|
||||
|
||||
struct FrameBuffer
|
||||
{
|
||||
FrameBuffer() : FramebufferSRGB(false), Dither(false) {}
|
||||
bool32 FramebufferSRGB;
|
||||
bool32 Dither;
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment() : Obj(), Layer(0), Mip(0)
|
||||
{
|
||||
Swizzle[0] = TextureSwizzle::Red;
|
||||
Swizzle[1] = TextureSwizzle::Green;
|
||||
Swizzle[2] = TextureSwizzle::Blue;
|
||||
Swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
ResourceId Obj;
|
||||
uint32_t Layer;
|
||||
uint32_t Mip;
|
||||
TextureSwizzle Swizzle[4];
|
||||
};
|
||||
|
||||
struct FBO
|
||||
{
|
||||
FBO() : Obj(), Depth(), Stencil(), ReadBuffer(0) {}
|
||||
ResourceId Obj;
|
||||
rdctype::array<Attachment> Color;
|
||||
Attachment Depth;
|
||||
Attachment Stencil;
|
||||
|
||||
rdctype::array<int32_t> DrawBuffers;
|
||||
int32_t ReadBuffer;
|
||||
} m_DrawFBO, m_ReadFBO;
|
||||
|
||||
struct BlendState
|
||||
{
|
||||
BlendState() { BlendFactor[0] = BlendFactor[1] = BlendFactor[2] = BlendFactor[3] = 0.0f; }
|
||||
struct RTBlend
|
||||
{
|
||||
RTBlend() : Enabled(false), WriteMask(0) {}
|
||||
struct BlendOp
|
||||
{
|
||||
rdctype::str Source;
|
||||
rdctype::str Destination;
|
||||
rdctype::str Operation;
|
||||
} m_Blend, m_AlphaBlend;
|
||||
|
||||
rdctype::str LogicOp;
|
||||
|
||||
bool32 Enabled;
|
||||
byte WriteMask;
|
||||
};
|
||||
rdctype::array<RTBlend> Blends;
|
||||
|
||||
float BlendFactor[4];
|
||||
} m_Blending;
|
||||
|
||||
} m_FB;
|
||||
|
||||
struct Hints
|
||||
{
|
||||
Hints()
|
||||
: Derivatives(QualityHint::DontCare),
|
||||
LineSmooth(QualityHint::DontCare),
|
||||
PolySmooth(QualityHint::DontCare),
|
||||
TexCompression(QualityHint::DontCare),
|
||||
LineSmoothEnabled(0),
|
||||
PolySmoothEnabled(0)
|
||||
{
|
||||
}
|
||||
|
||||
QualityHint Derivatives;
|
||||
QualityHint LineSmooth;
|
||||
QualityHint PolySmooth;
|
||||
QualityHint TexCompression;
|
||||
bool32 LineSmoothEnabled;
|
||||
bool32 PolySmoothEnabled;
|
||||
} m_Hints;
|
||||
Hints m_Hints;
|
||||
};
|
||||
|
||||
}; // namespace GLPipe
|
||||
@@ -224,7 +224,7 @@ struct IReplayRenderer
|
||||
virtual bool SetFrameEvent(uint32_t eventID, bool force) = 0;
|
||||
virtual bool GetD3D11PipelineState(D3D11Pipe::State *state) = 0;
|
||||
virtual bool GetD3D12PipelineState(D3D12PipelineState *state) = 0;
|
||||
virtual bool GetGLPipelineState(GLPipelineState *state) = 0;
|
||||
virtual bool GetGLPipelineState(GLPipe::State *state) = 0;
|
||||
virtual bool GetVulkanPipelineState(VulkanPipelineState *state) = 0;
|
||||
|
||||
virtual ResourceId BuildCustomShader(const char *entry, const char *source,
|
||||
@@ -302,7 +302,7 @@ ReplayRenderer_GetD3D11PipelineState(IReplayRenderer *rend, D3D11Pipe::State *st
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC
|
||||
ReplayRenderer_GetD3D12PipelineState(IReplayRenderer *rend, D3D12PipelineState *state);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetGLPipelineState(IReplayRenderer *rend,
|
||||
GLPipelineState *state);
|
||||
GLPipe::State *state);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC
|
||||
ReplayRenderer_GetVulkanPipelineState(IReplayRenderer *rend, VulkanPipelineState *state);
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
}
|
||||
void SavePipelineState() {}
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipelineState GetGLPipelineState() { return GLPipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
void ReplayLog(uint32_t endEventID, ReplayLogType replayType) {}
|
||||
vector<uint32_t> GetPassEvents(uint32_t eventID) { return vector<uint32_t>(); }
|
||||
|
||||
@@ -737,11 +737,11 @@ void Serialiser::Serialise(const char *name, D3D12PipelineState &el)
|
||||
#pragma region OpenGL pipeline state
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::VertexInput::VertexAttribute &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::VertexAttribute &el)
|
||||
{
|
||||
Serialise("", el.Enabled);
|
||||
Serialise("", el.Format);
|
||||
SerialisePODArray<4>("", el.GenericValue.f);
|
||||
SerialisePODArray<4>("", el.GenericValue.value_f);
|
||||
Serialise("", el.BufferSlot);
|
||||
Serialise("", el.RelativeOffset);
|
||||
|
||||
@@ -749,7 +749,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::VertexInput::Verte
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::VertexInput &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::VertexInput &el)
|
||||
{
|
||||
Serialise("", el.attributes);
|
||||
Serialise("", el.vbuffers);
|
||||
@@ -762,7 +762,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::VertexInput &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::Shader &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::Shader &el)
|
||||
{
|
||||
Serialise("", el.Object);
|
||||
|
||||
@@ -787,7 +787,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::Shader &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::Sampler &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::Sampler &el)
|
||||
{
|
||||
Serialise("", el.Samp);
|
||||
Serialise("", el.AddressS);
|
||||
@@ -809,7 +809,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::Sampler &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::ImageLoadStore &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::ImageLoadStore &el)
|
||||
{
|
||||
Serialise("", el.Resource);
|
||||
Serialise("", el.Level);
|
||||
@@ -824,7 +824,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::ImageLoadStore &el
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::Rasterizer &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::Rasterizer &el)
|
||||
{
|
||||
Serialise("", el.Viewports);
|
||||
Serialise("", el.Scissors);
|
||||
@@ -834,7 +834,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::Rasterizer &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::DepthState &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::DepthState &el)
|
||||
{
|
||||
Serialise("", el.DepthEnable);
|
||||
Serialise("", el.DepthFunc);
|
||||
@@ -847,7 +847,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::DepthState &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::StencilState &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::StencilState &el)
|
||||
{
|
||||
Serialise("", el.StencilEnable);
|
||||
|
||||
@@ -871,7 +871,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::StencilState &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer::BlendState::RTBlend &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::Blend &el)
|
||||
{
|
||||
Serialise("", el.Enabled);
|
||||
Serialise("", el.WriteMask);
|
||||
@@ -889,7 +889,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer::Blend
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer::BlendState &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::BlendState &el)
|
||||
{
|
||||
SerialisePODArray<4>("", el.BlendFactor);
|
||||
Serialise("", el.Blends);
|
||||
@@ -898,7 +898,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer::Blend
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer::Attachment &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::Attachment &el)
|
||||
{
|
||||
Serialise("", el.Obj);
|
||||
Serialise("", el.Layer);
|
||||
@@ -909,7 +909,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer::Attac
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::FrameBuffer &el)
|
||||
{
|
||||
Serialise("", el.FramebufferSRGB);
|
||||
Serialise("", el.Dither);
|
||||
@@ -934,7 +934,7 @@ void Serialiser::Serialise(const char *name, GLPipelineState::FrameBuffer &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, GLPipelineState &el)
|
||||
void Serialiser::Serialise(const char *name, GLPipe::State &el)
|
||||
{
|
||||
Serialise("", el.m_VtxIn);
|
||||
|
||||
@@ -1838,52 +1838,47 @@ string ToStrHelper<false, D3D12PipelineState::Rasterizer::RasterizerState>::Get(
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::VertexInput::VertexBuffer>::Get(
|
||||
const GLPipelineState::VertexInput::VertexBuffer &el)
|
||||
string ToStrHelper<false, GLPipe::VB>::Get(const GLPipe::VB &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::FixedVertexProcessing>::Get(
|
||||
const GLPipelineState::FixedVertexProcessing &el)
|
||||
string ToStrHelper<false, GLPipe::FixedVertexProcessing>::Get(const GLPipe::FixedVertexProcessing &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Texture>::Get(const GLPipelineState::Texture &el)
|
||||
string ToStrHelper<false, GLPipe::Texture>::Get(const GLPipe::Texture &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Buffer>::Get(const GLPipelineState::Buffer &el)
|
||||
string ToStrHelper<false, GLPipe::Buffer>::Get(const GLPipe::Buffer &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Feedback>::Get(const GLPipelineState::Feedback &el)
|
||||
string ToStrHelper<false, GLPipe::Feedback>::Get(const GLPipe::Feedback &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Rasterizer::Viewport>::Get(
|
||||
const GLPipelineState::Rasterizer::Viewport &el)
|
||||
string ToStrHelper<false, GLPipe::Viewport>::Get(const GLPipe::Viewport &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Rasterizer::Scissor>::Get(
|
||||
const GLPipelineState::Rasterizer::Scissor &el)
|
||||
string ToStrHelper<false, GLPipe::Scissor>::Get(const GLPipe::Scissor &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Rasterizer::RasterizerState>::Get(
|
||||
const GLPipelineState::Rasterizer::RasterizerState &el)
|
||||
string ToStrHelper<false, GLPipe::RasterizerState>::Get(const GLPipe::RasterizerState &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, GLPipelineState::Hints>::Get(const GLPipelineState::Hints &el)
|
||||
string ToStrHelper<false, GLPipe::Hints>::Get(const GLPipe::Hints &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
@@ -2394,7 +2389,7 @@ void ReplayProxy::SavePipelineState()
|
||||
|
||||
m_D3D11PipelineState = D3D11Pipe::State();
|
||||
m_D3D12PipelineState = D3D12PipelineState();
|
||||
m_GLPipelineState = GLPipelineState();
|
||||
m_GLPipelineState = GLPipe::State();
|
||||
m_VulkanPipelineState = VulkanPipelineState();
|
||||
}
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
void SavePipelineState();
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return m_D3D11PipelineState; }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return m_D3D12PipelineState; }
|
||||
GLPipelineState GetGLPipelineState() { return m_GLPipelineState; }
|
||||
GLPipe::State GetGLPipelineState() { return m_GLPipelineState; }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return m_VulkanPipelineState; }
|
||||
void ReplayLog(uint32_t endEventID, ReplayLogType replayType);
|
||||
|
||||
@@ -553,6 +553,6 @@ private:
|
||||
|
||||
D3D11Pipe::State m_D3D11PipelineState;
|
||||
D3D12PipelineState m_D3D12PipelineState;
|
||||
GLPipelineState m_GLPipelineState;
|
||||
GLPipe::State m_GLPipelineState;
|
||||
VulkanPipelineState m_VulkanPipelineState;
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
void SavePipelineState() { m_CurPipelineState = MakePipelineState(); }
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return m_CurPipelineState; }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipelineState GetGLPipelineState() { return GLPipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
void FreeCustomShader(ResourceId id);
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
void SavePipelineState() { MakePipelineState(); }
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return D3D11Pipe::State(); }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return m_PipelineState; }
|
||||
GLPipelineState GetGLPipelineState() { return GLPipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
void FreeCustomShader(ResourceId id);
|
||||
|
||||
@@ -842,7 +842,7 @@ ShaderReflection *GLReplay::GetShader(ResourceId shader, string entryPoint)
|
||||
|
||||
void GLReplay::SavePipelineState()
|
||||
{
|
||||
GLPipelineState &pipe = m_CurPipelineState;
|
||||
GLPipe::State &pipe = m_CurPipelineState;
|
||||
WrappedOpenGL &gl = *m_pDriver;
|
||||
GLResourceManager *rm = m_pDriver->GetResourceManager();
|
||||
|
||||
@@ -904,7 +904,8 @@ void GLReplay::SavePipelineState()
|
||||
gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_INTEGER, &integer);
|
||||
|
||||
RDCEraseEl(pipe.m_VtxIn.attributes[i].GenericValue);
|
||||
gl.glGetVertexAttribfv(i, eGL_CURRENT_VERTEX_ATTRIB, pipe.m_VtxIn.attributes[i].GenericValue.f);
|
||||
gl.glGetVertexAttribfv(i, eGL_CURRENT_VERTEX_ATTRIB,
|
||||
pipe.m_VtxIn.attributes[i].GenericValue.value_f);
|
||||
|
||||
ResourceFormat fmt;
|
||||
|
||||
@@ -1063,7 +1064,7 @@ void GLReplay::SavePipelineState()
|
||||
GLuint curProg = 0;
|
||||
gl.glGetIntegerv(eGL_CURRENT_PROGRAM, (GLint *)&curProg);
|
||||
|
||||
GLPipelineState::Shader *stages[6] = {
|
||||
GLPipe::Shader *stages[6] = {
|
||||
&pipe.m_VS, &pipe.m_TCS, &pipe.m_TES, &pipe.m_GS, &pipe.m_FS, &pipe.m_CS,
|
||||
};
|
||||
ShaderReflection *refls[6] = {NULL};
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
void SavePipelineState();
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return D3D11Pipe::State(); }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipelineState GetGLPipelineState() { return m_CurPipelineState; }
|
||||
GLPipe::State GetGLPipelineState() { return m_CurPipelineState; }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
|
||||
@@ -421,7 +421,7 @@ private:
|
||||
|
||||
WrappedOpenGL *m_pDriver;
|
||||
|
||||
GLPipelineState m_CurPipelineState;
|
||||
GLPipe::State m_CurPipelineState;
|
||||
};
|
||||
|
||||
const GLHookSet &GetRealGLFunctions();
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
void SavePipelineState();
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return D3D11Pipe::State(); }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipelineState GetGLPipelineState() { return GLPipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return m_VulkanPipelineState; }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
virtual void SavePipelineState() = 0;
|
||||
virtual D3D11Pipe::State GetD3D11PipelineState() = 0;
|
||||
virtual D3D12PipelineState GetD3D12PipelineState() = 0;
|
||||
virtual GLPipelineState GetGLPipelineState() = 0;
|
||||
virtual GLPipe::State GetGLPipelineState() = 0;
|
||||
virtual VulkanPipelineState GetVulkanPipelineState() = 0;
|
||||
|
||||
virtual FetchFrameRecord GetFrameRecord() = 0;
|
||||
|
||||
@@ -205,7 +205,7 @@ bool ReplayRenderer::GetD3D12PipelineState(D3D12PipelineState *state)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ReplayRenderer::GetGLPipelineState(GLPipelineState *state)
|
||||
bool ReplayRenderer::GetGLPipelineState(GLPipe::State *state)
|
||||
{
|
||||
if(state)
|
||||
{
|
||||
@@ -1647,7 +1647,7 @@ void ReplayRenderer::FetchPipelineState()
|
||||
}
|
||||
|
||||
{
|
||||
GLPipelineState::Shader *stages[] = {
|
||||
GLPipe::Shader *stages[] = {
|
||||
&m_GLPipelineState.m_VS, &m_GLPipelineState.m_TCS, &m_GLPipelineState.m_TES,
|
||||
&m_GLPipelineState.m_GS, &m_GLPipelineState.m_FS, &m_GLPipelineState.m_CS,
|
||||
};
|
||||
@@ -1729,7 +1729,7 @@ ReplayRenderer_GetD3D12PipelineState(IReplayRenderer *rend, D3D12PipelineState *
|
||||
return rend->GetD3D12PipelineState(state);
|
||||
}
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetGLPipelineState(IReplayRenderer *rend,
|
||||
GLPipelineState *state)
|
||||
GLPipe::State *state)
|
||||
{
|
||||
return rend->GetGLPipelineState(state);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
|
||||
bool GetD3D11PipelineState(D3D11Pipe::State *state);
|
||||
bool GetD3D12PipelineState(D3D12PipelineState *state);
|
||||
bool GetGLPipelineState(GLPipelineState *state);
|
||||
bool GetGLPipelineState(GLPipe::State *state);
|
||||
bool GetVulkanPipelineState(VulkanPipelineState *state);
|
||||
|
||||
ResourceId BuildCustomShader(const char *entry, const char *source, const uint32_t compileFlags,
|
||||
@@ -211,7 +211,7 @@ private:
|
||||
|
||||
D3D11Pipe::State m_D3D11PipelineState;
|
||||
D3D12PipelineState m_D3D12PipelineState;
|
||||
GLPipelineState m_GLPipelineState;
|
||||
GLPipe::State m_GLPipelineState;
|
||||
VulkanPipelineState m_VulkanPipelineState;
|
||||
|
||||
std::vector<ReplayOutput *> m_Outputs;
|
||||
|
||||
Reference in New Issue
Block a user