diff --git a/docs/python_api/enums_data.rst b/docs/python_api/enums_data.rst index 0255d584d..6fc7f44a7 100644 --- a/docs/python_api/enums_data.rst +++ b/docs/python_api/enums_data.rst @@ -5,4 +5,4 @@ Enums and Data Structures :members: :undoc-members: :imported-members: - :exclude-members: free_functions__, enum_constants__, name_match__startswith__D3D11_, name_match__startswith__D3D12_, name_match__startswith__VK_, name_match__startswith__GL_, str, ReplayController, ReplayOutput, TargetControl, RemoteServer, CaptureFile + :exclude-members: free_functions__, enum_constants__, name_match__startswith__D3D11, name_match__startswith__D3D12, name_match__startswith__VK, name_match__startswith__GL, str, ReplayController, ReplayOutput, TargetControl, RemoteServer, CaptureFile diff --git a/docs/python_api/pipelines/d3d11.rst b/docs/python_api/pipelines/d3d11.rst index 25ec9305f..1ecfbf9ba 100644 --- a/docs/python_api/pipelines/d3d11.rst +++ b/docs/python_api/pipelines/d3d11.rst @@ -1,15 +1,14 @@ D3D11 Pipeline State ==================== -.. module:: renderdoc +.. currentmodule:: renderdoc -.. autoclass:: D3D11_State +.. autoclass:: D3D11State :members: :undoc-members: .. automodule:: renderdoc :members: - :noindex: :undoc-members: :imported-members: - :exclude-members: D3D11_State, free_functions__, enum_constants__, name_match__include_only__startswith__D3D11_ + :exclude-members: D3D11State, free_functions__, enum_constants__, name_match__include_only__startswith__D3D11 diff --git a/docs/python_api/pipelines/d3d12.rst b/docs/python_api/pipelines/d3d12.rst index 24f52e48e..7de3727e0 100644 --- a/docs/python_api/pipelines/d3d12.rst +++ b/docs/python_api/pipelines/d3d12.rst @@ -1,15 +1,14 @@ D3D12 Pipeline State ==================== -.. module:: renderdoc +.. currentmodule:: renderdoc -.. autoclass:: D3D12_State +.. autoclass:: D3D12State :members: :undoc-members: .. automodule:: renderdoc :members: - :noindex: :undoc-members: :imported-members: - :exclude-members: D3D12_State, free_functions__, enum_constants__, name_match__include_only__startswith__D3D12_ + :exclude-members: D3D12State, free_functions__, enum_constants__, name_match__include_only__startswith__D3D12 diff --git a/docs/python_api/pipelines/gl.rst b/docs/python_api/pipelines/gl.rst index 642cde531..db37d9a5c 100644 --- a/docs/python_api/pipelines/gl.rst +++ b/docs/python_api/pipelines/gl.rst @@ -1,15 +1,14 @@ OpenGL Pipeline State ===================== -.. module:: renderdoc +.. currentmodule:: renderdoc -.. autoclass:: GL_State +.. autoclass:: GLState :members: :undoc-members: .. automodule:: renderdoc :members: - :noindex: :undoc-members: :imported-members: - :exclude-members: GL_State, free_functions__, enum_constants__, name_match__include_only__startswith__GL_ + :exclude-members: GLState, free_functions__, enum_constants__, name_match__include_only__startswith__GL diff --git a/docs/python_api/pipelines/vulkan.rst b/docs/python_api/pipelines/vulkan.rst index ee7da370d..77e88f1a4 100644 --- a/docs/python_api/pipelines/vulkan.rst +++ b/docs/python_api/pipelines/vulkan.rst @@ -1,15 +1,14 @@ Vulkan Pipeline State ===================== -.. module:: renderdoc +.. currentmodule:: renderdoc -.. autoclass:: VK_State +.. autoclass:: VKState :members: :undoc-members: .. automodule:: renderdoc :members: - :noindex: :undoc-members: :imported-members: - :exclude-members: VK_State, free_functions__, enum_constants__, name_match__include_only__startswith__VK_ + :exclude-members: VKState, free_functions__, enum_constants__, name_match__include_only__startswith__VK diff --git a/docs/python_api/qrenderdoc/config.rst b/docs/python_api/qrenderdoc/config.rst index ef9a88dde..35e3e2fad 100644 --- a/docs/python_api/qrenderdoc/config.rst +++ b/docs/python_api/qrenderdoc/config.rst @@ -3,7 +3,7 @@ Persistant Config .. contents:: -.. module:: qrenderdoc +.. currentmodule:: qrenderdoc Config ------ @@ -14,6 +14,15 @@ Config :members: :undoc-members: +.. autoclass:: qrenderdoc.BugReport + :members: + :undoc-members: + +.. autoclass:: qrenderdoc.TimeUnit + :members: + :undoc-members: + :exclude-members: enum_constants__, + Remote Host ----------- diff --git a/docs/python_api/qrenderdoc/main.rst b/docs/python_api/qrenderdoc/main.rst index 39b460ff7..21237fdc5 100644 --- a/docs/python_api/qrenderdoc/main.rst +++ b/docs/python_api/qrenderdoc/main.rst @@ -19,8 +19,8 @@ Replay Manager :members: :undoc-members: -LogViewer Interface -------------------- +CaptureViewer Interface +------------------------ .. autoclass:: qrenderdoc.CaptureViewer :members: @@ -34,7 +34,16 @@ Utilities :undoc-members: :exclude-members: enum_constants__, +.. autoclass:: qrenderdoc.CaptureModifications + :members: + :undoc-members: + :exclude-members: enum_constants__, + .. autoclass:: qrenderdoc.CaptureSettings :members: :undoc-members: +.. autoclass:: qrenderdoc.EventBookmark + :members: + :undoc-members: + diff --git a/docs/python_api/qrenderdoc/pipeline.rst b/docs/python_api/qrenderdoc/pipeline.rst index 0104384f9..b287acd8e 100644 --- a/docs/python_api/qrenderdoc/pipeline.rst +++ b/docs/python_api/qrenderdoc/pipeline.rst @@ -3,7 +3,7 @@ Pipeline Abstraction .. contents:: -.. module:: qrenderdoc +.. currentmodule:: qrenderdoc Pipeline -------- @@ -23,7 +23,7 @@ Bindings :members: :undoc-members: -.. autoclass:: qrenderdoc.BoundBuffer +.. autoclass:: qrenderdoc.BoundVBuffer :members: :undoc-members: @@ -35,7 +35,3 @@ Bindings :members: :undoc-members: -.. autoclass:: qrenderdoc.Viewport - :members: - :undoc-members: - diff --git a/docs/python_api/qrenderdoc/windows.rst b/docs/python_api/qrenderdoc/windows.rst index 100c283a5..3fb192f78 100644 --- a/docs/python_api/qrenderdoc/windows.rst +++ b/docs/python_api/qrenderdoc/windows.rst @@ -3,87 +3,122 @@ Windows .. contents:: -.. module:: qrenderdoc +.. currentmodule:: qrenderdoc -MainWindow ----------- +Main Window +----------- .. autoclass:: qrenderdoc.MainWindow :members: :undoc-members: -EventBrowser ------------- +Event Browser +------------- .. autoclass:: qrenderdoc.EventBrowser :members: :undoc-members: -APIInspector ------------- +API Inspector +------------- .. autoclass:: qrenderdoc.APIInspector :members: :undoc-members: -PipelineStateViewer -------------------- +Pipeline State +-------------- .. autoclass:: qrenderdoc.PipelineStateViewer :members: :undoc-members: -TextureViewer -------------- +Texture Viewer +-------------- .. autoclass:: qrenderdoc.TextureViewer :members: :undoc-members: -BufferViewer ------------- +Buffer Viewer +------------- .. autoclass:: qrenderdoc.BufferViewer :members: :undoc-members: -CaptureDialog -------------- +Resource Inspector +------------------ + +.. autoclass:: qrenderdoc.ResourceInspector + :members: + :undoc-members: + +Capture Dialog +-------------- .. autoclass:: qrenderdoc.CaptureDialog :members: :undoc-members: -DebugMessageView ----------------- +Debug Messages +-------------- .. autoclass:: qrenderdoc.DebugMessageView :members: :undoc-members: -StatisticsViewer ----------------- +Comment View +------------ + +.. autoclass:: qrenderdoc.CommentView + :members: + :undoc-members: + +Statistics Viewer +----------------- .. autoclass:: qrenderdoc.StatisticsViewer :members: :undoc-members: -ShaderViewer +Timeline Bar ------------ +.. autoclass:: qrenderdoc.TimelineBar + :members: + :undoc-members: + +Performance Counter Viewer +-------------------------- + +.. autoclass:: qrenderdoc.PerformanceCounterViewer + :members: + :undoc-members: + +Python Shell +------------ + +.. autoclass:: qrenderdoc.PythonShell + :members: + :undoc-members: + +Shader Viewer +------------- + .. autoclass:: qrenderdoc.ShaderViewer :members: :undoc-members: -ConstantBufferPreviewer ------------------------ +Constant Buffer Previewer +------------------------- .. autoclass:: qrenderdoc.ConstantBufferPreviewer :members: :undoc-members: -PixelHistoryView ----------------- +Pixel History +------------- .. autoclass:: qrenderdoc.PixelHistoryView :members: diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 1e0be173c..a6dbb4602 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -170,9 +170,9 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const rdcstr &origFi // make sure we're on a consistent event before invoking viewer forms if(m_LastDrawcall) - SetEventID(viewers, m_LastDrawcall->eventID, true); + SetEventID(viewers, m_LastDrawcall->eventId, true); else if(!m_Drawcalls.empty()) - SetEventID(viewers, m_Drawcalls.back().eventID, true); + SetEventID(viewers, m_Drawcalls.back().eventId, true); GUIInvoke::blockcall([&viewers]() { // notify all the registers viewers that a capture has been loaded @@ -292,17 +292,17 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const QStri m_ResourceList = r->GetResources(); for(ResourceDescription &res : m_ResourceList) - m_Resources[res.ID] = &res; + m_Resources[res.resourceId] = &res; m_BufferList = r->GetBuffers(); for(BufferDescription &b : m_BufferList) - m_Buffers[b.ID] = &b; + m_Buffers[b.resourceId] = &b; m_PostloadProgress = 0.8f; m_TextureList = r->GetTextures(); for(TextureDescription &t : m_TextureList) - m_Textures[t.ID] = &t; + m_Textures[t.resourceId] = &t; m_PostloadProgress = 0.9f; @@ -527,8 +527,8 @@ void CaptureContext::AddFakeProfileMarkers() DrawcallDescription mark; - mark.eventID = draws[start].eventID; - mark.drawcallID = draws[start].drawcallID; + mark.eventId = draws[start].eventId; + mark.drawcallId = draws[start].drawcallId; mark.flags = DrawFlags::PushMarker; memcpy(mark.outputs, draws[end].outputs, sizeof(mark.outputs)); @@ -563,7 +563,7 @@ void CaptureContext::AddFakeProfileMarkers() for(int j = start; j <= end; j++) { mark.children[j - start] = draws[j]; - draws[j].parent = mark.eventID; + draws[j].parent = mark.eventId; } ret.push_back(mark); @@ -846,15 +846,15 @@ void CaptureContext::CloseCapture() } void CaptureContext::SetEventID(const rdcarray &exclude, uint32_t selectedEventID, - uint32_t eventID, bool force) + uint32_t eventId, bool force) { uint32_t prevSelectedEventID = m_SelectedEventID; m_SelectedEventID = selectedEventID; uint32_t prevEventID = m_EventID; - m_EventID = eventID; + m_EventID = eventId; - m_Renderer.BlockInvoke([this, eventID, force](IReplayController *r) { - r->SetFrameEvent(eventID, force); + m_Renderer.BlockInvoke([this, eventId, force](IReplayController *r) { + r->SetFrameEvent(eventId, force); m_CurD3D11PipelineState = &r->GetD3D11PipelineState(); m_CurD3D12PipelineState = &r->GetD3D12PipelineState(); m_CurGLPipelineState = &r->GetGLPipelineState(); @@ -864,7 +864,7 @@ void CaptureContext::SetEventID(const rdcarray &exclude, uint3 }); bool updateSelectedEvent = force || prevSelectedEventID != selectedEventID; - bool updateEvent = force || prevEventID != eventID; + bool updateEvent = force || prevEventID != eventId; RefreshUIStatus(exclude, updateSelectedEvent, updateEvent); } @@ -1012,7 +1012,7 @@ void CaptureContext::SaveBookmarks() for(const EventBookmark &mark : m_Bookmarks) { QVariantMap variantmark; - variantmark[lit("EID")] = mark.EID; + variantmark[lit("eventId")] = mark.eventId; variantmark[lit("text")] = mark.text; bookmarks.push_back(variantmark); @@ -1043,10 +1043,10 @@ void CaptureContext::LoadBookmarks(const QString &data) QVariantMap variantmark = v.toMap(); EventBookmark mark; - mark.EID = variantmark[lit("EID")].toUInt(); + mark.eventId = variantmark[lit("eventId")].toUInt(); mark.text = variantmark[lit("text")].toString(); - if(mark.EID != 0) + if(mark.eventId != 0) m_Bookmarks.push_back(mark); } } diff --git a/qrenderdoc/Code/CaptureContext.h b/qrenderdoc/Code/CaptureContext.h index 38eabb445..ec26fa89e 100644 --- a/qrenderdoc/Code/CaptureContext.h +++ b/qrenderdoc/Code/CaptureContext.h @@ -75,7 +75,7 @@ public: void CloseCapture() override; void SetEventID(const rdcarray &exclude, uint32_t selectedEventID, - uint32_t eventID, bool force = false) override; + uint32_t eventId, bool force = false) override; void RefreshStatus() override { SetEventID({}, m_SelectedEventID, m_EventID, true); } void RefreshUIStatus(const rdcarray &exclude, bool updateSelectedEvent, @@ -126,9 +126,9 @@ public: const rdcarray &GetTextures() override { return m_TextureList; } BufferDescription *GetBuffer(ResourceId id) override { return m_Buffers[id]; } const rdcarray &GetBuffers() override { return m_BufferList; } - const DrawcallDescription *GetDrawcall(uint32_t eventID) override + const DrawcallDescription *GetDrawcall(uint32_t eventId) override { - return GetDrawcall(m_Drawcalls, eventID); + return GetDrawcall(m_Drawcalls, eventId); } const SDFile &GetStructuredFile() override { return *m_StructuredFile; } WindowingSystem CurWindowingSystem() override { return m_CurWinSystem; } @@ -271,18 +271,18 @@ private: uint32_t m_SelectedEventID = 0; uint32_t m_EventID = 0; - const DrawcallDescription *GetDrawcall(const rdcarray &draws, uint32_t eventID) + const DrawcallDescription *GetDrawcall(const rdcarray &draws, uint32_t eventId) { for(const DrawcallDescription &d : draws) { if(!d.children.empty()) { - const DrawcallDescription *draw = GetDrawcall(d.children, eventID); + const DrawcallDescription *draw = GetDrawcall(d.children, eventId); if(draw != NULL) return draw; } - if(d.eventID == eventID) + if(d.eventId == eventId) return &d; } diff --git a/qrenderdoc/Code/Interface/CommonPipelineState.cpp b/qrenderdoc/Code/Interface/CommonPipelineState.cpp index a6fcbbcc4..b420e22b7 100644 --- a/qrenderdoc/Code/Interface/CommonPipelineState.cpp +++ b/qrenderdoc/Code/Interface/CommonPipelineState.cpp @@ -34,16 +34,16 @@ rdcstr CommonPipelineState::GetResourceLayout(ResourceId id) { for(const VKPipe::ImageData &i : m_Vulkan->images) { - if(i.image == id) + if(i.resourceId == id) return i.layouts[0].name; } } if(IsCaptureD3D12()) { - for(const D3D12Pipe::ResourceData &r : m_D3D12->Resources) + for(const D3D12Pipe::ResourceData &r : m_D3D12->resourceStates) { - if(r.id == id) + if(r.resourceId == id) return r.states[0].name; } } @@ -54,8 +54,8 @@ rdcstr CommonPipelineState::GetResourceLayout(ResourceId id) rdcstr CommonPipelineState::Abbrev(ShaderStage stage) { - if(IsCaptureD3D11() || (!IsCaptureLoaded() && DefaultType == GraphicsAPI::D3D11) || - IsCaptureD3D12() || (!IsCaptureLoaded() && DefaultType == GraphicsAPI::D3D12)) + if(IsCaptureD3D11() || (!IsCaptureLoaded() && defaultType == GraphicsAPI::D3D11) || + IsCaptureD3D12() || (!IsCaptureLoaded() && defaultType == GraphicsAPI::D3D12)) { switch(stage) { @@ -68,8 +68,8 @@ rdcstr CommonPipelineState::Abbrev(ShaderStage stage) default: break; } } - else if(IsCaptureGL() || (!IsCaptureLoaded() && DefaultType == GraphicsAPI::OpenGL) || - IsCaptureVK() || (!IsCaptureLoaded() && DefaultType == GraphicsAPI::Vulkan)) + else if(IsCaptureGL() || (!IsCaptureLoaded() && defaultType == GraphicsAPI::OpenGL) || + IsCaptureVK() || (!IsCaptureLoaded() && defaultType == GraphicsAPI::Vulkan)) { switch(stage) { @@ -88,8 +88,8 @@ rdcstr CommonPipelineState::Abbrev(ShaderStage stage) rdcstr CommonPipelineState::OutputAbbrev() { - if(IsCaptureGL() || (!IsCaptureLoaded() && DefaultType == GraphicsAPI::OpenGL) || IsCaptureVK() || - (!IsCaptureLoaded() && DefaultType == GraphicsAPI::Vulkan)) + if(IsCaptureGL() || (!IsCaptureLoaded() && defaultType == GraphicsAPI::OpenGL) || IsCaptureVK() || + (!IsCaptureLoaded() && defaultType == GraphicsAPI::Vulkan)) { return lit("FB"); } @@ -100,83 +100,83 @@ rdcstr CommonPipelineState::OutputAbbrev() const D3D11Pipe::Shader &CommonPipelineState::GetD3D11Stage(ShaderStage stage) { if(stage == ShaderStage::Vertex) - return m_D3D11->m_VS; + return m_D3D11->vertexShader; if(stage == ShaderStage::Domain) - return m_D3D11->m_DS; + return m_D3D11->domainShader; if(stage == ShaderStage::Hull) - return m_D3D11->m_HS; + return m_D3D11->hullShader; if(stage == ShaderStage::Geometry) - return m_D3D11->m_GS; + return m_D3D11->geometryShader; if(stage == ShaderStage::Pixel) - return m_D3D11->m_PS; + return m_D3D11->pixelShader; if(stage == ShaderStage::Compute) - return m_D3D11->m_CS; + return m_D3D11->computeShader; qCritical() << "Error - invalid stage " << (int)stage; - return m_D3D11->m_CS; + return m_D3D11->computeShader; } const D3D12Pipe::Shader &CommonPipelineState::GetD3D12Stage(ShaderStage stage) { if(stage == ShaderStage::Vertex) - return m_D3D12->m_VS; + return m_D3D12->vertexShader; if(stage == ShaderStage::Domain) - return m_D3D12->m_DS; + return m_D3D12->domainShader; if(stage == ShaderStage::Hull) - return m_D3D12->m_HS; + return m_D3D12->hullShader; if(stage == ShaderStage::Geometry) - return m_D3D12->m_GS; + return m_D3D12->geometryShader; if(stage == ShaderStage::Pixel) - return m_D3D12->m_PS; + return m_D3D12->pixelShader; if(stage == ShaderStage::Compute) - return m_D3D12->m_CS; + return m_D3D12->computeShader; qCritical() << "Error - invalid stage " << (int)stage; - return m_D3D12->m_CS; + return m_D3D12->computeShader; } const GLPipe::Shader &CommonPipelineState::GetGLStage(ShaderStage stage) { if(stage == ShaderStage::Vertex) - return m_GL->m_VS; + return m_GL->vertexShader; if(stage == ShaderStage::Tess_Control) - return m_GL->m_TCS; + return m_GL->tessControlShader; if(stage == ShaderStage::Tess_Eval) - return m_GL->m_TES; + return m_GL->tessEvalShader; if(stage == ShaderStage::Geometry) - return m_GL->m_GS; + return m_GL->geometryShader; if(stage == ShaderStage::Fragment) - return m_GL->m_FS; + return m_GL->fragmentShader; if(stage == ShaderStage::Compute) - return m_GL->m_CS; + return m_GL->computeShader; qCritical() << "Error - invalid stage " << (int)stage; - return m_GL->m_CS; + return m_GL->computeShader; } const VKPipe::Shader &CommonPipelineState::GetVulkanStage(ShaderStage stage) { if(stage == ShaderStage::Vertex) - return m_Vulkan->m_VS; + return m_Vulkan->vertexShader; if(stage == ShaderStage::Tess_Control) - return m_Vulkan->m_TCS; + return m_Vulkan->tessControlShader; if(stage == ShaderStage::Tess_Eval) - return m_Vulkan->m_TES; + return m_Vulkan->tessEvalShader; if(stage == ShaderStage::Geometry) - return m_Vulkan->m_GS; + return m_Vulkan->geometryShader; if(stage == ShaderStage::Fragment) - return m_Vulkan->m_FS; + return m_Vulkan->fragmentShader; if(stage == ShaderStage::Compute) - return m_Vulkan->m_CS; + return m_Vulkan->computeShader; qCritical() << "Error - invalid stage " << (int)stage; - return m_Vulkan->m_CS; + return m_Vulkan->computeShader; } rdcstr CommonPipelineState::GetShaderExtension() { - if(IsCaptureGL() || (!IsCaptureLoaded() && DefaultType == GraphicsAPI::OpenGL) || IsCaptureVK() || - (!IsCaptureLoaded() && DefaultType == GraphicsAPI::Vulkan)) + if(IsCaptureGL() || (!IsCaptureLoaded() && defaultType == GraphicsAPI::OpenGL) || IsCaptureVK() || + (!IsCaptureLoaded() && defaultType == GraphicsAPI::Vulkan)) { return lit("glsl"); } @@ -186,41 +186,52 @@ rdcstr CommonPipelineState::GetShaderExtension() Viewport CommonPipelineState::GetViewport(int index) { - Viewport ret; - - // default to a 1x1 viewport just to avoid having to check for 0s all over - ret.x = ret.y = 0.0f; - ret.width = ret.height = 1.0f; + Viewport ret = {}; if(IsCaptureLoaded()) { - if(IsCaptureD3D11() && index < m_D3D11->m_RS.Viewports.count()) + if(IsCaptureD3D11() && index < m_D3D11->rasterizer.viewports.count()) { - ret.x = m_D3D11->m_RS.Viewports[index].X; - ret.y = m_D3D11->m_RS.Viewports[index].Y; - ret.width = m_D3D11->m_RS.Viewports[index].Width; - ret.height = m_D3D11->m_RS.Viewports[index].Height; + return m_D3D11->rasterizer.viewports[index]; } - else if(IsCaptureD3D12() && index < m_D3D12->m_RS.Viewports.count()) + else if(IsCaptureD3D12() && index < m_D3D12->rasterizer.viewports.count()) { - ret.x = m_D3D12->m_RS.Viewports[index].X; - ret.y = m_D3D12->m_RS.Viewports[index].Y; - ret.width = m_D3D12->m_RS.Viewports[index].Width; - ret.height = m_D3D12->m_RS.Viewports[index].Height; + return m_D3D12->rasterizer.viewports[index]; } - else if(IsCaptureGL() && index < m_GL->m_Rasterizer.Viewports.count()) + else if(IsCaptureGL() && index < m_GL->rasterizer.viewports.count()) { - ret.x = m_GL->m_Rasterizer.Viewports[index].Left; - ret.y = m_GL->m_Rasterizer.Viewports[index].Bottom; - ret.width = m_GL->m_Rasterizer.Viewports[index].Width; - ret.height = m_GL->m_Rasterizer.Viewports[index].Height; + return m_GL->rasterizer.viewports[index]; } - else if(IsCaptureVK() && index < m_Vulkan->VP.viewportScissors.count()) + else if(IsCaptureVK() && index < m_Vulkan->viewportScissor.viewportScissors.count()) { - ret.x = m_Vulkan->VP.viewportScissors[index].vp.x; - ret.y = m_Vulkan->VP.viewportScissors[index].vp.y; - ret.width = m_Vulkan->VP.viewportScissors[index].vp.width; - ret.height = m_Vulkan->VP.viewportScissors[index].vp.height; + return m_Vulkan->viewportScissor.viewportScissors[index].vp; + } + } + + return ret; +} + +Scissor CommonPipelineState::GetScissor(int index) +{ + Scissor ret = {}; + + if(IsCaptureLoaded()) + { + if(IsCaptureD3D11() && index < m_D3D11->rasterizer.viewports.count()) + { + return m_D3D11->rasterizer.scissors[index]; + } + else if(IsCaptureD3D12() && index < m_D3D12->rasterizer.viewports.count()) + { + return m_D3D12->rasterizer.scissors[index]; + } + else if(IsCaptureGL() && index < m_GL->rasterizer.viewports.count()) + { + return m_GL->rasterizer.scissors[index]; + } + else if(IsCaptureVK() && index < m_Vulkan->viewportScissor.viewportScissors.count()) + { + return m_Vulkan->viewportScissor.viewportScissors[index].scissor; } } @@ -235,12 +246,12 @@ const ShaderBindpointMapping &CommonPipelineState::GetBindpointMapping(ShaderSta { switch(stage) { - case ShaderStage::Vertex: return m_D3D11->m_VS.BindpointMapping; - case ShaderStage::Domain: return m_D3D11->m_DS.BindpointMapping; - case ShaderStage::Hull: return m_D3D11->m_HS.BindpointMapping; - case ShaderStage::Geometry: return m_D3D11->m_GS.BindpointMapping; - case ShaderStage::Pixel: return m_D3D11->m_PS.BindpointMapping; - case ShaderStage::Compute: return m_D3D11->m_CS.BindpointMapping; + case ShaderStage::Vertex: return m_D3D11->vertexShader.bindpointMapping; + case ShaderStage::Domain: return m_D3D11->domainShader.bindpointMapping; + case ShaderStage::Hull: return m_D3D11->hullShader.bindpointMapping; + case ShaderStage::Geometry: return m_D3D11->geometryShader.bindpointMapping; + case ShaderStage::Pixel: return m_D3D11->pixelShader.bindpointMapping; + case ShaderStage::Compute: return m_D3D11->computeShader.bindpointMapping; default: break; } } @@ -248,12 +259,12 @@ const ShaderBindpointMapping &CommonPipelineState::GetBindpointMapping(ShaderSta { switch(stage) { - case ShaderStage::Vertex: return m_D3D12->m_VS.BindpointMapping; - case ShaderStage::Domain: return m_D3D12->m_DS.BindpointMapping; - case ShaderStage::Hull: return m_D3D12->m_HS.BindpointMapping; - case ShaderStage::Geometry: return m_D3D12->m_GS.BindpointMapping; - case ShaderStage::Pixel: return m_D3D12->m_PS.BindpointMapping; - case ShaderStage::Compute: return m_D3D12->m_CS.BindpointMapping; + case ShaderStage::Vertex: return m_D3D12->vertexShader.bindpointMapping; + case ShaderStage::Domain: return m_D3D12->domainShader.bindpointMapping; + case ShaderStage::Hull: return m_D3D12->hullShader.bindpointMapping; + case ShaderStage::Geometry: return m_D3D12->geometryShader.bindpointMapping; + case ShaderStage::Pixel: return m_D3D12->pixelShader.bindpointMapping; + case ShaderStage::Compute: return m_D3D12->computeShader.bindpointMapping; default: break; } } @@ -261,12 +272,12 @@ const ShaderBindpointMapping &CommonPipelineState::GetBindpointMapping(ShaderSta { switch(stage) { - case ShaderStage::Vertex: return m_GL->m_VS.BindpointMapping; - case ShaderStage::Tess_Control: return m_GL->m_TCS.BindpointMapping; - case ShaderStage::Tess_Eval: return m_GL->m_TES.BindpointMapping; - case ShaderStage::Geometry: return m_GL->m_GS.BindpointMapping; - case ShaderStage::Fragment: return m_GL->m_FS.BindpointMapping; - case ShaderStage::Compute: return m_GL->m_CS.BindpointMapping; + case ShaderStage::Vertex: return m_GL->vertexShader.bindpointMapping; + case ShaderStage::Tess_Control: return m_GL->tessControlShader.bindpointMapping; + case ShaderStage::Tess_Eval: return m_GL->tessEvalShader.bindpointMapping; + case ShaderStage::Geometry: return m_GL->geometryShader.bindpointMapping; + case ShaderStage::Fragment: return m_GL->fragmentShader.bindpointMapping; + case ShaderStage::Compute: return m_GL->computeShader.bindpointMapping; default: break; } } @@ -274,12 +285,12 @@ const ShaderBindpointMapping &CommonPipelineState::GetBindpointMapping(ShaderSta { switch(stage) { - case ShaderStage::Vertex: return m_Vulkan->m_VS.BindpointMapping; - case ShaderStage::Tess_Control: return m_Vulkan->m_TCS.BindpointMapping; - case ShaderStage::Tess_Eval: return m_Vulkan->m_TES.BindpointMapping; - case ShaderStage::Geometry: return m_Vulkan->m_GS.BindpointMapping; - case ShaderStage::Fragment: return m_Vulkan->m_FS.BindpointMapping; - case ShaderStage::Compute: return m_Vulkan->m_CS.BindpointMapping; + case ShaderStage::Vertex: return m_Vulkan->vertexShader.bindpointMapping; + case ShaderStage::Tess_Control: return m_Vulkan->tessControlShader.bindpointMapping; + case ShaderStage::Tess_Eval: return m_Vulkan->tessEvalShader.bindpointMapping; + case ShaderStage::Geometry: return m_Vulkan->geometryShader.bindpointMapping; + case ShaderStage::Fragment: return m_Vulkan->fragmentShader.bindpointMapping; + case ShaderStage::Compute: return m_Vulkan->computeShader.bindpointMapping; default: break; } } @@ -298,12 +309,12 @@ const ShaderReflection *CommonPipelineState::GetShaderReflection(ShaderStage sta { switch(stage) { - case ShaderStage::Vertex: return m_D3D11->m_VS.ShaderDetails; - case ShaderStage::Domain: return m_D3D11->m_DS.ShaderDetails; - case ShaderStage::Hull: return m_D3D11->m_HS.ShaderDetails; - case ShaderStage::Geometry: return m_D3D11->m_GS.ShaderDetails; - case ShaderStage::Pixel: return m_D3D11->m_PS.ShaderDetails; - case ShaderStage::Compute: return m_D3D11->m_CS.ShaderDetails; + case ShaderStage::Vertex: return m_D3D11->vertexShader.reflection; + case ShaderStage::Domain: return m_D3D11->domainShader.reflection; + case ShaderStage::Hull: return m_D3D11->hullShader.reflection; + case ShaderStage::Geometry: return m_D3D11->geometryShader.reflection; + case ShaderStage::Pixel: return m_D3D11->pixelShader.reflection; + case ShaderStage::Compute: return m_D3D11->computeShader.reflection; default: break; } } @@ -311,12 +322,12 @@ const ShaderReflection *CommonPipelineState::GetShaderReflection(ShaderStage sta { switch(stage) { - case ShaderStage::Vertex: return m_D3D12->m_VS.ShaderDetails; - case ShaderStage::Domain: return m_D3D12->m_DS.ShaderDetails; - case ShaderStage::Hull: return m_D3D12->m_HS.ShaderDetails; - case ShaderStage::Geometry: return m_D3D12->m_GS.ShaderDetails; - case ShaderStage::Pixel: return m_D3D12->m_PS.ShaderDetails; - case ShaderStage::Compute: return m_D3D12->m_CS.ShaderDetails; + case ShaderStage::Vertex: return m_D3D12->vertexShader.reflection; + case ShaderStage::Domain: return m_D3D12->domainShader.reflection; + case ShaderStage::Hull: return m_D3D12->hullShader.reflection; + case ShaderStage::Geometry: return m_D3D12->geometryShader.reflection; + case ShaderStage::Pixel: return m_D3D12->pixelShader.reflection; + case ShaderStage::Compute: return m_D3D12->computeShader.reflection; default: break; } } @@ -324,12 +335,12 @@ const ShaderReflection *CommonPipelineState::GetShaderReflection(ShaderStage sta { switch(stage) { - case ShaderStage::Vertex: return m_GL->m_VS.ShaderDetails; - case ShaderStage::Tess_Control: return m_GL->m_TCS.ShaderDetails; - case ShaderStage::Tess_Eval: return m_GL->m_TES.ShaderDetails; - case ShaderStage::Geometry: return m_GL->m_GS.ShaderDetails; - case ShaderStage::Fragment: return m_GL->m_FS.ShaderDetails; - case ShaderStage::Compute: return m_GL->m_CS.ShaderDetails; + case ShaderStage::Vertex: return m_GL->vertexShader.reflection; + case ShaderStage::Tess_Control: return m_GL->tessControlShader.reflection; + case ShaderStage::Tess_Eval: return m_GL->tessEvalShader.reflection; + case ShaderStage::Geometry: return m_GL->geometryShader.reflection; + case ShaderStage::Fragment: return m_GL->fragmentShader.reflection; + case ShaderStage::Compute: return m_GL->computeShader.reflection; default: break; } } @@ -337,12 +348,12 @@ const ShaderReflection *CommonPipelineState::GetShaderReflection(ShaderStage sta { switch(stage) { - case ShaderStage::Vertex: return m_Vulkan->m_VS.ShaderDetails; - case ShaderStage::Tess_Control: return m_Vulkan->m_TCS.ShaderDetails; - case ShaderStage::Tess_Eval: return m_Vulkan->m_TES.ShaderDetails; - case ShaderStage::Geometry: return m_Vulkan->m_GS.ShaderDetails; - case ShaderStage::Fragment: return m_Vulkan->m_FS.ShaderDetails; - case ShaderStage::Compute: return m_Vulkan->m_CS.ShaderDetails; + case ShaderStage::Vertex: return m_Vulkan->vertexShader.reflection; + case ShaderStage::Tess_Control: return m_Vulkan->tessControlShader.reflection; + case ShaderStage::Tess_Eval: return m_Vulkan->tessEvalShader.reflection; + case ShaderStage::Geometry: return m_Vulkan->geometryShader.reflection; + case ShaderStage::Fragment: return m_Vulkan->fragmentShader.reflection; + case ShaderStage::Compute: return m_Vulkan->computeShader.reflection; default: break; } } @@ -355,11 +366,11 @@ ResourceId CommonPipelineState::GetComputePipelineObject() { if(IsCaptureLoaded() && IsCaptureVK()) { - return m_Vulkan->compute.obj; + return m_Vulkan->compute.pipelineResourceId; } else if(IsCaptureLoaded() && IsCaptureD3D12()) { - return m_D3D12->pipeline; + return m_D3D12->pipelineResourceId; } return ResourceId(); @@ -369,11 +380,11 @@ ResourceId CommonPipelineState::GetGraphicsPipelineObject() { if(IsCaptureLoaded() && IsCaptureVK()) { - return m_Vulkan->graphics.obj; + return m_Vulkan->graphics.pipelineResourceId; } else if(IsCaptureLoaded() && IsCaptureD3D12()) { - return m_D3D12->pipeline; + return m_D3D12->pipelineResourceId; } return ResourceId(); @@ -385,12 +396,12 @@ rdcstr CommonPipelineState::GetShaderEntryPoint(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_Vulkan->m_VS.entryPoint; - case ShaderStage::Tess_Control: return m_Vulkan->m_TCS.entryPoint; - case ShaderStage::Tess_Eval: return m_Vulkan->m_TES.entryPoint; - case ShaderStage::Geometry: return m_Vulkan->m_GS.entryPoint; - case ShaderStage::Fragment: return m_Vulkan->m_FS.entryPoint; - case ShaderStage::Compute: return m_Vulkan->m_CS.entryPoint; + case ShaderStage::Vertex: return m_Vulkan->vertexShader.entryPoint; + case ShaderStage::Tess_Control: return m_Vulkan->tessControlShader.entryPoint; + case ShaderStage::Tess_Eval: return m_Vulkan->tessEvalShader.entryPoint; + case ShaderStage::Geometry: return m_Vulkan->geometryShader.entryPoint; + case ShaderStage::Fragment: return m_Vulkan->fragmentShader.entryPoint; + case ShaderStage::Compute: return m_Vulkan->computeShader.entryPoint; default: break; } } @@ -406,12 +417,12 @@ ResourceId CommonPipelineState::GetShader(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_D3D11->m_VS.Object; - case ShaderStage::Domain: return m_D3D11->m_DS.Object; - case ShaderStage::Hull: return m_D3D11->m_HS.Object; - case ShaderStage::Geometry: return m_D3D11->m_GS.Object; - case ShaderStage::Pixel: return m_D3D11->m_PS.Object; - case ShaderStage::Compute: return m_D3D11->m_CS.Object; + case ShaderStage::Vertex: return m_D3D11->vertexShader.resourceId; + case ShaderStage::Domain: return m_D3D11->domainShader.resourceId; + case ShaderStage::Hull: return m_D3D11->hullShader.resourceId; + case ShaderStage::Geometry: return m_D3D11->geometryShader.resourceId; + case ShaderStage::Pixel: return m_D3D11->pixelShader.resourceId; + case ShaderStage::Compute: return m_D3D11->computeShader.resourceId; default: break; } } @@ -419,12 +430,12 @@ ResourceId CommonPipelineState::GetShader(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_D3D12->m_VS.Object; - case ShaderStage::Domain: return m_D3D12->m_DS.Object; - case ShaderStage::Hull: return m_D3D12->m_HS.Object; - case ShaderStage::Geometry: return m_D3D12->m_GS.Object; - case ShaderStage::Pixel: return m_D3D12->m_PS.Object; - case ShaderStage::Compute: return m_D3D12->m_CS.Object; + case ShaderStage::Vertex: return m_D3D12->vertexShader.resourceId; + case ShaderStage::Domain: return m_D3D12->domainShader.resourceId; + case ShaderStage::Hull: return m_D3D12->hullShader.resourceId; + case ShaderStage::Geometry: return m_D3D12->geometryShader.resourceId; + case ShaderStage::Pixel: return m_D3D12->pixelShader.resourceId; + case ShaderStage::Compute: return m_D3D12->computeShader.resourceId; default: break; } } @@ -432,12 +443,12 @@ ResourceId CommonPipelineState::GetShader(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_GL->m_VS.Object; - case ShaderStage::Tess_Control: return m_GL->m_TCS.Object; - case ShaderStage::Tess_Eval: return m_GL->m_TES.Object; - case ShaderStage::Geometry: return m_GL->m_GS.Object; - case ShaderStage::Fragment: return m_GL->m_FS.Object; - case ShaderStage::Compute: return m_GL->m_CS.Object; + case ShaderStage::Vertex: return m_GL->vertexShader.shaderResourceId; + case ShaderStage::Tess_Control: return m_GL->tessControlShader.shaderResourceId; + case ShaderStage::Tess_Eval: return m_GL->tessEvalShader.shaderResourceId; + case ShaderStage::Geometry: return m_GL->geometryShader.shaderResourceId; + case ShaderStage::Fragment: return m_GL->fragmentShader.shaderResourceId; + case ShaderStage::Compute: return m_GL->computeShader.shaderResourceId; default: break; } } @@ -445,12 +456,12 @@ ResourceId CommonPipelineState::GetShader(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_Vulkan->m_VS.Object; - case ShaderStage::Tess_Control: return m_Vulkan->m_TCS.Object; - case ShaderStage::Tess_Eval: return m_Vulkan->m_TES.Object; - case ShaderStage::Geometry: return m_Vulkan->m_GS.Object; - case ShaderStage::Fragment: return m_Vulkan->m_FS.Object; - case ShaderStage::Compute: return m_Vulkan->m_CS.Object; + case ShaderStage::Vertex: return m_Vulkan->vertexShader.resourceId; + case ShaderStage::Tess_Control: return m_Vulkan->tessControlShader.resourceId; + case ShaderStage::Tess_Eval: return m_Vulkan->tessEvalShader.resourceId; + case ShaderStage::Geometry: return m_Vulkan->geometryShader.resourceId; + case ShaderStage::Fragment: return m_Vulkan->fragmentShader.resourceId; + case ShaderStage::Compute: return m_Vulkan->computeShader.resourceId; default: break; } } @@ -467,12 +478,13 @@ rdcstr CommonPipelineState::GetShaderName(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_D3D11->m_VS.Object); - case ShaderStage::Domain: return m_Ctx.GetResourceName(m_D3D11->m_DS.Object); - case ShaderStage::Hull: return m_Ctx.GetResourceName(m_D3D11->m_HS.Object); - case ShaderStage::Geometry: return m_Ctx.GetResourceName(m_D3D11->m_GS.Object); - case ShaderStage::Pixel: return m_Ctx.GetResourceName(m_D3D11->m_PS.Object); - case ShaderStage::Compute: return m_Ctx.GetResourceName(m_D3D11->m_CS.Object); + case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_D3D11->vertexShader.resourceId); + case ShaderStage::Domain: return m_Ctx.GetResourceName(m_D3D11->domainShader.resourceId); + case ShaderStage::Hull: return m_Ctx.GetResourceName(m_D3D11->hullShader.resourceId); + case ShaderStage::Geometry: + return m_Ctx.GetResourceName(m_D3D11->geometryShader.resourceId); + case ShaderStage::Pixel: return m_Ctx.GetResourceName(m_D3D11->pixelShader.resourceId); + case ShaderStage::Compute: return m_Ctx.GetResourceName(m_D3D11->computeShader.resourceId); default: break; } } @@ -480,12 +492,18 @@ rdcstr CommonPipelineState::GetShaderName(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_D3D12->pipeline) + lit(" VS"); - case ShaderStage::Domain: return m_Ctx.GetResourceName(m_D3D12->pipeline) + lit(" DS"); - case ShaderStage::Hull: return m_Ctx.GetResourceName(m_D3D12->pipeline) + lit(" HS"); - case ShaderStage::Geometry: return m_Ctx.GetResourceName(m_D3D12->pipeline) + lit(" GS"); - case ShaderStage::Pixel: return m_Ctx.GetResourceName(m_D3D12->pipeline) + lit(" PS"); - case ShaderStage::Compute: return m_Ctx.GetResourceName(m_D3D12->pipeline) + lit(" CS"); + case ShaderStage::Vertex: + return m_Ctx.GetResourceName(m_D3D12->pipelineResourceId) + lit(" VS"); + case ShaderStage::Domain: + return m_Ctx.GetResourceName(m_D3D12->pipelineResourceId) + lit(" DS"); + case ShaderStage::Hull: + return m_Ctx.GetResourceName(m_D3D12->pipelineResourceId) + lit(" HS"); + case ShaderStage::Geometry: + return m_Ctx.GetResourceName(m_D3D12->pipelineResourceId) + lit(" GS"); + case ShaderStage::Pixel: + return m_Ctx.GetResourceName(m_D3D12->pipelineResourceId) + lit(" PS"); + case ShaderStage::Compute: + return m_Ctx.GetResourceName(m_D3D12->pipelineResourceId) + lit(" CS"); default: break; } } @@ -493,12 +511,17 @@ rdcstr CommonPipelineState::GetShaderName(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_GL->m_VS.Object); - case ShaderStage::Tess_Control: return m_Ctx.GetResourceName(m_GL->m_TCS.Object); - case ShaderStage::Tess_Eval: return m_Ctx.GetResourceName(m_GL->m_TES.Object); - case ShaderStage::Geometry: return m_Ctx.GetResourceName(m_GL->m_GS.Object); - case ShaderStage::Fragment: return m_Ctx.GetResourceName(m_GL->m_FS.Object); - case ShaderStage::Compute: return m_Ctx.GetResourceName(m_GL->m_CS.Object); + case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_GL->vertexShader.shaderResourceId); + case ShaderStage::Tess_Control: + return m_Ctx.GetResourceName(m_GL->tessControlShader.shaderResourceId); + case ShaderStage::Tess_Eval: + return m_Ctx.GetResourceName(m_GL->tessEvalShader.shaderResourceId); + case ShaderStage::Geometry: + return m_Ctx.GetResourceName(m_GL->geometryShader.shaderResourceId); + case ShaderStage::Fragment: + return m_Ctx.GetResourceName(m_GL->fragmentShader.shaderResourceId); + case ShaderStage::Compute: + return m_Ctx.GetResourceName(m_GL->computeShader.shaderResourceId); default: break; } } @@ -506,12 +529,14 @@ rdcstr CommonPipelineState::GetShaderName(ShaderStage stage) { switch(stage) { - case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_Vulkan->m_VS.Object); - case ShaderStage::Domain: return m_Ctx.GetResourceName(m_Vulkan->m_TCS.Object); - case ShaderStage::Hull: return m_Ctx.GetResourceName(m_Vulkan->m_TES.Object); - case ShaderStage::Geometry: return m_Ctx.GetResourceName(m_Vulkan->m_GS.Object); - case ShaderStage::Pixel: return m_Ctx.GetResourceName(m_Vulkan->m_FS.Object); - case ShaderStage::Compute: return m_Ctx.GetResourceName(m_Vulkan->m_CS.Object); + case ShaderStage::Vertex: return m_Ctx.GetResourceName(m_Vulkan->vertexShader.resourceId); + case ShaderStage::Domain: + return m_Ctx.GetResourceName(m_Vulkan->tessControlShader.resourceId); + case ShaderStage::Hull: return m_Ctx.GetResourceName(m_Vulkan->tessEvalShader.resourceId); + case ShaderStage::Geometry: + return m_Ctx.GetResourceName(m_Vulkan->geometryShader.resourceId); + case ShaderStage::Pixel: return m_Ctx.GetResourceName(m_Vulkan->fragmentShader.resourceId); + case ShaderStage::Compute: return m_Ctx.GetResourceName(m_Vulkan->computeShader.resourceId); default: break; } } @@ -520,7 +545,7 @@ rdcstr CommonPipelineState::GetShaderName(ShaderStage stage) return ""; } -BoundBuffer CommonPipelineState::GetIBuffer() +BoundVBuffer CommonPipelineState::GetIBuffer() { ResourceId buf; uint64_t ByteOffset = 0; @@ -529,29 +554,29 @@ BoundBuffer CommonPipelineState::GetIBuffer() { if(IsCaptureD3D11()) { - buf = m_D3D11->m_IA.ibuffer.Buffer; - ByteOffset = m_D3D11->m_IA.ibuffer.Offset; + buf = m_D3D11->inputAssembly.indexBuffer.resourceId; + ByteOffset = m_D3D11->inputAssembly.indexBuffer.byteOffset; } else if(IsCaptureD3D12()) { - buf = m_D3D12->m_IA.ibuffer.Buffer; - ByteOffset = m_D3D12->m_IA.ibuffer.Offset; + buf = m_D3D12->inputAssembly.indexBuffer.resourceId; + ByteOffset = m_D3D12->inputAssembly.indexBuffer.byteOffset; } else if(IsCaptureGL()) { - buf = m_GL->m_VtxIn.ibuffer; + buf = m_GL->vertexInput.indexBuffer; ByteOffset = 0; // GL only has per-draw index offset } else if(IsCaptureVK()) { - buf = m_Vulkan->IA.ibuffer.buf; - ByteOffset = m_Vulkan->IA.ibuffer.offs; + buf = m_Vulkan->inputAssembly.indexBuffer.resourceId; + ByteOffset = m_Vulkan->inputAssembly.indexBuffer.byteOffset; } } - BoundBuffer ret; - ret.Buffer = buf; - ret.ByteOffset = ByteOffset; + BoundVBuffer ret; + ret.resourceId = buf; + ret.byteOffset = ByteOffset; return ret; } @@ -567,15 +592,15 @@ bool CommonPipelineState::IsStripRestartEnabled() } else if(IsCaptureD3D12()) { - return m_D3D12->m_IA.indexStripCutValue != 0; + return m_D3D12->inputAssembly.indexStripCutValue != 0; } else if(IsCaptureGL()) { - return m_GL->m_VtxIn.primitiveRestart; + return m_GL->vertexInput.primitiveRestart; } else if(IsCaptureVK()) { - return m_Vulkan->IA.primitiveRestartEnable; + return m_Vulkan->inputAssembly.primitiveRestartEnable; } } @@ -593,62 +618,65 @@ uint32_t CommonPipelineState::GetStripRestartIndex() } else if(IsCaptureD3D12()) { - return m_D3D12->m_IA.indexStripCutValue; + return m_D3D12->inputAssembly.indexStripCutValue; } else if(IsCaptureGL()) { - return qMin(UINT32_MAX, m_GL->m_VtxIn.restartIndex); + return qMin(UINT32_MAX, m_GL->vertexInput.restartIndex); } } return UINT32_MAX; } -rdcarray CommonPipelineState::GetVBuffers() +rdcarray CommonPipelineState::GetVBuffers() { - rdcarray ret; + rdcarray ret; if(IsCaptureLoaded()) { if(IsCaptureD3D11()) { - ret.resize(m_D3D11->m_IA.vbuffers.count()); - for(int i = 0; i < m_D3D11->m_IA.vbuffers.count(); i++) + ret.resize(m_D3D11->inputAssembly.vertexBuffers.count()); + for(int i = 0; i < m_D3D11->inputAssembly.vertexBuffers.count(); i++) { - ret[i].Buffer = m_D3D11->m_IA.vbuffers[i].Buffer; - ret[i].ByteOffset = m_D3D11->m_IA.vbuffers[i].Offset; - ret[i].ByteStride = m_D3D11->m_IA.vbuffers[i].Stride; + ret[i].resourceId = m_D3D11->inputAssembly.vertexBuffers[i].resourceId; + ret[i].byteOffset = m_D3D11->inputAssembly.vertexBuffers[i].byteOffset; + ret[i].byteStride = m_D3D11->inputAssembly.vertexBuffers[i].byteStride; } } else if(IsCaptureD3D12()) { - ret.resize(m_D3D12->m_IA.vbuffers.count()); - for(int i = 0; i < m_D3D12->m_IA.vbuffers.count(); i++) + ret.resize(m_D3D12->inputAssembly.vertexBuffers.count()); + for(int i = 0; i < m_D3D12->inputAssembly.vertexBuffers.count(); i++) { - ret[i].Buffer = m_D3D12->m_IA.vbuffers[i].Buffer; - ret[i].ByteOffset = m_D3D12->m_IA.vbuffers[i].Offset; - ret[i].ByteStride = m_D3D12->m_IA.vbuffers[i].Stride; + ret[i].resourceId = m_D3D12->inputAssembly.vertexBuffers[i].resourceId; + ret[i].byteOffset = m_D3D12->inputAssembly.vertexBuffers[i].byteOffset; + ret[i].byteStride = m_D3D12->inputAssembly.vertexBuffers[i].byteStride; } } else if(IsCaptureGL()) { - ret.resize(m_GL->m_VtxIn.vbuffers.count()); - for(int i = 0; i < m_GL->m_VtxIn.vbuffers.count(); i++) + ret.resize(m_GL->vertexInput.vertexBuffers.count()); + for(int i = 0; i < m_GL->vertexInput.vertexBuffers.count(); i++) { - ret[i].Buffer = m_GL->m_VtxIn.vbuffers[i].Buffer; - ret[i].ByteOffset = m_GL->m_VtxIn.vbuffers[i].Offset; - ret[i].ByteStride = m_GL->m_VtxIn.vbuffers[i].Stride; + ret[i].resourceId = m_GL->vertexInput.vertexBuffers[i].resourceId; + ret[i].byteOffset = m_GL->vertexInput.vertexBuffers[i].byteOffset; + ret[i].byteStride = m_GL->vertexInput.vertexBuffers[i].byteStride; } } else if(IsCaptureVK()) { - ret.resize(m_Vulkan->VI.binds.count()); - for(int i = 0; i < m_Vulkan->VI.binds.count(); i++) + ret.resize(m_Vulkan->vertexInput.bindings.count()); + for(int i = 0; i < m_Vulkan->vertexInput.bindings.count(); i++) { - ret[i].Buffer = - i < m_Vulkan->VI.vbuffers.count() ? m_Vulkan->VI.vbuffers[i].buffer : ResourceId(); - ret[i].ByteOffset = i < m_Vulkan->VI.vbuffers.count() ? m_Vulkan->VI.vbuffers[i].offset : 0; - ret[i].ByteStride = m_Vulkan->VI.binds[i].bytestride; + ret[i].resourceId = i < m_Vulkan->vertexInput.vertexBuffers.count() + ? m_Vulkan->vertexInput.vertexBuffers[i].resourceId + : ResourceId(); + ret[i].byteOffset = i < m_Vulkan->vertexInput.vertexBuffers.count() + ? m_Vulkan->vertexInput.vertexBuffers[i].byteOffset + : 0; + ret[i].byteStride = m_Vulkan->vertexInput.bindings[i].byteStride; } } } @@ -664,53 +692,53 @@ rdcarray CommonPipelineState::GetVertexInputs() { uint32_t byteOffs[128] = {}; - const rdcarray &layouts = m_D3D11->m_IA.layouts; + const rdcarray &layouts = m_D3D11->inputAssembly.layouts; rdcarray ret; ret.resize(layouts.size()); for(int i = 0; i < layouts.count(); i++) { - QString semName = layouts[i].SemanticName; + QString semName = layouts[i].semanticName; bool needsSemanticIdx = false; for(int j = 0; j < layouts.count(); j++) { - if(i != j && !semName.compare(layouts[j].SemanticName, Qt::CaseInsensitive)) + if(i != j && !semName.compare(layouts[j].semanticName, Qt::CaseInsensitive)) { needsSemanticIdx = true; break; } } - uint32_t offs = layouts[i].ByteOffset; + uint32_t offs = layouts[i].byteOffset; if(offs == UINT32_MAX) // APPEND_ALIGNED - offs = byteOffs[layouts[i].InputSlot]; + offs = byteOffs[layouts[i].inputSlot]; else - byteOffs[layouts[i].InputSlot] = offs = layouts[i].ByteOffset; + byteOffs[layouts[i].inputSlot] = offs = layouts[i].byteOffset; - byteOffs[layouts[i].InputSlot] += - layouts[i].Format.compByteWidth * layouts[i].Format.compCount; + byteOffs[layouts[i].inputSlot] += + layouts[i].format.compByteWidth * layouts[i].format.compCount; - ret[i].Name = - semName + (needsSemanticIdx ? QString::number(layouts[i].SemanticIndex) : QString()); - ret[i].VertexBuffer = (int)layouts[i].InputSlot; - ret[i].RelativeByteOffset = offs; - ret[i].PerInstance = layouts[i].PerInstance; - ret[i].InstanceRate = (int)layouts[i].InstanceDataStepRate; - ret[i].Format = layouts[i].Format; - memset(&ret[i].GenericValue, 0, sizeof(PixelValue)); - ret[i].Used = false; - ret[i].GenericEnabled = false; + ret[i].name = + semName + (needsSemanticIdx ? QString::number(layouts[i].semanticIndex) : QString()); + ret[i].vertexBuffer = (int)layouts[i].inputSlot; + ret[i].byteOffset = offs; + ret[i].perInstance = layouts[i].perInstance; + ret[i].instanceRate = (int)layouts[i].instanceDataStepRate; + ret[i].format = layouts[i].format; + memset(&ret[i].genericValue, 0, sizeof(PixelValue)); + ret[i].used = false; + ret[i].genericEnabled = false; - if(m_D3D11->m_IA.Bytecode != NULL) + if(m_D3D11->inputAssembly.bytecode != NULL) { - rdcarray &sig = m_D3D11->m_IA.Bytecode->InputSig; + rdcarray &sig = m_D3D11->inputAssembly.bytecode->inputSignature; for(int ia = 0; ia < sig.count(); ia++) { if(!semName.compare(sig[ia].semanticName, Qt::CaseInsensitive) && - sig[ia].semanticIndex == layouts[i].SemanticIndex) + sig[ia].semanticIndex == layouts[i].semanticIndex) { - ret[i].Used = true; + ret[i].used = true; break; } } @@ -723,53 +751,53 @@ rdcarray CommonPipelineState::GetVertexInputs() { uint32_t byteOffs[128] = {}; - const rdcarray &layouts = m_D3D12->m_IA.layouts; + const rdcarray &layouts = m_D3D12->inputAssembly.layouts; rdcarray ret; ret.resize(layouts.size()); for(int i = 0; i < layouts.count(); i++) { - QString semName = layouts[i].SemanticName; + QString semName = layouts[i].semanticName; bool needsSemanticIdx = false; for(int j = 0; j < layouts.count(); j++) { - if(i != j && !semName.compare(QString(layouts[j].SemanticName), Qt::CaseInsensitive)) + if(i != j && !semName.compare(QString(layouts[j].semanticName), Qt::CaseInsensitive)) { needsSemanticIdx = true; break; } } - uint32_t offs = layouts[i].ByteOffset; + uint32_t offs = layouts[i].byteOffset; if(offs == UINT32_MAX) // APPEND_ALIGNED - offs = byteOffs[layouts[i].InputSlot]; + offs = byteOffs[layouts[i].inputSlot]; else - byteOffs[layouts[i].InputSlot] = offs = layouts[i].ByteOffset; + byteOffs[layouts[i].inputSlot] = offs = layouts[i].byteOffset; - byteOffs[layouts[i].InputSlot] += - layouts[i].Format.compByteWidth * layouts[i].Format.compCount; + byteOffs[layouts[i].inputSlot] += + layouts[i].format.compByteWidth * layouts[i].format.compCount; - ret[i].Name = - semName + (needsSemanticIdx ? QString::number(layouts[i].SemanticIndex) : QString()); - ret[i].VertexBuffer = (int)layouts[i].InputSlot; - ret[i].RelativeByteOffset = offs; - ret[i].PerInstance = layouts[i].PerInstance; - ret[i].InstanceRate = (int)layouts[i].InstanceDataStepRate; - ret[i].Format = layouts[i].Format; - memset(&ret[i].GenericValue, 0, sizeof(PixelValue)); - ret[i].Used = false; - ret[i].GenericEnabled = false; + ret[i].name = + semName + (needsSemanticIdx ? QString::number(layouts[i].semanticIndex) : QString()); + ret[i].vertexBuffer = (int)layouts[i].inputSlot; + ret[i].byteOffset = offs; + ret[i].perInstance = layouts[i].perInstance; + ret[i].instanceRate = (int)layouts[i].instanceDataStepRate; + ret[i].format = layouts[i].format; + memset(&ret[i].genericValue, 0, sizeof(PixelValue)); + ret[i].used = false; + ret[i].genericEnabled = false; - if(m_D3D12->m_VS.ShaderDetails != NULL) + if(m_D3D12->vertexShader.reflection != NULL) { - rdcarray &sig = m_D3D12->m_VS.ShaderDetails->InputSig; + rdcarray &sig = m_D3D12->vertexShader.reflection->inputSignature; for(int ia = 0; ia < sig.count(); ia++) { if(!semName.compare(sig[ia].semanticName, Qt::CaseInsensitive) && - sig[ia].semanticIndex == layouts[i].SemanticIndex) + sig[ia].semanticIndex == layouts[i].semanticIndex) { - ret[i].Used = true; + ret[i].used = true; break; } } @@ -780,14 +808,14 @@ rdcarray CommonPipelineState::GetVertexInputs() } else if(IsCaptureGL()) { - const rdcarray &attrs = m_GL->m_VtxIn.attributes; + const rdcarray &attrs = m_GL->vertexInput.attributes; int num = 0; for(int i = 0; i < attrs.count(); i++) { int attrib = -1; - if(m_GL->m_VS.ShaderDetails != NULL) - attrib = m_GL->m_VS.BindpointMapping.InputAttributes[i]; + if(m_GL->vertexShader.reflection != NULL) + attrib = m_GL->vertexShader.bindpointMapping.inputAttributes[i]; else attrib = i; @@ -800,54 +828,56 @@ rdcarray CommonPipelineState::GetVertexInputs() ret.resize(attrs.count()); for(int i = 0; i < attrs.count() && a < num; i++) { - ret[a].Name = lit("attr%1").arg(i); - memset(&ret[a].GenericValue, 0, sizeof(PixelValue)); - ret[a].VertexBuffer = (int)attrs[i].BufferSlot; - ret[a].RelativeByteOffset = attrs[i].RelativeOffset; - ret[a].PerInstance = m_GL->m_VtxIn.vbuffers[attrs[i].BufferSlot].Divisor > 0; - ret[a].InstanceRate = (int)m_GL->m_VtxIn.vbuffers[attrs[i].BufferSlot].Divisor; - ret[a].Format = attrs[i].Format; - ret[a].Used = true; - ret[a].GenericEnabled = false; + ret[a].name = lit("attr%1").arg(i); + memset(&ret[a].genericValue, 0, sizeof(PixelValue)); + ret[a].vertexBuffer = (int)attrs[i].vertexBufferSlot; + ret[a].byteOffset = attrs[i].byteOffset; + ret[a].perInstance = + m_GL->vertexInput.vertexBuffers[attrs[i].vertexBufferSlot].instanceDivisor > 0; + ret[a].instanceRate = + (int)m_GL->vertexInput.vertexBuffers[attrs[i].vertexBufferSlot].instanceDivisor; + ret[a].format = attrs[i].format; + ret[a].used = true; + ret[a].genericEnabled = false; - if(m_GL->m_VS.ShaderDetails != NULL) + if(m_GL->vertexShader.reflection != NULL) { - int attrib = m_GL->m_VS.BindpointMapping.InputAttributes[i]; + int attrib = m_GL->vertexShader.bindpointMapping.inputAttributes[i]; - if(attrib >= 0 && attrib < m_GL->m_VS.ShaderDetails->InputSig.count()) - ret[a].Name = m_GL->m_VS.ShaderDetails->InputSig[attrib].varName; + if(attrib >= 0 && attrib < m_GL->vertexShader.reflection->inputSignature.count()) + ret[a].name = m_GL->vertexShader.reflection->inputSignature[attrib].varName; if(attrib == -1) continue; - if(!attrs[i].Enabled) + if(!attrs[i].enabled) { - uint32_t compCount = m_GL->m_VS.ShaderDetails->InputSig[attrib].compCount; - CompType compType = m_GL->m_VS.ShaderDetails->InputSig[attrib].compType; + uint32_t compCount = m_GL->vertexShader.reflection->inputSignature[attrib].compCount; + CompType compType = m_GL->vertexShader.reflection->inputSignature[attrib].compType; for(uint32_t c = 0; c < compCount; c++) { if(compType == CompType::Float) - ret[a].GenericValue.value_f[c] = attrs[i].GenericValue.value_f[c]; + ret[a].genericValue.floatValue[c] = attrs[i].genericValue.floatValue[c]; else if(compType == CompType::UInt) - ret[a].GenericValue.value_u[c] = attrs[i].GenericValue.value_u[c]; + ret[a].genericValue.uintValue[c] = attrs[i].genericValue.uintValue[c]; else if(compType == CompType::SInt) - ret[a].GenericValue.value_i[c] = attrs[i].GenericValue.value_i[c]; + ret[a].genericValue.intValue[c] = attrs[i].genericValue.intValue[c]; else if(compType == CompType::UScaled) - ret[a].GenericValue.value_f[c] = (float)attrs[i].GenericValue.value_u[c]; + ret[a].genericValue.floatValue[c] = (float)attrs[i].genericValue.uintValue[c]; else if(compType == CompType::SScaled) - ret[a].GenericValue.value_f[c] = (float)attrs[i].GenericValue.value_i[c]; + ret[a].genericValue.floatValue[c] = (float)attrs[i].genericValue.intValue[c]; } - ret[a].GenericEnabled = true; + ret[a].genericEnabled = true; - ret[a].PerInstance = false; - ret[a].InstanceRate = 0; - ret[a].Format.compByteWidth = 4; - ret[a].Format.compCount = compCount; - ret[a].Format.compType = compType; - ret[a].Format.type = ResourceFormatType::Regular; - ret[a].Format.srgbCorrected = false; + ret[a].perInstance = false; + ret[a].instanceRate = 0; + ret[a].format.compByteWidth = 4; + ret[a].format.compCount = compCount; + ret[a].format.compType = compType; + ret[a].format.type = ResourceFormatType::Regular; + ret[a].format.srgbCorrected = false; } } @@ -858,16 +888,17 @@ rdcarray CommonPipelineState::GetVertexInputs() } else if(IsCaptureVK()) { - const rdcarray &attrs = m_Vulkan->VI.attrs; + const rdcarray &attrs = m_Vulkan->vertexInput.attributes; int num = 0; for(int i = 0; i < attrs.count(); i++) { int attrib = -1; - if(m_Vulkan->m_VS.ShaderDetails != NULL) + if(m_Vulkan->vertexShader.reflection != NULL) { - if(attrs[i].location < (uint32_t)m_Vulkan->m_VS.BindpointMapping.InputAttributes.count()) - attrib = m_Vulkan->m_VS.BindpointMapping.InputAttributes[attrs[i].location]; + if(attrs[i].location < + (uint32_t)m_Vulkan->vertexShader.bindpointMapping.inputAttributes.count()) + attrib = m_Vulkan->vertexShader.bindpointMapping.inputAttributes[attrs[i].location]; } else attrib = i; @@ -881,27 +912,28 @@ rdcarray CommonPipelineState::GetVertexInputs() ret.resize(num); for(int i = 0; i < attrs.count() && a < num; i++) { - ret[a].Name = lit("attr%1").arg(i); - memset(&ret[a].GenericValue, 0, sizeof(PixelValue)); - ret[a].VertexBuffer = (int)attrs[i].binding; - ret[a].RelativeByteOffset = attrs[i].byteoffset; - ret[a].PerInstance = false; - if(attrs[i].binding < (uint32_t)m_Vulkan->VI.binds.count()) - ret[a].PerInstance = m_Vulkan->VI.binds[attrs[i].binding].perInstance; - ret[a].InstanceRate = 1; - ret[a].Format = attrs[i].format; - ret[a].Used = true; - ret[a].GenericEnabled = false; + ret[a].name = lit("attr%1").arg(i); + memset(&ret[a].genericValue, 0, sizeof(PixelValue)); + ret[a].vertexBuffer = (int)attrs[i].binding; + ret[a].byteOffset = attrs[i].byteOffset; + ret[a].perInstance = false; + if(attrs[i].binding < (uint32_t)m_Vulkan->vertexInput.bindings.count()) + ret[a].perInstance = m_Vulkan->vertexInput.bindings[attrs[i].binding].perInstance; + ret[a].instanceRate = 1; + ret[a].format = attrs[i].format; + ret[a].used = true; + ret[a].genericEnabled = false; - if(m_Vulkan->m_VS.ShaderDetails != NULL) + if(m_Vulkan->vertexShader.reflection != NULL) { int attrib = -1; - if(attrs[i].location < (uint32_t)m_Vulkan->m_VS.BindpointMapping.InputAttributes.count()) - attrib = m_Vulkan->m_VS.BindpointMapping.InputAttributes[attrs[i].location]; + if(attrs[i].location < + (uint32_t)m_Vulkan->vertexShader.bindpointMapping.inputAttributes.count()) + attrib = m_Vulkan->vertexShader.bindpointMapping.inputAttributes[attrs[i].location]; - if(attrib >= 0 && attrib < m_Vulkan->m_VS.ShaderDetails->InputSig.count()) - ret[a].Name = m_Vulkan->m_VS.ShaderDetails->InputSig[attrib].varName; + if(attrib >= 0 && attrib < m_Vulkan->vertexShader.reflection->inputSignature.count()) + ret[a].name = m_Vulkan->vertexShader.reflection->inputSignature[attrib].varName; if(attrib == -1) continue; @@ -930,58 +962,59 @@ BoundCBuffer CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t { const D3D11Pipe::Shader &s = GetD3D11Stage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) + if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count()) { - const BindpointMap &bind = - s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint]; + const Bindpoint &bind = + s.bindpointMapping.constantBlocks[s.reflection->constantBlocks[BufIdx].bindPoint]; - if(bind.bind >= s.ConstantBuffers.count()) + if(bind.bind >= s.constantBuffers.count()) return BoundCBuffer(); - const D3D11Pipe::CBuffer &descriptor = s.ConstantBuffers[bind.bind]; + const D3D11Pipe::ConstantBuffer &descriptor = s.constantBuffers[bind.bind]; - buf = descriptor.Buffer; - ByteOffset = descriptor.VecOffset * 4 * sizeof(float); - ByteSize = descriptor.VecCount * 4 * sizeof(float); + buf = descriptor.resourceId; + ByteOffset = descriptor.vecOffset * 4 * sizeof(float); + ByteSize = descriptor.vecCount * 4 * sizeof(float); } } else if(IsCaptureD3D12()) { const D3D12Pipe::Shader &s = GetD3D12Stage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) + if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count()) { - const BindpointMap &bind = - s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint]; + const Bindpoint &bind = + s.bindpointMapping.constantBlocks[s.reflection->constantBlocks[BufIdx].bindPoint]; - if(bind.bindset >= s.Spaces.count() || - bind.bind >= s.Spaces[bind.bindset].ConstantBuffers.count()) + if(bind.bindset >= s.spaces.count() || + bind.bind >= s.spaces[bind.bindset].constantBuffers.count()) return BoundCBuffer(); - const D3D12Pipe::CBuffer &descriptor = s.Spaces[bind.bindset].ConstantBuffers[bind.bind]; + const D3D12Pipe::ConstantBuffer &descriptor = + s.spaces[bind.bindset].constantBuffers[bind.bind]; - buf = descriptor.Buffer; - ByteOffset = descriptor.Offset; - ByteSize = descriptor.ByteSize; + buf = descriptor.resourceId; + ByteOffset = descriptor.byteOffset; + ByteSize = descriptor.byteSize; } } else if(IsCaptureGL()) { const GLPipe::Shader &s = GetGLStage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) + if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count()) { - if(s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint >= 0) + if(s.reflection->constantBlocks[BufIdx].bindPoint >= 0) { int uboIdx = - s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint].bind; - if(uboIdx >= 0 && uboIdx < m_GL->UniformBuffers.count()) + s.bindpointMapping.constantBlocks[s.reflection->constantBlocks[BufIdx].bindPoint].bind; + if(uboIdx >= 0 && uboIdx < m_GL->uniformBuffers.count()) { - const GLPipe::Buffer &b = m_GL->UniformBuffers[uboIdx]; + const GLPipe::Buffer &b = m_GL->uniformBuffers[uboIdx]; - buf = b.Resource; - ByteOffset = b.Offset; - ByteSize = b.Size; + buf = b.resourceId; + ByteOffset = b.byteOffset; + ByteSize = b.byteSize; } } } @@ -992,34 +1025,34 @@ BoundCBuffer CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t stage == ShaderStage::Compute ? m_Vulkan->compute : m_Vulkan->graphics; const VKPipe::Shader &s = GetVulkanStage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) + if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count()) { - const BindpointMap &bind = - s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint]; + const Bindpoint &bind = + s.bindpointMapping.constantBlocks[s.reflection->constantBlocks[BufIdx].bindPoint]; - if(s.ShaderDetails->ConstantBlocks[BufIdx].bufferBacked == false) + if(s.reflection->constantBlocks[BufIdx].bufferBacked == false) { BoundCBuffer ret; // dummy value, it would be nice to fetch this properly - ret.ByteSize = 1024; + ret.byteSize = 1024; return ret; } const VKPipe::BindingElement &descriptorBind = - pipe.DescSets[bind.bindset].bindings[bind.bind].binds[ArrayIdx]; + pipe.descriptorSets[bind.bindset].bindings[bind.bind].binds[ArrayIdx]; - buf = descriptorBind.res; - ByteOffset = descriptorBind.offset; - ByteSize = descriptorBind.size; + buf = descriptorBind.resourceResourceId; + ByteOffset = descriptorBind.byteOffset; + ByteSize = descriptorBind.byteSize; } } } BoundCBuffer ret; - ret.Buffer = buf; - ret.ByteOffset = ByteOffset; - ret.ByteSize = ByteSize; + ret.resourceId = buf; + ret.byteOffset = ByteOffset; + ret.byteSize = ByteSize; return ret; } @@ -1034,17 +1067,17 @@ rdcarray CommonPipelineState::GetReadOnlyResources(ShaderSta { const D3D11Pipe::Shader &s = GetD3D11Stage(stage); - ret.reserve(s.SRVs.size()); + ret.reserve(s.srvs.size()); - for(int i = 0; i < s.SRVs.count(); i++) + for(int i = 0; i < s.srvs.count(); i++) { - BindpointMap key(0, i); + Bindpoint key(0, i); BoundResource val; - val.Id = s.SRVs[i].Resource; - val.HighestMip = (int)s.SRVs[i].HighestMip; - val.FirstSlice = (int)s.SRVs[i].FirstArraySlice; - val.typeHint = s.SRVs[i].Format.compType; + 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; ret.push_back(BoundResourceArray(key, {val})); } @@ -1055,23 +1088,23 @@ rdcarray CommonPipelineState::GetReadOnlyResources(ShaderSta { const D3D12Pipe::Shader &s = GetD3D12Stage(stage); - for(int space = 0; space < s.Spaces.count(); space++) + for(int space = 0; space < s.spaces.count(); space++) { - for(int reg = 0; reg < s.Spaces[space].SRVs.count(); reg++) + for(int reg = 0; reg < s.spaces[space].srvs.count(); reg++) { - const D3D12Pipe::View &bind = s.Spaces[space].SRVs[reg]; - BindpointMap key(space, reg); + const D3D12Pipe::View &bind = s.spaces[space].srvs[reg]; + Bindpoint key(space, reg); BoundResource val; // consider this register to not exist - it's in a gap defined by sparse root signature // elements - if(bind.RootElement == ~0U) + if(bind.rootElement == ~0U) continue; - val.Id = bind.Resource; - val.HighestMip = (int)bind.HighestMip; - val.FirstSlice = (int)bind.FirstArraySlice; - val.typeHint = bind.Format.compType; + val.resourceId = bind.resourceId; + val.firstMip = (int)bind.firstMip; + val.firstSlice = (int)bind.firstSlice; + val.typeHint = bind.viewFormat.compType; ret.push_back(BoundResourceArray(key, {val})); } @@ -1081,16 +1114,16 @@ rdcarray CommonPipelineState::GetReadOnlyResources(ShaderSta } else if(IsCaptureGL()) { - ret.reserve(m_GL->Textures.size()); + ret.reserve(m_GL->textures.size()); - for(int i = 0; i < m_GL->Textures.count(); i++) + for(int i = 0; i < m_GL->textures.count(); i++) { - BindpointMap key(0, i); + Bindpoint key(0, i); BoundResource val; - val.Id = m_GL->Textures[i].Resource; - val.HighestMip = (int)m_GL->Textures[i].HighestMip; - val.FirstSlice = (int)m_GL->Textures[i].FirstSlice; + val.resourceId = m_GL->textures[i].resourceId; + val.firstMip = (int)m_GL->textures[i].firstMip; + val.firstSlice = (int)m_GL->textures[i].firstSlice; val.typeHint = CompType::Typeless; ret.push_back(BoundResourceArray(key, {val})); @@ -1100,8 +1133,9 @@ rdcarray CommonPipelineState::GetReadOnlyResources(ShaderSta } else if(IsCaptureVK()) { - const rdcarray &descsets = - stage == ShaderStage::Compute ? m_Vulkan->compute.DescSets : m_Vulkan->graphics.DescSets; + const rdcarray &descsets = stage == ShaderStage::Compute + ? m_Vulkan->compute.descriptorSets + : m_Vulkan->graphics.descriptorSets; ShaderStageMask mask = MaskForStage(stage); @@ -1116,17 +1150,17 @@ rdcarray CommonPipelineState::GetReadOnlyResources(ShaderSta (bind.stageFlags & mask) == mask) { ret.push_back(BoundResourceArray()); - ret.back().BindPoint = BindpointMap(set, slot); + ret.back().bindPoint = Bindpoint(set, slot); - rdcarray &val = ret.back().Resources; + rdcarray &val = ret.back().resources; val.resize(bind.descriptorCount); for(uint32_t i = 0; i < bind.descriptorCount; i++) { - val[i].Id = bind.binds[i].res; - val[i].HighestMip = (int)bind.binds[i].baseMip; - val[i].FirstSlice = (int)bind.binds[i].baseLayer; - val[i].typeHint = bind.binds[i].viewfmt.compType; + val[i].resourceId = bind.binds[i].resourceResourceId; + val[i].firstMip = (int)bind.binds[i].firstMip; + val[i].firstSlice = (int)bind.binds[i].firstSlice; + val[i].typeHint = bind.binds[i].viewFormat.compType; } } } @@ -1149,45 +1183,45 @@ rdcarray CommonPipelineState::GetReadWriteResources(ShaderSt { if(stage == ShaderStage::Compute) { - ret.reserve(m_D3D11->m_CS.UAVs.size()); + ret.reserve(m_D3D11->computeShader.uavs.size()); - for(int i = 0; i < m_D3D11->m_CS.UAVs.count(); i++) + for(int i = 0; i < m_D3D11->computeShader.uavs.count(); i++) { - BindpointMap key(0, i); + Bindpoint key(0, i); BoundResource val; - val.Id = m_D3D11->m_CS.UAVs[i].Resource; - val.HighestMip = (int)m_D3D11->m_CS.UAVs[i].HighestMip; - val.FirstSlice = (int)m_D3D11->m_CS.UAVs[i].FirstArraySlice; - val.typeHint = m_D3D11->m_CS.UAVs[i].Format.compType; + 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; ret.push_back(BoundResourceArray(key, {val})); } } else { - int uavstart = (int)m_D3D11->m_OM.UAVStartSlot; + int uavstart = (int)m_D3D11->outputMerger.uavStartSlot; - ret.reserve(m_D3D11->m_OM.UAVs.size() + qMax(0, uavstart)); + ret.reserve(m_D3D11->outputMerger.uavs.size() + qMax(0, uavstart)); // up to UAVStartSlot treat these bindings as empty. for(int i = 0; i < uavstart; i++) { - BindpointMap key(0, i); + Bindpoint key(0, i); BoundResource val; ret.push_back(BoundResourceArray(key, {val})); } - for(int i = 0; i < m_D3D11->m_OM.UAVs.count() - uavstart; i++) + for(int i = 0; i < m_D3D11->outputMerger.uavs.count() - uavstart; i++) { - BindpointMap key(0, i + uavstart); + Bindpoint key(0, i + uavstart); BoundResource val; - val.Id = m_D3D11->m_OM.UAVs[i].Resource; - val.HighestMip = (int)m_D3D11->m_OM.UAVs[i].HighestMip; - val.FirstSlice = (int)m_D3D11->m_OM.UAVs[i].FirstArraySlice; - val.typeHint = m_D3D11->m_OM.UAVs[i].Format.compType; + 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; ret.push_back(BoundResourceArray(key, {val})); } @@ -1197,23 +1231,23 @@ rdcarray CommonPipelineState::GetReadWriteResources(ShaderSt { const D3D12Pipe::Shader &s = GetD3D12Stage(stage); - for(int space = 0; space < s.Spaces.count(); space++) + for(int space = 0; space < s.spaces.count(); space++) { - for(int reg = 0; reg < s.Spaces[space].UAVs.count(); reg++) + for(int reg = 0; reg < s.spaces[space].uavs.count(); reg++) { - const D3D12Pipe::View &bind = s.Spaces[space].UAVs[reg]; - BindpointMap key(space, reg); + const D3D12Pipe::View &bind = s.spaces[space].uavs[reg]; + Bindpoint key(space, reg); BoundResource val; // consider this register to not exist - it's in a gap defined by sparse root signature // elements - if(bind.RootElement == ~0U) + if(bind.rootElement == ~0U) continue; - val.Id = bind.Resource; - val.HighestMip = (int)bind.HighestMip; - val.FirstSlice = (int)bind.FirstArraySlice; - val.typeHint = bind.Format.compType; + val.resourceId = bind.resourceId; + val.firstMip = (int)bind.firstMip; + val.firstSlice = (int)bind.firstSlice; + val.typeHint = bind.viewFormat.compType; ret.push_back(BoundResourceArray(key, {val})); } @@ -1221,25 +1255,26 @@ rdcarray CommonPipelineState::GetReadWriteResources(ShaderSt } else if(IsCaptureGL()) { - ret.reserve(m_GL->Images.size()); + ret.reserve(m_GL->images.size()); - for(int i = 0; i < m_GL->Images.count(); i++) + for(int i = 0; i < m_GL->images.count(); i++) { - BindpointMap key(0, i); + Bindpoint key(0, i); BoundResource val; - val.Id = m_GL->Images[i].Resource; - val.HighestMip = (int)m_GL->Images[i].Level; - val.FirstSlice = (int)m_GL->Images[i].Layer; - val.typeHint = m_GL->Images[i].Format.compType; + 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; ret.push_back(BoundResourceArray(key, {val})); } } else if(IsCaptureVK()) { - const rdcarray &descsets = - stage == ShaderStage::Compute ? m_Vulkan->compute.DescSets : m_Vulkan->graphics.DescSets; + const rdcarray &descsets = stage == ShaderStage::Compute + ? m_Vulkan->compute.descriptorSets + : m_Vulkan->graphics.descriptorSets; ShaderStageMask mask = MaskForStage(stage); @@ -1254,17 +1289,17 @@ rdcarray CommonPipelineState::GetReadWriteResources(ShaderSt (bind.stageFlags & mask) == mask) { ret.push_back(BoundResourceArray()); - ret.back().BindPoint = BindpointMap(set, slot); + ret.back().bindPoint = Bindpoint(set, slot); - rdcarray &val = ret.back().Resources; + rdcarray &val = ret.back().resources; val.resize(bind.descriptorCount); for(uint32_t i = 0; i < bind.descriptorCount; i++) { - val[i].Id = bind.binds[i].res; - val[i].HighestMip = (int)bind.binds[i].baseMip; - val[i].FirstSlice = (int)bind.binds[i].baseLayer; - val[i].typeHint = bind.binds[i].viewfmt.compType; + val[i].resourceId = bind.binds[i].resourceResourceId; + val[i].firstMip = (int)bind.binds[i].firstMip; + val[i].firstSlice = (int)bind.binds[i].firstSlice; + val[i].typeHint = bind.binds[i].viewFormat.compType; } } } @@ -1282,42 +1317,42 @@ BoundResource CommonPipelineState::GetDepthTarget() if(IsCaptureD3D11()) { BoundResource ret; - ret.Id = m_D3D11->m_OM.DepthTarget.Resource; - ret.HighestMip = (int)m_D3D11->m_OM.DepthTarget.HighestMip; - ret.FirstSlice = (int)m_D3D11->m_OM.DepthTarget.FirstArraySlice; - ret.typeHint = m_D3D11->m_OM.DepthTarget.Format.compType; + 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; return ret; } else if(IsCaptureD3D12()) { BoundResource ret; - ret.Id = m_D3D12->m_OM.DepthTarget.Resource; - ret.HighestMip = (int)m_D3D12->m_OM.DepthTarget.HighestMip; - ret.FirstSlice = (int)m_D3D12->m_OM.DepthTarget.FirstArraySlice; - ret.typeHint = m_D3D12->m_OM.DepthTarget.Format.compType; + 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; return ret; } else if(IsCaptureGL()) { BoundResource ret; - ret.Id = m_GL->m_FB.m_DrawFBO.Depth.Obj; - ret.HighestMip = (int)m_GL->m_FB.m_DrawFBO.Depth.Mip; - ret.FirstSlice = (int)m_GL->m_FB.m_DrawFBO.Depth.Layer; + 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; return ret; } else if(IsCaptureVK()) { - const VKPipe::RenderPass &rp = m_Vulkan->Pass.renderpass; - const VKPipe::Framebuffer &fb = m_Vulkan->Pass.framebuffer; + const VKPipe::RenderPass &rp = m_Vulkan->currentPass.renderpass; + const VKPipe::Framebuffer &fb = m_Vulkan->currentPass.framebuffer; if(rp.depthstencilAttachment >= 0 && rp.depthstencilAttachment < fb.attachments.count()) { BoundResource ret; - ret.Id = fb.attachments[rp.depthstencilAttachment].img; - ret.HighestMip = (int)fb.attachments[rp.depthstencilAttachment].baseMip; - ret.FirstSlice = (int)fb.attachments[rp.depthstencilAttachment].baseLayer; - ret.typeHint = fb.attachments[rp.depthstencilAttachment].viewfmt.compType; + 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; return ret; } @@ -1336,46 +1371,46 @@ rdcarray CommonPipelineState::GetOutputTargets() { if(IsCaptureD3D11()) { - ret.resize(m_D3D11->m_OM.RenderTargets.count()); - for(int i = 0; i < m_D3D11->m_OM.RenderTargets.count(); i++) + ret.resize(m_D3D11->outputMerger.renderTargets.count()); + for(int i = 0; i < m_D3D11->outputMerger.renderTargets.count(); i++) { - ret[i].Id = m_D3D11->m_OM.RenderTargets[i].Resource; - ret[i].HighestMip = (int)m_D3D11->m_OM.RenderTargets[i].HighestMip; - ret[i].FirstSlice = (int)m_D3D11->m_OM.RenderTargets[i].FirstArraySlice; - ret[i].typeHint = m_D3D11->m_OM.RenderTargets[i].Format.compType; + 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; } } else if(IsCaptureD3D12()) { - ret.resize(m_D3D12->m_OM.RenderTargets.count()); - for(int i = 0; i < m_D3D12->m_OM.RenderTargets.count(); i++) + ret.resize(m_D3D12->outputMerger.renderTargets.count()); + for(int i = 0; i < m_D3D12->outputMerger.renderTargets.count(); i++) { - ret[i].Id = m_D3D12->m_OM.RenderTargets[i].Resource; - ret[i].HighestMip = (int)m_D3D12->m_OM.RenderTargets[i].HighestMip; - ret[i].FirstSlice = (int)m_D3D12->m_OM.RenderTargets[i].FirstArraySlice; - ret[i].typeHint = m_D3D12->m_OM.RenderTargets[i].Format.compType; + 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; } } else if(IsCaptureGL()) { - ret.resize(m_GL->m_FB.m_DrawFBO.DrawBuffers.count()); - for(int i = 0; i < m_GL->m_FB.m_DrawFBO.DrawBuffers.count(); i++) + ret.resize(m_GL->framebuffer.drawFBO.drawBuffers.count()); + for(int i = 0; i < m_GL->framebuffer.drawFBO.drawBuffers.count(); i++) { - int db = m_GL->m_FB.m_DrawFBO.DrawBuffers[i]; + int db = m_GL->framebuffer.drawFBO.drawBuffers[i]; if(db >= 0) { - ret[i].Id = m_GL->m_FB.m_DrawFBO.Color[db].Obj; - ret[i].HighestMip = (int)m_GL->m_FB.m_DrawFBO.Color[db].Mip; - ret[i].FirstSlice = (int)m_GL->m_FB.m_DrawFBO.Color[db].Layer; + 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; } } } else if(IsCaptureVK()) { - const VKPipe::RenderPass &rp = m_Vulkan->Pass.renderpass; - const VKPipe::Framebuffer &fb = m_Vulkan->Pass.framebuffer; + const VKPipe::RenderPass &rp = m_Vulkan->currentPass.renderpass; + const VKPipe::Framebuffer &fb = m_Vulkan->currentPass.framebuffer; int idx = 0; @@ -1384,10 +1419,10 @@ rdcarray CommonPipelineState::GetOutputTargets() { if(rp.colorAttachments[i] < (uint32_t)fb.attachments.count()) { - ret[idx].Id = fb.attachments[rp.colorAttachments[i]].img; - ret[idx].HighestMip = (int)fb.attachments[rp.colorAttachments[i]].baseMip; - ret[idx].FirstSlice = (int)fb.attachments[rp.colorAttachments[i]].baseLayer; - ret[idx].typeHint = fb.attachments[rp.colorAttachments[i]].viewfmt.compType; + 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; } idx++; @@ -1397,10 +1432,10 @@ rdcarray CommonPipelineState::GetOutputTargets() { if(rp.resolveAttachments[i] < (uint32_t)fb.attachments.count()) { - ret[idx].Id = fb.attachments[rp.resolveAttachments[i]].img; - ret[idx].HighestMip = (int)fb.attachments[rp.resolveAttachments[i]].baseMip; - ret[idx].FirstSlice = (int)fb.attachments[rp.resolveAttachments[i]].baseLayer; - ret[idx].typeHint = fb.attachments[rp.resolveAttachments[i]].viewfmt.compType; + 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; } idx++; diff --git a/qrenderdoc/Code/Interface/CommonPipelineState.h b/qrenderdoc/Code/Interface/CommonPipelineState.h index 585e92ce1..0b69187ca 100644 --- a/qrenderdoc/Code/Interface/CommonPipelineState.h +++ b/qrenderdoc/Code/Interface/CommonPipelineState.h @@ -35,42 +35,42 @@ struct BoundResource DOCUMENT(""); BoundResource() { - Id = ResourceId(); - HighestMip = -1; - FirstSlice = -1; + resourceId = ResourceId(); + firstMip = -1; + firstSlice = -1; typeHint = CompType::Typeless; } BoundResource(ResourceId id) { - Id = id; - HighestMip = -1; - FirstSlice = -1; + resourceId = id; + firstMip = -1; + firstSlice = -1; typeHint = CompType::Typeless; } bool operator==(const BoundResource &o) const { - return Id == o.Id && HighestMip == o.HighestMip && FirstSlice == o.FirstSlice && + return resourceId == o.resourceId && firstMip == o.firstMip && firstSlice == o.firstSlice && typeHint == o.typeHint; } bool operator<(const BoundResource &o) const { - if(Id != o.Id) - return Id < o.Id; - if(HighestMip != o.HighestMip) - return HighestMip < o.HighestMip; - if(FirstSlice != o.FirstSlice) - return FirstSlice < o.FirstSlice; + if(resourceId != o.resourceId) + return resourceId < o.resourceId; + if(firstMip != o.firstMip) + return firstMip < o.firstMip; + if(firstSlice != o.firstSlice) + return firstSlice < o.firstSlice; if(typeHint != o.typeHint) return typeHint < o.typeHint; return false; } DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the bound resource."); - ResourceId Id; + ResourceId resourceId; DOCUMENT("For textures, the highest mip level available on this binding, or -1 for all mips"); - int HighestMip; + int firstMip; DOCUMENT("For textures, the first array slice available on this binding. or -1 for all slices."); - int FirstSlice; + int firstSlice; DOCUMENT( "For textures, a :class:`~renderdoc.CompType` hint for how to interpret typeless textures."); CompType typeHint; @@ -86,61 +86,58 @@ struct BoundResourceArray { DOCUMENT(""); BoundResourceArray() = default; - BoundResourceArray(BindpointMap b) : BindPoint(b) {} - BoundResourceArray(BindpointMap b, const rdcarray &r) : BindPoint(b), Resources(r) - { - } - + BoundResourceArray(Bindpoint b) : bindPoint(b) {} + BoundResourceArray(Bindpoint b, const rdcarray &r) : bindPoint(b), resources(r) {} // for convenience for searching the array, we compare only using the BindPoint - bool operator==(const BoundResourceArray &o) const { return BindPoint == o.BindPoint; } - bool operator!=(const BoundResourceArray &o) const { return !(BindPoint == o.BindPoint); } - bool operator<(const BoundResourceArray &o) const { return BindPoint < o.BindPoint; } + bool operator==(const BoundResourceArray &o) const { return bindPoint == o.bindPoint; } + bool operator!=(const BoundResourceArray &o) const { return !(bindPoint == o.bindPoint); } + bool operator<(const BoundResourceArray &o) const { return bindPoint < o.bindPoint; } DOCUMENT("The bind point for this array of bound resources."); - BindpointMap BindPoint; + Bindpoint bindPoint; DOCUMENT("The resources at this bind point"); - rdcarray Resources; + rdcarray resources; }; DECLARE_REFLECTION_STRUCT(BoundResourceArray); DOCUMENT("Information about a single vertex or index buffer binding."); -struct BoundBuffer +struct BoundVBuffer { DOCUMENT(""); - bool operator==(const BoundBuffer &o) const + bool operator==(const BoundVBuffer &o) const { - return Buffer == o.Buffer && ByteOffset == o.ByteOffset && ByteStride == o.ByteStride; + return resourceId == o.resourceId && byteOffset == o.byteOffset && byteStride == o.byteStride; } - bool operator<(const BoundBuffer &o) const + bool operator<(const BoundVBuffer &o) const { - if(Buffer != o.Buffer) - return Buffer < o.Buffer; - if(ByteOffset != o.ByteOffset) - return ByteOffset < o.ByteOffset; - if(ByteStride != o.ByteStride) - return ByteStride < o.ByteStride; + if(resourceId != o.resourceId) + return resourceId < o.resourceId; + if(byteOffset != o.byteOffset) + return byteOffset < o.byteOffset; + if(byteStride != o.byteStride) + return byteStride < o.byteStride; return false; } DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the buffer."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The offset in bytes from the start of the buffer to the data."); - uint64_t ByteOffset = 0; + uint64_t byteOffset = 0; DOCUMENT("The stride in bytes between the start of one element and the start of the next."); - uint32_t ByteStride = 0; + uint32_t byteStride = 0; }; -DECLARE_REFLECTION_STRUCT(BoundBuffer); +DECLARE_REFLECTION_STRUCT(BoundVBuffer); DOCUMENT("Information about a single constant buffer binding."); struct BoundCBuffer { DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the buffer."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The offset in bytes from the start of the buffer to the constant data."); - uint64_t ByteOffset = 0; + uint64_t byteOffset = 0; DOCUMENT("The size in bytes for the constant buffer. Access outside this size returns 0."); - uint32_t ByteSize = 0; + uint32_t byteSize = 0; }; DECLARE_REFLECTION_STRUCT(BoundCBuffer); @@ -151,76 +148,60 @@ struct VertexInputAttribute DOCUMENT(""); bool operator==(const VertexInputAttribute &o) const { - return Name == o.Name && VertexBuffer == o.VertexBuffer && - RelativeByteOffset == o.RelativeByteOffset && PerInstance == o.PerInstance && - InstanceRate == o.InstanceRate && Format == o.Format && - !memcmp(&GenericValue, &o.GenericValue, sizeof(GenericValue)) && - GenericEnabled == o.GenericEnabled && Used == o.Used; + return name == o.name && vertexBuffer == o.vertexBuffer && byteOffset == o.byteOffset && + perInstance == o.perInstance && instanceRate == o.instanceRate && format == o.format && + !memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) && + genericEnabled == o.genericEnabled && used == o.used; } bool operator<(const VertexInputAttribute &o) const { - if(Name != o.Name) - return Name < o.Name; - if(VertexBuffer != o.VertexBuffer) - return VertexBuffer < o.VertexBuffer; - if(RelativeByteOffset != o.RelativeByteOffset) - return RelativeByteOffset < o.RelativeByteOffset; - if(PerInstance != o.PerInstance) - return PerInstance < o.PerInstance; - if(InstanceRate != o.InstanceRate) - return InstanceRate < o.InstanceRate; - if(Format != o.Format) - return Format < o.Format; - if(memcmp(&GenericValue, &o.GenericValue, sizeof(GenericValue)) < 0) + if(name != o.name) + return name < o.name; + if(vertexBuffer != o.vertexBuffer) + return vertexBuffer < o.vertexBuffer; + if(byteOffset != o.byteOffset) + return byteOffset < o.byteOffset; + if(perInstance != o.perInstance) + return perInstance < o.perInstance; + if(instanceRate != o.instanceRate) + return instanceRate < o.instanceRate; + if(format != o.format) + return format < o.format; + if(memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) < 0) return true; - if(GenericEnabled != o.GenericEnabled) - return GenericEnabled < o.GenericEnabled; - if(Used != o.Used) - return Used < o.Used; + if(genericEnabled != o.genericEnabled) + return genericEnabled < o.genericEnabled; + if(used != o.used) + return used < o.used; return false; } DOCUMENT("The name of this input. This may be a variable name or a semantic name."); - rdcstr Name; + rdcstr name; DOCUMENT("The index of the vertex buffer used to provide this attribute."); - int VertexBuffer; + int vertexBuffer; DOCUMENT("The byte offset from the start of the vertex data for this VB to this attribute."); - uint32_t RelativeByteOffset; + uint32_t byteOffset; DOCUMENT("``True`` if this attribute runs at instance rate."); - bool PerInstance; - DOCUMENT(R"(If :data:`PerInstance` is ``True``, the number of instances that source the same value + bool perInstance; + DOCUMENT(R"(If :data:`perInstance` is ``True``, the number of instances that source the same value from the vertex buffer before advancing to the next value. )"); - int InstanceRate; + int instanceRate; DOCUMENT("A :class:`~renderdoc.ResourceFormat` with the interpreted format of this attribute."); - ResourceFormat Format; + ResourceFormat format; DOCUMENT(R"(A :class:`~renderdoc.PixelValue` with the generic value for this attribute if it has no VB bound. )"); - PixelValue GenericValue; - DOCUMENT("``True`` if this attribute is using :data:`GenericValue` for its data."); - bool GenericEnabled; + PixelValue genericValue; + DOCUMENT("``True`` if this attribute is using :data:`genericValue` for its data."); + bool genericEnabled; DOCUMENT("``True`` if this attribute is enabled and used by the vertex shader."); - bool Used; + bool used; }; DECLARE_REFLECTION_STRUCT(VertexInputAttribute); -DOCUMENT("Information about a viewport."); -struct Viewport -{ - DOCUMENT("The X co-ordinate of the viewport."); - float x; - DOCUMENT("The Y co-ordinate of the viewport."); - float y; - DOCUMENT("The width of the viewport."); - float width; - DOCUMENT("The height of the viewport."); - float height; -}; - -DECLARE_REFLECTION_STRUCT(Viewport); - DOCUMENT(R"(An API-agnostic view of the common aspects of the pipeline state. This allows simple access to e.g. find out the bound resources or vertex buffers, or certain pipeline state which is available on all APIs. @@ -235,10 +216,10 @@ public: DOCUMENT(R"(Set the source API-specific states to read data from. :param ~renderdoc.APIProperties props: The properties of the current capture. -:param ~renderdoc.D3D11_State d3d11: The D3D11 state. -:param ~renderdoc.D3D12_State d3d12: The D3D11 state. -:param ~renderdoc.GL_State gl: The OpenGL state. -:param ~renderdoc.VK_State vk: The Vulkan state. +:param ~renderdoc.D3D11State d3d11: The D3D11 state. +:param ~renderdoc.D3D12State d3d12: The D3D11 state. +:param ~renderdoc.GLState gl: The OpenGL state. +:param ~renderdoc.VKState vk: The Vulkan state. )"); void SetStates(APIProperties props, const D3D11Pipe::State *d3d11, const D3D12Pipe::State *d3d12, const GLPipe::State *gl, const VKPipe::State *vk) @@ -253,7 +234,7 @@ public: DOCUMENT( "The default :class:`~renderdoc.GraphicsAPI` to pretend to contain, if no capture is " "loaded."); - GraphicsAPI DefaultType = GraphicsAPI::D3D11; + GraphicsAPI defaultType = GraphicsAPI::D3D11; DOCUMENT(R"(Determines whether or not a capture is currently loaded. @@ -317,16 +298,16 @@ public: if(IsCaptureLoaded()) { if(IsCaptureD3D11()) - return m_D3D11 != NULL && m_D3D11->m_HS.Object != ResourceId(); + return m_D3D11 != NULL && m_D3D11->hullShader.resourceId != ResourceId(); if(IsCaptureD3D12()) - return m_D3D12 != NULL && m_D3D12->m_HS.Object != ResourceId(); + return m_D3D12 != NULL && m_D3D12->hullShader.resourceId != ResourceId(); if(IsCaptureGL()) - return m_GL != NULL && m_GL->m_TES.Object != ResourceId(); + return m_GL != NULL && m_GL->tessEvalShader.shaderResourceId != ResourceId(); if(IsCaptureVK()) - return m_Vulkan != NULL && m_Vulkan->m_TES.Object != ResourceId(); + return m_Vulkan != NULL && m_Vulkan->tessEvalShader.resourceId != ResourceId(); } return false; @@ -377,12 +358,20 @@ requirements. DOCUMENT(R"(Retrieves the viewport for a given index. -:param int index: The viewport index to retrieve. +:param int index: The index to retrieve. :return: The viewport for the given index. -:rtype: Viewport +:rtype: ~renderdoc.Viewport )"); Viewport GetViewport(int index); + DOCUMENT(R"(Retrieves the scissor region for a given index. + +:param int index: The index to retrieve. +:return: The scissor region for the given index. +:rtype: ~renderdoc.Scissor +)"); + Scissor GetScissor(int index); + DOCUMENT(R"(Retrieves the current bindpoint mapping for a shader stage. This returns an empty bindpoint mapping if no shader is bound. @@ -454,10 +443,10 @@ Typically this is ``glsl`` or ``hlsl``. DOCUMENT(R"(Retrieves the current index buffer binding. -:return: A :class:`BoundBuffer` with the index buffer details. The stride is always 0. -:rtype: ``BoundBuffer`` +:return: A :class:`BoundVBuffer` with the index buffer details. The stride is always 0. +:rtype: ``BoundVBuffer`` )"); - BoundBuffer GetIBuffer(); + BoundVBuffer GetIBuffer(); DOCUMENT(R"(Determines whether or not primitive restart is enabled. @@ -477,9 +466,9 @@ Typically this is ``glsl`` or ``hlsl``. DOCUMENT(R"(Retrieves the currently bound vertex buffers. :return: The list of bound vertex buffers. -:rtype: ``list`` of :class:`BoundBuffer`. +:rtype: ``list`` of :class:`BoundVBuffer`. )"); - rdcarray GetVBuffers(); + rdcarray GetVBuffers(); DOCUMENT(R"(Retrieves the currently specified vertex attributes. @@ -522,7 +511,7 @@ Typically this is ``glsl`` or ``hlsl``. )"); BoundResource GetDepthTarget(); - DOCUMENT(R"(Retrieves the resources bound to the colour outputs. + DOCUMENT(R"(Retrieves the resources bound to the color outputs. :return: The currently bound output targets. :rtype: ``list`` of :class:`BoundResource`. diff --git a/qrenderdoc/Code/Interface/PersistantConfig.cpp b/qrenderdoc/Code/Interface/PersistantConfig.cpp index 2c8f5621c..9503630ef 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.cpp +++ b/qrenderdoc/Code/Interface/PersistantConfig.cpp @@ -184,10 +184,10 @@ void PersistantConfig::AddAndroidHosts() QMap oldHosts; for(int i = RemoteHosts.count() - 1; i >= 0; i--) { - if(RemoteHosts[i]->IsHostADB()) + if(RemoteHosts[i]->IsADB()) { RemoteHost *host = RemoteHosts.takeAt(i); - oldHosts[host->Hostname] = host; + oldHosts[host->hostname] = host; } } @@ -216,12 +216,12 @@ void PersistantConfig::AddAndroidHosts() else host = new RemoteHost(); - host->Hostname = hostName; + host->hostname = hostName; rdcstr friendly; RENDERDOC_GetAndroidFriendlyName(hostName.toUtf8().data(), friendly); - host->FriendlyName = friendly; + host->friendlyName = friendly; // Just a command to display in the GUI and allow Launch() to be called. - host->RunCommand = lit("org.renderdoc.renderdoccmd"); + host->runCommand = lit("org.renderdoc.renderdoccmd"); RemoteHosts.push_back(host); } @@ -284,7 +284,7 @@ bool PersistantConfig::Load(const rdcstr &filename) if(!foundLocalhost) { RemoteHost *host = new RemoteHost(); - host->Hostname = "localhost"; + host->hostname = "localhost"; RemoteHosts.insert(0, host); } @@ -389,24 +389,24 @@ SPIRVDisassembler::operator QVariant() const BugReport::BugReport(const QVariant &var) { QVariantMap map = var.toMap(); - if(map.contains(lit("ID"))) - ID = map[lit("ID")].toString(); - if(map.contains(lit("SubmitDate"))) - SubmitDate = map[lit("SubmitDate")].toDateTime(); - if(map.contains(lit("CheckDate"))) - CheckDate = map[lit("CheckDate")].toDateTime(); - if(map.contains(lit("UnreadUpdates"))) - UnreadUpdates = map[lit("UnreadUpdates")].toBool(); + if(map.contains(lit("reportId"))) + reportId = map[lit("reportId")].toString(); + if(map.contains(lit("submitDate"))) + submitDate = map[lit("submitDate")].toDateTime(); + if(map.contains(lit("checkDate"))) + checkDate = map[lit("checkDate")].toDateTime(); + if(map.contains(lit("unreadUpdates"))) + unreadUpdates = map[lit("unreadUpdates")].toBool(); } BugReport::operator QVariant() const { QVariantMap map; - map[lit("ID")] = ID; - map[lit("SubmitDate")] = SubmitDate; - map[lit("CheckDate")] = CheckDate; - map[lit("UnreadUpdates")] = UnreadUpdates; + map[lit("reportId")] = reportId; + map[lit("submitDate")] = submitDate; + map[lit("checkDate")] = checkDate; + map[lit("unreadUpdates")] = unreadUpdates; return map; } diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h index 71437cc6f..7554605c2 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.h +++ b/qrenderdoc/Code/Interface/PersistantConfig.h @@ -65,40 +65,40 @@ DOCUMENT("Describes a submitted bug report."); struct BugReport { DOCUMENT(""); - BugReport() { UnreadUpdates = false; } + BugReport() { unreadUpdates = false; } VARIANT_CAST(BugReport); bool operator==(const BugReport &o) const { - return ID == o.ID && SubmitDate == o.SubmitDate && CheckDate == o.CheckDate && - UnreadUpdates == o.UnreadUpdates; + return reportId == o.reportId && submitDate == o.submitDate && checkDate == o.checkDate && + unreadUpdates == o.unreadUpdates; } bool operator<(const BugReport &o) const { - if(ID != o.ID) - return ID < o.ID; - if(SubmitDate != o.SubmitDate) - return SubmitDate < o.SubmitDate; - if(CheckDate != o.CheckDate) - return CheckDate < o.CheckDate; - if(UnreadUpdates != o.UnreadUpdates) - return UnreadUpdates < o.UnreadUpdates; + if(reportId != o.reportId) + return reportId < o.reportId; + if(submitDate != o.submitDate) + return submitDate < o.submitDate; + if(checkDate != o.checkDate) + return checkDate < o.checkDate; + if(unreadUpdates != o.unreadUpdates) + return unreadUpdates < o.unreadUpdates; return false; } DOCUMENT("The private ID of the bug report."); - rdcstr ID; + rdcstr reportId; DOCUMENT("The original date when this bug was submitted."); - QDateTime SubmitDate; + QDateTime submitDate; DOCUMENT("The last date that we checked for updates."); - QDateTime CheckDate; + QDateTime checkDate; DOCUMENT("Unread updates to the bug exist"); - bool UnreadUpdates = false; + bool unreadUpdates = false; DOCUMENT(R"(Gets the URL for this report. :return: The URL to the report. :rtype: ``str`` )"); - rdcstr URL() const { return lit(BUGREPORT_URL "/report/%1").arg(QString(ID)); } + rdcstr URL() const { return lit(BUGREPORT_URL "/report/%1").arg(QString(reportId)); } }; DECLARE_REFLECTION_STRUCT(BugReport); @@ -376,14 +376,14 @@ For more information about some of these settings that are user-facing see .. data:: EventBrowser_ApplyColors - ``True`` if the :class:`EventBrowser` should apply any colours specified with API marker regions. + ``True`` if the :class:`EventBrowser` should apply any colors specified with API marker regions. Defaults to ``True``. .. data:: EventBrowser_ColorEventRow - ``True`` if when colouring marker regions in the :class:`EventBrowser`, the whole row should be - coloured instead of just a side-bar. + ``True`` if when coloring marker regions in the :class:`EventBrowser`, the whole row should be + colored instead of just a side-bar. Defaults to ``True``. )", @@ -456,8 +456,8 @@ For more information about some of these settings that are user-facing see .. data:: CheckUpdate_AllowChecks - ``True`` if when colouring marker regions in the :class:`EventBrowser`, the whole row should be - coloured instead of just a side-bar. + ``True`` if when coloring marker regions in the :class:`EventBrowser`, the whole row should be + colored instead of just a side-bar. Defaults to ``True``. diff --git a/qrenderdoc/Code/Interface/QRDInterface.cpp b/qrenderdoc/Code/Interface/QRDInterface.cpp index 0b6391159..ef7e57c3a 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.cpp +++ b/qrenderdoc/Code/Interface/QRDInterface.cpp @@ -71,41 +71,41 @@ EnvironmentModification EnvModFromVariant(const QVariant &v) CaptureSettings::CaptureSettings() { - Inject = false; - AutoStart = false; - RENDERDOC_GetDefaultCaptureOptions(&Options); + inject = false; + autoStart = false; + RENDERDOC_GetDefaultCaptureOptions(&options); } CaptureSettings::operator QVariant() const { QVariantMap ret; - ret[lit("Inject")] = Inject; - ret[lit("AutoStart")] = AutoStart; + ret[lit("inject")] = inject; + ret[lit("autoStart")] = autoStart; - ret[lit("Executable")] = Executable; - ret[lit("WorkingDir")] = WorkingDir; - ret[lit("CmdLine")] = CmdLine; + ret[lit("executable")] = executable; + ret[lit("workingDir")] = workingDir; + ret[lit("commandLine")] = commandLine; QVariantList env; - for(int i = 0; i < Environment.count(); i++) - env.push_back(EnvModToVariant(Environment[i])); - ret[lit("Environment")] = env; + for(int i = 0; i < environment.count(); i++) + env.push_back(EnvModToVariant(environment[i])); + ret[lit("environment")] = env; QVariantMap opts; - opts[lit("AllowVSync")] = Options.AllowVSync; - opts[lit("AllowFullscreen")] = Options.AllowFullscreen; - opts[lit("APIValidation")] = Options.APIValidation; - opts[lit("CaptureCallstacks")] = Options.CaptureCallstacks; - opts[lit("CaptureCallstacksOnlyDraws")] = Options.CaptureCallstacksOnlyDraws; - opts[lit("DelayForDebugger")] = Options.DelayForDebugger; - opts[lit("VerifyMapWrites")] = Options.VerifyMapWrites; - opts[lit("HookIntoChildren")] = Options.HookIntoChildren; - opts[lit("RefAllResources")] = Options.RefAllResources; - opts[lit("SaveAllInitials")] = Options.SaveAllInitials; - opts[lit("CaptureAllCmdLists")] = Options.CaptureAllCmdLists; - opts[lit("DebugOutputMute")] = Options.DebugOutputMute; - ret[lit("Options")] = opts; + opts[lit("allowVSync")] = options.allowVSync; + opts[lit("allowFullscreen")] = options.allowFullscreen; + opts[lit("apiValidation")] = options.apiValidation; + opts[lit("captureCallstacks")] = options.captureCallstacks; + opts[lit("captureCallstacksOnlyDraws")] = options.captureCallstacksOnlyDraws; + opts[lit("delayForDebugger")] = options.delayForDebugger; + opts[lit("verifyMapWrites")] = options.verifyMapWrites; + opts[lit("hookIntoChildren")] = options.hookIntoChildren; + opts[lit("refAllResources")] = options.refAllResources; + opts[lit("saveAllInitials")] = options.saveAllInitials; + opts[lit("captureAllCmdLists")] = options.captureAllCmdLists; + opts[lit("debugOutputMute")] = options.debugOutputMute; + ret[lit("options")] = opts; return ret; } @@ -114,34 +114,34 @@ CaptureSettings::CaptureSettings(const QVariant &v) { QVariantMap data = v.toMap(); - Inject = data[lit("Inject")].toBool(); - AutoStart = data[lit("AutoStart")].toBool(); + inject = data[lit("inject")].toBool(); + autoStart = data[lit("autoStart")].toBool(); - Executable = data[lit("Executable")].toString(); - WorkingDir = data[lit("WorkingDir")].toString(); - CmdLine = data[lit("CmdLine")].toString(); + executable = data[lit("executable")].toString(); + workingDir = data[lit("workingDir")].toString(); + commandLine = data[lit("commandLine")].toString(); - QVariantList env = data[lit("Environment")].toList(); + QVariantList env = data[lit("environment")].toList(); for(int i = 0; i < env.size(); i++) { EnvironmentModification e = EnvModFromVariant(env[i]); - Environment.push_back(e); + environment.push_back(e); } - QVariantMap opts = data[lit("Options")].toMap(); + QVariantMap opts = data[lit("options")].toMap(); - Options.AllowVSync = opts[lit("AllowVSync")].toBool(); - Options.AllowFullscreen = opts[lit("AllowFullscreen")].toBool(); - Options.APIValidation = opts[lit("APIValidation")].toBool(); - Options.CaptureCallstacks = opts[lit("CaptureCallstacks")].toBool(); - Options.CaptureCallstacksOnlyDraws = opts[lit("CaptureCallstacksOnlyDraws")].toBool(); - Options.DelayForDebugger = opts[lit("DelayForDebugger")].toUInt(); - Options.VerifyMapWrites = opts[lit("VerifyMapWrites")].toBool(); - Options.HookIntoChildren = opts[lit("HookIntoChildren")].toBool(); - Options.RefAllResources = opts[lit("RefAllResources")].toBool(); - Options.SaveAllInitials = opts[lit("SaveAllInitials")].toBool(); - Options.CaptureAllCmdLists = opts[lit("CaptureAllCmdLists")].toBool(); - Options.DebugOutputMute = opts[lit("DebugOutputMute")].toBool(); + options.allowVSync = opts[lit("allowVSync")].toBool(); + options.allowFullscreen = opts[lit("allowFullscreen")].toBool(); + options.apiValidation = opts[lit("apiValidation")].toBool(); + options.captureCallstacks = opts[lit("captureCallstacks")].toBool(); + options.captureCallstacksOnlyDraws = opts[lit("captureCallstacksOnlyDraws")].toBool(); + options.delayForDebugger = opts[lit("delayForDebugger")].toUInt(); + options.verifyMapWrites = opts[lit("verifyMapWrites")].toBool(); + options.hookIntoChildren = opts[lit("hookIntoChildren")].toBool(); + options.refAllResources = opts[lit("refAllResources")].toBool(); + options.saveAllInitials = opts[lit("saveAllInitials")].toBool(); + options.captureAllCmdLists = opts[lit("captureAllCmdLists")].toBool(); + options.debugOutputMute = opts[lit("debugOutputMute")].toBool(); } rdcstr configFilePath(const rdcstr &filename) diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index 1c957df11..4900d2666 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -76,23 +76,23 @@ struct CaptureSettings VARIANT_CAST(CaptureSettings); DOCUMENT("The :class:`~renderdoc.CaptureOptions` with fine-tuned settings for the capture."); - CaptureOptions Options; + CaptureOptions options; DOCUMENT( "``True`` if the described capture is an inject-into-process instead of a launched " "executable."); - bool Inject; + bool inject; DOCUMENT("``True`` if this capture settings object should be immediately executed upon load."); - bool AutoStart; + bool autoStart; DOCUMENT("The path to the executable to run."); - rdcstr Executable; + rdcstr executable; DOCUMENT("The path to the working directory to run in, or blank for the executable's directory."); - rdcstr WorkingDir; - DOCUMENT("The command line to pass when running :data:`Exectuable`."); - rdcstr CmdLine; + rdcstr workingDir; + DOCUMENT("The command line to pass when running :data:`executable`."); + rdcstr commandLine; DOCUMENT( "A ``list`` of :class:`~renderdoc.EnvironmentModification` with environment changes to " "apply."); - rdcarray Environment; + rdcarray environment; }; DECLARE_REFLECTION_STRUCT(CaptureSettings); @@ -220,10 +220,10 @@ struct ITextureViewer DOCUMENT(R"(Open a texture view, optionally raising this window to the foreground. -:param ~renderdoc.ResourceId ID: The ID of the texture to view. +:param ~renderdoc.ResourceId resourceId: The ID of the texture to view. :param bool focus: ``True`` if the :class:`TextureViewer` should be raised. )"); - virtual void ViewTexture(ResourceId ID, bool focus) = 0; + virtual void ViewTexture(ResourceId resourceId, bool focus) = 0; DOCUMENT(R"(Highlights the given pixel location in the current texture. :param int x: The X co-ordinate. @@ -612,23 +612,23 @@ effective current event, since for example selecting a marker region will change to be the last event inside that region, to be consistent with selecting an item reflecting the current state after that item. -The selected event shows the :data:`EID ` that was actually selected, +The selected event shows the :data:`eventId ` that was actually selected, which will usually but not always be the same as the current effective -:data:`EID `. +:data:`eventId `. The distinction for this callback is not normally desired, instead use :meth:`OnEventChanged` to be notified whenever the current event changes. The API inspector uses this to display API events up to a marker region. -:param int eventID: The new :data:`EID `. +:param int eventId: The new :data:`eventId `. )"); - virtual void OnSelectedEventChanged(uint32_t eventID) = 0; + virtual void OnSelectedEventChanged(uint32_t eventId) = 0; DOCUMENT(R"(Called whenever the effective current event changes. -:param int eventID: The new :data:`EID `. +:param int eventId: The new :data:`eventId `. )"); - virtual void OnEventChanged(uint32_t eventID) = 0; + virtual void OnEventChanged(uint32_t eventId) = 0; protected: ICaptureViewer() = default; @@ -698,7 +698,7 @@ struct IReplayManager DOCUMENT(R"(Retrieves the capture file handle for the currently open file. :return: The file handle active, or ``None`` if no capture is open. -:rtype: StackResolver +:rtype: ~renderdoc.CaptureAccess )"); virtual ICaptureAccess *GetCaptureAccess() = 0; @@ -711,7 +711,8 @@ This happens either locally, or on the remote server, depending on whether a con directory containing the executable is used. :param str cmdLine: The command line to use when running the executable, it will be processed in a platform specific way to generate arguments. -:param list env: Any :class:`EnvironmentModification` that should be made when running the program. +:param list env: Any :class:`~renderdoc.EnvironmentModification` that should be made when running + the program. :param str capturefile: The location to save any captures, if running locally. :param CaptureOptions opts: The capture options to use when injecting into the program. :return: The ident where the new application is listening for target control, or 0 if something went @@ -737,7 +738,8 @@ blocking fashion on the current thread. :param bool synchronous: If a capture is open, then ``True`` will use :meth:`BlockInvoke` to call the callback. Otherwise if ``False`` then :meth:`AsyncInvoke` will be used. -:param DirectoryBrowseMethod method: The function to callback on the replay thread. +:param method: The function to callback on the replay thread. +:type method: :func:`DirectoryBrowseCallback` )"); virtual void GetHomeFolder(bool synchronous, DirectoryBrowseCallback cb) = 0; @@ -749,7 +751,7 @@ blocking fashion on the current thread. :param str path: The path to query the contents of. :param bool synchronous: If a capture is open, then ``True`` will use :meth:`BlockInvoke` to call the callback. Otherwise if ``False`` then :meth:`AsyncInvoke` will be used. -:param DirectoryBrowseMethod method: The function to callback on the replay thread. +:param DirectoryBrowseCallback method: The function to callback on the replay thread. )"); virtual void ListFolder(const rdcstr &path, bool synchronous, DirectoryBrowseCallback cb) = 0; @@ -946,18 +948,18 @@ BITMASK_OPERATORS(CaptureModifications); DOCUMENT("A description of a bookmark on an event"); struct EventBookmark { - DOCUMENT("The EID at which this bookmark is placed."); - uint32_t EID = 0; + DOCUMENT("The :data:`eventId ` at which this bookmark is placed."); + uint32_t eventId = 0; DOCUMENT("The text associated with this bookmark - could be empty"); rdcstr text; DOCUMENT(""); EventBookmark() = default; - EventBookmark(uint32_t e) : EID(e) {} - bool operator==(const EventBookmark &o) { return EID == o.EID; } - bool operator!=(const EventBookmark &o) const { return EID != o.EID; } - bool operator<(const EventBookmark &o) const { return EID < o.EID; } + EventBookmark(uint32_t e) : eventId(e) {} + bool operator==(const EventBookmark &o) { return eventId == o.eventId; } + bool operator!=(const EventBookmark &o) const { return eventId != o.eventId; } + bool operator<(const EventBookmark &o) const { return eventId < o.eventId; } }; DECLARE_REFLECTION_STRUCT(EventBookmark); @@ -990,7 +992,7 @@ data. If the capture was temporary, this save action means it is no longer temporary and will be treated like any other capture. -Any modifications to the capture (see :meth:`GetCaptureModifcations`) will be applied at the same +Any modifications to the capture (see :meth:`GetCaptureModifications`) will be applied at the same time. :param str captureFile: The path to save the capture file to. @@ -1009,15 +1011,15 @@ time. :param list exclude: A list of :class:`CaptureViewer` to exclude from being notified of this, to stop infinite recursion. -:param int selectedEventID: The selected :data:`EID `. See +:param int selectedEventId: The selected :data:`eventId `. See :meth:`CaptureViewer.OnSelectedEventChanged` for more information. -:param int eventID: The new current :data:`EID `. See +:param int eventId: The new current :data:`eventId `. See :meth:`CaptureViewer.OnEventChanged` for more information. :param bool force: Optional parameter, if ``True`` then the replay will 'move' even if it is moving - to the same :data:`EID ` as it's currently on. + to the same :data:`eventId ` as it's currently on. )"); - virtual void SetEventID(const rdcarray &exclude, uint32_t selectedEventID, - uint32_t eventID, bool force = false) = 0; + virtual void SetEventID(const rdcarray &exclude, uint32_t selectedEventId, + uint32_t eventId, bool force = false) = 0; DOCUMENT(R"(Replay the capture to the current event again, to pick up any changes that might have been made. )"); @@ -1105,7 +1107,7 @@ the UI which aren't reflected in the capture file on disk. )"); virtual const APIProperties &APIProps() = 0; - DOCUMENT(R"(Retrieve the currently selected :data:`EID `. + DOCUMENT(R"(Retrieve the currently selected :data:`eventId `. In most cases, prefer using :meth:`CurEvent`. See :meth:`CaptureViewer.OnSelectedEventChanged` for more information for how this differs. @@ -1115,7 +1117,7 @@ information for how this differs. )"); virtual uint32_t CurSelectedEvent() = 0; - DOCUMENT(R"(Retrieve the current :data:`EID `. + DOCUMENT(R"(Retrieve the current :data:`eventId `. :return: The current event. :rtype: ``int`` @@ -1269,14 +1271,14 @@ considered out of date virtual const rdcarray &GetBuffers() = 0; DOCUMENT(R"(Retrieve the information about a drawcall at a given -:data:`EID `. +:data:`eventId `. -:param int id: The :data:`EID ` to query for. +:param int id: The :data:`eventId ` to query for. :return: The information about the drawcall, or ``None`` if the - :data:`EID ` doesn't correspond to a drawcall. + :data:`eventId ` doesn't correspond to a drawcall. :rtype: ~renderdoc.BufferDescription )"); - virtual const DrawcallDescription *GetDrawcall(uint32_t eventID) = 0; + virtual const DrawcallDescription *GetDrawcall(uint32_t eventId) = 0; DOCUMENT(R"(Retrieve the :class:`~renderdoc.SDFile` for the currently open capture. @@ -1293,7 +1295,7 @@ considered out of date virtual WindowingSystem CurWindowingSystem() = 0; DOCUMENT(R"(Create an opaque pointer suitable for passing to -:meth:`~ReplayController.CreateOutput` or other functions that expect windowing data. +:meth:`~renderdoc.ReplayController.CreateOutput` or other functions that expect windowing data. .. note:: @@ -1353,32 +1355,32 @@ See :meth:`GetNotes` for a list of possible common field keys. virtual void SetNotes(const rdcstr &key, const rdcstr &contents) = 0; DOCUMENT(R"(Get the current list of bookmarks in the capture. Each bookmark is associated with an -EID and has some text attached. There will only be at most one bookmark for any given EID. +eventId and has some text attached. There will only be at most one bookmark for any given eventId. -The list of bookmarks is not necessarily sorted by EID. Thus, bookmark 1 is always bookmark 1 until -it is removed, the indices do not shift as new bookmarks are added or removed. +The list of bookmarks is not necessarily sorted by eventId. Thus, bookmark 1 is always bookmark 1 +until it is removed, the indices do not shift as new bookmarks are added or removed. :return: The currently set bookmarks. -:rtype: ``list`` of :class:`BookMark` +:rtype: ``list`` of :class:`EventBookmark` )"); virtual rdcarray GetBookmarks() = 0; DOCUMENT(R"(Set or update a bookmark. -A bookmark will be added at the specified EID, or if one already exists then the attached text will -be replaced. +A bookmark will be added at the specified eventId, or if one already exists then the attached text +will be replaced. -:param Bookmark mark: The bookmark to add. +:param EventBookmark mark: The bookmark to add. )"); virtual void SetBookmark(const EventBookmark &mark) = 0; - DOCUMENT(R"(Remove a bookmark at a given EID. + DOCUMENT(R"(Remove a bookmark at a given eventId. If no bookmark exists, this function will do nothing. -:param int EID: The EID of the bookmark to remove. +:param int eventId: The eventId of the bookmark to remove. )"); - virtual void RemoveBookmark(uint32_t EID) = 0; + virtual void RemoveBookmark(uint32_t eventId) = 0; DOCUMENT(R"(Retrieve the current singleton :class:`MainWindow`. @@ -1499,14 +1501,14 @@ If no bookmark exists, this function will do nothing. )"); virtual bool HasTextureViewer() = 0; - DOCUMENT(R"(Check if there is a current :class:`PipelineViewer` open. + DOCUMENT(R"(Check if there is a current :class:`PipelineStateViewer` open. :return: ``True`` if there is a window open. :rtype: ``bool`` )"); virtual bool HasPipelineViewer() = 0; - DOCUMENT(R"(Check if there is a current :class:`MeshPreview` open. + DOCUMENT(R"(Check if there is a current mesh previewing :class:`BufferViewer` open. :return: ``True`` if there is a window open. :rtype: ``bool`` @@ -1575,9 +1577,12 @@ If no bookmark exists, this function will do nothing. virtual void ShowAPIInspector() = 0; DOCUMENT("Raise the current :class:`TextureViewer`, showing it in the default place if needed."); virtual void ShowTextureViewer() = 0; - DOCUMENT("Raise the current :class:`MeshPreview`, showing it in the default place if needed."); + DOCUMENT(R"(Raise the current mesh previewing :class:`BufferViewer`, showing it in the default +place if needed. +)"); virtual void ShowMeshPreview() = 0; - DOCUMENT("Raise the current :class:`PipelineViewer`, showing it in the default place if needed."); + DOCUMENT( + "Raise the current :class:`PipelineStateViewer`, showing it in the default place if needed."); virtual void ShowPipelineViewer() = 0; DOCUMENT("Raise the current :class:`CaptureDialog`, showing it in the default place if needed."); virtual void ShowCaptureDialog() = 0; @@ -1628,7 +1633,7 @@ through the execution of a given shader. bound to. :param ~renderdoc.ShaderDebugTrace trace: The execution trace of the debugged shader. :param str debugContext: A human-readable context string describing which invocation of this shader - was debugged. For example 'Pixel 12,34 at EID 678'. + was debugged. For example 'Pixel 12,34 at eventId 678'. :return: The new :class:`ShaderViewer` window opened, but not shown. :rtype: ShaderViewer )"); @@ -1738,31 +1743,31 @@ currently docked. virtual void AddDockWindow(QWidget *newWindow, DockReference ref, QWidget *refWindow, float percentage = 0.5f) = 0; - DOCUMENT(R"(Retrieve the current :class:`~renderdoc.D3D11_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`~renderdoc.D3D11State` pipeline state. :return: The current D3D11 pipeline state. -:rtype: ~renderdoc.D3D11_State +:rtype: ~renderdoc.D3D11State )"); virtual const D3D11Pipe::State &CurD3D11PipelineState() = 0; - DOCUMENT(R"(Retrieve the current :class:`~renderdoc.D3D12_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`~renderdoc.D3D12State` pipeline state. :return: The current D3D12 pipeline state. -:rtype: ~renderdoc.D3D12_State +:rtype: ~renderdoc.D3D12State )"); virtual const D3D12Pipe::State &CurD3D12PipelineState() = 0; - DOCUMENT(R"(Retrieve the current :class:`~renderdoc.GL_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`~renderdoc.GLState` pipeline state. :return: The current OpenGL pipeline state. -:rtype: ~renderdoc.GL_State +:rtype: ~renderdoc.GLState )"); virtual const GLPipe::State &CurGLPipelineState() = 0; - DOCUMENT(R"(Retrieve the current :class:`~renderdoc.VK_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`~renderdoc.VKState` pipeline state. :return: The current Vulkan pipeline state. -:rtype: ~renderdoc.VK_State +:rtype: ~renderdoc.VKState )"); virtual const VKPipe::State &CurVulkanPipelineState() = 0; diff --git a/qrenderdoc/Code/Interface/RemoteHost.cpp b/qrenderdoc/Code/Interface/RemoteHost.cpp index 4cea8ef1a..e0d72f9b1 100644 --- a/qrenderdoc/Code/Interface/RemoteHost.cpp +++ b/qrenderdoc/Code/Interface/RemoteHost.cpp @@ -29,65 +29,65 @@ RemoteHost::RemoteHost() { - ServerRunning = Connected = Busy = VersionMismatch = false; + serverRunning = connected = busy = versionMismatch = false; } RemoteHost::RemoteHost(const QVariant &var) { QVariantMap map = var.toMap(); - if(map.contains(lit("Hostname"))) - Hostname = map[lit("Hostname")].toString(); - if(map.contains(lit("FriendlyName"))) - FriendlyName = map[lit("FriendlyName")].toString(); - if(map.contains(lit("RunCommand"))) - RunCommand = map[lit("RunCommand")].toString(); + if(map.contains(lit("hostname"))) + hostname = map[lit("hostname")].toString(); + if(map.contains(lit("friendlyName"))) + friendlyName = map[lit("friendlyName")].toString(); + if(map.contains(lit("runCommand"))) + runCommand = map[lit("runCommand")].toString(); - ServerRunning = Connected = Busy = VersionMismatch = false; + serverRunning = connected = busy = versionMismatch = false; } RemoteHost::operator QVariant() const { QVariantMap map; - map[lit("Hostname")] = Hostname; - map[lit("FriendlyName")] = FriendlyName; - map[lit("RunCommand")] = RunCommand; + map[lit("hostname")] = hostname; + map[lit("friendlyName")] = friendlyName; + map[lit("runCommand")] = runCommand; return map; } void RemoteHost::CheckStatus() { // special case - this is the local context - if(Hostname == "localhost") + if(hostname == "localhost") { - ServerRunning = false; - VersionMismatch = Busy = false; + serverRunning = false; + versionMismatch = busy = false; return; } IRemoteServer *rend = NULL; - ReplayStatus status = RENDERDOC_CreateRemoteServerConnection(Hostname.c_str(), 0, &rend); + ReplayStatus status = RENDERDOC_CreateRemoteServerConnection(hostname.c_str(), 0, &rend); if(status == ReplayStatus::Succeeded) { - ServerRunning = true; - VersionMismatch = Busy = false; + serverRunning = true; + versionMismatch = busy = false; } else if(status == ReplayStatus::NetworkRemoteBusy) { - ServerRunning = true; - Busy = true; - VersionMismatch = false; + serverRunning = true; + busy = true; + versionMismatch = false; } else if(status == ReplayStatus::NetworkVersionMismatch) { - ServerRunning = true; - Busy = true; - VersionMismatch = true; + serverRunning = true; + busy = true; + versionMismatch = true; } else { - ServerRunning = false; - VersionMismatch = Busy = false; + serverRunning = false; + versionMismatch = busy = false; } if(rend) @@ -106,15 +106,15 @@ void RemoteHost::Launch() { int WAIT_TIME = 2000; - if(IsHostADB()) + if(IsADB()) { - RENDERDOC_StartAndroidRemoteServer(Hostname.c_str()); + RENDERDOC_StartAndroidRemoteServer(hostname.c_str()); QThread::msleep(WAIT_TIME); return; } RDProcess process; - process.start(RunCommand); + process.start(runCommand); process.waitForFinished(WAIT_TIME); process.detach(); } diff --git a/qrenderdoc/Code/Interface/RemoteHost.h b/qrenderdoc/Code/Interface/RemoteHost.h index 84cbd4e38..256692ac8 100644 --- a/qrenderdoc/Code/Interface/RemoteHost.h +++ b/qrenderdoc/Code/Interface/RemoteHost.h @@ -40,36 +40,36 @@ public: DOCUMENT( "Ping the host to check current status - if the server is running, connection status, etc."); void CheckStatus(); - DOCUMENT("Runs the command specified in :data:`RunCommand`."); + DOCUMENT("Runs the command specified in :data:`runCommand`."); void Launch(); DOCUMENT("``True`` if a remote server is currently running on this host."); - bool ServerRunning : 1; + bool serverRunning : 1; DOCUMENT("``True`` if an active connection exists to this remote server."); - bool Connected : 1; + bool connected : 1; DOCUMENT("``True`` if someone else is currently connected to this server."); - bool Busy : 1; + bool busy : 1; DOCUMENT("``True`` if there is a code version mismatch with this server."); - bool VersionMismatch : 1; + bool versionMismatch : 1; DOCUMENT("The hostname of this host."); - rdcstr Hostname; + rdcstr hostname; DOCUMENT("The friendly name for this host, if available (if empty, the Hostname is used)."); - rdcstr FriendlyName; + rdcstr friendlyName; DOCUMENT("The command to run locally to try to launch the server remotely."); - rdcstr RunCommand; + rdcstr runCommand; DOCUMENT(R"( -Returns the name to display for this host in the UI, either :data:`FriendlyName` or :data:`Hostname` +Returns the name to display for this host in the UI, either :data:`friendlyName` or :data:`hostname` )"); - const rdcstr &Name() const { return !FriendlyName.isEmpty() ? FriendlyName : Hostname; } + const rdcstr &Name() const { return !friendlyName.isEmpty() ? friendlyName : hostname; } DOCUMENT("Returns ``True`` if this host represents a connected ADB (Android) device."); - bool IsHostADB() const + bool IsADB() const { - return Hostname[0] == 'a' && Hostname[1] == 'd' && Hostname[2] == 'b' && Hostname[3] == ':'; + return hostname[0] == 'a' && hostname[1] == 'd' && hostname[2] == 'b' && hostname[3] == ':'; } DOCUMENT("Returns ``True`` if this host represents the special localhost device."); - bool IsLocalhost() const { return Hostname == "localhost"; } + bool IsLocalhost() const { return hostname == "localhost"; } }; DECLARE_REFLECTION_STRUCT(RemoteHost); \ No newline at end of file diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 9c57389db..5e6c85478 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -604,12 +604,12 @@ void CombineUsageEvents(ICaptureContext &ctx, const rdcarray &usage, { if(start == 0) { - start = end = u.eventID; + start = end = u.eventId; us = u.usage; continue; } - const DrawcallDescription *draw = ctx.GetDrawcall(u.eventID); + const DrawcallDescription *draw = ctx.GetDrawcall(u.eventId); bool distinct = false; @@ -627,7 +627,7 @@ void CombineUsageEvents(ICaptureContext &ctx, const rdcarray &usage, // entry in the context menu const DrawcallDescription *prev = ctx.GetDrawcall(draw->previous); - while(prev != NULL && prev->eventID > end) + while(prev != NULL && prev->eventId > end) { if(!(prev->flags & (DrawFlags::Dispatch | DrawFlags::Drawcall | DrawFlags::CmdList))) { @@ -647,11 +647,11 @@ void CombineUsageEvents(ICaptureContext &ctx, const rdcarray &usage, if(distinct) { callback(start, end, us); - start = end = u.eventID; + start = end = u.eventId; us = u.usage; } - end = u.eventID; + end = u.eventId; } if(start != 0) diff --git a/qrenderdoc/Code/ReplayManager.cpp b/qrenderdoc/Code/ReplayManager.cpp index a9145baee..2c57da2f2 100644 --- a/qrenderdoc/Code/ReplayManager.cpp +++ b/qrenderdoc/Code/ReplayManager.cpp @@ -300,9 +300,9 @@ void ReplayManager::CloseThread() ReplayStatus ReplayManager::ConnectToRemoteServer(RemoteHost *host) { - ReplayStatus status = RENDERDOC_CreateRemoteServerConnection(host->Hostname.c_str(), 0, &m_Remote); + ReplayStatus status = RENDERDOC_CreateRemoteServerConnection(host->hostname.c_str(), 0, &m_Remote); - if(host->IsHostADB()) + if(host->IsADB()) { ANALYTIC_SET(UIFeatures.RemoteReplay.Android, true); } @@ -315,7 +315,7 @@ ReplayStatus ReplayManager::ConnectToRemoteServer(RemoteHost *host) if(status == ReplayStatus::Succeeded) { - m_RemoteHost->Connected = true; + m_RemoteHost->connected = true; return status; } @@ -325,7 +325,7 @@ ReplayStatus ReplayManager::ConnectToRemoteServer(RemoteHost *host) void ReplayManager::DisconnectFromRemoteServer() { if(m_RemoteHost) - m_RemoteHost->Connected = false; + m_RemoteHost->connected = false; if(m_Remote) { @@ -358,7 +358,7 @@ void ReplayManager::PingRemote() if(!IsRunning() || m_Thread->isCurrentThread()) { if(!m_Remote->Ping()) - m_RemoteHost->ServerRunning = false; + m_RemoteHost->serverRunning = false; } m_RemoteLock.unlock(); } diff --git a/qrenderdoc/Code/pyrenderdoc/qrenderdoc.i b/qrenderdoc/Code/pyrenderdoc/qrenderdoc.i index 5dd86e7d7..be9de6866 100644 --- a/qrenderdoc/Code/pyrenderdoc/qrenderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/qrenderdoc.i @@ -82,7 +82,7 @@ DOCUMENT(""); TEMPLATE_ARRAY_INSTANTIATE(rdcarray, EventBookmark) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, SPIRVDisassembler) -TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundBuffer) +TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundVBuffer) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, VertexInputAttribute) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundResource) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundResourceArray) diff --git a/qrenderdoc/Code/pyrenderdoc/renderdoc.i b/qrenderdoc/Code/pyrenderdoc/renderdoc.i index 7e05b9e8b..dbb832203 100644 --- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i @@ -42,12 +42,13 @@ %rename("%(regex:/^I([A-Z].*)/\\1/)s", %$isclass) ""; // Since SWIG will inline all namespaces, and doesn't support nested structs, the namespaces -// for each pipeline state causes conflicts. We just fall back to a rename with _ as that's -// still acceptable/intuitive. -%rename("%(regex:/^D3D11Pipe::(.*)/D3D11_\\1/)s", regextarget=1, fullname=1, %$isclass) "D3D11Pipe::.*"; -%rename("%(regex:/^D3D12Pipe::(.*)/D3D12_\\1/)s", regextarget=1, fullname=1, %$isclass) "D3D12Pipe::.*"; -%rename("%(regex:/^GLPipe::(.*)/GL_\\1/)s", regextarget=1, fullname=1, %$isclass) "GLPipe::.*"; -%rename("%(regex:/^VKPipe::(.*)/VK_\\1/)s", regextarget=1, fullname=1, %$isclass) "VKPipe::.*"; +// for each pipeline state causes conflicts. We just fall back to a rename with just a concatenated +// prefix as that's still acceptable/intuitive. We don't have a _ as that's less pythonic naming +// (not that we follow python naming perfectly) +%rename("%(regex:/^D3D11Pipe::(.*)/D3D11\\1/)s", regextarget=1, fullname=1, %$isclass) "D3D11Pipe::.*"; +%rename("%(regex:/^D3D12Pipe::(.*)/D3D12\\1/)s", regextarget=1, fullname=1, %$isclass) "D3D12Pipe::.*"; +%rename("%(regex:/^GLPipe::(.*)/GL\\1/)s", regextarget=1, fullname=1, %$isclass) "GLPipe::.*"; +%rename("%(regex:/^VKPipe::(.*)/VK\\1/)s", regextarget=1, fullname=1, %$isclass) "VKPipe::.*"; %begin %{ @@ -161,6 +162,7 @@ TEMPLATE_ARRAY_DECLARE(rdcarray); %include "structured_data.h" %include "capture_options.h" %include "control_types.h" +%include "common_pipestate.h" %include "d3d11_pipestate.h" %include "d3d12_pipestate.h" %include "data_types.h" @@ -198,7 +200,7 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, DrawcallDescription) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, GPUCounter) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CounterResult) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, APIEvent) -TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BindpointMap) +TEMPLATE_ARRAY_INSTANTIATE(rdcarray, Bindpoint) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BufferDescription) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CaptureFileFormat) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ConstantBlock) @@ -219,49 +221,42 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ShaderVariable) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, SigParameter) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, TextureDescription) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ShaderEntryPoint) +TEMPLATE_ARRAY_INSTANTIATE(rdcarray, Viewport) +TEMPLATE_ARRAY_INSTANTIATE(rdcarray, Scissor) +TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ColorBlend) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, Attachment) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, BindingElement) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, Blend) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, DescriptorBinding) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, DescriptorSet) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, ImageData) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, ImageLayout) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, SpecInfo) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VB) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, SpecializationConstant) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VertexBuffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VertexAttribute) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VertexBinding) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, ViewportScissor) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Blend) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, CBuffer) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, ConstantBuffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Layout) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Sampler) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Scissor) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, SOBind) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, VB) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, StreamOutBind) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, VertexBuffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, View) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Viewport) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Blend) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, CBuffer) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ConstantBuffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Layout) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, RegisterSpace) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ResourceData) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ResourceState) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Sampler) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Scissor) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, SOBind) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, VB) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, StreamOutBind) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, VertexBuffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, View) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Viewport) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Attachment) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Blend) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Buffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, ImageLoadStore) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Sampler) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Scissor) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Texture) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VB) +TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VertexBuffer) TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VertexAttribute) -TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Viewport) /////////////////////////////////////////////////////////////////////////////////////////// // declare a function for passing external objects into python diff --git a/qrenderdoc/Windows/APIInspector.cpp b/qrenderdoc/Windows/APIInspector.cpp index a4ca83ee7..8c5caf6e0 100644 --- a/qrenderdoc/Windows/APIInspector.cpp +++ b/qrenderdoc/Windows/APIInspector.cpp @@ -66,7 +66,7 @@ void APIInspector::OnCaptureClosed() ui->callstack->clear(); } -void APIInspector::OnSelectedEventChanged(uint32_t eventID) +void APIInspector::OnSelectedEventChanged(uint32_t eventId) { ui->apiEvents->clearSelection(); @@ -138,7 +138,7 @@ void APIInspector::fillAPIView() { for(const APIEvent &ev : draw->events) { - RDTreeWidgetItem *root = new RDTreeWidgetItem({QString::number(ev.eventID), QString()}); + RDTreeWidgetItem *root = new RDTreeWidgetItem({QString::number(ev.eventId), QString()}); if(ev.chunkIndex < file.chunks.size()) { @@ -153,7 +153,7 @@ void APIInspector::fillAPIView() root->setText(1, tr("Invalid chunk index %1").arg(ev.chunkIndex)); } - if(ev.eventID == draw->eventID) + if(ev.eventId == draw->eventId) root->setBold(true); root->setTag(QVariant::fromValue(ev)); diff --git a/qrenderdoc/Windows/APIInspector.h b/qrenderdoc/Windows/APIInspector.h index 7106fd169..6bd701b2c 100644 --- a/qrenderdoc/Windows/APIInspector.h +++ b/qrenderdoc/Windows/APIInspector.h @@ -48,8 +48,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override; - void OnEventChanged(uint32_t eventID) override {} + void OnSelectedEventChanged(uint32_t eventId) override; + void OnEventChanged(uint32_t eventId) override {} public slots: void on_apiEvents_itemSelectionChanged(); diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 24d5118fd..dac878537 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -859,15 +859,15 @@ private: { if(el.format.compType == CompType::Float) { - return interpretVariant(QVariant(generics[col].value_f[comp]), el); + return interpretVariant(QVariant(generics[col].floatValue[comp]), el); } else if(el.format.compType == CompType::SInt) { - return interpretVariant(QVariant(generics[col].value_i[comp]), el); + return interpretVariant(QVariant(generics[col].intValue[comp]), el); } else if(el.format.compType == CompType::UInt) { - return interpretVariant(QVariant(generics[col].value_u[comp]), el); + return interpretVariant(QVariant(generics[col].uintValue[comp]), el); } } @@ -1379,7 +1379,7 @@ void BufferViewer::OnCaptureClosed() ToolWindowManager::closeToolWindow(this); } -void BufferViewer::OnEventChanged(uint32_t eventID) +void BufferViewer::OnEventChanged(uint32_t eventId) { int vsinHoriz = ui->vsinData->horizontalScrollBar()->value(); int vsoutHoriz = ui->vsoutData->horizontalScrollBar()->value(); @@ -1554,13 +1554,13 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) { const DrawcallDescription *draw = m_Ctx.CurDrawcall(); - BoundBuffer ib = m_Ctx.CurPipelineState().GetIBuffer(); + BoundVBuffer ib = m_Ctx.CurPipelineState().GetIBuffer(); - rdcarray vbs = m_Ctx.CurPipelineState().GetVBuffers(); + rdcarray vbs = m_Ctx.CurPipelineState().GetVBuffers(); bytebuf idata; - if(ib.Buffer != ResourceId() && draw && (draw->flags & DrawFlags::UseIBuffer)) - idata = r->GetBufferData(ib.Buffer, ib.ByteOffset + draw->indexOffset * draw->indexByteWidth, + if(ib.resourceId != ResourceId() && draw && (draw->flags & DrawFlags::UseIBuffer)) + idata = r->GetBufferData(ib.resourceId, ib.byteOffset + draw->indexOffset * draw->indexByteWidth, draw->numIndices * draw->indexByteWidth); uint32_t *indices = NULL; @@ -1631,7 +1631,7 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) } int vbIdx = 0; - for(BoundBuffer vb : vbs) + for(BoundVBuffer vb : vbs) { bool used = false; bool pi = false; @@ -1678,13 +1678,13 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) BufferData *buf = new BufferData; if(used) { - bytebuf bufdata = r->GetBufferData(vb.Buffer, vb.ByteOffset + offset * vb.ByteStride, - (maxIdx + 1) * vb.ByteStride); + bytebuf bufdata = r->GetBufferData(vb.resourceId, vb.byteOffset + offset * vb.byteStride, + (maxIdx + 1) * vb.byteStride); buf->data = new byte[bufdata.size()]; memcpy(buf->data, bufdata.data(), bufdata.size()); buf->end = buf->data + bufdata.size(); - buf->stride = vb.ByteStride; + buf->stride = vb.byteStride; } // ref passes to model m_ModelVSIn->buffers.push_back(buf); @@ -1692,10 +1692,10 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) m_PostVS = r->GetPostVSData(m_Config.curInstance, MeshDataStage::VSOut); - m_ModelVSOut->numRows = m_PostVS.numVerts; + m_ModelVSOut->numRows = m_PostVS.numIndices; - if(draw && m_PostVS.idxbuf != ResourceId() && (draw->flags & DrawFlags::UseIBuffer)) - idata = r->GetBufferData(m_PostVS.idxbuf, 0, draw->numIndices * draw->indexByteWidth); + if(draw && m_PostVS.indexResourceId != ResourceId() && (draw->flags & DrawFlags::UseIBuffer)) + idata = r->GetBufferData(m_PostVS.indexResourceId, 0, draw->numIndices * draw->indexByteWidth); indices = NULL; if(m_ModelVSOut->indices) @@ -1734,15 +1734,15 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) } } - if(m_PostVS.buf != ResourceId()) + if(m_PostVS.vertexResourceId != ResourceId()) { BufferData *postvs = new BufferData; - bytebuf bufdata = r->GetBufferData(m_PostVS.buf, m_PostVS.offset, 0); + bytebuf bufdata = r->GetBufferData(m_PostVS.vertexResourceId, m_PostVS.vertexByteOffset, 0); postvs->data = new byte[bufdata.size()]; memcpy(postvs->data, bufdata.data(), bufdata.size()); postvs->end = postvs->data + bufdata.size(); - postvs->stride = m_PostVS.stride; + postvs->stride = m_PostVS.vertexByteStride; // ref passes to model m_ModelVSOut->buffers.push_back(postvs); @@ -1750,20 +1750,20 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) m_PostGS = r->GetPostVSData(m_Config.curInstance, MeshDataStage::GSOut); - m_ModelGSOut->numRows = m_PostGS.numVerts; + m_ModelGSOut->numRows = m_PostGS.numIndices; indices = NULL; m_ModelGSOut->indices = NULL; - if(m_PostGS.buf != ResourceId()) + if(m_PostGS.vertexResourceId != ResourceId()) { BufferData *postgs = new BufferData; - bytebuf bufdata = r->GetBufferData(m_PostGS.buf, m_PostGS.offset, 0); + bytebuf bufdata = r->GetBufferData(m_PostGS.vertexResourceId, m_PostGS.vertexByteOffset, 0); postgs->data = new byte[bufdata.size()]; memcpy(postgs->data, bufdata.data(), bufdata.size()); postgs->end = postgs->data + bufdata.size(); - postgs->stride = m_PostGS.stride; + postgs->stride = m_PostGS.vertexByteStride; // ref passes to model m_ModelGSOut->buffers.push_back(postgs); @@ -1772,12 +1772,12 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) if(!draw) return; - uint32_t eventID = draw->eventID; + uint32_t eventId = draw->eventId; bool calcNeeded = false; { QMutexLocker autolock(&m_BBoxLock); - calcNeeded = !m_BBoxes.contains(eventID); + calcNeeded = !m_BBoxes.contains(eventId); } if(!calcNeeded) @@ -1788,7 +1788,7 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) { QMutexLocker autolock(&m_BBoxLock); - m_BBoxes.insert(eventID, BBoxData()); + m_BBoxes.insert(eventId, BBoxData()); } CalcBoundingBoxData *bbox = new CalcBoundingBoxData; @@ -1797,7 +1797,7 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) bbox->inst = m_ModelVSIn->curInstance; bbox->baseVertex = draw->baseVertex; - bbox->eventID = eventID; + bbox->eventId = eventId; for(size_t i = 0; i < ARRAY_COUNT(bbox->input); i++) { @@ -1919,10 +1919,10 @@ void BufferViewer::updateBoundingBox(const CalcBoundingBoxData &bbox) { { QMutexLocker autolock(&m_BBoxLock); - m_BBoxes[bbox.eventID] = bbox.output; + m_BBoxes[bbox.eventId] = bbox.output; } - if(m_Ctx.CurEvent() == bbox.eventID) + if(m_Ctx.CurEvent() == bbox.eventId) UpdateMeshConfig(); resetArcball(); @@ -2094,7 +2094,7 @@ void BufferViewer::updatePreviewColumns() if(!m_MeshView) return; - rdcarray vbs = m_Ctx.CurPipelineState().GetVBuffers(); + rdcarray vbs = m_Ctx.CurPipelineState().GetVBuffers(); const DrawcallDescription *draw = m_Ctx.CurDrawcall(); if(draw) @@ -2108,35 +2108,35 @@ void BufferViewer::updatePreviewColumns() if(elIdx < 0 || elIdx >= m_ModelVSIn->columns.count()) elIdx = 0; - m_VSInPosition.numVerts = draw->numIndices; - m_VSInPosition.topo = draw->topology; - m_VSInPosition.idxByteWidth = draw->indexByteWidth; + m_VSInPosition.numIndices = draw->numIndices; + m_VSInPosition.topology = draw->topology; + m_VSInPosition.indexByteStride = draw->indexByteWidth; m_VSInPosition.baseVertex = draw->baseVertex; - BoundBuffer ib = m_Ctx.CurPipelineState().GetIBuffer(); - m_VSInPosition.idxbuf = ib.Buffer; - m_VSInPosition.idxoffs = ib.ByteOffset + draw->indexOffset * draw->indexByteWidth; + BoundVBuffer ib = m_Ctx.CurPipelineState().GetIBuffer(); + m_VSInPosition.indexResourceId = ib.resourceId; + m_VSInPosition.indexByteOffset = ib.byteOffset + draw->indexOffset * draw->indexByteWidth; - if((draw->flags & DrawFlags::UseIBuffer) && m_VSInPosition.idxByteWidth == 0) - m_VSInPosition.idxByteWidth = 4U; + if((draw->flags & DrawFlags::UseIBuffer) && m_VSInPosition.indexByteStride == 0) + m_VSInPosition.indexByteStride = 4U; { const FormatElement &el = m_ModelVSIn->columns[elIdx]; if(el.buffer < vbs.count()) { - m_VSInPosition.buf = vbs[el.buffer].Buffer; - m_VSInPosition.stride = vbs[el.buffer].ByteStride; - m_VSInPosition.offset = - vbs[el.buffer].ByteOffset + el.offset + draw->vertexOffset * m_VSInPosition.stride; + m_VSInPosition.vertexResourceId = vbs[el.buffer].resourceId; + m_VSInPosition.vertexByteStride = vbs[el.buffer].byteStride; + m_VSInPosition.vertexByteOffset = vbs[el.buffer].byteOffset + el.offset + + draw->vertexOffset * m_VSInPosition.vertexByteStride; } else { - m_VSInPosition.buf = ResourceId(); - m_VSInPosition.stride = 0; - m_VSInPosition.offset = 0; + m_VSInPosition.vertexResourceId = ResourceId(); + m_VSInPosition.vertexByteStride = 0; + m_VSInPosition.vertexByteOffset = 0; } - m_VSInPosition.fmt = el.format; + m_VSInPosition.format = el.format; } elIdx = m_ModelVSIn->secondaryColumn(); @@ -2147,19 +2147,19 @@ void BufferViewer::updatePreviewColumns() if(el.buffer < vbs.count()) { - m_VSInSecondary.buf = vbs[el.buffer].Buffer; - m_VSInSecondary.stride = vbs[el.buffer].ByteStride; - m_VSInSecondary.offset = - vbs[el.buffer].ByteOffset + el.offset + draw->vertexOffset * m_VSInSecondary.stride; + m_VSInSecondary.vertexResourceId = vbs[el.buffer].resourceId; + m_VSInSecondary.vertexByteStride = vbs[el.buffer].byteStride; + m_VSInSecondary.vertexByteOffset = vbs[el.buffer].byteOffset + el.offset + + draw->vertexOffset * m_VSInSecondary.vertexByteStride; } else { - m_VSInSecondary.buf = ResourceId(); - m_VSInSecondary.stride = 0; - m_VSInSecondary.offset = 0; + m_VSInSecondary.vertexResourceId = ResourceId(); + m_VSInSecondary.vertexByteStride = 0; + m_VSInSecondary.vertexByteOffset = 0; } - m_VSInSecondary.fmt = el.format; + m_VSInSecondary.format = el.format; m_VSInSecondary.showAlpha = m_ModelVSIn->secondaryAlpha(); } } @@ -2174,14 +2174,14 @@ void BufferViewer::updatePreviewColumns() elIdx = 0; m_PostVSPosition = m_PostVS; - m_PostVSPosition.offset += m_ModelVSOut->columns[elIdx].offset; + m_PostVSPosition.vertexByteOffset += m_ModelVSOut->columns[elIdx].offset; elIdx = m_ModelVSOut->secondaryColumn(); if(elIdx >= 0 && elIdx < m_ModelVSOut->columns.count()) { m_PostVSSecondary = m_PostVS; - m_PostVSSecondary.offset += m_ModelVSOut->columns[elIdx].offset; + m_PostVSSecondary.vertexByteOffset += m_ModelVSOut->columns[elIdx].offset; m_PostVSSecondary.showAlpha = m_ModelVSOut->secondaryAlpha(); } } @@ -2196,22 +2196,22 @@ void BufferViewer::updatePreviewColumns() elIdx = 0; m_PostGSPosition = m_PostGS; - m_PostGSPosition.offset += m_ModelGSOut->columns[elIdx].offset; + m_PostGSPosition.vertexByteOffset += m_ModelGSOut->columns[elIdx].offset; elIdx = m_ModelGSOut->secondaryColumn(); if(elIdx >= 0 && elIdx < m_ModelGSOut->columns.count()) { m_PostGSSecondary = m_PostGS; - m_PostGSSecondary.offset += m_ModelGSOut->columns[elIdx].offset; + m_PostGSSecondary.vertexByteOffset += m_ModelGSOut->columns[elIdx].offset; m_PostGSSecondary.showAlpha = m_ModelGSOut->secondaryAlpha(); } } - m_PostGSPosition.idxByteWidth = 0; + m_PostGSPosition.indexByteStride = 0; if(!(draw->flags & DrawFlags::UseIBuffer)) - m_PostVSPosition.idxByteWidth = m_VSInPosition.idxByteWidth = 0; + m_PostVSPosition.indexByteStride = m_VSInPosition.indexByteStride = 0; m_PostGSPosition.unproject = true; m_PostVSPosition.unproject = !m_Ctx.CurPipelineState().IsTessellationEnabled(); @@ -2243,20 +2243,20 @@ void BufferViewer::configureMeshColumns() for(const VertexInputAttribute &a : vinputs) { - if(!a.Used) + if(!a.used) continue; - FormatElement f(a.Name, a.VertexBuffer, a.RelativeByteOffset, a.PerInstance, a.InstanceRate, + FormatElement f(a.name, a.vertexBuffer, a.byteOffset, a.perInstance, a.instanceRate, false, // row major matrix 1, // matrix dimension - a.Format, false, false); + a.format, false, false); m_ModelVSIn->genericsEnabled[m_ModelVSIn->columns.size()] = false; - if(a.GenericEnabled) + if(a.genericEnabled) { m_ModelVSIn->genericsEnabled[m_ModelVSIn->columns.size()] = true; - m_ModelVSIn->generics[m_ModelVSIn->columns.size()] = a.GenericValue; + m_ModelVSIn->generics[m_ModelVSIn->columns.size()] = a.genericValue; } m_ModelVSIn->columns.push_back(f); @@ -2270,7 +2270,7 @@ void BufferViewer::configureMeshColumns() Viewport vp = m_Ctx.CurPipelineState().GetViewport(0); m_Config.fov = ui->fovGuess->value(); - m_Config.aspect = vp.width / vp.height; + m_Config.aspect = (vp.width > 0.0f && vp.height > 0.0f) ? (vp.width / vp.height) : 1.0f; m_Config.highlightVert = 0; if(ui->aspectGuess->value() > 0.0) @@ -2288,10 +2288,10 @@ void BufferViewer::configureMeshColumns() if(draw && vs) { - m_ModelVSOut->columns.reserve(vs->OutputSig.count()); + m_ModelVSOut->columns.reserve(vs->outputSignature.count()); int i = 0, posidx = -1; - for(const SigParameter &sig : vs->OutputSig) + for(const SigParameter &sig : vs->outputSignature) { FormatElement f; @@ -2355,10 +2355,10 @@ void BufferViewer::configureMeshColumns() if(last) { - m_ModelGSOut->columns.reserve(last->OutputSig.count()); + m_ModelGSOut->columns.reserve(last->outputSignature.count()); int i = 0, posidx = -1; - for(const SigParameter &sig : last->OutputSig) + for(const SigParameter &sig : last->outputSignature) { FormatElement f; @@ -2474,12 +2474,12 @@ void BufferViewer::UpdateMeshConfig() { BBoxData bbox; - uint32_t eventID = m_Ctx.CurEvent(); + uint32_t eventId = m_Ctx.CurEvent(); { QMutexLocker autolocker(&m_BBoxLock); - if(m_BBoxes.contains(eventID)) - bbox = m_BBoxes[eventID]; + if(m_BBoxes.contains(eventId)) + bbox = m_BBoxes[eventId]; } m_Config.type = m_CurStage; @@ -2940,7 +2940,7 @@ void BufferViewer::camGuess_changed(double value) // take a guess for the aspect ratio, for if the user hasn't overridden it Viewport vp = m_Ctx.CurPipelineState().GetViewport(0); - m_Config.aspect = vp.width / vp.height; + m_Config.aspect = (vp.width > 0.0f && vp.height > 0.0f) ? (vp.width / vp.height) : 1.0f; if(ui->aspectGuess->value() > 0.0) m_Config.aspect = ui->aspectGuess->value(); diff --git a/qrenderdoc/Windows/BufferViewer.h b/qrenderdoc/Windows/BufferViewer.h index 2f6939cd4..1c2f38a74 100644 --- a/qrenderdoc/Windows/BufferViewer.h +++ b/qrenderdoc/Windows/BufferViewer.h @@ -84,8 +84,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; QVariant persistData(); void setPersistData(const QVariant &persistData); @@ -164,7 +164,7 @@ private: struct CalcBoundingBoxData { - uint32_t eventID; + uint32_t eventId; uint32_t inst; int32_t baseVertex; diff --git a/qrenderdoc/Windows/CommentView.cpp b/qrenderdoc/Windows/CommentView.cpp index e6171bc68..0324b3dc0 100644 --- a/qrenderdoc/Windows/CommentView.cpp +++ b/qrenderdoc/Windows/CommentView.cpp @@ -82,7 +82,7 @@ void CommentView::OnCaptureLoaded() m_ignoreModifications = false; } -void CommentView::OnEventChanged(uint32_t eventID) +void CommentView::OnEventChanged(uint32_t eventId) { QString oldText = QString::fromUtf8(m_commentsEditor->getText(m_commentsEditor->textLength() + 1)); QString newText = m_Ctx.GetNotes("comments"); diff --git a/qrenderdoc/Windows/CommentView.h b/qrenderdoc/Windows/CommentView.h index bf614d57c..c96287855 100644 --- a/qrenderdoc/Windows/CommentView.h +++ b/qrenderdoc/Windows/CommentView.h @@ -47,8 +47,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: diff --git a/qrenderdoc/Windows/ConstantBufferPreviewer.cpp b/qrenderdoc/Windows/ConstantBufferPreviewer.cpp index c3c3b38d2..bd8a72053 100644 --- a/qrenderdoc/Windows/ConstantBufferPreviewer.cpp +++ b/qrenderdoc/Windows/ConstantBufferPreviewer.cpp @@ -105,12 +105,12 @@ void ConstantBufferPreviewer::OnCaptureClosed() ToolWindowManager::closeToolWindow(this); } -void ConstantBufferPreviewer::OnEventChanged(uint32_t eventID) +void ConstantBufferPreviewer::OnEventChanged(uint32_t eventId) { BoundCBuffer cb = m_Ctx.CurPipelineState().GetConstantBuffer(m_stage, m_slot, m_arrayIdx); - m_cbuffer = cb.Buffer; - uint64_t offs = cb.ByteOffset; - uint64_t size = cb.ByteSize; + m_cbuffer = cb.resourceId; + uint64_t offs = cb.byteOffset; + uint64_t size = cb.byteSize; m_shader = m_Ctx.CurPipelineState().GetShader(m_stage); QString entryPoint = m_Ctx.CurPipelineState().GetShaderEntryPoint(m_stage); @@ -118,7 +118,7 @@ void ConstantBufferPreviewer::OnEventChanged(uint32_t eventID) updateLabels(); - if(reflection == NULL || m_slot >= reflection->ConstantBlocks.size()) + if(reflection == NULL || m_slot >= reflection->constantBlocks.size()) { setVariables({}); return; @@ -344,9 +344,9 @@ void ConstantBufferPreviewer::updateLabels() if(reflection != NULL) { - if(m_Ctx.IsAutogeneratedName(m_cbuffer) && m_slot < reflection->ConstantBlocks.size() && - !reflection->ConstantBlocks[m_slot].name.isEmpty()) - bufName = QFormatStr("<%1>").arg(reflection->ConstantBlocks[m_slot].name); + if(m_Ctx.IsAutogeneratedName(m_cbuffer) && m_slot < reflection->constantBlocks.size() && + !reflection->constantBlocks[m_slot].name.isEmpty()) + bufName = QFormatStr("<%1>").arg(reflection->constantBlocks[m_slot].name); } ui->nameLabel->setText(bufName); diff --git a/qrenderdoc/Windows/ConstantBufferPreviewer.h b/qrenderdoc/Windows/ConstantBufferPreviewer.h index 0a81826e1..5b7c5b345 100644 --- a/qrenderdoc/Windows/ConstantBufferPreviewer.h +++ b/qrenderdoc/Windows/ConstantBufferPreviewer.h @@ -53,8 +53,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: // automatic slots diff --git a/qrenderdoc/Windows/DebugMessageView.cpp b/qrenderdoc/Windows/DebugMessageView.cpp index 683a20456..d31e676f0 100644 --- a/qrenderdoc/Windows/DebugMessageView.cpp +++ b/qrenderdoc/Windows/DebugMessageView.cpp @@ -98,7 +98,7 @@ public: switch(col) { - case 0: return msg.eventID; + case 0: return msg.eventId; case 1: return ToQStr(msg.source); case 2: return ToQStr(msg.severity); case 3: return ToQStr(msg.category); @@ -111,7 +111,7 @@ public: if(index.isValid() && role == EIDRole && index.row() >= 0 && index.row() < m_Ctx.DebugMessages().count()) - return m_Ctx.DebugMessages()[index.row()].eventID; + return m_Ctx.DebugMessages()[index.row()].eventId; return QVariant(); } @@ -187,7 +187,7 @@ protected: const DebugMessage &leftMsg = m_Ctx.DebugMessages()[left.row()]; const DebugMessage &rightMsg = m_Ctx.DebugMessages()[right.row()]; - if(leftMsg.eventID < rightMsg.eventID) + if(leftMsg.eventId < rightMsg.eventId) return true; if(leftMsg.source < rightMsg.source) diff --git a/qrenderdoc/Windows/DebugMessageView.h b/qrenderdoc/Windows/DebugMessageView.h index 71f449505..7478e0abe 100644 --- a/qrenderdoc/Windows/DebugMessageView.h +++ b/qrenderdoc/Windows/DebugMessageView.h @@ -50,8 +50,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override {} + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override {} void RefreshMessageList(); private slots: diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index 91239f699..720a5b9dc 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -425,7 +425,7 @@ void CaptureDialog::CheckAndroidSetup(QString &filename) LambdaThread *scan = new LambdaThread([this, filename]() { - rdcstr host = m_Ctx.Replay().CurrentRemote()->Hostname; + rdcstr host = m_Ctx.Replay().CurrentRemote()->hostname; RENDERDOC_CheckAndroidPackage(host.c_str(), filename.toUtf8().data(), &m_AndroidFlags); const bool missingLibrary = bool(m_AndroidFlags & AndroidFlags::MissingLibrary); @@ -544,7 +544,7 @@ void CaptureDialog::androidWarn_mouseClick() // Call into layer push routine, then continue LambdaThread *push = new LambdaThread([this, exe, &pushSucceeded]() { - rdcstr host = m_Ctx.Replay().CurrentRemote()->Hostname; + rdcstr host = m_Ctx.Replay().CurrentRemote()->hostname; if(RENDERDOC_PushLayerToInstalledAndroidApp(host.c_str(), exe.toUtf8().data())) { // Sucess! @@ -609,7 +609,7 @@ void CaptureDialog::androidWarn_mouseClick() // call into APK pull, patch, install routine, then continue LambdaThread *patch = new LambdaThread([this, exe, &patchSucceeded, &progress]() { - rdcstr host = m_Ctx.Replay().CurrentRemote()->Hostname; + rdcstr host = m_Ctx.Replay().CurrentRemote()->hostname; if(RENDERDOC_AddLayerToAndroidPackage(host.c_str(), exe.toUtf8().data(), &progress)) { // Sucess! @@ -698,7 +698,7 @@ void CaptureDialog::on_exePathBrowse_clicked() { SetExecutableFilename(filename); - if(m_Ctx.Replay().CurrentRemote() && m_Ctx.Replay().CurrentRemote()->IsHostADB()) + if(m_Ctx.Replay().CurrentRemote() && m_Ctx.Replay().CurrentRemote()->IsADB()) { CheckAndroidSetup(filename); } @@ -831,7 +831,7 @@ void CaptureDialog::on_toggleGlobal_clicked() QString capturefile = m_Ctx.TempCaptureFilename(QFileInfo(exe).baseName()); bool success = RENDERDOC_StartGlobalHook(exe.toUtf8().data(), capturefile.toUtf8().data(), - Settings().Options); + Settings().options); if(!success) { @@ -907,30 +907,30 @@ void CaptureDialog::on_close_clicked() void CaptureDialog::SetSettings(CaptureSettings settings) { - SetInjectMode(settings.Inject); + SetInjectMode(settings.inject); - ui->exePath->setText(settings.Executable); - ui->workDirPath->setText(settings.WorkingDir); - ui->cmdline->setText(settings.CmdLine); + ui->exePath->setText(settings.executable); + ui->workDirPath->setText(settings.workingDir); + ui->cmdline->setText(settings.commandLine); - SetEnvironmentModifications(settings.Environment); + SetEnvironmentModifications(settings.environment); - ui->AllowFullscreen->setChecked(settings.Options.AllowFullscreen); - ui->AllowVSync->setChecked(settings.Options.AllowVSync); - ui->HookIntoChildren->setChecked(settings.Options.HookIntoChildren); - ui->CaptureCallstacks->setChecked(settings.Options.CaptureCallstacks); - ui->CaptureCallstacksOnlyDraws->setChecked(settings.Options.CaptureCallstacksOnlyDraws); - ui->APIValidation->setChecked(settings.Options.APIValidation); - ui->RefAllResources->setChecked(settings.Options.RefAllResources); - ui->SaveAllInitials->setChecked(settings.Options.SaveAllInitials); - ui->DelayForDebugger->setValue(settings.Options.DelayForDebugger); - ui->VerifyMapWrites->setChecked(settings.Options.VerifyMapWrites); - ui->AutoStart->setChecked(settings.AutoStart); + ui->AllowFullscreen->setChecked(settings.options.allowFullscreen); + ui->AllowVSync->setChecked(settings.options.allowVSync); + ui->HookIntoChildren->setChecked(settings.options.hookIntoChildren); + ui->CaptureCallstacks->setChecked(settings.options.captureCallstacks); + ui->CaptureCallstacksOnlyDraws->setChecked(settings.options.captureCallstacksOnlyDraws); + ui->APIValidation->setChecked(settings.options.apiValidation); + ui->RefAllResources->setChecked(settings.options.refAllResources); + ui->SaveAllInitials->setChecked(settings.options.saveAllInitials); + ui->DelayForDebugger->setValue(settings.options.delayForDebugger); + ui->VerifyMapWrites->setChecked(settings.options.verifyMapWrites); + ui->AutoStart->setChecked(settings.autoStart); // force flush this state on_CaptureCallstacks_toggled(ui->CaptureCallstacks->isChecked()); - if(settings.AutoStart) + if(settings.autoStart) { TriggerCapture(); } @@ -940,27 +940,27 @@ CaptureSettings CaptureDialog::Settings() { CaptureSettings ret; - ret.Inject = IsInjectMode(); + ret.inject = IsInjectMode(); - ret.AutoStart = ui->AutoStart->isChecked(); + ret.autoStart = ui->AutoStart->isChecked(); - ret.Executable = ui->exePath->text(); - ret.WorkingDir = ui->workDirPath->text(); - ret.CmdLine = ui->cmdline->text(); + ret.executable = ui->exePath->text(); + ret.workingDir = ui->workDirPath->text(); + ret.commandLine = ui->cmdline->text(); - ret.Environment = m_EnvModifications; + ret.environment = m_EnvModifications; - ret.Options.AllowFullscreen = ui->AllowFullscreen->isChecked(); - ret.Options.AllowVSync = ui->AllowVSync->isChecked(); - ret.Options.HookIntoChildren = ui->HookIntoChildren->isChecked(); - ret.Options.CaptureCallstacks = ui->CaptureCallstacks->isChecked(); - ret.Options.CaptureCallstacksOnlyDraws = ui->CaptureCallstacksOnlyDraws->isChecked(); - ret.Options.APIValidation = ui->APIValidation->isChecked(); - ret.Options.RefAllResources = ui->RefAllResources->isChecked(); - ret.Options.SaveAllInitials = ui->SaveAllInitials->isChecked(); - ret.Options.CaptureAllCmdLists = ui->CaptureAllCmdLists->isChecked(); - ret.Options.DelayForDebugger = (uint32_t)ui->DelayForDebugger->value(); - ret.Options.VerifyMapWrites = ui->VerifyMapWrites->isChecked(); + ret.options.allowFullscreen = ui->AllowFullscreen->isChecked(); + ret.options.allowVSync = ui->AllowVSync->isChecked(); + ret.options.hookIntoChildren = ui->HookIntoChildren->isChecked(); + ret.options.captureCallstacks = ui->CaptureCallstacks->isChecked(); + ret.options.captureCallstacksOnlyDraws = ui->CaptureCallstacksOnlyDraws->isChecked(); + ret.options.apiValidation = ui->APIValidation->isChecked(); + ret.options.refAllResources = ui->RefAllResources->isChecked(); + ret.options.saveAllInitials = ui->SaveAllInitials->isChecked(); + ret.options.captureAllCmdLists = ui->CaptureAllCmdLists->isChecked(); + ret.options.delayForDebugger = (uint32_t)ui->DelayForDebugger->value(); + ret.options.verifyMapWrites = ui->VerifyMapWrites->isChecked(); return ret; } @@ -1107,7 +1107,7 @@ void CaptureDialog::TriggerCapture() QString name = m_ProcessModel->data(m_ProcessModel->index(item.row(), 0)).toString(); uint32_t PID = m_ProcessModel->data(m_ProcessModel->index(item.row(), 1)).toUInt(); - m_InjectCallback(PID, Settings().Environment, name, Settings().Options, + m_InjectCallback(PID, Settings().environment, name, Settings().options, [this](LiveCapture *live) { if(ui->queueFrameCap->isChecked()) live->QueueCapture((int)ui->queuedFrame->value()); @@ -1144,7 +1144,7 @@ void CaptureDialog::TriggerCapture() QString cmdLine = ui->cmdline->text(); - m_CaptureCallback(exe, workingDir, cmdLine, Settings().Environment, Settings().Options, + m_CaptureCallback(exe, workingDir, cmdLine, Settings().environment, Settings().options, [this](LiveCapture *live) { if(ui->queueFrameCap->isChecked()) live->QueueCapture((int)ui->queuedFrame->value()); diff --git a/qrenderdoc/Windows/Dialogs/CrashDialog.cpp b/qrenderdoc/Windows/Dialogs/CrashDialog.cpp index c828aeb68..e9a9faabe 100644 --- a/qrenderdoc/Windows/Dialogs/CrashDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CrashDialog.cpp @@ -360,7 +360,7 @@ void CrashDialog::sendReport() if(!m_ReportID.isEmpty()) { BugReport bug; - bug.ID = m_ReportID; + bug.reportId = m_ReportID; QString url = bug.URL(); text += @@ -409,9 +409,9 @@ void CrashDialog::on_buttonBox_accepted() { // add to list of bug reports to check for updates. BugReport bug; - bug.ID = m_ReportID; - bug.SubmitDate = QDateTime::currentDateTimeUtc(); - bug.CheckDate = QDateTime::currentDateTimeUtc(); + bug.reportId = m_ReportID; + bug.submitDate = QDateTime::currentDateTimeUtc(); + bug.checkDate = QDateTime::currentDateTimeUtc(); m_Config.CrashReport_ReportedBugs.push_back(bug); if(m_Config.CrashReport_ReportedBugs.count() > 20) diff --git a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp index a9f9b9793..0e82fd115 100644 --- a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp +++ b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp @@ -618,8 +618,8 @@ bool LiveCapture::checkAllowClose() // to by having an active connection or replay context on that host. if(suppressRemoteWarning == false && (!m_Connection || !m_Connection->Connected()) && !cap->local && (!m_Ctx.Replay().CurrentRemote() || - QString(m_Ctx.Replay().CurrentRemote()->Hostname) != m_Hostname || - !m_Ctx.Replay().CurrentRemote()->Connected)) + QString(m_Ctx.Replay().CurrentRemote()->hostname) != m_Hostname || + !m_Ctx.Replay().CurrentRemote()->connected)) { QMessageBox::StandardButton res2 = RDDialog::question( this, tr("No active replay context"), @@ -671,8 +671,8 @@ void LiveCapture::openCapture(Capture *cap) cap->opened = true; if(!cap->local && (!m_Ctx.Replay().CurrentRemote() || - QString(m_Ctx.Replay().CurrentRemote()->Hostname) != m_Hostname || - !m_Ctx.Replay().CurrentRemote()->Connected)) + QString(m_Ctx.Replay().CurrentRemote()->hostname) != m_Hostname || + !m_Ctx.Replay().CurrentRemote()->connected)) { RDDialog::critical( this, tr("No active replay context"), @@ -726,8 +726,8 @@ bool LiveCapture::saveCapture(Capture *cap) else { if(!m_Ctx.Replay().CurrentRemote() || - QString(m_Ctx.Replay().CurrentRemote()->Hostname) != m_Hostname || - !m_Ctx.Replay().CurrentRemote()->Connected) + QString(m_Ctx.Replay().CurrentRemote()->hostname) != m_Hostname || + !m_Ctx.Replay().CurrentRemote()->connected) { RDDialog::critical(this, tr("No active replay context"), tr("This capture is on remote host %1 and there is no active replay " @@ -952,8 +952,8 @@ void LiveCapture::connectionClosed() if(!cap->local) { if(!m_Ctx.Replay().CurrentRemote() || - QString(m_Ctx.Replay().CurrentRemote()->Hostname) != m_Hostname || - !m_Ctx.Replay().CurrentRemote()->Connected) + QString(m_Ctx.Replay().CurrentRemote()->hostname) != m_Hostname || + !m_Ctx.Replay().CurrentRemote()->connected) return; } @@ -1089,9 +1089,9 @@ void LiveCapture::connectionThreadEntry() TargetControlMessage msg = m_Connection->ReceiveMessage(); - if(msg.Type == TargetControlMessageType::RegisterAPI) + if(msg.type == TargetControlMessageType::RegisterAPI) { - QString api = msg.RegisterAPI.APIName; + QString api = msg.apiUse.name; GUIInvoke::call([this, api]() { QString target = QString::fromUtf8(m_Connection->GetTarget()); uint32_t pid = m_Connection->GetPID(); @@ -1111,16 +1111,16 @@ void LiveCapture::connectionThreadEntry() }); } - if(msg.Type == TargetControlMessageType::NewCapture) + if(msg.type == TargetControlMessageType::NewCapture) { - uint32_t capID = msg.NewCapture.ID; + uint32_t capID = msg.newCapture.captureId; QDateTime timestamp = QDateTime(QDate(1970, 1, 1), QTime(0, 0, 0)); - timestamp = timestamp.addSecs(msg.NewCapture.timestamp).toLocalTime(); - bytebuf thumb = msg.NewCapture.thumbnail; - int32_t thumbWidth = msg.NewCapture.thumbWidth; - int32_t thumbHeight = msg.NewCapture.thumbHeight; - QString path = msg.NewCapture.path; - bool local = msg.NewCapture.local; + timestamp = timestamp.addSecs(msg.newCapture.timestamp).toLocalTime(); + bytebuf thumb = msg.newCapture.thumbnail; + int32_t thumbWidth = msg.newCapture.thumbWidth; + int32_t thumbHeight = msg.newCapture.thumbHeight; + QString path = msg.newCapture.path; + bool local = msg.newCapture.local; GUIInvoke::call([this, capID, timestamp, thumb, thumbWidth, thumbHeight, path, local]() { QString target = QString::fromUtf8(m_Connection->GetTarget()); @@ -1130,21 +1130,21 @@ void LiveCapture::connectionThreadEntry() }); } - if(msg.Type == TargetControlMessageType::CaptureCopied) + if(msg.type == TargetControlMessageType::CaptureCopied) { - uint32_t capID = msg.NewCapture.ID; - QString path = msg.NewCapture.path; + uint32_t capID = msg.newCapture.captureId; + QString path = msg.newCapture.path; GUIInvoke::call([=]() { captureCopied(capID, path); }); } - if(msg.Type == TargetControlMessageType::NewChild) + if(msg.type == TargetControlMessageType::NewChild) { - if(msg.NewChild.PID != 0) + if(msg.newChild.processId != 0) { ChildProcess c; - c.PID = (int)msg.NewChild.PID; - c.ident = msg.NewChild.ident; + c.PID = (int)msg.newChild.processId; + c.ident = msg.newChild.ident; { QMutexLocker l(&m_ChildrenLock); diff --git a/qrenderdoc/Windows/Dialogs/PerformanceCounterSelection.cpp b/qrenderdoc/Windows/Dialogs/PerformanceCounterSelection.cpp index f6e99ec4b..56a002380 100644 --- a/qrenderdoc/Windows/Dialogs/PerformanceCounterSelection.cpp +++ b/qrenderdoc/Windows/Dialogs/PerformanceCounterSelection.cpp @@ -273,10 +273,10 @@ void PerformanceCounterSelection::SetCounters(const QVector for(const CounterDescription &desc : descriptions) { - m_CounterToUuid[desc.counterID] = desc.uuid; - m_UuidToCounter[desc.uuid] = desc.counterID; + m_CounterToUuid[desc.counter] = desc.uuid; + m_UuidToCounter[desc.uuid] = desc.counter; - const CounterFamily family = GetCounterFamily(desc.counterID); + const CounterFamily family = GetCounterFamily(desc.counter); if(family != currentFamily) { currentRoot = new RDTreeWidgetItem(); @@ -314,12 +314,12 @@ void PerformanceCounterSelection::SetCounters(const QVector RDTreeWidgetItem *counterItem = new RDTreeWidgetItem(); counterItem->setText(0, desc.name); counterItem->setData(0, CounterDescriptionRole, desc.description); - counterItem->setData(0, CounterIdRole, (uint32_t)desc.counterID); + counterItem->setData(0, CounterIdRole, (uint32_t)desc.counter); counterItem->setCheckState(0, Qt::Unchecked); counterItem->setData(0, PreviousCheckStateRole, Qt::Unchecked); categoryItem->addChild(counterItem); - m_CounterToTreeItem[desc.counterID] = counterItem; + m_CounterToTreeItem[desc.counter] = counterItem; } } diff --git a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp index d4f356290..35401c4b2 100644 --- a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp +++ b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp @@ -142,8 +142,8 @@ void RemoteManager::setRemoteServerLive(RDTreeWidgetItem *node, bool live, bool if(!host) return; - host->ServerRunning = live; - host->Busy = busy; + host->serverRunning = live; + host->busy = busy; if(host->IsLocalhost()) { @@ -154,11 +154,11 @@ void RemoteManager::setRemoteServerLive(RDTreeWidgetItem *node, bool live, bool { QString text = live ? tr("Remote server running") : tr("No remote server"); - if(host->Connected) + if(host->connected) text += tr(" (Active Context)"); - else if(host->VersionMismatch) + else if(host->versionMismatch) text += tr(" (Version Mismatch)"); - else if(host->Busy) + else if(host->busy) text += tr(" (Busy)"); node->setText(1, text); @@ -170,7 +170,7 @@ void RemoteManager::setRemoteServerLive(RDTreeWidgetItem *node, bool live, bool bool RemoteManager::isRemoteServerLive(RDTreeWidgetItem *node) { RemoteHost *host = getRemoteHost(node); - return host && host->ServerRunning; + return host && host->serverRunning; } void RemoteManager::addHost(RemoteHost *host) @@ -228,7 +228,7 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node) host->CheckStatus(); GUIInvoke::call( - [this, node, host]() { setRemoteServerLive(node, host->ServerRunning, host->Busy); }); + [this, node, host]() { setRemoteServerLive(node, host->serverRunning, host->busy); }); uint32_t nextIdent = 0; @@ -237,13 +237,13 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node) // just a sanity check to make sure we don't hit some unexpected case and infinite loop uint32_t prevIdent = nextIdent; - nextIdent = RENDERDOC_EnumerateRemoteTargets(host->Hostname.c_str(), nextIdent); + nextIdent = RENDERDOC_EnumerateRemoteTargets(host->hostname.c_str(), nextIdent); if(nextIdent == 0 || prevIdent >= nextIdent) break; ITargetControl *conn = - RENDERDOC_CreateTargetControl(host->Hostname.c_str(), nextIdent, username.data(), false); + RENDERDOC_CreateTargetControl(host->hostname.c_str(), nextIdent, username.data(), false); if(conn) { @@ -258,7 +258,7 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node) else running = tr("Running %1").arg(api); - RemoteConnect tag(host->Hostname, host->Name(), nextIdent); + RemoteConnect tag(host->hostname, host->Name(), nextIdent); GUIInvoke::call([this, node, target, running, tag]() { RDTreeWidgetItem *child = new RDTreeWidgetItem({target, running}); @@ -340,18 +340,18 @@ void RemoteManager::updateConnectButton() ui->connect->setText(tr("Run Server")); ui->connect->setEnabled(false); } - else if(host->ServerRunning) + else if(host->serverRunning) { ui->connect->setText(tr("Shutdown")); - if(host->Busy && !host->Connected) + if(host->busy && !host->connected) ui->connect->setEnabled(false); } else { ui->connect->setText(tr("Run Server")); - if(host->RunCommand.isEmpty()) + if(host->runCommand.isEmpty()) ui->connect->setEnabled(false); } } @@ -371,7 +371,7 @@ void RemoteManager::addNewHost() for(int i = 0; i < m_Ctx.Config().RemoteHosts.count(); i++) { - QString hostname = m_Ctx.Config().RemoteHosts[i]->Hostname; + QString hostname = m_Ctx.Config().RemoteHosts[i]->hostname; if(hostname.compare(host, Qt::CaseInsensitive) == 0) { found = true; @@ -382,8 +382,8 @@ void RemoteManager::addNewHost() if(!found) { RemoteHost *h = new RemoteHost(); - h->Hostname = host; - h->RunCommand = ui->runCommand->text().trimmed(); + h->hostname = host; + h->runCommand = ui->runCommand->text().trimmed(); m_Ctx.Config().RemoteHosts.push_back(h); m_Ctx.Config().Save(); @@ -406,7 +406,7 @@ void RemoteManager::setRunCommand() if(h) { - h->RunCommand = ui->runCommand->text().trimmed(); + h->runCommand = ui->runCommand->text().trimmed(); m_Ctx.Config().Save(); } } @@ -451,12 +451,12 @@ void RemoteManager::on_hosts_itemSelectionChanged() if(ui->refreshAll->isEnabled()) ui->refreshOne->setEnabled(true); - ui->runCommand->setText(host->RunCommand); + ui->runCommand->setText(host->runCommand); ui->hostname->setText(host->Name()); ui->addUpdateHost->setText(tr("Update")); - if(host->IsLocalhost() || host->IsHostADB()) + if(host->IsLocalhost() || host->IsADB()) { // localhost and android hosts cannot be updated or have their run command changed ui->addUpdateHost->setEnabled(false); @@ -591,7 +591,7 @@ void RemoteManager::on_connect_clicked() } else if(host) { - if(host->ServerRunning) + if(host->serverRunning) { QMessageBox::StandardButton res = RDDialog::question( this, tr("Remote server shutdown"), @@ -602,7 +602,7 @@ void RemoteManager::on_connect_clicked() return; // shut down - if(host->Connected) + if(host->connected) { m_Ctx.Replay().ShutdownServer(); setRemoteServerLive(node, false, false); @@ -611,7 +611,7 @@ void RemoteManager::on_connect_clicked() { IRemoteServer *server = NULL; ReplayStatus status = - RENDERDOC_CreateRemoteServerConnection(host->Hostname.c_str(), 0, &server); + RENDERDOC_CreateRemoteServerConnection(host->hostname.c_str(), 0, &server); if(server) server->ShutdownServerAndConnection(); setRemoteServerLive(node, false, false); diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index a930be1e9..4f610b48b 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -38,8 +38,8 @@ struct EventItemTag { EventItemTag() = default; - EventItemTag(uint32_t eventID) : EID(eventID), lastEID(eventID) {} - EventItemTag(uint32_t eventID, uint32_t lastEventID) : EID(eventID), lastEID(lastEventID) {} + EventItemTag(uint32_t eventId) : EID(eventId), lastEID(eventId) {} + EventItemTag(uint32_t eventId, uint32_t lastEventID) : EID(eventId), lastEID(lastEventID) {} uint32_t EID = 0; uint32_t lastEID = 0; double duration = -1.0; @@ -237,9 +237,9 @@ void EventBrowser::OnCaptureClosed() ui->stepNext->setEnabled(false); } -void EventBrowser::OnEventChanged(uint32_t eventID) +void EventBrowser::OnEventChanged(uint32_t eventId) { - SelectEvent(eventID); + SelectEvent(eventId); repopulateBookmarks(); highlightBookmarks(); } @@ -254,28 +254,28 @@ QPair EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent, const DrawcallDescription &d = draws[i]; RDTreeWidgetItem *child = new RDTreeWidgetItem( - {d.name, QString::number(d.eventID), QString::number(d.drawcallID), lit("---")}); + {d.name, QString::number(d.eventId), QString::number(d.drawcallId), lit("---")}); QPair last = AddDrawcalls(child, d.children); lastEID = last.first; lastDraw = last.second; - if(lastEID > d.eventID) + if(lastEID > d.eventId) { - child->setText(COL_EID, QFormatStr("%1-%2").arg(d.eventID).arg(lastEID)); - child->setText(COL_DRAW, QFormatStr("%1-%2").arg(d.drawcallID).arg(lastDraw)); + child->setText(COL_EID, QFormatStr("%1-%2").arg(d.eventId).arg(lastEID)); + child->setText(COL_DRAW, QFormatStr("%1-%2").arg(d.drawcallId).arg(lastDraw)); } if(lastEID == 0) { - lastEID = d.eventID; - lastDraw = d.drawcallID; + lastEID = d.eventId; + lastDraw = d.drawcallId; if((draws[i].flags & DrawFlags::SetMarker) && i + 1 < draws.count()) - lastEID = draws[i + 1].eventID; + lastEID = draws[i + 1].eventId; } - child->setTag(QVariant::fromValue(EventItemTag(draws[i].eventID, lastEID))); + child->setTag(QVariant::fromValue(EventItemTag(draws[i].eventId, lastEID))); if(m_Ctx.Config().EventBrowser_ApplyColors) { @@ -320,7 +320,7 @@ void EventBrowser::SetDrawcallTimes(RDTreeWidgetItem *node, const rdcarraystepNext->setEnabled(true); // special case for the first 'virtual' draw at EID 0 - if(m_Ctx.GetFirstDrawcall() && tag.lastEID == m_Ctx.GetFirstDrawcall()->eventID) + if(m_Ctx.GetFirstDrawcall() && tag.lastEID == m_Ctx.GetFirstDrawcall()->eventId) ui->stepPrev->setEnabled(true); highlightBookmarks(); @@ -540,7 +540,7 @@ void EventBrowser::on_stepNext_clicked() // special case for the first 'virtual' draw at EID 0 if(m_Ctx.CurEvent() == 0) - SelectEvent(m_Ctx.GetFirstDrawcall()->eventID); + SelectEvent(m_Ctx.GetFirstDrawcall()->eventId); } void EventBrowser::on_stepPrev_clicked() @@ -554,7 +554,7 @@ void EventBrowser::on_stepPrev_clicked() SelectEvent(draw->previous); // special case for the first 'virtual' draw at EID 0 - if(m_Ctx.CurEvent() == m_Ctx.GetFirstDrawcall()->eventID) + if(m_Ctx.CurEvent() == m_Ctx.GetFirstDrawcall()->eventId) SelectEvent(0); } @@ -715,7 +715,7 @@ double EventBrowser::GetDrawTime(const DrawcallDescription &drawcall) for(const CounterResult &r : m_Times) { - if(r.eventID == drawcall.eventID) + if(r.eventId == drawcall.eventId) return r.value.d; } @@ -741,14 +741,14 @@ void EventBrowser::GetMaxNameLength(int &maxNameLength, int indent, bool firstch void EventBrowser::ExportDrawcall(QTextStream &writer, int maxNameLength, int indent, bool firstchild, const DrawcallDescription &drawcall) { - QString eidString = drawcall.children.empty() ? QString::number(drawcall.eventID) : QString(); + QString eidString = drawcall.children.empty() ? QString::number(drawcall.eventId) : QString(); QString nameString = GetExportDrawcallString(indent, firstchild, drawcall); QString line = QFormatStr("%1 | %2 | %3") .arg(eidString, -5) .arg(nameString, -maxNameLength) - .arg(drawcall.drawcallID, -6); + .arg(drawcall.drawcallId, -6); if(!m_Times.empty()) { @@ -929,9 +929,9 @@ void EventBrowser::repopulateBookmarks() // add any bookmark markers that we don't have for(const EventBookmark &mark : bookmarks) { - if(!m_BookmarkButtons.contains(mark.EID)) + if(!m_BookmarkButtons.contains(mark.eventId)) { - uint32_t EID = mark.EID; + uint32_t EID = mark.eventId; QToolButton *but = new QToolButton(this); @@ -1007,7 +1007,7 @@ void EventBrowser::jumpToBookmark(int idx) return; // don't exclude ourselves, so we're updated as normal - SelectEvent(bookmarks[idx].EID); + SelectEvent(bookmarks[idx].eventId); } void EventBrowser::highlightBookmarks() @@ -1046,7 +1046,7 @@ void EventBrowser::RefreshIcon(RDTreeWidgetItem *item, EventItemTag tag) item->setIcon(COL_NAME, QIcon()); } -bool EventBrowser::FindEventNode(RDTreeWidgetItem *&found, RDTreeWidgetItem *parent, uint32_t eventID) +bool EventBrowser::FindEventNode(RDTreeWidgetItem *&found, RDTreeWidgetItem *parent, uint32_t eventId) { // do a reverse search to find the last match (in case of 'set' markers that // inherit the event of the next real draw). @@ -1057,15 +1057,15 @@ bool EventBrowser::FindEventNode(RDTreeWidgetItem *&found, RDTreeWidgetItem *par uint nEID = n->tag().value().lastEID; uint fEID = found ? found->tag().value().lastEID : 0; - if(nEID >= eventID && (found == NULL || nEID <= fEID)) + if(nEID >= eventId && (found == NULL || nEID <= fEID)) found = n; - if(nEID == eventID && n->childCount() == 0) + if(nEID == eventId && n->childCount() == 0) return true; if(n->childCount() > 0) { - bool exact = FindEventNode(found, n, eventID); + bool exact = FindEventNode(found, n, eventId); if(exact) return true; } @@ -1087,13 +1087,13 @@ void EventBrowser::ExpandNode(RDTreeWidgetItem *node) ui->events->scrollToItem(n); } -bool EventBrowser::SelectEvent(uint32_t eventID) +bool EventBrowser::SelectEvent(uint32_t eventId) { if(!m_Ctx.IsCaptureLoaded()) return false; RDTreeWidgetItem *found = NULL; - FindEventNode(found, ui->events->topLevelItem(0), eventID); + FindEventNode(found, ui->events->topLevelItem(0), eventId); if(found != NULL) { ui->events->setCurrentItem(found); diff --git a/qrenderdoc/Windows/EventBrowser.h b/qrenderdoc/Windows/EventBrowser.h index 1ded7bd10..3cdbdb848 100644 --- a/qrenderdoc/Windows/EventBrowser.h +++ b/qrenderdoc/Windows/EventBrowser.h @@ -58,8 +58,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; QVariant persistData(); void setPersistData(const QVariant &persistData); @@ -101,8 +101,8 @@ private: void ExpandNode(RDTreeWidgetItem *node); - bool FindEventNode(RDTreeWidgetItem *&found, RDTreeWidgetItem *parent, uint32_t eventID); - bool SelectEvent(uint32_t eventID); + bool FindEventNode(RDTreeWidgetItem *&found, RDTreeWidgetItem *parent, uint32_t eventId); + bool SelectEvent(uint32_t eventId); void ClearFindIcons(RDTreeWidgetItem *parent); void ClearFindIcons(); diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index 9300109af..d6203240a 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -214,16 +214,16 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai for(const BugReport &b : bugs) { // check bugs every two days - qint64 diff = b.CheckDate.secsTo(now); + qint64 diff = b.checkDate.secsTo(now); if(diff > 2 * 24 * 60 * 60) { // update the check date on the stored bug GUIInvoke::call([this, b, now]() { for(BugReport &bug : m_Ctx.Config().CrashReport_ReportedBugs) { - if(bug.ID == b.ID) + if(bug.reportId == b.reportId) { - bug.CheckDate = now; + bug.checkDate = now; break; } } @@ -248,13 +248,13 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai QDateTime update = QDateTime::fromString(response, lit("yyyy-MM-dd HH:mm:ss")); // if there's been an update since the last check, set unread - if(update.isValid() && update > b.CheckDate) + if(update.isValid() && update > b.checkDate) { for(BugReport &bug : m_Ctx.Config().CrashReport_ReportedBugs) { - if(bug.ID == b.ID) + if(bug.reportId == b.reportId) { - bug.UnreadUpdates = true; + bug.unreadUpdates = true; break; } } @@ -440,7 +440,7 @@ void MainWindow::OnCaptureTrigger(const QString &exe, const QString &workingDir, } LiveCapture *live = new LiveCapture( - m_Ctx, m_Ctx.Replay().CurrentRemote() ? m_Ctx.Replay().CurrentRemote()->Hostname : "", + m_Ctx, m_Ctx.Replay().CurrentRemote() ? m_Ctx.Replay().CurrentRemote()->hostname : "", m_Ctx.Replay().CurrentRemote() ? m_Ctx.Replay().CurrentRemote()->Name() : "", ret, this, this); ShowLiveCapture(live); @@ -509,7 +509,7 @@ void MainWindow::LoadCapture(const QString &filename, bool temporary, bool local ReplaySupport support = ReplaySupport::Unsupported; bool remoteReplay = - !local || (m_Ctx.Replay().CurrentRemote() && m_Ctx.Replay().CurrentRemote()->Connected); + !local || (m_Ctx.Replay().CurrentRemote() && m_Ctx.Replay().CurrentRemote()->connected); if(local) { @@ -571,7 +571,7 @@ void MainWindow::LoadCapture(const QString &filename, bool temporary, bool local } remoteReplay = - (m_Ctx.Replay().CurrentRemote() && m_Ctx.Replay().CurrentRemote()->Connected); + (m_Ctx.Replay().CurrentRemote() && m_Ctx.Replay().CurrentRemote()->connected); if(!remoteReplay) { @@ -983,23 +983,23 @@ void MainWindow::PopulateReportedBugs() BugReport &bug = m_Ctx.Config().CrashReport_ReportedBugs[i]; QString fmt = tr("&%1: Bug reported at %2"); - if(bug.UnreadUpdates) + if(bug.unreadUpdates) fmt = tr("&%1: (Update) Bug reported at %2"); QAction *action = - ui->menu_Reported_Bugs->addAction(fmt.arg(idx).arg(bug.SubmitDate.toString()), [this, i] { + ui->menu_Reported_Bugs->addAction(fmt.arg(idx).arg(bug.submitDate.toString()), [this, i] { BugReport &bug = m_Ctx.Config().CrashReport_ReportedBugs[i]; QDesktopServices::openUrl(QString(bug.URL())); - bug.UnreadUpdates = false; + bug.unreadUpdates = false; m_Ctx.Config().Save(); PopulateReportedBugs(); }); idx++; - if(bug.UnreadUpdates) + if(bug.unreadUpdates) { action->setIcon(Icons::bug()); unread = true; @@ -1366,7 +1366,7 @@ void MainWindow::remoteProbe() for(RemoteHost *host : m_Ctx.Config().RemoteHosts) { // don't mess with a host we're connected to - this is handled anyway - if(host->Connected) + if(host->connected) continue; host->CheckStatus(); @@ -1389,11 +1389,11 @@ void MainWindow::messageCheck() if(m_Ctx.Replay().CurrentRemote()) { - bool prev = m_Ctx.Replay().CurrentRemote()->ServerRunning; + bool prev = m_Ctx.Replay().CurrentRemote()->serverRunning; m_Ctx.Replay().PingRemote(); - if(prev != m_Ctx.Replay().CurrentRemote()->ServerRunning) + if(prev != m_Ctx.Replay().CurrentRemote()->serverRunning) disconnected = true; } @@ -1408,7 +1408,7 @@ void MainWindow::messageCheck() "RenderDoc to reconnect and load the capture again")); } - if(m_Ctx.Replay().CurrentRemote() && !m_Ctx.Replay().CurrentRemote()->ServerRunning) + if(m_Ctx.Replay().CurrentRemote() && !m_Ctx.Replay().CurrentRemote()->serverRunning) contextChooser->setIcon(Icons::cross()); if(!msgs.empty()) @@ -1431,7 +1431,7 @@ void MainWindow::messageCheck() m_Ctx.Replay().PingRemote(); GUIInvoke::call([this]() { - if(m_Ctx.Replay().CurrentRemote() && !m_Ctx.Replay().CurrentRemote()->ServerRunning) + if(m_Ctx.Replay().CurrentRemote() && !m_Ctx.Replay().CurrentRemote()->serverRunning) { contextChooser->setIcon(Icons::cross()); contextChooser->setText(tr("Replay Context: %1").arg(tr("Local"))); @@ -1458,14 +1458,14 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost) QAction *action = new QAction(menu); - action->setIcon(host->ServerRunning && !host->VersionMismatch ? Icons::tick() : Icons::cross()); - if(host->Connected) + action->setIcon(host->serverRunning && !host->versionMismatch ? Icons::tick() : Icons::cross()); + if(host->connected) action->setText(tr("%1 (Connected)").arg(host->Name())); - else if(host->ServerRunning && host->VersionMismatch) + else if(host->serverRunning && host->versionMismatch) action->setText(tr("%1 (Bad Version)").arg(host->Name())); - else if(host->ServerRunning && host->Busy) + else if(host->serverRunning && host->busy) action->setText(tr("%1 (Busy)").arg(host->Name())); - else if(host->ServerRunning) + else if(host->serverRunning) action->setText(tr("%1 (Online)").arg(host->Name())); else action->setText(tr("%1 (Offline)").arg(host->Name())); @@ -1473,7 +1473,7 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost) action->setData(i); // don't allow switching to the connected host - if(host->Connected) + if(host->connected) action->setEnabled(false); menu->addAction(action); @@ -1518,7 +1518,7 @@ void MainWindow::switchContext() // allow live captures to this host to stay open, that way // we can connect to a live capture, then switch into that // context - if(host && live->hostname() == host->Hostname) + if(host && live->hostname() == host->hostname) continue; if(!live->checkAllowClose()) @@ -1533,7 +1533,7 @@ void MainWindow::switchContext() // allow live captures to this host to stay open, that way // we can connect to a live capture, then switch into that // context - if(host && live->hostname() == host->Hostname) + if(host && live->hostname() == host->hostname) continue; live->cleanItems(); @@ -1556,7 +1556,7 @@ void MainWindow::switchContext() else { contextChooser->setText(tr("Replay Context: %1").arg(host->Name())); - contextChooser->setIcon(host->ServerRunning ? Icons::connect() : Icons::disconnect()); + contextChooser->setIcon(host->serverRunning ? Icons::connect() : Icons::disconnect()); // disable until checking is done contextChooser->setEnabled(false); @@ -1571,7 +1571,7 @@ void MainWindow::switchContext() // see if the server is up host->CheckStatus(); - if(!host->ServerRunning && !host->RunCommand.isEmpty()) + if(!host->serverRunning && !host->runCommand.isEmpty()) { GUIInvoke::call([this]() { statusText->setText(tr("Running remote server command...")); }); @@ -1583,13 +1583,13 @@ void MainWindow::switchContext() ReplayStatus status = ReplayStatus::Succeeded; - if(host->ServerRunning && !host->Busy) + if(host->serverRunning && !host->busy) { status = m_Ctx.Replay().ConnectToRemoteServer(host); } GUIInvoke::call([this, host, status]() { - contextChooser->setIcon(host->ServerRunning && !host->Busy ? Icons::connect() + contextChooser->setIcon(host->serverRunning && !host->busy ? Icons::connect() : Icons::disconnect()); if(status != ReplayStatus::Succeeded) @@ -1598,22 +1598,22 @@ void MainWindow::switchContext() contextChooser->setText(tr("Replay Context: %1").arg(tr("Local"))); statusText->setText(tr("Connection failed: %1").arg(ToQStr(status))); } - else if(host->VersionMismatch) + else if(host->versionMismatch) { statusText->setText( tr("Remote server is not running RenderDoc %1").arg(lit(FULL_VERSION_STRING))); } - else if(host->Busy) + else if(host->busy) { statusText->setText(tr("Remote server in use elsewhere")); } - else if(host->ServerRunning) + else if(host->serverRunning) { statusText->setText(tr("Remote server ready")); } else { - if(!host->RunCommand.isEmpty()) + if(!host->runCommand.isEmpty()) statusText->setText(tr("Remote server not running or failed to start")); else statusText->setText(tr("Remote server not running - no start command configured")); @@ -1698,7 +1698,7 @@ void MainWindow::OnCaptureClosed() SetTitle(); // if the remote sever disconnected during capture replay, resort back to a 'disconnected' state - if(m_Ctx.Replay().CurrentRemote() && !m_Ctx.Replay().CurrentRemote()->ServerRunning) + if(m_Ctx.Replay().CurrentRemote() && !m_Ctx.Replay().CurrentRemote()->serverRunning) { statusText->setText( tr("Remote server disconnected. To attempt to reconnect please select it again.")); @@ -1707,7 +1707,7 @@ void MainWindow::OnCaptureClosed() } } -void MainWindow::OnEventChanged(uint32_t eventID) +void MainWindow::OnEventChanged(uint32_t eventId) { } @@ -2056,7 +2056,7 @@ void MainWindow::on_action_Start_Replay_Loop_triggered() if(displayTex) { - id = displayTex->ID; + id = displayTex->resourceId; popup.resize((int)displayTex->width, (int)displayTex->height); popup.setWindowTitle(tr("Looping replay of %1 Displaying %2") .arg(m_Ctx.GetCaptureFilename()) diff --git a/qrenderdoc/Windows/MainWindow.h b/qrenderdoc/Windows/MainWindow.h index 9f7289d09..a25d34b7f 100644 --- a/qrenderdoc/Windows/MainWindow.h +++ b/qrenderdoc/Windows/MainWindow.h @@ -61,8 +61,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; ToolWindowManager *mainToolManager(); ToolWindowManager::AreaReference mainToolArea(); diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.cpp b/qrenderdoc/Windows/PerformanceCounterViewer.cpp index 54dae0d12..30773aa46 100644 --- a/qrenderdoc/Windows/PerformanceCounterViewer.cpp +++ b/qrenderdoc/Windows/PerformanceCounterViewer.cpp @@ -40,10 +40,10 @@ struct SortValue double d; } val; - SortValue(uint32_t eventID) + SortValue(uint32_t eventId) { type = Integer; - val.u = eventID; + val.u = eventId; } SortValue(const CounterResult &result, const CounterDescription &description) @@ -228,9 +228,9 @@ void PerformanceCounterViewer::CaptureCounters() QMap eventIdToRow; for(const CounterResult &result : results) { - if(eventIdToRow.contains(result.eventID)) + if(eventIdToRow.contains(result.eventId)) continue; - eventIdToRow[result.eventID] = eventIdToRow.size(); + eventIdToRow[result.eventId] = eventIdToRow.size(); } ui->counterResults->setColumnCount(headers.size()); @@ -239,17 +239,17 @@ void PerformanceCounterViewer::CaptureCounters() for(int i = 0; i < (int)results.size(); ++i) { - int row = eventIdToRow[results[i].eventID]; + int row = eventIdToRow[results[i].eventId]; ui->counterResults->setItem(row, 0, - new CustomSortedTableItem(QString::number(results[i].eventID), - SortValue(results[i].eventID))); + new CustomSortedTableItem(QString::number(results[i].eventId), + SortValue(results[i].eventId))); ui->counterResults->setItem( - row, counterIndex[results[i].counterID] + 1, - MakeCounterResultItem(results[i], counterDescriptions[results[i].counterID])); + row, counterIndex[results[i].counter] + 1, + MakeCounterResultItem(results[i], counterDescriptions[results[i].counter])); - ui->counterResults->item(row, 0)->setData(Qt::UserRole, results[i].eventID); + ui->counterResults->item(row, 0)->setData(Qt::UserRole, results[i].eventId); } ui->counterResults->resizeColumnsToContents(); diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.h b/qrenderdoc/Windows/PerformanceCounterViewer.h index 17f5eeed4..b17f23149 100644 --- a/qrenderdoc/Windows/PerformanceCounterViewer.h +++ b/qrenderdoc/Windows/PerformanceCounterViewer.h @@ -47,8 +47,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override {} + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override {} private slots: // automatic slots void on_counterResults_doubleClicked(const QModelIndex &index); diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index e6b526bda..67ebe2339 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -430,7 +430,7 @@ void D3D11PipelineStateViewer::OnCaptureClosed() clearState(); } -void D3D11PipelineStateViewer::OnEventChanged(uint32_t eventID) +void D3D11PipelineStateViewer::OnEventChanged(uint32_t eventId) { setState(); } @@ -463,15 +463,14 @@ bool D3D11PipelineStateViewer::HasImportantViewParams(const D3D11Pipe::View &vie // in the row since there's no real hidden important information there. The formats can't be // different for any other reason (if the SRV format differs from the texture format, the // texture must have been typeless. - if(view.HighestMip > 0 || view.FirstArraySlice > 0 || - (view.NumMipLevels < tex->mips && tex->mips > 1) || - (view.ArraySize < tex->arraysize && tex->arraysize > 1)) + if(view.firstMip > 0 || view.firstSlice > 0 || (view.numMips < tex->mips && tex->mips > 1) || + (view.numSlices < tex->arraysize && tex->arraysize > 1)) return true; // in the case of the swapchain case, types can be different and it won't have shown // up as taking the view's format because the swapchain already has one. Make sure to mark it // as important - if(view.Format.compType != CompType::Typeless && view.Format != tex->format) + if(view.viewFormat.compType != CompType::Typeless && view.viewFormat != tex->format) return true; return false; @@ -480,7 +479,7 @@ bool D3D11PipelineStateViewer::HasImportantViewParams(const D3D11Pipe::View &vie bool D3D11PipelineStateViewer::HasImportantViewParams(const D3D11Pipe::View &view, BufferDescription *buf) { - if(view.FirstElement > 0 || view.NumElements * view.ElementSize < buf->length) + if(view.firstElement > 0 || view.numElements * view.elementByteSize < buf->length) return true; return false; @@ -498,48 +497,48 @@ void D3D11PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1 bool viewdetails = false; - if(res.Format != tex->format) + if(res.viewFormat != tex->format) { text += tr("The texture is format %1, the view treats it as %2.\n") .arg(tex->format.Name()) - .arg(res.Format.Name()); + .arg(res.viewFormat.Name()); viewdetails = true; } if(view.type == D3D11ViewTag::OMDepth) { - if(m_Ctx.CurD3D11PipelineState().m_OM.DepthReadOnly) + if(m_Ctx.CurD3D11PipelineState().outputMerger.depthReadOnly) text += tr("Depth component is read-only\n"); - if(m_Ctx.CurD3D11PipelineState().m_OM.StencilReadOnly) + if(m_Ctx.CurD3D11PipelineState().outputMerger.stencilReadOnly) text += tr("Stencil component is read-only\n"); } - if(tex->mips > 1 && (tex->mips != res.NumMipLevels || res.HighestMip > 0)) + if(tex->mips > 1 && (tex->mips != res.numMips || res.firstMip > 0)) { - if(res.NumMipLevels == 1) + if(res.numMips == 1) text += - tr("The texture has %1 mips, the view covers mip %2.\n").arg(tex->mips).arg(res.HighestMip); + tr("The texture has %1 mips, the view covers mip %2.\n").arg(tex->mips).arg(res.firstMip); else text += tr("The texture has %1 mips, the view covers mips %2-%3.\n") .arg(tex->mips) - .arg(res.HighestMip) - .arg(res.HighestMip + res.NumMipLevels - 1); + .arg(res.firstMip) + .arg(res.firstMip + res.numMips - 1); viewdetails = true; } - if(tex->arraysize > 1 && (tex->arraysize != res.ArraySize || res.FirstArraySlice > 0)) + if(tex->arraysize > 1 && (tex->arraysize != res.numSlices || res.firstSlice > 0)) { - if(res.ArraySize == 1) + if(res.numSlices == 1) text += tr("The texture has %1 array slices, the view covers slice %2.\n") .arg(tex->arraysize) - .arg(res.FirstArraySlice); + .arg(res.firstSlice); else text += tr("The texture has %1 array slices, the view covers slices %2-%3.\n") .arg(tex->arraysize) - .arg(res.FirstArraySlice) - .arg(res.FirstArraySlice + res.ArraySize); + .arg(res.firstSlice) + .arg(res.firstSlice + res.numSlices); viewdetails = true; } @@ -565,15 +564,16 @@ void D3D11PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1 const D3D11Pipe::View &res = view.res; - if((res.FirstElement * res.ElementSize) > 0 || (res.NumElements * res.ElementSize) < buf->length) + if((res.firstElement * res.elementByteSize) > 0 || + (res.numElements * res.elementByteSize) < buf->length) { text += tr("The view covers bytes %1-%2 (%3 elements).\nThe buffer is %4 bytes in length (%5 " "elements).") - .arg(res.FirstElement * res.ElementSize) - .arg((res.FirstElement + res.NumElements) * res.ElementSize) - .arg(res.NumElements) + .arg(res.firstElement * res.elementByteSize) + .arg((res.firstElement + res.numElements) * res.elementByteSize) + .arg(res.numElements) .arg(buf->length) - .arg(buf->length / res.ElementSize); + .arg(buf->length / res.elementByteSize); } else { @@ -587,17 +587,17 @@ void D3D11PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1 void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view, const ShaderResource *shaderInput, - const BindpointMap *map, RDTreeWidget *resources) + const Bindpoint *map, RDTreeWidget *resources) { const D3D11Pipe::View &r = view.res; bool viewDetails = false; if(view.type == D3D11ViewTag::OMDepth) - viewDetails = m_Ctx.CurD3D11PipelineState().m_OM.DepthReadOnly || - m_Ctx.CurD3D11PipelineState().m_OM.StencilReadOnly; + viewDetails = m_Ctx.CurD3D11PipelineState().outputMerger.depthReadOnly || + m_Ctx.CurD3D11PipelineState().outputMerger.stencilReadOnly; - bool filledSlot = (r.Resource != ResourceId()); + bool filledSlot = (r.resourceResourceId != ResourceId()); bool usedSlot = (map && map->used); // if a target is set to RTVs or DSV, it is implicitly used @@ -623,7 +623,7 @@ void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view, w = h = d = a = 0; } - TextureDescription *tex = m_Ctx.GetTexture(r.Resource); + TextureDescription *tex = m_Ctx.GetTexture(r.resourceResourceId); if(tex) { @@ -632,21 +632,21 @@ void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view, d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); - if(tex->resType == TextureDim::Texture2DMS || tex->resType == TextureDim::Texture2DMSArray) + if(tex->type == TextureType::Texture2DMS || tex->type == TextureType::Texture2DMSArray) { typeName += QFormatStr(" %1x").arg(tex->msSamp); } - if(tex->format != r.Format) - format = tr("Viewed as %1").arg(r.Format.Name()); + if(tex->format != r.viewFormat) + format = tr("Viewed as %1").arg(r.viewFormat.Name()); if(HasImportantViewParams(r, tex)) viewDetails = true; } - BufferDescription *buf = m_Ctx.GetBuffer(r.Resource); + BufferDescription *buf = m_Ctx.GetBuffer(r.resourceResourceId); if(buf) { @@ -657,28 +657,28 @@ void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view, format = QString(); typeName = lit("Buffer"); - if(r.Flags & D3DBufferViewFlags::Raw) + if(r.bufferFlags & D3DBufferViewFlags::Raw) { typeName = QFormatStr("%1ByteAddressBuffer") .arg(view.type == D3D11ViewTag::UAV ? lit("RW") : QString()); } - else if(r.ElementSize > 0) + else if(r.elementByteSize > 0) { // for structured buffers, display how many 'elements' there are in the buffer typeName = QFormatStr("%1StructuredBuffer[%2]") .arg(view.type == D3D11ViewTag::UAV ? lit("RW") : QString()) - .arg(buf->length / r.ElementSize); + .arg(buf->length / r.elementByteSize); } - if(r.Flags & (D3DBufferViewFlags::Append | D3DBufferViewFlags::Counter)) + if(r.bufferFlags & (D3DBufferViewFlags::Append | D3DBufferViewFlags::Counter)) { - typeName += tr(" (Count: %1)").arg(r.BufferStructCount); + typeName += tr(" (Count: %1)").arg(r.bufferStructCount); } // get the buffer type, whether it's just a basic type or a complex struct - if(shaderInput && !shaderInput->IsTexture) + if(shaderInput && !shaderInput->isTexture) { - if(r.Format.compType == CompType::Typeless) + if(r.viewFormat.compType == CompType::Typeless) { if(!shaderInput->variableType.members.empty()) format = lit("struct ") + shaderInput->variableType.descriptor.name; @@ -687,7 +687,7 @@ void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view, } else { - format = r.Format.Name(); + format = r.viewFormat.Name(); } } @@ -695,10 +695,10 @@ void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view, viewDetails = true; } - QVariant name = r.Resource; + QVariant name = r.resourceResourceId; if(viewDetails) - name = tr("%1 viewed by %2").arg(ToQStr(r.Resource)).arg(ToQStr(r.Object)); + name = tr("%1 viewed by %2").arg(ToQStr(r.resourceResourceId)).arg(ToQStr(r.viewResourceId)); RDTreeWidgetItem *node = new RDTreeWidgetItem({slotname, name, typeName, w, h, d, a, format, QString()}); @@ -751,23 +751,23 @@ const D3D11Pipe::Shader *D3D11PipelineStateViewer::stageForSender(QWidget *widge while(widget) { if(widget == ui->stagesTabs->widget(0)) - return &m_Ctx.CurD3D11PipelineState().m_VS; + return &m_Ctx.CurD3D11PipelineState().vertexShader; if(widget == ui->stagesTabs->widget(1)) - return &m_Ctx.CurD3D11PipelineState().m_VS; + return &m_Ctx.CurD3D11PipelineState().vertexShader; if(widget == ui->stagesTabs->widget(2)) - return &m_Ctx.CurD3D11PipelineState().m_HS; + return &m_Ctx.CurD3D11PipelineState().hullShader; if(widget == ui->stagesTabs->widget(3)) - return &m_Ctx.CurD3D11PipelineState().m_DS; + return &m_Ctx.CurD3D11PipelineState().domainShader; if(widget == ui->stagesTabs->widget(4)) - return &m_Ctx.CurD3D11PipelineState().m_GS; + return &m_Ctx.CurD3D11PipelineState().geometryShader; if(widget == ui->stagesTabs->widget(5)) - return &m_Ctx.CurD3D11PipelineState().m_PS; + return &m_Ctx.CurD3D11PipelineState().pixelShader; if(widget == ui->stagesTabs->widget(6)) - return &m_Ctx.CurD3D11PipelineState().m_PS; + return &m_Ctx.CurD3D11PipelineState().pixelShader; if(widget == ui->stagesTabs->widget(7)) - return &m_Ctx.CurD3D11PipelineState().m_PS; + return &m_Ctx.CurD3D11PipelineState().pixelShader; if(widget == ui->stagesTabs->widget(8)) - return &m_Ctx.CurD3D11PipelineState().m_CS; + return &m_Ctx.CurD3D11PipelineState().computeShader; widget = widget->parentWidget(); } @@ -855,16 +855,16 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD RDTreeWidget *resources, RDTreeWidget *samplers, RDTreeWidget *cbuffers, RDTreeWidget *classes) { - ShaderReflection *shaderDetails = stage.ShaderDetails; - const ShaderBindpointMapping &mapping = stage.BindpointMapping; + ShaderReflection *shaderDetails = stage.reflection; + const ShaderBindpointMapping &mapping = stage.bindpointMapping; - QString shText = ToQStr(stage.Object); + QString shText = ToQStr(stage.resourceId); - if(shaderDetails && !shaderDetails->DebugInfo.files.empty()) + if(shaderDetails && !shaderDetails->debugInfo.files.empty()) { shText += QFormatStr(": %1() - %2") - .arg(shaderDetails->EntryPoint) - .arg(QFileInfo(shaderDetails->DebugInfo.files[0].Filename).fileName()); + .arg(shaderDetails->entryPoint) + .arg(QFileInfo(shaderDetails->debugInfo.files[0].filename).fileName()); } shader->setText(shText); @@ -874,17 +874,17 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD vs = resources->verticalScrollBar()->value(); resources->beginUpdate(); resources->clear(); - for(int i = 0; i < stage.SRVs.count(); i++) + for(int i = 0; i < stage.srvs.count(); i++) { const ShaderResource *shaderInput = NULL; - const BindpointMap *map = NULL; + const Bindpoint *map = NULL; if(shaderDetails) { - for(int b = 0; b < shaderDetails->ReadOnlyResources.count(); b++) + for(int b = 0; b < shaderDetails->readOnlyResources.count(); b++) { - const ShaderResource &res = shaderDetails->ReadOnlyResources[b]; - const BindpointMap &bind = mapping.ReadOnlyResources[b]; + const ShaderResource &res = shaderDetails->readOnlyResources[b]; + const Bindpoint &bind = mapping.readOnlyResources[b]; if(bind.bind == i) { @@ -895,7 +895,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD } } - addResourceRow(D3D11ViewTag(D3D11ViewTag::SRV, i, stage.SRVs[i]), shaderInput, map, resources); + addResourceRow(D3D11ViewTag(D3D11ViewTag::SRV, i, stage.srvs[i]), shaderInput, map, resources); } resources->clearSelection(); resources->endUpdate(); @@ -904,19 +904,19 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD vs = samplers->verticalScrollBar()->value(); samplers->beginUpdate(); samplers->clear(); - for(int i = 0; i < stage.Samplers.count(); i++) + for(int i = 0; i < stage.samplers.count(); i++) { - const D3D11Pipe::Sampler &s = stage.Samplers[i]; + const D3D11Pipe::Sampler &s = stage.samplers[i]; const ShaderSampler *shaderInput = NULL; - const BindpointMap *map = NULL; + const Bindpoint *map = NULL; if(shaderDetails) { - for(int b = 0; b < shaderDetails->Samplers.count(); b++) + for(int b = 0; b < shaderDetails->samplers.count(); b++) { - const ShaderSampler &res = shaderDetails->Samplers[b]; - const BindpointMap &bind = mapping.Samplers[b]; + const ShaderSampler &res = shaderDetails->samplers[b]; + const Bindpoint &bind = mapping.samplers[b]; if(bind.bind == i) { @@ -927,7 +927,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD } } - bool filledSlot = s.Samp != ResourceId(); + bool filledSlot = s.resourceId != ResourceId(); bool usedSlot = (map && map->used); if(showNode(usedSlot, filledSlot)) @@ -938,17 +938,17 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD slotname += lit(": ") + shaderInput->name; QString borderColor = QFormatStr("%1, %2, %3, %4") - .arg(s.BorderColor[0]) - .arg(s.BorderColor[1]) - .arg(s.BorderColor[2]) - .arg(s.BorderColor[3]); + .arg(s.borderColor[0]) + .arg(s.borderColor[1]) + .arg(s.borderColor[2]) + .arg(s.borderColor[3]); QString addressing; QString addPrefix; QString addVal; - QString addr[] = {ToQStr(s.AddressU), ToQStr(s.AddressV), ToQStr(s.AddressW)}; + QString addr[] = {ToQStr(s.addressU), ToQStr(s.addressV), ToQStr(s.addressW)}; // arrange like either UVW: WRAP or UV: WRAP, W: CLAMP for(int a = 0; a < 3; a++) @@ -974,22 +974,22 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD if(s.UseBorder()) addressing += QFormatStr("<%1>").arg(borderColor); - QString filter = ToQStr(s.Filter); + QString filter = ToQStr(s.filter); - if(s.MaxAniso > 1) - filter += QFormatStr(" %1x").arg(s.MaxAniso); + if(s.maxAnisotropy > 1) + filter += QFormatStr(" %1x").arg(s.maxAnisotropy); - if(s.Filter.func == FilterFunc::Comparison) - filter = QFormatStr(" (%1)").arg(ToQStr(s.Comparison)); - else if(s.Filter.func != FilterFunc::Normal) - filter = QFormatStr(" (%1)").arg(ToQStr(s.Filter.func)); + if(s.filter.filter == FilterFunction::Comparison) + filter = QFormatStr(" (%1)").arg(ToQStr(s.compareFunction)); + else if(s.filter.filter != FilterFunction::Normal) + filter = QFormatStr(" (%1)").arg(ToQStr(s.filter.filter)); RDTreeWidgetItem *node = new RDTreeWidgetItem( - {slotname, s.Samp, addressing, filter, + {slotname, s.resourceId, addressing, filter, QFormatStr("%1 - %2") - .arg(s.MinLOD == -FLT_MAX ? lit("0") : QString::number(s.MinLOD)) - .arg(s.MaxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.MaxLOD)), - s.MipLODBias}); + .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) + .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), + s.mipLODBias}); if(!filledSlot) setEmptyRow(node); @@ -1008,19 +1008,19 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD vs = cbuffers->verticalScrollBar()->value(); cbuffers->beginUpdate(); cbuffers->clear(); - for(int i = 0; i < stage.ConstantBuffers.count(); i++) + for(int i = 0; i < stage.constantBuffers.count(); i++) { - const D3D11Pipe::CBuffer &b = stage.ConstantBuffers[i]; + const D3D11Pipe::ConstantBuffer &b = stage.constantBuffers[i]; const ConstantBlock *shaderCBuf = NULL; - const BindpointMap *map = NULL; + const Bindpoint *map = NULL; if(shaderDetails) { - for(int cb = 0; cb < shaderDetails->ConstantBlocks.count(); cb++) + for(int cb = 0; cb < shaderDetails->constantBlocks.count(); cb++) { - const ConstantBlock &cbuf = shaderDetails->ConstantBlocks[cb]; - const BindpointMap &bind = mapping.ConstantBlocks[cb]; + const ConstantBlock &cbuf = shaderDetails->constantBlocks[cb]; + const Bindpoint &bind = mapping.constantBlocks[cb]; if(bind.bind == i) { @@ -1031,7 +1031,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD } } - bool filledSlot = b.Buffer != ResourceId(); + bool filledSlot = b.resourceId != ResourceId(); bool usedSlot = (map && map->used); if(showNode(usedSlot, filledSlot)) @@ -1040,7 +1040,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t bytesize = shaderCBuf ? shaderCBuf->byteSize : 0; - BufferDescription *buf = m_Ctx.GetBuffer(b.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(b.resourceId); if(buf) length = buf->length; @@ -1060,10 +1060,10 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD if(length < bytesize) filledSlot = false; - QString vecrange = QFormatStr("%1 - %2").arg(b.VecOffset).arg(b.VecOffset + b.VecCount); + QString vecrange = QFormatStr("%1 - %2").arg(b.vecOffset).arg(b.vecOffset + b.vecCount); RDTreeWidgetItem *node = - new RDTreeWidgetItem({slotname, b.Buffer, vecrange, sizestr, QString()}); + new RDTreeWidgetItem({slotname, b.resourceId, vecrange, sizestr, QString()}); node->setTag(QVariant::fromValue(i)); @@ -1083,20 +1083,20 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, RD vs = classes->verticalScrollBar()->value(); classes->beginUpdate(); classes->clear(); - for(int i = 0; i < stage.ClassInstances.count(); i++) + for(int i = 0; i < stage.classInstances.count(); i++) { QString interfaceName = lit("Interface %1").arg(i); - if(shaderDetails && i < shaderDetails->Interfaces.count()) - interfaceName = shaderDetails->Interfaces[i]; + if(shaderDetails && i < shaderDetails->interfaces.count()) + interfaceName = shaderDetails->interfaces[i]; - classes->addTopLevelItem(new RDTreeWidgetItem({i, interfaceName, stage.ClassInstances[i]})); + classes->addTopLevelItem(new RDTreeWidgetItem({i, interfaceName, stage.classInstances[i]})); } classes->clearSelection(); classes->endUpdate(); classes->verticalScrollBar()->setValue(vs); - classes->parentWidget()->setVisible(!stage.ClassInstances.empty()); + classes->parentWidget()->setVisible(!stage.classInstances.empty()); } void D3D11PipelineStateViewer::setState() @@ -1116,36 +1116,39 @@ void D3D11PipelineStateViewer::setState() //////////////////////////////////////////////// // Vertex Input - if(state.m_IA.Bytecode) + if(state.inputAssembly.bytecode) { - QString layout = ToQStr(state.m_IA.layout); + QString layout = ToQStr(state.inputAssembly.resourceId); - if(state.m_IA.Bytecode && !state.m_IA.Bytecode->DebugInfo.files.empty()) + if(state.inputAssembly.bytecode && !state.inputAssembly.bytecode->debugInfo.files.empty()) { - layout += QFormatStr(": %1() - %2") - .arg(state.m_IA.Bytecode->EntryPoint) - .arg(QFileInfo(state.m_IA.Bytecode->DebugInfo.files[0].Filename).fileName()); + layout += + QFormatStr(": %1() - %2") + .arg(state.inputAssembly.bytecode->entryPoint) + .arg(QFileInfo(state.inputAssembly.bytecode->debugInfo.files[0].filename).fileName()); } ui->iaBytecode->setText(layout); } else { - ui->iaBytecode->setText(ToQStr(state.m_IA.layout)); + ui->iaBytecode->setText(ToQStr(state.inputAssembly.resourceId)); } ui->iaBytecodeMismatch->setVisible(false); // check for IA-VS mismatches here. // This should be moved to a "Render Doctor" window reporting problems - if(state.m_IA.Bytecode && state.m_VS.ShaderDetails) + if(state.inputAssembly.bytecode && state.vertexShader.reflection) { QString mismatchDetails; // VS wants more elements - if(state.m_IA.Bytecode->InputSig.count() < state.m_VS.ShaderDetails->InputSig.count()) + if(state.inputAssembly.bytecode->inputSignature.count() < + state.vertexShader.reflection->inputSignature.count()) { - int excess = state.m_VS.ShaderDetails->InputSig.count() - state.m_IA.Bytecode->InputSig.count(); + int excess = state.vertexShader.reflection->inputSignature.count() - + state.inputAssembly.bytecode->inputSignature.count(); bool allSystem = true; @@ -1153,7 +1156,8 @@ void D3D11PipelineStateViewer::setState() // (ie. SV_VertexID or SV_InstanceID) for(int e = 0; e < excess; e++) { - if(state.m_VS.ShaderDetails->InputSig[state.m_VS.ShaderDetails->InputSig.count() - 1 - e] + if(state.vertexShader.reflection + ->inputSignature[state.vertexShader.reflection->inputSignature.count() - 1 - e] .systemValue == ShaderBuiltin::Undefined) { allSystem = false; @@ -1166,8 +1170,8 @@ void D3D11PipelineStateViewer::setState() } { - const rdcarray &IA = state.m_IA.Bytecode->InputSig; - const rdcarray &VS = state.m_VS.ShaderDetails->InputSig; + const rdcarray &IA = state.inputAssembly.bytecode->inputSignature; + const rdcarray &VS = state.vertexShader.reflection->inputSignature; int count = qMin(IA.count(), VS.count()); @@ -1225,30 +1229,32 @@ void D3D11PipelineStateViewer::setState() ui->iaLayouts->clear(); { int i = 0; - for(const D3D11Pipe::Layout &l : state.m_IA.layouts) + for(const D3D11Pipe::Layout &l : state.inputAssembly.layouts) { - QString byteOffs = QString::number(l.ByteOffset); + QString byteOffs = QString::number(l.byteOffset); // D3D11 specific value - if(l.ByteOffset == ~0U) + if(l.byteOffset == ~0U) { - byteOffs = lit("APPEND_ALIGNED (%1)").arg(layoutOffs[l.InputSlot]); + byteOffs = lit("APPEND_ALIGNED (%1)").arg(layoutOffs[l.inputSlot]); } else { - layoutOffs[l.InputSlot] = l.ByteOffset; + layoutOffs[l.inputSlot] = l.byteOffset; } - layoutOffs[l.InputSlot] += l.Format.compByteWidth * l.Format.compCount; + layoutOffs[l.inputSlot] += l.format.compByteWidth * l.format.compCount; bool filledSlot = true; bool usedSlot = false; - for(int ia = 0; state.m_IA.Bytecode && ia < state.m_IA.Bytecode->InputSig.count(); ia++) + for(int ia = 0; + state.inputAssembly.bytecode && ia < state.inputAssembly.bytecode->inputSignature.count(); + ia++) { - if(!QString(state.m_IA.Bytecode->InputSig[ia].semanticName) - .compare(l.SemanticName, Qt::CaseInsensitive) && - state.m_IA.Bytecode->InputSig[ia].semanticIndex == l.SemanticIndex) + if(!QString(state.inputAssembly.bytecode->inputSignature[ia].semanticName) + .compare(l.semanticName, Qt::CaseInsensitive) && + state.inputAssembly.bytecode->inputSignature[ia].semanticIndex == l.semanticIndex) { usedSlot = true; break; @@ -1258,12 +1264,12 @@ void D3D11PipelineStateViewer::setState() if(showNode(usedSlot, filledSlot)) { RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, l.SemanticName, l.SemanticIndex, l.Format.Name(), l.InputSlot, - byteOffs, l.PerInstance ? lit("PER_INSTANCE") : lit("PER_VERTEX"), - l.InstanceDataStepRate, QString()}); + new RDTreeWidgetItem({i, l.semanticName, l.semanticIndex, l.format.Name(), l.inputSlot, + byteOffs, l.perInstance ? lit("PER_INSTANCE") : lit("PER_VERTEX"), + l.instanceDataStepRate, QString()}); if(usedSlot) - usedVBuffers[l.InputSlot] = true; + usedVBuffers[l.inputSlot] = true; if(!usedSlot) setInactiveRow(node); @@ -1298,28 +1304,28 @@ void D3D11PipelineStateViewer::setState() ui->iaBuffers->beginUpdate(); ui->iaBuffers->clear(); - if(state.m_IA.ibuffer.Buffer != ResourceId()) + if(state.inputAssembly.indexBuffer.resourceId != ResourceId()) { if(ibufferUsed || ui->showDisabled->isChecked()) { uint64_t length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(state.m_IA.ibuffer.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(state.inputAssembly.indexBuffer.resourceId); if(buf) length = buf->length; RDTreeWidgetItem *node = new RDTreeWidgetItem( - {tr("Index"), state.m_IA.ibuffer.Buffer, draw ? draw->indexByteWidth : 0, - state.m_IA.ibuffer.Offset, (qulonglong)length, QString()}); + {tr("Index"), state.inputAssembly.indexBuffer.resourceId, draw ? draw->indexByteWidth : 0, + state.inputAssembly.indexBuffer.byteOffset, (qulonglong)length, QString()}); node->setTag(QVariant::fromValue( - D3D11VBIBTag(state.m_IA.ibuffer.Buffer, draw ? draw->indexOffset : 0))); + D3D11VBIBTag(state.inputAssembly.indexBuffer.resourceId, draw ? draw->indexOffset : 0))); if(!ibufferUsed) setInactiveRow(node); - if(state.m_IA.ibuffer.Buffer == ResourceId()) + if(state.inputAssembly.indexBuffer.resourceId == ResourceId()) setEmptyRow(node); ui->iaBuffers->addTopLevelItem(node); @@ -1333,7 +1339,7 @@ void D3D11PipelineStateViewer::setState() {tr("Index"), tr("No Buffer Set"), lit("-"), lit("-"), lit("-"), QString()}); node->setTag(QVariant::fromValue( - D3D11VBIBTag(state.m_IA.ibuffer.Buffer, draw ? draw->indexOffset : 0))); + D3D11VBIBTag(state.inputAssembly.indexBuffer.resourceId, draw ? draw->indexOffset : 0))); setEmptyRow(node); @@ -1346,30 +1352,30 @@ void D3D11PipelineStateViewer::setState() m_VBNodes.clear(); - for(int i = 0; i < state.m_IA.vbuffers.count(); i++) + for(int i = 0; i < state.inputAssembly.vertexBuffers.count(); i++) { - const D3D11Pipe::VB &v = state.m_IA.vbuffers[i]; + const D3D11Pipe::VertexBuffer &v = state.inputAssembly.vertexBuffers[i]; - bool filledSlot = (v.Buffer != ResourceId()); + bool filledSlot = (v.resourceId != ResourceId()); bool usedSlot = (usedVBuffers[i]); if(showNode(usedSlot, filledSlot)) { qulonglong length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(v.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(v.resourceId); if(buf) length = buf->length; RDTreeWidgetItem *node = NULL; if(filledSlot) - node = new RDTreeWidgetItem({i, v.Buffer, v.Stride, v.Offset, length, QString()}); + node = new RDTreeWidgetItem({i, v.resourceId, v.byteStride, v.byteOffset, length, QString()}); else node = new RDTreeWidgetItem({i, tr("No Buffer Set"), lit("-"), lit("-"), lit("-"), QString()}); - node->setTag(QVariant::fromValue(D3D11VBIBTag(v.Buffer, v.Offset))); + node->setTag(QVariant::fromValue(D3D11VBIBTag(v.resourceId, v.byteOffset))); if(!filledSlot) setEmptyRow(node); @@ -1386,35 +1392,35 @@ void D3D11PipelineStateViewer::setState() ui->iaBuffers->endUpdate(); ui->iaBuffers->verticalScrollBar()->setValue(vs); - setShaderState(state.m_VS, ui->vsShader, ui->vsResources, ui->vsSamplers, ui->vsCBuffers, + setShaderState(state.vertexShader, ui->vsShader, ui->vsResources, ui->vsSamplers, ui->vsCBuffers, ui->vsClasses); - setShaderState(state.m_GS, ui->gsShader, ui->gsResources, ui->gsSamplers, ui->gsCBuffers, - ui->gsClasses); - setShaderState(state.m_HS, ui->hsShader, ui->hsResources, ui->hsSamplers, ui->hsCBuffers, + setShaderState(state.geometryShader, ui->gsShader, ui->gsResources, ui->gsSamplers, + ui->gsCBuffers, ui->gsClasses); + setShaderState(state.hullShader, ui->hsShader, ui->hsResources, ui->hsSamplers, ui->hsCBuffers, ui->hsClasses); - setShaderState(state.m_DS, ui->dsShader, ui->dsResources, ui->dsSamplers, ui->dsCBuffers, + setShaderState(state.domainShader, ui->dsShader, ui->dsResources, ui->dsSamplers, ui->dsCBuffers, ui->dsClasses); - setShaderState(state.m_PS, ui->psShader, ui->psResources, ui->psSamplers, ui->psCBuffers, + setShaderState(state.pixelShader, ui->psShader, ui->psResources, ui->psSamplers, ui->psCBuffers, ui->psClasses); - setShaderState(state.m_CS, ui->csShader, ui->csResources, ui->csSamplers, ui->csCBuffers, + setShaderState(state.computeShader, ui->csShader, ui->csResources, ui->csSamplers, ui->csCBuffers, ui->csClasses); vs = ui->csUAVs->verticalScrollBar()->value(); ui->csUAVs->beginUpdate(); ui->csUAVs->clear(); - for(int i = 0; i < state.m_CS.UAVs.count(); i++) + for(int i = 0; i < state.computeShader.uavs.count(); i++) { const ShaderResource *shaderInput = NULL; - const BindpointMap *map = NULL; + const Bindpoint *map = NULL; - const D3D11Pipe::Shader &cs = state.m_CS; + const D3D11Pipe::Shader &cs = state.computeShader; - if(cs.ShaderDetails) + if(cs.reflection) { - for(int b = 0; b < cs.ShaderDetails->ReadWriteResources.count(); b++) + for(int b = 0; b < cs.reflection->readWriteResources.count(); b++) { - const ShaderResource &res = cs.ShaderDetails->ReadWriteResources[b]; - const BindpointMap &bind = cs.BindpointMapping.ReadWriteResources[b]; + const ShaderResource &res = cs.reflection->readWriteResources[b]; + const Bindpoint &bind = cs.bindpointMapping.readWriteResources[b]; if(bind.bind == i) { @@ -1425,8 +1431,8 @@ void D3D11PipelineStateViewer::setState() } } - addResourceRow(D3D11ViewTag(D3D11ViewTag::UAV, i, state.m_CS.UAVs[i]), shaderInput, map, - ui->csUAVs); + addResourceRow(D3D11ViewTag(D3D11ViewTag::UAV, i, state.computeShader.uavs[i]), shaderInput, + map, ui->csUAVs); } ui->csUAVs->clearSelection(); ui->csUAVs->endUpdate(); @@ -1436,24 +1442,25 @@ void D3D11PipelineStateViewer::setState() vs = ui->gsStreamOut->verticalScrollBar()->value(); ui->gsStreamOut->beginUpdate(); ui->gsStreamOut->clear(); - for(int i = 0; i < state.m_SO.Outputs.count(); i++) + for(int i = 0; i < state.streamOut.outputs.count(); i++) { - const D3D11Pipe::SOBind &s = state.m_SO.Outputs[i]; + const D3D11Pipe::StreamOutBind &s = state.streamOut.outputs[i]; - bool filledSlot = (s.Buffer != ResourceId()); + bool filledSlot = (s.resourceId != ResourceId()); bool usedSlot = (filledSlot); if(showNode(usedSlot, filledSlot)) { qulonglong length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(s.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(s.resourceId); if(buf) length = buf->length; - RDTreeWidgetItem *node = new RDTreeWidgetItem({i, s.Buffer, length, s.Offset, QString()}); + RDTreeWidgetItem *node = + new RDTreeWidgetItem({i, s.resourceId, length, s.byteOffset, QString()}); - node->setTag(QVariant::fromValue(s.Buffer)); + node->setTag(QVariant::fromValue(s.resourceId)); if(!filledSlot) setEmptyRow(node); @@ -1477,19 +1484,19 @@ void D3D11PipelineStateViewer::setState() vs = ui->viewports->verticalScrollBar()->value(); ui->viewports->beginUpdate(); ui->viewports->clear(); - for(int i = 0; i < state.m_RS.Viewports.count(); i++) + for(int i = 0; i < state.rasterizer.viewports.count(); i++) { - const D3D11Pipe::Viewport &v = state.m_RS.Viewports[i]; + const Viewport &v = state.rasterizer.viewports[i]; - if(v.Enabled || ui->showEmpty->isChecked()) + if(v.enabled || ui->showEmpty->isChecked()) { RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, v.X, v.Y, v.Width, v.Height, v.MinDepth, v.MaxDepth}); + new RDTreeWidgetItem({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth}); - if(v.Width == 0 || v.Height == 0 || v.MinDepth == v.MaxDepth) + if(v.width == 0 || v.height == 0 || v.minDepth == v.maxDepth) setEmptyRow(node); - if(!v.Enabled) + if(!v.enabled) setInactiveRow(node); ui->viewports->addTopLevelItem(node); @@ -1502,19 +1509,18 @@ void D3D11PipelineStateViewer::setState() vs = ui->scissors->verticalScrollBar()->value(); ui->scissors->beginUpdate(); ui->scissors->clear(); - for(int i = 0; i < state.m_RS.Scissors.count(); i++) + for(int i = 0; i < state.rasterizer.scissors.count(); i++) { - const D3D11Pipe::Scissor &s = state.m_RS.Scissors[i]; + const Scissor &s = state.rasterizer.scissors[i]; - if(s.Enabled || ui->showEmpty->isChecked()) + if(s.enabled || ui->showEmpty->isChecked()) { - RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, s.left, s.top, s.right - s.left, s.bottom - s.top}); + RDTreeWidgetItem *node = new RDTreeWidgetItem({i, s.x, s.y, s.width, s.height}); - if(s.right == s.left || s.bottom == s.top) + if(s.width == 0 || s.height == 0) setEmptyRow(node); - if(!s.Enabled) + if(!s.enabled) setInactiveRow(node); ui->scissors->addTopLevelItem(node); @@ -1524,36 +1530,36 @@ void D3D11PipelineStateViewer::setState() ui->scissors->verticalScrollBar()->setValue(vs); ui->scissors->endUpdate(); - ui->rastState->setText(ToQStr(state.m_RS.m_State.State)); + ui->rastState->setText(ToQStr(state.rasterizer.state.resourceId)); - ui->fillMode->setText(ToQStr(state.m_RS.m_State.fillMode)); - ui->cullMode->setText(ToQStr(state.m_RS.m_State.cullMode)); - ui->frontCCW->setPixmap(state.m_RS.m_State.FrontCCW ? tick : cross); + ui->fillMode->setText(ToQStr(state.rasterizer.state.fillMode)); + ui->cullMode->setText(ToQStr(state.rasterizer.state.cullMode)); + ui->frontCCW->setPixmap(state.rasterizer.state.frontCCW ? tick : cross); - ui->scissorEnabled->setPixmap(state.m_RS.m_State.ScissorEnable ? tick : cross); - ui->lineAA->setPixmap(state.m_RS.m_State.AntialiasedLineEnable ? tick : cross); - ui->multisample->setPixmap(state.m_RS.m_State.MultisampleEnable ? tick : cross); + ui->scissorEnabled->setPixmap(state.rasterizer.state.scissorEnable ? tick : cross); + ui->lineAA->setPixmap(state.rasterizer.state.antialiasedLines ? tick : cross); + ui->multisample->setPixmap(state.rasterizer.state.multisampleEnable ? tick : cross); - ui->depthClip->setPixmap(state.m_RS.m_State.DepthClip ? tick : cross); - ui->depthBias->setText(Formatter::Format(state.m_RS.m_State.DepthBias)); - ui->depthBiasClamp->setText(Formatter::Format(state.m_RS.m_State.DepthBiasClamp)); - ui->slopeScaledBias->setText(Formatter::Format(state.m_RS.m_State.SlopeScaledDepthBias)); - ui->forcedSampleCount->setText(QString::number(state.m_RS.m_State.ForcedSampleCount)); - ui->conservativeRaster->setPixmap(state.m_RS.m_State.ConservativeRasterization ? tick : cross); + ui->depthClip->setPixmap(state.rasterizer.state.depthClip ? tick : cross); + ui->depthBias->setText(Formatter::Format(state.rasterizer.state.depthBias)); + ui->depthBiasClamp->setText(Formatter::Format(state.rasterizer.state.depthBiasClamp)); + ui->slopeScaledBias->setText(Formatter::Format(state.rasterizer.state.slopeScaledDepthBias)); + ui->forcedSampleCount->setText(QString::number(state.rasterizer.state.forcedSampleCount)); + ui->conservativeRaster->setPixmap(state.rasterizer.state.conservativeRasterization ? tick : cross); //////////////////////////////////////////////// // Predication - if(state.m_Predicate.Obj == ResourceId()) + if(state.predication.resourceId == ResourceId()) { ui->predicateGroup->setVisible(false); } else { ui->predicateGroup->setVisible(true); - ui->predicate->setText(ToQStr(state.m_Predicate.Obj)); - ui->predicateValue->setText(state.m_Predicate.Value ? lit("TRUE") : lit("FALSE")); - ui->predicatePassing->setPixmap(state.m_Predicate.Passing ? tick : cross); + ui->predicate->setText(ToQStr(state.predication.resourceId)); + ui->predicateValue->setText(state.predication.value ? lit("TRUE") : lit("FALSE")); + ui->predicatePassing->setPixmap(state.predication.isPassing ? tick : cross); } //////////////////////////////////////////////// @@ -1565,36 +1571,36 @@ void D3D11PipelineStateViewer::setState() ui->targetOutputs->beginUpdate(); ui->targetOutputs->clear(); { - for(int i = 0; i < state.m_OM.RenderTargets.count(); i++) + for(int i = 0; i < state.outputMerger.renderTargets.count(); i++) { - addResourceRow(D3D11ViewTag(D3D11ViewTag::OMTarget, i, state.m_OM.RenderTargets[i]), NULL, - NULL, ui->targetOutputs); + addResourceRow(D3D11ViewTag(D3D11ViewTag::OMTarget, i, state.outputMerger.renderTargets[i]), + NULL, NULL, ui->targetOutputs); - if(state.m_OM.RenderTargets[i].Resource != ResourceId()) + if(state.outputMerger.renderTargets[i].resourceResourceId != ResourceId()) targets[i] = true; } - for(int i = 0; i < state.m_OM.UAVs.count(); i++) + for(int i = 0; i < state.outputMerger.uavs.count(); i++) { const ShaderResource *shaderInput = NULL; - const BindpointMap *map = NULL; + const Bindpoint *map = NULL; // any non-CS shader can use these. When that's not supported (Before feature level 11.1) // this search will just boil down to only PS. // When multiple stages use the UAV, we allow the last stage to 'win' and define its type, // although it would be very surprising if the types were actually different anyway. - const D3D11Pipe::Shader *nonCS[] = {&state.m_VS, &state.m_DS, &state.m_HS, &state.m_GS, - &state.m_PS}; + const D3D11Pipe::Shader *nonCS[] = {&state.vertexShader, &state.domainShader, &state.hullShader, + &state.geometryShader, &state.pixelShader}; for(const D3D11Pipe::Shader *stage : nonCS) { - if(stage->ShaderDetails) + if(stage->reflection) { - for(int b = 0; b < stage->ShaderDetails->ReadWriteResources.count(); b++) + for(int b = 0; b < stage->reflection->readWriteResources.count(); b++) { - const ShaderResource &res = stage->ShaderDetails->ReadWriteResources[b]; - const BindpointMap &bind = stage->BindpointMapping.ReadWriteResources[b]; + const ShaderResource &res = stage->reflection->readWriteResources[b]; + const Bindpoint &bind = stage->bindpointMapping.readWriteResources[b]; - if(bind.bind == i + (int)state.m_OM.UAVStartSlot) + if(bind.bind == i + (int)state.outputMerger.uavStartSlot) { shaderInput = &res; map = &bind; @@ -1603,12 +1609,12 @@ void D3D11PipelineStateViewer::setState() } } } - addResourceRow(D3D11ViewTag(D3D11ViewTag::UAV, i, state.m_OM.UAVs[i]), shaderInput, map, - ui->targetOutputs); + addResourceRow(D3D11ViewTag(D3D11ViewTag::UAV, i, state.outputMerger.uavs[i]), shaderInput, + map, ui->targetOutputs); } - addResourceRow(D3D11ViewTag(D3D11ViewTag::OMDepth, 0, state.m_OM.DepthTarget), NULL, NULL, - ui->targetOutputs); + addResourceRow(D3D11ViewTag(D3D11ViewTag::OMDepth, 0, state.outputMerger.depthTarget), NULL, + NULL, ui->targetOutputs); } ui->targetOutputs->clearSelection(); ui->targetOutputs->endUpdate(); @@ -1619,32 +1625,32 @@ void D3D11PipelineStateViewer::setState() ui->blends->clear(); { int i = 0; - for(const D3D11Pipe::Blend &blend : state.m_OM.m_BlendState.Blends) + for(const ColorBlend &blend : state.outputMerger.blendState.blends) { - bool filledSlot = (blend.Enabled || targets[i]); + bool filledSlot = (blend.enabled || targets[i]); bool usedSlot = (targets[i]); if(showNode(usedSlot, filledSlot)) { RDTreeWidgetItem *node = NULL; - node = new RDTreeWidgetItem({i, blend.Enabled ? tr("True") : tr("False"), - blend.LogicEnabled ? tr("True") : tr("False"), + node = new RDTreeWidgetItem( + {i, blend.enabled ? tr("True") : tr("False"), + blend.logicOperationEnabled ? tr("True") : tr("False"), - ToQStr(blend.m_Blend.Source), ToQStr(blend.m_Blend.Destination), - ToQStr(blend.m_Blend.Operation), + ToQStr(blend.colorBlend.source), ToQStr(blend.colorBlend.destination), + ToQStr(blend.colorBlend.operation), - ToQStr(blend.m_AlphaBlend.Source), - ToQStr(blend.m_AlphaBlend.Destination), - ToQStr(blend.m_AlphaBlend.Operation), + ToQStr(blend.alphaBlend.source), ToQStr(blend.alphaBlend.destination), + ToQStr(blend.alphaBlend.operation), - ToQStr(blend.Logic), + ToQStr(blend.logicOperation), - QFormatStr("%1%2%3%4") - .arg((blend.WriteMask & 0x1) == 0 ? lit("_") : lit("R")) - .arg((blend.WriteMask & 0x2) == 0 ? lit("_") : lit("G")) - .arg((blend.WriteMask & 0x4) == 0 ? lit("_") : lit("B")) - .arg((blend.WriteMask & 0x8) == 0 ? lit("_") : lit("A"))}); + QFormatStr("%1%2%3%4") + .arg((blend.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + .arg((blend.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + .arg((blend.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + .arg((blend.writeMask & 0x8) == 0 ? lit("_") : lit("A"))}); if(!filledSlot) setEmptyRow(node); @@ -1662,45 +1668,49 @@ void D3D11PipelineStateViewer::setState() ui->blends->endUpdate(); ui->blends->verticalScrollBar()->setValue(vs); - ui->blendState->setText(ToQStr(state.m_OM.m_BlendState.State)); + ui->blendState->setText(ToQStr(state.outputMerger.blendState.resourceId)); - ui->alphaToCoverage->setPixmap(state.m_OM.m_BlendState.AlphaToCoverage ? tick : cross); - ui->independentBlend->setPixmap(state.m_OM.m_BlendState.IndependentBlend ? tick : cross); - ui->sampleMask->setText(Formatter::Format(state.m_OM.m_BlendState.SampleMask, true)); + ui->alphaToCoverage->setPixmap(state.outputMerger.blendState.alphaToCoverage ? tick : cross); + ui->independentBlend->setPixmap(state.outputMerger.blendState.independentBlend ? tick : cross); + ui->sampleMask->setText(Formatter::Format(state.outputMerger.blendState.sampleMask, true)); ui->blendFactor->setText(QFormatStr("%1, %2, %3, %4") - .arg(state.m_OM.m_BlendState.BlendFactor[0], 0, 'f', 2) - .arg(state.m_OM.m_BlendState.BlendFactor[1], 0, 'f', 2) - .arg(state.m_OM.m_BlendState.BlendFactor[2], 0, 'f', 2) - .arg(state.m_OM.m_BlendState.BlendFactor[3], 0, 'f', 2)); + .arg(state.outputMerger.blendState.blendFactor[0], 0, 'f', 2) + .arg(state.outputMerger.blendState.blendFactor[1], 0, 'f', 2) + .arg(state.outputMerger.blendState.blendFactor[2], 0, 'f', 2) + .arg(state.outputMerger.blendState.blendFactor[3], 0, 'f', 2)); - ui->depthState->setText(ToQStr(state.m_OM.m_State.State)); + ui->depthState->setText(ToQStr(state.outputMerger.depthStencilState.resourceId)); - ui->depthEnabled->setPixmap(state.m_OM.m_State.DepthEnable ? tick : cross); - ui->depthFunc->setText(ToQStr(state.m_OM.m_State.DepthFunc)); - ui->depthWrite->setPixmap(state.m_OM.m_State.DepthWrites ? tick : cross); + ui->depthEnabled->setPixmap(state.outputMerger.depthStencilState.depthEnable ? tick : cross); + ui->depthFunc->setText(ToQStr(state.outputMerger.depthStencilState.depthFunction)); + ui->depthWrite->setPixmap(state.outputMerger.depthStencilState.depthWrites ? tick : cross); - ui->stencilEnabled->setPixmap(state.m_OM.m_State.StencilEnable ? tick : cross); - ui->stencilReadMask->setText(Formatter::Format(state.m_OM.m_State.StencilReadMask, true)); - ui->stencilWriteMask->setText(Formatter::Format(state.m_OM.m_State.StencilWriteMask, true)); - ui->stencilRef->setText(Formatter::Format(state.m_OM.m_State.StencilRef, true)); + ui->stencilEnabled->setPixmap(state.outputMerger.depthStencilState.stencilEnable ? tick : cross); + ui->stencilReadMask->setText( + Formatter::Format(state.outputMerger.depthStencilState.frontFace.compareMask, true)); + ui->stencilWriteMask->setText( + Formatter::Format(state.outputMerger.depthStencilState.frontFace.writeMask, true)); + ui->stencilRef->setText( + Formatter::Format(state.outputMerger.depthStencilState.frontFace.reference, true)); ui->stencils->beginUpdate(); ui->stencils->clear(); - ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Front"), ToQStr(state.m_OM.m_State.m_FrontFace.Func), - ToQStr(state.m_OM.m_State.m_FrontFace.FailOp), - ToQStr(state.m_OM.m_State.m_FrontFace.DepthFailOp), - ToQStr(state.m_OM.m_State.m_FrontFace.PassOp)})); ui->stencils->addTopLevelItem(new RDTreeWidgetItem( - {tr("Back"), ToQStr(state.m_OM.m_State.m_BackFace.Func), - ToQStr(state.m_OM.m_State.m_BackFace.FailOp), ToQStr(state.m_OM.m_State.m_BackFace.DepthFailOp), - ToQStr(state.m_OM.m_State.m_BackFace.PassOp)})); + {tr("Front"), ToQStr(state.outputMerger.depthStencilState.frontFace.function), + ToQStr(state.outputMerger.depthStencilState.frontFace.failOperation), + ToQStr(state.outputMerger.depthStencilState.frontFace.depthFailOperation), + ToQStr(state.outputMerger.depthStencilState.frontFace.passOperation)})); + ui->stencils->addTopLevelItem(new RDTreeWidgetItem( + {tr("Back"), ToQStr(state.outputMerger.depthStencilState.backFace.function), + ToQStr(state.outputMerger.depthStencilState.backFace.failOperation), + ToQStr(state.outputMerger.depthStencilState.backFace.depthFailOperation), + ToQStr(state.outputMerger.depthStencilState.backFace.passOperation)})); ui->stencils->clearSelection(); ui->stencils->endUpdate(); // set up thread debugging inputs - if(state.m_CS.ShaderDetails && draw && (draw->flags & DrawFlags::Dispatch)) + if(state.computeShader.reflection && draw && (draw->flags & DrawFlags::Dispatch)) { ui->groupX->setEnabled(true); ui->groupY->setEnabled(true); @@ -1719,9 +1729,9 @@ void D3D11PipelineStateViewer::setState() if(draw->dispatchThreadsDimension[0] == 0) { - ui->threadX->setMaximum((int)state.m_CS.ShaderDetails->DispatchThreadsDimension[0] - 1); - ui->threadY->setMaximum((int)state.m_CS.ShaderDetails->DispatchThreadsDimension[1] - 1); - ui->threadZ->setMaximum((int)state.m_CS.ShaderDetails->DispatchThreadsDimension[2] - 1); + ui->threadX->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[0] - 1); + ui->threadY->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[1] - 1); + ui->threadZ->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[2] - 1); } else { @@ -1754,9 +1764,10 @@ void D3D11PipelineStateViewer::setState() } else { - ui->pipeFlow->setStagesEnabled( - {true, true, state.m_HS.Object != ResourceId(), state.m_DS.Object != ResourceId(), - state.m_GS.Object != ResourceId(), true, state.m_PS.Object != ResourceId(), true, false}); + ui->pipeFlow->setStagesEnabled({true, true, state.hullShader.resourceId != ResourceId(), + state.domainShader.resourceId != ResourceId(), + state.geometryShader.resourceId != ResourceId(), true, + state.pixelShader.resourceId != ResourceId(), true, false}); } } @@ -1821,15 +1832,15 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in else if(tag.canConvert()) { D3D11ViewTag view = tag.value(); - tex = m_Ctx.GetTexture(view.res.Resource); - buf = m_Ctx.GetBuffer(view.res.Resource); + tex = m_Ctx.GetTexture(view.res.resourceResourceId); + buf = m_Ctx.GetBuffer(view.res.resourceResourceId); } if(tex) { - if(tex->resType == TextureDim::Buffer) + if(tex->type == TextureType::Buffer) { - IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->ID); + IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -1838,7 +1849,7 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in if(!m_Ctx.HasTextureViewer()) m_Ctx.ShowTextureViewer(); ITextureViewer *viewer = m_Ctx.GetTextureViewer(); - viewer->ViewTexture(tex->ID, true); + viewer->ViewTexture(tex->resourceId, true); } return; @@ -1852,10 +1863,10 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in uint64_t offs = 0; uint64_t size = buf->length; - if(view.res.Resource != ResourceId()) + if(view.res.resourceResourceId != ResourceId()) { - offs = uint64_t(view.res.FirstElement) * view.res.ElementSize; - size = uint64_t(view.res.NumElements) * view.res.ElementSize; + offs = uint64_t(view.res.firstElement) * view.res.elementByteSize; + size = uint64_t(view.res.numElements) * view.res.elementByteSize; } else { @@ -1863,12 +1874,12 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in if(stage->stage == ShaderStage::Geometry) { - for(int i = 0; i < m_Ctx.CurD3D11PipelineState().m_SO.Outputs.count(); i++) + for(int i = 0; i < m_Ctx.CurD3D11PipelineState().streamOut.outputs.count(); i++) { - if(buf->ID == m_Ctx.CurD3D11PipelineState().m_SO.Outputs[i].Buffer) + if(buf->resourceId == m_Ctx.CurD3D11PipelineState().streamOut.outputs[i].resourceId) { - size -= m_Ctx.CurD3D11PipelineState().m_SO.Outputs[i].Offset; - offs += m_Ctx.CurD3D11PipelineState().m_SO.Outputs[i].Offset; + size -= m_Ctx.CurD3D11PipelineState().streamOut.outputs[i].byteOffset; + offs += m_Ctx.CurD3D11PipelineState().streamOut.outputs[i].byteOffset; break; } } @@ -1891,18 +1902,18 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in if(view.type == D3D11ViewTag::UAV && stage->stage != ShaderStage::Compute) { const D3D11Pipe::State &state = m_Ctx.CurD3D11PipelineState(); - const D3D11Pipe::Shader *nonCS[] = {&state.m_VS, &state.m_DS, &state.m_HS, &state.m_GS, - &state.m_PS}; + const D3D11Pipe::Shader *nonCS[] = {&state.vertexShader, &state.domainShader, &state.hullShader, + &state.geometryShader, &state.pixelShader}; - bind += state.m_OM.UAVStartSlot; + bind += state.outputMerger.uavStartSlot; for(const D3D11Pipe::Shader *searchstage : nonCS) { - if(searchstage->ShaderDetails) + if(searchstage->reflection) { - for(const ShaderResource &res : searchstage->ShaderDetails->ReadWriteResources) + for(const ShaderResource &res : searchstage->reflection->readWriteResources) { - if(!res.IsTexture && res.bindPoint == bind) + if(!res.isTexture && res.bindPoint == bind) { stage = searchstage; break; @@ -1912,19 +1923,19 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } } - if(stage->ShaderDetails) + if(stage->reflection) { const rdcarray &resArray = view.type == D3D11ViewTag::SRV - ? stage->ShaderDetails->ReadOnlyResources - : stage->ShaderDetails->ReadWriteResources; + ? stage->reflection->readOnlyResources + : stage->reflection->readWriteResources; - const rdcarray &bindArray = view.type == D3D11ViewTag::SRV - ? stage->BindpointMapping.ReadOnlyResources - : stage->BindpointMapping.ReadWriteResources; + const rdcarray &bindArray = view.type == D3D11ViewTag::SRV + ? stage->bindpointMapping.readOnlyResources + : stage->bindpointMapping.readWriteResources; for(const ShaderResource &res : resArray) { - if(!res.IsTexture && res.bindPoint < bindArray.count() && + if(!res.isTexture && res.bindPoint < bindArray.count() && bindArray[res.bindPoint].bind == bind) { shaderRes = &res; @@ -1947,17 +1958,17 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in { const auto &desc = res.variableType.descriptor; - if(view.res.Format.Name().empty()) + if(view.res.viewFormat.Name().empty()) { format = QString(); if(desc.rowMajorStorage) format += lit("row_major "); format += ToQStr(desc.type); - if(desc.rows > 1 && desc.cols > 1) - format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.cols); - else if(desc.cols > 1) - format += QString::number(desc.cols); + if(desc.rows > 1 && desc.columns > 1) + format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.columns); + else if(desc.columns > 1) + format += QString::number(desc.columns); if(!desc.name.empty()) format += lit(" ") + desc.name; @@ -1967,7 +1978,7 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } else { - const ResourceFormat &fmt = view.res.Format; + const ResourceFormat &fmt = view.res.viewFormat; if(fmt.type == ResourceFormatType::R10G10B10A2) { if(fmt.compType == CompType::UInt) @@ -2025,7 +2036,7 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } } - if(view.res.Flags & D3DBufferViewFlags::Raw) + if(view.res.bufferFlags & D3DBufferViewFlags::Raw) format = lit("xint"); format += QString::number(fmt.compCount); @@ -2034,7 +2045,7 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } } - IBufferViewer *viewer = m_Ctx.ViewBuffer(offs, size, view.res.Resource, format); + IBufferViewer *viewer = m_Ctx.ViewBuffer(offs, size, view.res.resourceResourceId, format); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -2056,9 +2067,9 @@ void D3D11PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int int cbufIdx = -1; - for(int i = 0; i < stage->BindpointMapping.ConstantBlocks.count(); i++) + for(int i = 0; i < stage->bindpointMapping.constantBlocks.count(); i++) { - if(stage->BindpointMapping.ConstantBlocks[i].bind == cb) + if(stage->bindpointMapping.constantBlocks[i].bind == cb) { cbufIdx = i; break; @@ -2068,13 +2079,13 @@ void D3D11PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int if(cbufIdx == -1) { // unused cbuffer, open regular buffer viewer - if(cb >= stage->ConstantBuffers.count()) + if(cb >= stage->constantBuffers.count()) return; - const D3D11Pipe::CBuffer &bind = stage->ConstantBuffers[cb]; + const D3D11Pipe::ConstantBuffer &bind = stage->constantBuffers[cb]; - IBufferViewer *viewer = m_Ctx.ViewBuffer(bind.VecOffset * sizeof(float) * 4, - bind.VecCount * sizeof(float) * 4, bind.Buffer); + IBufferViewer *viewer = m_Ctx.ViewBuffer(bind.vecOffset * sizeof(float) * 4, + bind.vecCount * sizeof(float) * 4, bind.resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); return; @@ -2111,7 +2122,7 @@ void D3D11PipelineStateViewer::highlightIABind(int slot) { int idx = ((slot + 1) * 21) % 32; // space neighbouring colours reasonably distinctly - const D3D11Pipe::IA &IA = m_Ctx.CurD3D11PipelineState().m_IA; + const D3D11Pipe::InputAssembly &IA = m_Ctx.CurD3D11PipelineState().inputAssembly; QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); @@ -2131,7 +2142,7 @@ void D3D11PipelineStateViewer::highlightIABind(int slot) { RDTreeWidgetItem *item = ui->iaLayouts->topLevelItem(i); - if((int)IA.layouts[i].InputSlot != slot) + if((int)IA.layouts[i].inputSlot != slot) { item->setBackground(QBrush()); item->setForeground(QBrush()); @@ -2156,13 +2167,13 @@ void D3D11PipelineStateViewer::on_iaLayouts_mouseMove(QMouseEvent *e) vertex_leave(NULL); - const D3D11Pipe::IA &IA = m_Ctx.CurD3D11PipelineState().m_IA; + const D3D11Pipe::InputAssembly &IA = m_Ctx.CurD3D11PipelineState().inputAssembly; if(idx.isValid()) { if(idx.row() >= 0 && idx.row() < IA.layouts.count()) { - uint32_t buffer = IA.layouts[idx.row()].InputSlot; + uint32_t buffer = IA.layouts[idx.row()].inputSlot; highlightIABind((int)buffer); } @@ -2230,16 +2241,16 @@ void D3D11PipelineStateViewer::shaderView_clicked() QWidget *sender = qobject_cast(QObject::sender()); if(sender == ui->iaBytecode || sender == ui->iaBytecodeViewButton) { - shaderDetails = m_Ctx.CurD3D11PipelineState().m_IA.Bytecode; + shaderDetails = m_Ctx.CurD3D11PipelineState().inputAssembly.bytecode; } else { const D3D11Pipe::Shader *stage = stageForSender(sender); - if(stage == NULL || stage->Object == ResourceId()) + if(stage == NULL || stage->resourceId == ResourceId()) return; - shaderDetails = stage->ShaderDetails; + shaderDetails = stage->reflection; } IShaderViewer *shad = m_Ctx.ViewShader(shaderDetails, ResourceId()); @@ -2252,10 +2263,10 @@ void D3D11PipelineStateViewer::shaderEdit_clicked() QWidget *sender = qobject_cast(QObject::sender()); const D3D11Pipe::Shader *stage = stageForSender(sender); - if(!stage || stage->Object == ResourceId()) + if(!stage || stage->resourceId == ResourceId()) return; - const ShaderReflection *shaderDetails = stage->ShaderDetails; + const ShaderReflection *shaderDetails = stage->reflection; if(!shaderDetails) return; @@ -2276,7 +2287,7 @@ void D3D11PipelineStateViewer::shaderEdit_clicked() if(files.empty()) return; - m_Common.EditShader(stage->stage, stage->Object, shaderDetails, entryFunc, files); + m_Common.EditShader(stage->stage, stage->resourceId, shaderDetails, entryFunc, files); } void D3D11PipelineStateViewer::shaderSave_clicked() @@ -2286,9 +2297,9 @@ void D3D11PipelineStateViewer::shaderSave_clicked() if(stage == NULL) return; - ShaderReflection *shaderDetails = stage->ShaderDetails; + ShaderReflection *shaderDetails = stage->reflection; - if(stage->Object == ResourceId()) + if(stage->resourceId == ResourceId()) return; m_Common.SaveShaderFile(shaderDetails); @@ -2304,7 +2315,7 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie if(refl) { - for(const ShaderResource &bind : refl->ReadOnlyResources) + for(const ShaderResource &bind : refl->readOnlyResources) { if(bind.bindPoint == i) { @@ -2312,7 +2323,7 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie break; } } - for(const ShaderResource &bind : refl->ReadWriteResources) + for(const ShaderResource &bind : refl->readWriteResources) { if(bind.bindPoint == i) { @@ -2323,18 +2334,19 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie } } - QString name = - view.Resource == ResourceId() ? tr("Empty") : QString(m_Ctx.GetResourceName(view.Resource)); + QString name = view.resourceResourceId == ResourceId() + ? tr("Empty") + : QString(m_Ctx.GetResourceName(view.resourceResourceId)); QString typeName = tr("Unknown"); QString format = tr("Unknown"); uint64_t w = 1; uint32_t h = 1, d = 1; uint32_t a = 0; - QString viewFormat = view.Format.Name(); + QString viewFormat = view.viewFormat.Name(); - TextureDescription *tex = m_Ctx.GetTexture(view.Resource); - BufferDescription *buf = m_Ctx.GetBuffer(view.Resource); + TextureDescription *tex = m_Ctx.GetTexture(view.resourceResourceId); + BufferDescription *buf = m_Ctx.GetBuffer(view.resourceResourceId); QString viewParams; @@ -2346,17 +2358,16 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); if(tex->mips > 1) - viewParams = tr("Highest Mip: %1, Num Mips: %2").arg(view.HighestMip).arg(view.NumMipLevels); + viewParams = tr("Highest Mip: %1, Num Mips: %2").arg(view.firstMip).arg(view.numMips); if(tex->arraysize > 1) { if(!viewParams.isEmpty()) viewParams += lit(", "); - viewParams += - tr("First Slice: %1, Array Size: %2").arg(view.FirstArraySlice).arg(view.ArraySize); + viewParams += tr("First Slice: %1, Array Size: %2").arg(view.firstSlice).arg(view.numSlices); } } @@ -2367,29 +2378,29 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie h = 0; d = 0; a = 0; - format = view.Format.Name(); + format = view.viewFormat.Name(); typeName = lit("Buffer"); - if(view.Flags & D3DBufferViewFlags::Raw) + if(view.bufferFlags & D3DBufferViewFlags::Raw) { typeName = rw ? lit("RWByteAddressBuffer") : lit("ByteAddressBuffer"); } - else if(view.ElementSize > 0) + else if(view.elementByteSize > 0) { // for structured buffers, display how many 'elements' there are in the buffer typeName = QFormatStr("%1[%2]") .arg(rw ? lit("RWStructuredBuffer") : lit("StructuredBuffer")) - .arg(buf->length / view.ElementSize); + .arg(buf->length / view.elementByteSize); } - if(view.Flags & D3DBufferViewFlags::Append || view.Flags & D3DBufferViewFlags::Counter) + if(view.bufferFlags & D3DBufferViewFlags::Append || view.bufferFlags & D3DBufferViewFlags::Counter) { - typeName += tr(" (Count: %1)").arg(view.BufferStructCount); + typeName += tr(" (Count: %1)").arg(view.bufferStructCount); } - if(shaderInput && !shaderInput->IsTexture) + if(shaderInput && !shaderInput->isTexture) { - if(view.Format.compType == CompType::Typeless) + if(view.viewFormat.compType == CompType::Typeless) { if(!shaderInput->variableType.members.isEmpty()) viewFormat = format = lit("struct ") + shaderInput->variableType.descriptor.name; @@ -2398,14 +2409,14 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie } else { - format = view.Format.Name(); + format = view.viewFormat.Name(); } } viewParams = tr("First Element: %1, Num Elements %2, Flags %3") - .arg(view.FirstElement) - .arg(view.NumElements) - .arg(ToQStr(view.Flags)); + .arg(view.firstElement) + .arg(view.numElements) + .arg(ToQStr(view.bufferFlags)); } if(viewParams.isEmpty()) @@ -2413,11 +2424,11 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie else viewParams += lit(", ") + extraParams; - return {i, name, ToQStr(view.Type), typeName, (qulonglong)w, h, + return {i, name, ToQStr(view.type), typeName, (qulonglong)w, h, d, a, viewFormat, format, viewParams}; } -void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::IA &ia) +void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::InputAssembly &ia) { { xml.writeStartElement(lit("h3")); @@ -2429,8 +2440,8 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe int i = 0; for(const D3D11Pipe::Layout &l : ia.layouts) { - rows.push_back({i, l.SemanticName, l.SemanticIndex, l.Format.Name(), l.InputSlot, - l.ByteOffset, (bool)l.PerInstance, l.InstanceDataStepRate}); + rows.push_back({i, l.semanticName, l.semanticIndex, l.format.Name(), l.inputSlot, + l.byteOffset, (bool)l.perInstance, l.instanceDataStepRate}); i++; } @@ -2449,23 +2460,23 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; int i = 0; - for(const D3D11Pipe::VB &vb : ia.vbuffers) + for(const D3D11Pipe::VertexBuffer &vb : ia.vertexBuffers) { - QString name = m_Ctx.GetResourceName(vb.Buffer); + QString name = m_Ctx.GetResourceName(vb.resourceId); uint64_t length = 0; - if(vb.Buffer == ResourceId()) + if(vb.resourceId == ResourceId()) { continue; } else { - BufferDescription *buf = m_Ctx.GetBuffer(vb.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(vb.resourceId); if(buf) length = buf->length; } - rows.push_back({i, name, vb.Stride, vb.Offset, (qulonglong)length}); + rows.push_back({i, name, vb.byteStride, vb.byteOffset, (qulonglong)length}); i++; } @@ -2479,16 +2490,16 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe xml.writeCharacters(tr("Index Buffer")); xml.writeEndElement(); - QString name = m_Ctx.GetResourceName(ia.ibuffer.Buffer); + QString name = m_Ctx.GetResourceName(ia.indexBuffer.resourceId); uint64_t length = 0; - if(ia.ibuffer.Buffer == ResourceId()) + if(ia.indexBuffer.resourceId == ResourceId()) { name = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(ia.ibuffer.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(ia.indexBuffer.resourceId); if(buf) length = buf->length; } @@ -2500,7 +2511,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe ifmt = lit("R32_UINT"); m_Common.exportHTMLTable(xml, {tr("Buffer"), tr("Format"), tr("Offset"), tr("Byte Length")}, - {name, ifmt, ia.ibuffer.Offset, (qulonglong)length}); + {name, ifmt, ia.indexBuffer.byteOffset, (qulonglong)length}); } xml.writeStartElement(lit("p")); @@ -2511,7 +2522,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::Shader &sh) { - ShaderReflection *shaderDetails = sh.ShaderDetails; + ShaderReflection *shaderDetails = sh.reflection; { xml.writeStartElement(lit("h3")); @@ -2520,23 +2531,23 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QString shadername = tr("Unknown"); - if(sh.Object == ResourceId()) + if(sh.resourceId == ResourceId()) shadername = tr("Unbound"); else - shadername = m_Ctx.GetResourceName(sh.Object); + shadername = m_Ctx.GetResourceName(sh.resourceId); - if(shaderDetails && !shaderDetails->DebugInfo.files.isEmpty()) + if(shaderDetails && !shaderDetails->debugInfo.files.isEmpty()) { shadername = QFormatStr("%1() - %2") - .arg(shaderDetails->EntryPoint) - .arg(QFileInfo(shaderDetails->DebugInfo.files[0].Filename).fileName()); + .arg(shaderDetails->entryPoint) + .arg(QFileInfo(shaderDetails->debugInfo.files[0].filename).fileName()); } xml.writeStartElement(lit("p")); xml.writeCharacters(shadername); xml.writeEndElement(); - if(sh.Object == ResourceId()) + if(sh.resourceId == ResourceId()) return; } @@ -2547,12 +2558,12 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.SRVs.count(); i++) + for(int i = 0; i < sh.srvs.count(); i++) { - if(sh.SRVs[i].Object == ResourceId()) + if(sh.srvs[i].viewResourceId == ResourceId()) continue; - rows.push_back(exportViewHTML(sh.SRVs[i], i, shaderDetails, QString())); + rows.push_back(exportViewHTML(sh.srvs[i], i, shaderDetails, QString())); } m_Common.exportHTMLTable(xml, @@ -2572,12 +2583,12 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.UAVs.count(); i++) + for(int i = 0; i < sh.uavs.count(); i++) { - if(sh.UAVs[i].Object == ResourceId()) + if(sh.uavs[i].viewResourceId == ResourceId()) continue; - rows.push_back(exportViewHTML(sh.UAVs[i], i, shaderDetails, QString())); + rows.push_back(exportViewHTML(sh.uavs[i], i, shaderDetails, QString())); } m_Common.exportHTMLTable(xml, @@ -2596,25 +2607,25 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.Samplers.count(); i++) + for(int i = 0; i < sh.samplers.count(); i++) { - const D3D11Pipe::Sampler &s = sh.Samplers[i]; + const D3D11Pipe::Sampler &s = sh.samplers[i]; - if(s.Samp == ResourceId()) + if(s.resourceId == ResourceId()) continue; QString borderColor = QFormatStr("%1, %2, %3, %4") - .arg(s.BorderColor[0]) - .arg(s.BorderColor[1]) - .arg(s.BorderColor[2]) - .arg(s.BorderColor[3]); + .arg(s.borderColor[0]) + .arg(s.borderColor[1]) + .arg(s.borderColor[2]) + .arg(s.borderColor[3]); QString addressing; QString addPrefix; QString addVal; - QString addr[] = {ToQStr(s.AddressU), ToQStr(s.AddressV), ToQStr(s.AddressW)}; + QString addr[] = {ToQStr(s.addressU), ToQStr(s.addressV), ToQStr(s.addressW)}; // arrange like either UVW: WRAP or UV: WRAP, W: CLAMP for(int a = 0; a < 3; a++) @@ -2637,9 +2648,9 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe addressing += addPrefix + lit(": ") + addVal; - rows.push_back({i, addressing, borderColor, ToQStr(s.Comparison), ToQStr(s.Filter), - s.MaxAniso, s.MinLOD == -FLT_MAX ? lit("0") : QString::number(s.MinLOD), - s.MaxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.MaxLOD), s.MipLODBias}); + rows.push_back({i, addressing, borderColor, ToQStr(s.compareFunction), ToQStr(s.filter), + s.maxAnisotropy, s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD), + s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD), s.mipLODBias}); } m_Common.exportHTMLTable( @@ -2658,33 +2669,33 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.ConstantBuffers.count(); i++) + for(int i = 0; i < sh.constantBuffers.count(); i++) { ConstantBlock *shaderCBuf = NULL; - if(sh.ConstantBuffers[i].Buffer == ResourceId()) + if(sh.constantBuffers[i].resourceId == ResourceId()) continue; - if(shaderDetails && i < shaderDetails->ConstantBlocks.count() && - !shaderDetails->ConstantBlocks[i].name.isEmpty()) - shaderCBuf = &shaderDetails->ConstantBlocks[i]; + if(shaderDetails && i < shaderDetails->constantBlocks.count() && + !shaderDetails->constantBlocks[i].name.isEmpty()) + shaderCBuf = &shaderDetails->constantBlocks[i]; - QString name = m_Ctx.GetResourceName(sh.ConstantBuffers[i].Buffer); + QString name = m_Ctx.GetResourceName(sh.constantBuffers[i].resourceId); uint64_t length = 1; int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t byteSize = shaderCBuf ? shaderCBuf->byteSize : 0; - if(sh.ConstantBuffers[i].Buffer == ResourceId()) + if(sh.constantBuffers[i].resourceId == ResourceId()) { name = tr("Empty"); length = 0; } - BufferDescription *buf = m_Ctx.GetBuffer(sh.ConstantBuffers[i].Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(sh.constantBuffers[i].resourceId); if(buf) length = buf->length; - rows.push_back({i, name, sh.ConstantBuffers[i].VecOffset, sh.ConstantBuffers[i].VecCount, + rows.push_back({i, name, sh.constantBuffers[i].vecOffset, sh.constantBuffers[i].vecCount, numvars, byteSize, (qulonglong)length}); } @@ -2694,7 +2705,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe rows); } - if(!sh.ClassInstances.isEmpty()) + if(!sh.classInstances.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Class Instances")); @@ -2702,14 +2713,14 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.ClassInstances.count(); i++) + for(int i = 0; i < sh.classInstances.count(); i++) { QString interfaceName = tr("Interface %1").arg(i); - if(sh.ShaderDetails && i < sh.ShaderDetails->Interfaces.count()) - interfaceName = sh.ShaderDetails->Interfaces[i]; + if(sh.reflection && i < sh.reflection->interfaces.count()) + interfaceName = sh.reflection->interfaces[i]; - rows.push_back({i, interfaceName, sh.ClassInstances[i]}); + rows.push_back({i, interfaceName, sh.classInstances[i]}); } m_Common.exportHTMLTable(xml, @@ -2720,7 +2731,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe } } -void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::SO &so) +void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::StreamOut &so) { { xml.writeStartElement(lit("h3")); @@ -2730,23 +2741,23 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; int i = 0; - for(const D3D11Pipe::SOBind &o : so.Outputs) + for(const D3D11Pipe::StreamOutBind &o : so.outputs) { - QString name = m_Ctx.GetResourceName(o.Buffer); + QString name = m_Ctx.GetResourceName(o.resourceId); uint64_t length = 0; - if(o.Buffer == ResourceId()) + if(o.resourceId == ResourceId()) { name = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(o.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(o.resourceId); if(buf) length = buf->length; } - rows.push_back({i, name, o.Offset, (qulonglong)length}); + rows.push_back({i, name, o.byteOffset, (qulonglong)length}); i++; } @@ -2763,8 +2774,8 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe xml.writeEndElement(); m_Common.exportHTMLTable(xml, {tr("Fill Mode"), tr("Cull Mode"), tr("Front CCW")}, - {ToQStr(rs.m_State.fillMode), ToQStr(rs.m_State.cullMode), - rs.m_State.FrontCCW ? tr("Yes") : tr("No")}); + {ToQStr(rs.state.fillMode), ToQStr(rs.state.cullMode), + rs.state.frontCCW ? tr("Yes") : tr("No")}); xml.writeStartElement(lit("p")); xml.writeEndElement(); @@ -2772,19 +2783,19 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable( xml, {tr("Scissor Enable"), tr("Line AA Enable"), tr("Multisample Enable"), tr("Forced Sample Count"), tr("Conservative Raster")}, - {rs.m_State.ScissorEnable ? tr("Yes") : tr("No"), - rs.m_State.AntialiasedLineEnable ? tr("Yes") : tr("No"), - rs.m_State.MultisampleEnable ? tr("Yes") : tr("No"), rs.m_State.ForcedSampleCount, - rs.m_State.ConservativeRasterization ? tr("Yes") : tr("No")}); + {rs.state.scissorEnable ? tr("Yes") : tr("No"), + rs.state.antialiasedLines ? tr("Yes") : tr("No"), + rs.state.multisampleEnable ? tr("Yes") : tr("No"), rs.state.forcedSampleCount, + rs.state.conservativeRasterization ? tr("Yes") : tr("No")}); xml.writeStartElement(lit("p")); xml.writeEndElement(); m_Common.exportHTMLTable( xml, {tr("Depth Clip"), tr("Depth Bias"), tr("Depth Bias Clamp"), tr("Slope Scaled Bias")}, - {rs.m_State.DepthClip ? tr("Yes") : tr("No"), rs.m_State.DepthBias, - Formatter::Format(rs.m_State.DepthBiasClamp), - Formatter::Format(rs.m_State.SlopeScaledDepthBias)}); + {rs.state.depthClip ? tr("Yes") : tr("No"), rs.state.depthBias, + Formatter::Format(rs.state.depthBiasClamp), + Formatter::Format(rs.state.slopeScaledDepthBias)}); } { @@ -2795,18 +2806,16 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; int i = 0; - for(const D3D11Pipe::Viewport &v : rs.Viewports) + for(const Viewport &v : rs.viewports) { - if(v.Width == v.Height && v.Width == 0 && v.Height == 0) - continue; - - rows.push_back({i, v.X, v.Y, v.Width, v.Height, v.MinDepth, v.MaxDepth}); + rows.push_back({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth, + v.enabled ? tr("Yes") : tr("No")}); i++; } m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), - tr("Min Depth"), tr("Max Depth")}, + tr("Min Depth"), tr("Max Depth"), tr("Enabled")}, rows); } @@ -2818,21 +2827,19 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; int i = 0; - for(const D3D11Pipe::Scissor &s : rs.Scissors) + for(const Scissor &s : rs.scissors) { - if(s.right == 0 && s.bottom == 0) - continue; - - rows.push_back({i, s.left, s.top, s.right - s.left, s.bottom - s.top}); + rows.push_back({i, s.x, s.y, s.width, s.height, s.enabled ? tr("Yes") : tr("No")}); i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height")}, rows); + m_Common.exportHTMLTable( + xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Enabled")}, rows); } } -void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::OM &om) +void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::OutputMerger &om) { { xml.writeStartElement(lit("h3")); @@ -2840,17 +2847,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe xml.writeEndElement(); QString blendFactor = QFormatStr("%1, %2, %3, %4") - .arg(om.m_BlendState.BlendFactor[0], 0, 'f', 2) - .arg(om.m_BlendState.BlendFactor[1], 0, 'f', 2) - .arg(om.m_BlendState.BlendFactor[2], 0, 'f', 2) - .arg(om.m_BlendState.BlendFactor[3], 0, 'f', 2); + .arg(om.blendState.blendFactor[0], 0, 'f', 2) + .arg(om.blendState.blendFactor[1], 0, 'f', 2) + .arg(om.blendState.blendFactor[2], 0, 'f', 2) + .arg(om.blendState.blendFactor[3], 0, 'f', 2); m_Common.exportHTMLTable(xml, {tr("Independent Blend Enable"), tr("Alpha to Coverage"), tr("Sample Mask"), tr("Blend Factor")}, { - om.m_BlendState.IndependentBlend ? tr("Yes") : tr("No"), - om.m_BlendState.AlphaToCoverage ? tr("Yes") : tr("No"), - Formatter::Format(om.m_BlendState.SampleMask, true), blendFactor, + om.blendState.independentBlend ? tr("Yes") : tr("No"), + om.blendState.alphaToCoverage ? tr("Yes") : tr("No"), + Formatter::Format(om.blendState.sampleMask, true), blendFactor, }); xml.writeStartElement(lit("h3")); @@ -2860,22 +2867,22 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; int i = 0; - for(const D3D11Pipe::Blend &b : om.m_BlendState.Blends) + for(const ColorBlend &b : om.blendState.blends) { - if(i >= om.RenderTargets.count()) + if(i >= om.renderTargets.count()) continue; QString mask = QFormatStr("%1%2%3%4") - .arg((b.WriteMask & 0x1) == 0 ? lit("_") : lit("R")) - .arg((b.WriteMask & 0x2) == 0 ? lit("_") : lit("G")) - .arg((b.WriteMask & 0x4) == 0 ? lit("_") : lit("B")) - .arg((b.WriteMask & 0x8) == 0 ? lit("_") : lit("A")); + .arg((b.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + .arg((b.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + .arg((b.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + .arg((b.writeMask & 0x8) == 0 ? lit("_") : lit("A")); - rows.push_back({i, b.Enabled ? tr("Yes") : tr("No"), b.LogicEnabled ? tr("Yes") : tr("No"), - ToQStr(b.m_Blend.Source), ToQStr(b.m_Blend.Destination), - ToQStr(b.m_Blend.Operation), ToQStr(b.m_AlphaBlend.Source), - ToQStr(b.m_AlphaBlend.Destination), ToQStr(b.m_AlphaBlend.Operation), - ToQStr(b.Logic), mask}); + rows.push_back({i, b.enabled ? tr("Yes") : tr("No"), + b.logicOperationEnabled ? tr("Yes") : tr("No"), ToQStr(b.colorBlend.source), + ToQStr(b.colorBlend.destination), ToQStr(b.colorBlend.operation), + ToQStr(b.alphaBlend.source), ToQStr(b.alphaBlend.destination), + ToQStr(b.alphaBlend.operation), ToQStr(b.logicOperation), mask}); i++; } @@ -2898,8 +2905,9 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable( xml, {tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function")}, - {om.m_State.DepthEnable ? tr("Yes") : tr("No"), - om.m_State.DepthWrites ? tr("Yes") : tr("No"), ToQStr(om.m_State.DepthFunc)}); + {om.depthStencilState.depthEnable ? tr("Yes") : tr("No"), + om.depthStencilState.depthWrites ? tr("Yes") : tr("No"), + ToQStr(om.depthStencilState.depthFunction)}); } { @@ -2909,22 +2917,25 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable( xml, {tr("Stencil Test Enable"), tr("Stencil Read Mask"), tr("Stencil Write Mask")}, - {om.m_State.StencilEnable ? tr("Yes") : tr("No"), - Formatter::Format(om.m_State.StencilReadMask, true), - Formatter::Format(om.m_State.StencilWriteMask, true)}); + {om.depthStencilState.stencilEnable ? tr("Yes") : tr("No"), + Formatter::Format(om.depthStencilState.frontFace.compareMask, true), + Formatter::Format(om.depthStencilState.frontFace.writeMask, true)}); xml.writeStartElement(lit("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, {tr("Face"), tr("Function"), tr("Pass Operation"), tr("Fail Operation"), - tr("Depth Fail Operation")}, - { - {tr("Front"), ToQStr(om.m_State.m_FrontFace.Func), ToQStr(om.m_State.m_FrontFace.PassOp), - ToQStr(om.m_State.m_FrontFace.FailOp), ToQStr(om.m_State.m_FrontFace.DepthFailOp)}, - {tr("Back"), ToQStr(om.m_State.m_BackFace.Func), ToQStr(om.m_State.m_BackFace.PassOp), - ToQStr(om.m_State.m_BackFace.FailOp), ToQStr(om.m_State.m_BackFace.DepthFailOp)}, - }); + m_Common.exportHTMLTable(xml, {tr("Face"), tr("Function"), tr("Pass Operation"), + tr("Fail Operation"), tr("Depth Fail Operation")}, + { + {tr("Front"), ToQStr(om.depthStencilState.frontFace.function), + ToQStr(om.depthStencilState.frontFace.passOperation), + ToQStr(om.depthStencilState.frontFace.failOperation), + ToQStr(om.depthStencilState.frontFace.depthFailOperation)}, + {tr("Back"), ToQStr(om.depthStencilState.backFace.function), + ToQStr(om.depthStencilState.backFace.passOperation), + ToQStr(om.depthStencilState.backFace.failOperation), + ToQStr(om.depthStencilState.backFace.depthFailOperation)}, + }); } { @@ -2934,12 +2945,12 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < om.RenderTargets.count(); i++) + for(int i = 0; i < om.renderTargets.count(); i++) { - if(om.RenderTargets[i].Object == ResourceId()) + if(om.renderTargets[i].viewResourceId == ResourceId()) continue; - rows.push_back(exportViewHTML(om.RenderTargets[i], i, NULL, QString())); + rows.push_back(exportViewHTML(om.renderTargets[i], i, NULL, QString())); } m_Common.exportHTMLTable(xml, @@ -2951,7 +2962,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe rows); } - if(!om.UAVs.isEmpty() && om.UAVs[0].Object != ResourceId()) + if(!om.uavs.isEmpty() && om.uavs[0].viewResourceId != ResourceId()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Unordered Access Views")); @@ -2961,17 +2972,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe uint32_t i = 0; - for(; i < om.UAVStartSlot; i++) + for(; i < om.uavStartSlot; i++) rows.push_back({i, tr("Empty"), QString(), QString(), QString(), QString(), 0, 0, 0, 0, QString(), QString(), QString()}); - for(; i < (uint32_t)om.RenderTargets.count(); i++) + for(; i < (uint32_t)om.renderTargets.count(); i++) { - if(om.UAVs[i - om.UAVStartSlot].Object == ResourceId()) + if(om.uavs[i - om.uavStartSlot].viewResourceId == ResourceId()) continue; - rows.push_back(exportViewHTML(om.UAVs[i - om.UAVStartSlot], i, - m_Ctx.CurD3D11PipelineState().m_PS.ShaderDetails, QString())); + rows.push_back(exportViewHTML(om.uavs[i - om.uavStartSlot], i, + m_Ctx.CurD3D11PipelineState().pixelShader.reflection, QString())); } m_Common.exportHTMLTable(xml, @@ -2992,14 +3003,14 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QString extra; - if(om.DepthReadOnly && om.StencilReadOnly) + if(om.depthReadOnly && om.stencilReadOnly) extra = tr("Depth & Stencil Read-Only"); - else if(om.DepthReadOnly) + else if(om.depthReadOnly) extra = tr("Depth Read-Only"); - else if(om.StencilReadOnly) + else if(om.stencilReadOnly) extra = tr("Stencil Read-Only"); - rows.push_back(exportViewHTML(om.DepthTarget, 0, NULL, extra)); + rows.push_back(exportViewHTML(om.depthTarget, 0, NULL, extra)); m_Common.exportHTMLTable(xml, { @@ -3040,18 +3051,18 @@ void D3D11PipelineStateViewer::on_exportHTML_clicked() switch(stage) { - case 0: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_IA); break; - case 1: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_VS); break; - case 2: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_HS); break; - case 3: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_DS); break; + case 0: exportHTML(xml, m_Ctx.CurD3D11PipelineState().inputAssembly); break; + case 1: exportHTML(xml, m_Ctx.CurD3D11PipelineState().vertexShader); break; + case 2: exportHTML(xml, m_Ctx.CurD3D11PipelineState().hullShader); break; + case 3: exportHTML(xml, m_Ctx.CurD3D11PipelineState().domainShader); break; case 4: - exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_GS); - exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_SO); + exportHTML(xml, m_Ctx.CurD3D11PipelineState().geometryShader); + exportHTML(xml, m_Ctx.CurD3D11PipelineState().streamOut); break; - case 5: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_RS); break; - case 6: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_PS); break; - case 7: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_OM); break; - case 8: exportHTML(xml, m_Ctx.CurD3D11PipelineState().m_CS); break; + case 5: exportHTML(xml, m_Ctx.CurD3D11PipelineState().rasterizer); break; + case 6: exportHTML(xml, m_Ctx.CurD3D11PipelineState().pixelShader); break; + case 7: exportHTML(xml, m_Ctx.CurD3D11PipelineState().outputMerger); break; + case 8: exportHTML(xml, m_Ctx.CurD3D11PipelineState().computeShader); break; } xml.writeEndElement(); @@ -3080,7 +3091,7 @@ void D3D11PipelineStateViewer::on_debugThread_clicked() if(!draw) return; - ShaderReflection *shaderDetails = m_Ctx.CurD3D11PipelineState().m_CS.ShaderDetails; + ShaderReflection *shaderDetails = m_Ctx.CurD3D11PipelineState().computeShader.reflection; if(!shaderDetails) return; @@ -3097,7 +3108,7 @@ void D3D11PipelineStateViewer::on_debugThread_clicked() if(threadsdim[0] == 0) { for(int i = 0; i < 3; i++) - threadsdim[i] = shaderDetails->DispatchThreadsDimension[i]; + threadsdim[i] = shaderDetails->dispatchThreadsDimension[i]; } struct threadSelect diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.h b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.h index 3ed3a1a6b..f78e76312 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.h +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.h @@ -51,8 +51,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: // automatic slots @@ -86,7 +86,7 @@ private: RDTreeWidget *samp, RDTreeWidget *cbuffer, RDTreeWidget *classes); void addResourceRow(const D3D11ViewTag &view, const ShaderResource *shaderInput, - const BindpointMap *map, RDTreeWidget *resources); + const Bindpoint *map, RDTreeWidget *resources); void clearShaderState(RDLabel *shader, RDTreeWidget *tex, RDTreeWidget *samp, RDTreeWidget *cbuffer, RDTreeWidget *classes); @@ -95,11 +95,11 @@ private: QVariantList exportViewHTML(const D3D11Pipe::View &view, int i, ShaderReflection *refl, const QString &extraParams); - void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::IA &ia); + void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::InputAssembly &ia); void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::Shader &sh); - void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::SO &so); + void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::StreamOut &so); void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::Rasterizer &rs); - void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::OM &om); + void exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::OutputMerger &om); void setInactiveRow(RDTreeWidgetItem *node); void setEmptyRow(RDTreeWidgetItem *node); diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index 7e04a9bec..31f035b2c 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -462,7 +462,7 @@ void D3D12PipelineStateViewer::OnCaptureClosed() clearState(); } -void D3D12PipelineStateViewer::OnEventChanged(uint32_t eventID) +void D3D12PipelineStateViewer::OnEventChanged(uint32_t eventId) { setState(); } @@ -493,15 +493,14 @@ bool D3D12PipelineStateViewer::HasImportantViewParams(const D3D12Pipe::View &vie // in the row since there's no real hidden important information there. The formats can't be // different for any other reason (if the SRV format differs from the texture format, the // texture must have been typeless. - if(view.HighestMip > 0 || view.FirstArraySlice > 0 || - (view.NumMipLevels < tex->mips && tex->mips > 1) || - (view.ArraySize < tex->arraysize && tex->arraysize > 1)) + if(view.firstMip > 0 || view.firstSlice > 0 || (view.numMips < tex->mips && tex->mips > 1) || + (view.numSlices < tex->arraysize && tex->arraysize > 1)) return true; // in the case of the swapchain case, types can be different and it won't have shown // up as taking the view's format because the swapchain already has one. Make sure to mark it // as important - if(view.Format.compType != CompType::Typeless && view.Format != tex->format) + if(view.viewFormat.compType != CompType::Typeless && view.viewFormat != tex->format) return true; return false; @@ -510,7 +509,7 @@ bool D3D12PipelineStateViewer::HasImportantViewParams(const D3D12Pipe::View &vie bool D3D12PipelineStateViewer::HasImportantViewParams(const D3D12Pipe::View &view, BufferDescription *buf) { - if(view.FirstElement > 0 || view.NumElements * view.ElementSize < buf->length) + if(view.firstElement > 0 || view.numElements * view.elementByteSize < buf->length) return true; return false; @@ -528,57 +527,57 @@ void D3D12PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1 bool viewdetails = false; - for(const D3D12Pipe::ResourceData &im : m_Ctx.CurD3D12PipelineState().Resources) + for(const D3D12Pipe::ResourceData &im : m_Ctx.CurD3D12PipelineState().resourceStates) { - if(im.id == tex->ID) + if(im.resourceId == tex->resourceId) { text += tr("Texture is in the '%1' state\n\n").arg(im.states[0].name); break; } } - if(res.Format != tex->format) + if(res.viewFormat != tex->format) { text += tr("The texture is format %1, the view treats it as %2.\n") .arg(tex->format.Name()) - .arg(res.Format.Name()); + .arg(res.viewFormat.Name()); viewdetails = true; } if(view.space == D3D12ViewTag::OMDepth) { - if(m_Ctx.CurD3D12PipelineState().m_OM.DepthReadOnly) + if(m_Ctx.CurD3D12PipelineState().outputMerger.depthReadOnly) text += tr("Depth component is read-only\n"); - if(m_Ctx.CurD3D12PipelineState().m_OM.StencilReadOnly) + if(m_Ctx.CurD3D12PipelineState().outputMerger.stencilReadOnly) text += tr("Stencil component is read-only\n"); } - if(tex->mips > 1 && (tex->mips != res.NumMipLevels || res.HighestMip > 0)) + if(tex->mips > 1 && (tex->mips != res.numMips || res.firstMip > 0)) { - if(res.NumMipLevels == 1) + if(res.numMips == 1) text += - tr("The texture has %1 mips, the view covers mip %2.\n").arg(tex->mips).arg(res.HighestMip); + tr("The texture has %1 mips, the view covers mip %2.\n").arg(tex->mips).arg(res.firstMip); else text += tr("The texture has %1 mips, the view covers mips %2-%3.\n") .arg(tex->mips) - .arg(res.HighestMip) - .arg(res.HighestMip + res.NumMipLevels - 1); + .arg(res.firstMip) + .arg(res.firstMip + res.numMips - 1); viewdetails = true; } - if(tex->arraysize > 1 && (tex->arraysize != res.ArraySize || res.FirstArraySlice > 0)) + if(tex->arraysize > 1 && (tex->arraysize != res.numSlices || res.firstSlice > 0)) { - if(res.ArraySize == 1) + if(res.numSlices == 1) text += tr("The texture has %1 array slices, the view covers slice %2.\n") .arg(tex->arraysize) - .arg(res.FirstArraySlice); + .arg(res.firstSlice); else text += tr("The texture has %1 array slices, the view covers slices %2-%3.\n") .arg(tex->arraysize) - .arg(res.FirstArraySlice) - .arg(res.FirstArraySlice + res.ArraySize); + .arg(res.firstSlice) + .arg(res.firstSlice + res.numSlices); viewdetails = true; } @@ -604,9 +603,9 @@ void D3D12PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1 const D3D12Pipe::View &res = view.res; - for(const D3D12Pipe::ResourceData &im : m_Ctx.CurD3D12PipelineState().Resources) + for(const D3D12Pipe::ResourceData &im : m_Ctx.CurD3D12PipelineState().resourceStates) { - if(im.id == buf->ID) + if(im.resourceId == buf->resourceId) { text += tr("Buffer is in the '%1' state\n\n").arg(im.states[0].name); break; @@ -615,15 +614,16 @@ void D3D12PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1 bool viewdetails = false; - if((res.FirstElement * res.ElementSize) > 0 || (res.NumElements * res.ElementSize) < buf->length) + if((res.firstElement * res.elementByteSize) > 0 || + (res.numElements * res.elementByteSize) < buf->length) { text += tr("The view covers bytes %1-%2 (%3 elements).\nThe buffer is %3 bytes in length (%5 " "elements).") - .arg(res.FirstElement * res.ElementSize) - .arg((res.FirstElement + res.NumElements) * res.ElementSize) - .arg(res.NumElements) + .arg(res.firstElement * res.elementByteSize) + .arg((res.firstElement + res.numElements) * res.elementByteSize) + .arg(res.numElements) .arg(buf->length) - .arg(buf->length / res.ElementSize); + .arg(buf->length / res.elementByteSize); viewdetails = true; } @@ -646,21 +646,21 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, bool uav = view.type == D3D12ViewTag::UAV; // consider this register to not exist - it's in a gap defined by sparse root signature elements - if(r.RootElement == ~0U) + if(r.rootElement == ~0U) return; - const BindpointMap *bind = NULL; + const Bindpoint *bind = NULL; const ShaderResource *shaderInput = NULL; - if(stage && stage->ShaderDetails) + if(stage && stage->reflection) { - const rdcarray &binds = uav ? stage->BindpointMapping.ReadWriteResources - : stage->BindpointMapping.ReadOnlyResources; + const rdcarray &binds = uav ? stage->bindpointMapping.readWriteResources + : stage->bindpointMapping.readOnlyResources; const rdcarray &res = - uav ? stage->ShaderDetails->ReadWriteResources : stage->ShaderDetails->ReadOnlyResources; + uav ? stage->reflection->readWriteResources : stage->reflection->readOnlyResources; for(int i = 0; i < binds.count(); i++) { - const BindpointMap &b = binds[i]; + const Bindpoint &b = binds[i]; bool regMatch = b.bind == view.reg; @@ -681,13 +681,13 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, bool viewDetails = false; if(view.space == D3D12ViewTag::OMDepth) - viewDetails = m_Ctx.CurD3D12PipelineState().m_OM.DepthReadOnly || - m_Ctx.CurD3D12PipelineState().m_OM.StencilReadOnly; + viewDetails = m_Ctx.CurD3D12PipelineState().outputMerger.depthReadOnly || + m_Ctx.CurD3D12PipelineState().outputMerger.stencilReadOnly; - QString rootel = r.Immediate ? tr("#%1 Direct").arg(r.RootElement) - : tr("#%1 Table[%2]").arg(r.RootElement).arg(r.TableIndex); + QString rootel = r.immediate ? tr("#%1 Direct").arg(r.rootElement) + : tr("#%1 Table[%2]").arg(r.rootElement).arg(r.tableIndex); - bool filledSlot = (r.Resource != ResourceId()); + bool filledSlot = (r.resourceId != ResourceId()); bool usedSlot = (bind && bind->used); // if a target is set to RTVs or DSV, it is implicitly used @@ -717,7 +717,7 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, w = h = d = a = 0; } - TextureDescription *tex = m_Ctx.GetTexture(r.Resource); + TextureDescription *tex = m_Ctx.GetTexture(r.resourceId); if(tex) { @@ -726,21 +726,21 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); - if(tex->resType == TextureDim::Texture2DMS || tex->resType == TextureDim::Texture2DMSArray) + if(tex->type == TextureType::Texture2DMS || tex->type == TextureType::Texture2DMSArray) { typeName += QFormatStr(" %1x").arg(tex->msSamp); } - if(tex->format != r.Format) - format = tr("Viewed as %1").arg(r.Format.Name()); + if(tex->format != r.viewFormat) + format = tr("Viewed as %1").arg(r.viewFormat.Name()); if(HasImportantViewParams(r, tex)) viewDetails = true; } - BufferDescription *buf = m_Ctx.GetBuffer(r.Resource); + BufferDescription *buf = m_Ctx.GetBuffer(r.resourceId); if(buf) { @@ -751,31 +751,31 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, format = QString(); typeName = lit("Buffer"); - if(r.BufferFlags & D3DBufferViewFlags::Raw) + if(r.bufferFlags & D3DBufferViewFlags::Raw) { typeName = QFormatStr("%1ByteAddressBuffer").arg(uav ? lit("RW") : QString()); } - else if(r.ElementSize > 0) + else if(r.elementByteSize > 0) { // for structured buffers, display how many 'elements' there are in the buffer - a = buf->length / r.ElementSize; + a = buf->length / r.elementByteSize; typeName = QFormatStr("%1StructuredBuffer[%2]").arg(uav ? lit("RW") : QString()).arg(a); } - if(r.CounterResource != ResourceId()) + if(r.counterResourceId != ResourceId()) { - typeName += tr(" (Counter %1: %2)").arg(ToQStr(r.CounterResource)).arg(r.BufferStructCount); + typeName += tr(" (Counter %1: %2)").arg(ToQStr(r.counterResourceId)).arg(r.bufferStructCount); } // get the buffer type, whether it's just a basic type or a complex struct - if(shaderInput && !shaderInput->IsTexture) + if(shaderInput && !shaderInput->isTexture) { if(!shaderInput->variableType.members.empty()) format = lit("struct ") + shaderInput->variableType.descriptor.name; - else if(r.Format.compType == CompType::Typeless) + else if(r.viewFormat.compType == CompType::Typeless) format = shaderInput->variableType.descriptor.name; else - format = r.Format.Name(); + format = r.viewFormat.Name(); } if(HasImportantViewParams(r, buf)) @@ -783,7 +783,7 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, } RDTreeWidgetItem *node = new RDTreeWidgetItem( - {rootel, view.space, regname, r.Resource, typeName, w, h, d, a, format, QString()}); + {rootel, view.space, regname, r.resourceId, typeName, w, h, d, a, format, QString()}); node->setTag(QVariant::fromValue(view)); @@ -833,23 +833,23 @@ const D3D12Pipe::Shader *D3D12PipelineStateViewer::stageForSender(QWidget *widge while(widget) { if(widget == ui->stagesTabs->widget(0)) - return &m_Ctx.CurD3D12PipelineState().m_VS; + return &m_Ctx.CurD3D12PipelineState().vertexShader; if(widget == ui->stagesTabs->widget(1)) - return &m_Ctx.CurD3D12PipelineState().m_VS; + return &m_Ctx.CurD3D12PipelineState().vertexShader; if(widget == ui->stagesTabs->widget(2)) - return &m_Ctx.CurD3D12PipelineState().m_HS; + return &m_Ctx.CurD3D12PipelineState().hullShader; if(widget == ui->stagesTabs->widget(3)) - return &m_Ctx.CurD3D12PipelineState().m_DS; + return &m_Ctx.CurD3D12PipelineState().domainShader; if(widget == ui->stagesTabs->widget(4)) - return &m_Ctx.CurD3D12PipelineState().m_GS; + return &m_Ctx.CurD3D12PipelineState().geometryShader; if(widget == ui->stagesTabs->widget(5)) - return &m_Ctx.CurD3D12PipelineState().m_PS; + return &m_Ctx.CurD3D12PipelineState().pixelShader; if(widget == ui->stagesTabs->widget(6)) - return &m_Ctx.CurD3D12PipelineState().m_PS; + return &m_Ctx.CurD3D12PipelineState().pixelShader; if(widget == ui->stagesTabs->widget(7)) - return &m_Ctx.CurD3D12PipelineState().m_PS; + return &m_Ctx.CurD3D12PipelineState().pixelShader; if(widget == ui->stagesTabs->widget(8)) - return &m_Ctx.CurD3D12PipelineState().m_CS; + return &m_Ctx.CurD3D12PipelineState().computeShader; widget = widget->parentWidget(); } @@ -939,22 +939,23 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD RDTreeWidget *samplers, RDTreeWidget *cbuffers, RDTreeWidget *uavs) { - ShaderReflection *shaderDetails = stage.ShaderDetails; + ShaderReflection *shaderDetails = stage.reflection; const D3D12Pipe::State &state = m_Ctx.CurD3D12PipelineState(); - rootSig->setText(ToQStr(state.rootSig)); + rootSig->setText(ToQStr(state.rootSignatureResourceId)); - QString shText = ToQStr(stage.Object); + QString shText = ToQStr(stage.resourceId); - if(stage.Object != ResourceId()) - shText = - tr("%1 - %2 Shader").arg(ToQStr(state.pipeline)).arg(ToQStr(stage.stage, GraphicsAPI::D3D12)); + if(stage.resourceId != ResourceId()) + shText = tr("%1 - %2 Shader") + .arg(ToQStr(state.pipelineResourceId)) + .arg(ToQStr(stage.stage, GraphicsAPI::D3D12)); - if(shaderDetails && !shaderDetails->DebugInfo.files.empty()) + if(shaderDetails && !shaderDetails->debugInfo.files.empty()) { shText += QFormatStr(": %1() - %2") - .arg(shaderDetails->EntryPoint) - .arg(QFileInfo(shaderDetails->DebugInfo.files[0].Filename).fileName()); + .arg(shaderDetails->entryPoint) + .arg(QFileInfo(shaderDetails->debugInfo.files[0].filename).fileName()); } shader->setText(shText); @@ -963,11 +964,11 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD vs = resources->verticalScrollBar()->value(); resources->beginUpdate(); resources->clear(); - for(int space = 0; space < stage.Spaces.count(); space++) + for(int space = 0; space < stage.spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].SRVs.count(); reg++) + for(int reg = 0; reg < stage.spaces[space].srvs.count(); reg++) { - addResourceRow(D3D12ViewTag(D3D12ViewTag::SRV, space, reg, stage.Spaces[space].SRVs[reg]), + addResourceRow(D3D12ViewTag(D3D12ViewTag::SRV, space, reg, stage.spaces[space].srvs[reg]), &stage, resources); } } @@ -978,11 +979,11 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD vs = uavs->verticalScrollBar()->value(); uavs->beginUpdate(); uavs->clear(); - for(int space = 0; space < stage.Spaces.count(); space++) + for(int space = 0; space < stage.spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].UAVs.count(); reg++) + for(int reg = 0; reg < stage.spaces[space].uavs.count(); reg++) { - addResourceRow(D3D12ViewTag(D3D12ViewTag::UAV, space, reg, stage.Spaces[space].UAVs[reg]), + addResourceRow(D3D12ViewTag(D3D12ViewTag::UAV, space, reg, stage.spaces[space].uavs[reg]), &stage, uavs); } } @@ -993,26 +994,26 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD vs = samplers->verticalScrollBar()->value(); samplers->beginUpdate(); samplers->clear(); - for(int space = 0; space < stage.Spaces.count(); space++) + for(int space = 0; space < stage.spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].Samplers.count(); reg++) + for(int reg = 0; reg < stage.spaces[space].samplers.count(); reg++) { - const D3D12Pipe::Sampler &s = stage.Spaces[space].Samplers[reg]; + const D3D12Pipe::Sampler &s = stage.spaces[space].samplers[reg]; // consider this register to not exist - it's in a gap defined by sparse root signature // elements - if(s.RootElement == ~0U) + if(s.rootElement == ~0U) continue; - const BindpointMap *bind = NULL; + const Bindpoint *bind = NULL; const ShaderSampler *shaderInput = NULL; - if(stage.ShaderDetails) + if(stage.reflection) { - for(int i = 0; i < stage.BindpointMapping.Samplers.count(); i++) + for(int i = 0; i < stage.bindpointMapping.samplers.count(); i++) { - const BindpointMap &b = stage.BindpointMapping.Samplers[i]; - const ShaderSampler &res = stage.ShaderDetails->Samplers[i]; + const Bindpoint &b = stage.bindpointMapping.samplers[i]; + const ShaderSampler &res = stage.reflection->samplers[i]; bool regMatch = b.bind == reg; @@ -1030,10 +1031,10 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD } } - QString rootel = s.Immediate ? tr("#%1 Static").arg(s.RootElement) - : tr("#%1 Table[%2]").arg(s.RootElement).arg(s.TableIndex); + QString rootel = s.immediate ? tr("#%1 Static").arg(s.rootElement) + : tr("#%1 Table[%2]").arg(s.rootElement).arg(s.tableIndex); - bool filledSlot = s.Filter.minify != FilterMode::NoFilter; + bool filledSlot = s.filter.minify != FilterMode::NoFilter; bool usedSlot = (bind && bind->used); if(showNode(usedSlot, filledSlot)) @@ -1044,17 +1045,17 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD regname += lit(": ") + shaderInput->name; QString borderColor = QFormatStr("%1, %2, %3, %4") - .arg(s.BorderColor[0]) - .arg(s.BorderColor[1]) - .arg(s.BorderColor[2]) - .arg(s.BorderColor[3]); + .arg(s.borderColor[0]) + .arg(s.borderColor[1]) + .arg(s.borderColor[2]) + .arg(s.borderColor[3]); QString addressing; QString addPrefix; QString addVal; - QString addr[] = {ToQStr(s.AddressU), ToQStr(s.AddressV), ToQStr(s.AddressW)}; + QString addr[] = {ToQStr(s.addressU), ToQStr(s.addressV), ToQStr(s.addressW)}; // arrange like either UVW: WRAP or UV: WRAP, W: CLAMP for(int a = 0; a < 3; a++) @@ -1080,22 +1081,22 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD if(s.UseBorder()) addressing += QFormatStr("<%1>").arg(borderColor); - QString filter = ToQStr(s.Filter); + QString filter = ToQStr(s.filter); - if(s.MaxAniso > 1) - filter += QFormatStr(" %1x").arg(s.MaxAniso); + if(s.maxAnisotropy > 1) + filter += QFormatStr(" %1x").arg(s.maxAnisotropy); - if(s.Filter.func == FilterFunc::Comparison) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Comparison)); - else if(s.Filter.func != FilterFunc::Normal) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Filter.func)); + if(s.filter.filter == FilterFunction::Comparison) + filter += QFormatStr(" (%1)").arg(ToQStr(s.compareFunction)); + else if(s.filter.filter != FilterFunction::Normal) + filter += QFormatStr(" (%1)").arg(ToQStr(s.filter.filter)); RDTreeWidgetItem *node = new RDTreeWidgetItem( {rootel, space, regname, addressing, filter, QFormatStr("%1 - %2") - .arg(s.MinLOD == -FLT_MAX ? lit("0") : QString::number(s.MinLOD)) - .arg(s.MaxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.MaxLOD)), - s.MipLODBias}); + .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) + .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), + s.mipLODBias}); if(!filledSlot) setEmptyRow(node); @@ -1114,23 +1115,23 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD vs = cbuffers->verticalScrollBar()->value(); cbuffers->beginUpdate(); cbuffers->clear(); - for(int space = 0; space < stage.Spaces.count(); space++) + for(int space = 0; space < stage.spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].ConstantBuffers.count(); reg++) + for(int reg = 0; reg < stage.spaces[space].constantBuffers.count(); reg++) { - const D3D12Pipe::CBuffer &b = stage.Spaces[space].ConstantBuffers[reg]; + const D3D12Pipe::ConstantBuffer &b = stage.spaces[space].constantBuffers[reg]; QVariant tag; - const BindpointMap *bind = NULL; + const Bindpoint *bind = NULL; const ConstantBlock *shaderCBuf = NULL; - if(stage.ShaderDetails) + if(stage.reflection) { - for(int i = 0; i < stage.BindpointMapping.ConstantBlocks.count(); i++) + for(int i = 0; i < stage.bindpointMapping.constantBlocks.count(); i++) { - const BindpointMap &bm = stage.BindpointMapping.ConstantBlocks[i]; - const ConstantBlock &res = stage.ShaderDetails->ConstantBlocks[i]; + const Bindpoint &bm = stage.bindpointMapping.constantBlocks[i]; + const ConstantBlock &res = stage.reflection->constantBlocks[i]; bool regMatch = bm.bind == reg; @@ -1154,33 +1155,33 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD QString rootel; - if(b.Immediate) + if(b.immediate) { - if(!b.RootValues.empty()) - rootel = tr("#%1 Consts").arg(b.RootElement); + if(!b.rootValues.empty()) + rootel = tr("#%1 Consts").arg(b.rootElement); else - rootel = tr("#%1 Direct").arg(b.RootElement); + rootel = tr("#%1 Direct").arg(b.rootElement); } else { - rootel = tr("#%1 Table[%2]").arg(b.RootElement).arg(b.TableIndex); + rootel = tr("#%1 Table[%2]").arg(b.rootElement).arg(b.tableIndex); } - bool filledSlot = (b.Buffer != ResourceId()); - if(b.Immediate && !b.RootValues.empty()) + bool filledSlot = (b.resourceId != ResourceId()); + if(b.immediate && !b.rootValues.empty()) filledSlot = true; bool usedSlot = (bind && bind->used); if(showNode(usedSlot, filledSlot)) { - ulong length = b.ByteSize; - uint64_t offset = b.Offset; + ulong length = b.byteSize; + uint64_t offset = b.byteOffset; int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t bytesize = shaderCBuf ? shaderCBuf->byteSize : 0; - if(b.Immediate && !b.RootValues.empty()) - bytesize = uint32_t(b.RootValues.count() * 4); + if(b.immediate && !b.rootValues.empty()) + bytesize = uint32_t(b.rootValues.count() * 4); QString regname = QString::number(reg); @@ -1197,8 +1198,9 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD if(length < bytesize) filledSlot = false; - RDTreeWidgetItem *node = new RDTreeWidgetItem( - {rootel, (qulonglong)space, regname, b.Buffer, (qulonglong)offset, sizestr, QString()}); + RDTreeWidgetItem *node = + new RDTreeWidgetItem({rootel, (qulonglong)space, regname, b.resourceId, + (qulonglong)offset, sizestr, QString()}); node->setTag(tag); @@ -1244,31 +1246,32 @@ void D3D12PipelineStateViewer::setState() ui->iaLayouts->clear(); { int i = 0; - for(const D3D12Pipe::Layout &l : state.m_IA.layouts) + for(const D3D12Pipe::Layout &l : state.inputAssembly.layouts) { - QString byteOffs = QString::number(l.ByteOffset); + QString byteOffs = QString::number(l.byteOffset); // D3D12 specific value - if(l.ByteOffset == ~0U) + if(l.byteOffset == ~0U) { - byteOffs = lit("APPEND_ALIGNED (%1)").arg(layoutOffs[l.InputSlot]); + byteOffs = lit("APPEND_ALIGNED (%1)").arg(layoutOffs[l.inputSlot]); } else { - layoutOffs[l.InputSlot] = l.ByteOffset; + layoutOffs[l.inputSlot] = l.byteOffset; } - layoutOffs[l.InputSlot] += l.Format.compByteWidth * l.Format.compCount; + layoutOffs[l.inputSlot] += l.format.compByteWidth * l.format.compCount; bool filledSlot = true; bool usedSlot = false; - for(int ia = 0; state.m_VS.ShaderDetails && ia < state.m_VS.ShaderDetails->InputSig.count(); + for(int ia = 0; state.vertexShader.reflection && + ia < state.vertexShader.reflection->inputSignature.count(); ia++) { - if(!QString(state.m_VS.ShaderDetails->InputSig[ia].semanticName) - .compare(l.SemanticName, Qt::CaseInsensitive) && - state.m_VS.ShaderDetails->InputSig[ia].semanticIndex == l.SemanticIndex) + if(!QString(state.vertexShader.reflection->inputSignature[ia].semanticName) + .compare(l.semanticName, Qt::CaseInsensitive) && + state.vertexShader.reflection->inputSignature[ia].semanticIndex == l.semanticIndex) { usedSlot = true; break; @@ -1278,12 +1281,12 @@ void D3D12PipelineStateViewer::setState() if(showNode(usedSlot, filledSlot)) { RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, l.SemanticName, l.SemanticIndex, l.Format.Name(), l.InputSlot, - byteOffs, l.PerInstance ? lit("PER_INSTANCE") : lit("PER_VERTEX"), - l.InstanceDataStepRate, QString()}); + new RDTreeWidgetItem({i, l.semanticName, l.semanticIndex, l.format.Name(), l.inputSlot, + byteOffs, l.perInstance ? lit("PER_INSTANCE") : lit("PER_VERTEX"), + l.instanceDataStepRate, QString()}); if(usedSlot) - usedVBuffers[l.InputSlot] = true; + usedVBuffers[l.inputSlot] = true; if(!usedSlot) setInactiveRow(node); @@ -1318,28 +1321,28 @@ void D3D12PipelineStateViewer::setState() ui->iaBuffers->beginUpdate(); ui->iaBuffers->clear(); - if(state.m_IA.ibuffer.Buffer != ResourceId()) + if(state.inputAssembly.indexBuffer.resourceId != ResourceId()) { if(ibufferUsed || ui->showDisabled->isChecked()) { uint64_t length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(state.m_IA.ibuffer.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(state.inputAssembly.indexBuffer.resourceId); if(buf) length = buf->length; RDTreeWidgetItem *node = new RDTreeWidgetItem( - {tr("Index"), state.m_IA.ibuffer.Buffer, draw ? draw->indexByteWidth : 0, - (qulonglong)state.m_IA.ibuffer.Offset, (qulonglong)length, QString()}); + {tr("Index"), state.inputAssembly.indexBuffer.resourceId, draw ? draw->indexByteWidth : 0, + (qulonglong)state.inputAssembly.indexBuffer.byteOffset, (qulonglong)length, QString()}); node->setTag(QVariant::fromValue( - D3D12VBIBTag(state.m_IA.ibuffer.Buffer, draw ? draw->indexOffset : 0))); + D3D12VBIBTag(state.inputAssembly.indexBuffer.resourceId, draw ? draw->indexOffset : 0))); if(!ibufferUsed) setInactiveRow(node); - if(state.m_IA.ibuffer.Buffer == ResourceId()) + if(state.inputAssembly.indexBuffer.resourceId == ResourceId()) setEmptyRow(node); ui->iaBuffers->addTopLevelItem(node); @@ -1353,7 +1356,7 @@ void D3D12PipelineStateViewer::setState() {tr("Index"), tr("No Buffer Set"), lit("-"), lit("-"), lit("-"), QString()}); node->setTag(QVariant::fromValue( - D3D12VBIBTag(state.m_IA.ibuffer.Buffer, draw ? draw->indexOffset : 0))); + D3D12VBIBTag(state.inputAssembly.indexBuffer.resourceId, draw ? draw->indexOffset : 0))); setEmptyRow(node); @@ -1366,30 +1369,31 @@ void D3D12PipelineStateViewer::setState() m_VBNodes.clear(); - for(int i = 0; i < state.m_IA.vbuffers.count(); i++) + for(int i = 0; i < state.inputAssembly.vertexBuffers.count(); i++) { - const D3D12Pipe::VB &v = state.m_IA.vbuffers[i]; + const D3D12Pipe::VertexBuffer &v = state.inputAssembly.vertexBuffers[i]; - bool filledSlot = (v.Buffer != ResourceId()); + bool filledSlot = (v.resourceId != ResourceId()); bool usedSlot = (usedVBuffers[i]); if(showNode(usedSlot, filledSlot)) { qulonglong length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(v.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(v.resourceId); if(buf) length = buf->length; RDTreeWidgetItem *node = NULL; if(filledSlot) - node = new RDTreeWidgetItem({i, v.Buffer, v.Stride, (qulonglong)v.Offset, length, QString()}); + node = new RDTreeWidgetItem( + {i, v.resourceId, v.byteStride, (qulonglong)v.byteOffset, length, QString()}); else node = new RDTreeWidgetItem({i, tr("No Buffer Set"), lit("-"), lit("-"), lit("-"), QString()}); - node->setTag(QVariant::fromValue(D3D12VBIBTag(v.Buffer, v.Offset))); + node->setTag(QVariant::fromValue(D3D12VBIBTag(v.resourceId, v.byteOffset))); if(!filledSlot) setEmptyRow(node); @@ -1406,44 +1410,44 @@ void D3D12PipelineStateViewer::setState() ui->iaBuffers->endUpdate(); ui->iaBuffers->verticalScrollBar()->setValue(vs); - setShaderState(state.m_VS, ui->vsShader, ui->vsRootSig, ui->vsResources, ui->vsSamplers, + setShaderState(state.vertexShader, ui->vsShader, ui->vsRootSig, ui->vsResources, ui->vsSamplers, ui->vsCBuffers, ui->vsUAVs); - setShaderState(state.m_GS, ui->gsShader, ui->gsRootSig, ui->gsResources, ui->gsSamplers, + setShaderState(state.geometryShader, ui->gsShader, ui->gsRootSig, ui->gsResources, ui->gsSamplers, ui->gsCBuffers, ui->gsUAVs); - setShaderState(state.m_HS, ui->hsShader, ui->hsRootSig, ui->hsResources, ui->hsSamplers, + setShaderState(state.hullShader, ui->hsShader, ui->hsRootSig, ui->hsResources, ui->hsSamplers, ui->hsCBuffers, ui->hsUAVs); - setShaderState(state.m_DS, ui->dsShader, ui->dsRootSig, ui->dsResources, ui->dsSamplers, + setShaderState(state.domainShader, ui->dsShader, ui->dsRootSig, ui->dsResources, ui->dsSamplers, ui->dsCBuffers, ui->dsUAVs); - setShaderState(state.m_PS, ui->psShader, ui->psRootSig, ui->psResources, ui->psSamplers, + setShaderState(state.pixelShader, ui->psShader, ui->psRootSig, ui->psResources, ui->psSamplers, ui->psCBuffers, ui->psUAVs); - setShaderState(state.m_CS, ui->csShader, ui->csRootSig, ui->csResources, ui->csSamplers, + setShaderState(state.computeShader, ui->csShader, ui->csRootSig, ui->csResources, ui->csSamplers, ui->csCBuffers, ui->csUAVs); bool streamoutSet = false; vs = ui->gsStreamOut->verticalScrollBar()->value(); ui->gsStreamOut->beginUpdate(); ui->gsStreamOut->clear(); - for(int i = 0; i < state.m_SO.Outputs.count(); i++) + for(int i = 0; i < state.streamOut.outputs.count(); i++) { - const D3D12Pipe::SOBind &s = state.m_SO.Outputs[i]; + const D3D12Pipe::StreamOutBind &s = state.streamOut.outputs[i]; - bool filledSlot = (s.Buffer != ResourceId()); + bool filledSlot = (s.resourceId != ResourceId()); bool usedSlot = (filledSlot); if(showNode(usedSlot, filledSlot)) { qulonglong length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(s.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(s.resourceId); if(buf) length = buf->length; - RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, s.Buffer, (qulonglong)s.Offset, length, s.WrittenCountBuffer, - (qulonglong)s.WrittenCountOffset, QString()}); + RDTreeWidgetItem *node = new RDTreeWidgetItem( + {i, s.resourceId, (qulonglong)s.byteOffset, length, s.writtenCountResourceId, + (qulonglong)s.writtenCountByteOffset, QString()}); - node->setTag(QVariant::fromValue(s.Buffer)); + node->setTag(QVariant::fromValue(s.resourceId)); if(!filledSlot) setEmptyRow(node); @@ -1467,14 +1471,14 @@ void D3D12PipelineStateViewer::setState() vs = ui->viewports->verticalScrollBar()->value(); ui->viewports->beginUpdate(); ui->viewports->clear(); - for(int i = 0; i < state.m_RS.Viewports.count(); i++) + for(int i = 0; i < state.rasterizer.viewports.count(); i++) { - const D3D12Pipe::Viewport &v = state.m_RS.Viewports[i]; + const Viewport &v = state.rasterizer.viewports[i]; RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, v.X, v.Y, v.Width, v.Height, v.MinDepth, v.MaxDepth}); + new RDTreeWidgetItem({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth}); - if(v.Width == 0 || v.Height == 0 || v.MinDepth == v.MaxDepth) + if(v.width == 0 || v.height == 0 || v.minDepth == v.maxDepth) setEmptyRow(node); ui->viewports->addTopLevelItem(node); @@ -1486,14 +1490,13 @@ void D3D12PipelineStateViewer::setState() vs = ui->scissors->verticalScrollBar()->value(); ui->scissors->beginUpdate(); ui->scissors->clear(); - for(int i = 0; i < state.m_RS.Scissors.count(); i++) + for(int i = 0; i < state.rasterizer.scissors.count(); i++) { - const D3D12Pipe::Scissor &s = state.m_RS.Scissors[i]; + const Scissor &s = state.rasterizer.scissors[i]; - RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, s.left, s.top, s.right - s.left, s.bottom - s.top}); + RDTreeWidgetItem *node = new RDTreeWidgetItem({i, s.x, s.y, s.width, s.height}); - if(s.right == s.left || s.bottom == s.top) + if(s.width == 0 || s.height == 0) setEmptyRow(node); ui->scissors->addTopLevelItem(node); @@ -1502,19 +1505,19 @@ void D3D12PipelineStateViewer::setState() ui->scissors->verticalScrollBar()->setValue(vs); ui->scissors->endUpdate(); - ui->fillMode->setText(ToQStr(state.m_RS.m_State.fillMode)); - ui->cullMode->setText(ToQStr(state.m_RS.m_State.cullMode)); - ui->frontCCW->setPixmap(state.m_RS.m_State.FrontCCW ? tick : cross); + ui->fillMode->setText(ToQStr(state.rasterizer.state.fillMode)); + ui->cullMode->setText(ToQStr(state.rasterizer.state.cullMode)); + ui->frontCCW->setPixmap(state.rasterizer.state.frontCCW ? tick : cross); - ui->lineAA->setPixmap(state.m_RS.m_State.AntialiasedLineEnable ? tick : cross); - ui->multisample->setPixmap(state.m_RS.m_State.MultisampleEnable ? tick : cross); + ui->lineAA->setPixmap(state.rasterizer.state.antialiasedLines ? tick : cross); + ui->multisample->setPixmap(state.rasterizer.state.multisampleEnable ? tick : cross); - ui->depthClip->setPixmap(state.m_RS.m_State.DepthClip ? tick : cross); - ui->depthBias->setText(Formatter::Format(state.m_RS.m_State.DepthBias)); - ui->depthBiasClamp->setText(Formatter::Format(state.m_RS.m_State.DepthBiasClamp)); - ui->slopeScaledBias->setText(Formatter::Format(state.m_RS.m_State.SlopeScaledDepthBias)); - ui->forcedSampleCount->setText(QString::number(state.m_RS.m_State.ForcedSampleCount)); - ui->conservativeRaster->setPixmap(state.m_RS.m_State.ConservativeRasterization ? tick : cross); + ui->depthClip->setPixmap(state.rasterizer.state.depthClip ? tick : cross); + ui->depthBias->setText(Formatter::Format(state.rasterizer.state.depthBias)); + ui->depthBiasClamp->setText(Formatter::Format(state.rasterizer.state.depthBiasClamp)); + ui->slopeScaledBias->setText(Formatter::Format(state.rasterizer.state.slopeScaledDepthBias)); + ui->forcedSampleCount->setText(QString::number(state.rasterizer.state.forcedSampleCount)); + ui->conservativeRaster->setPixmap(state.rasterizer.state.conservativeRasterization ? tick : cross); //////////////////////////////////////////////// // Output Merger @@ -1525,16 +1528,16 @@ void D3D12PipelineStateViewer::setState() ui->targetOutputs->beginUpdate(); ui->targetOutputs->clear(); { - for(int i = 0; i < state.m_OM.RenderTargets.count(); i++) + for(int i = 0; i < state.outputMerger.renderTargets.count(); i++) { - addResourceRow(D3D12ViewTag(D3D12ViewTag::OMTarget, 0, i, state.m_OM.RenderTargets[i]), NULL, - ui->targetOutputs); + addResourceRow(D3D12ViewTag(D3D12ViewTag::OMTarget, 0, i, state.outputMerger.renderTargets[i]), + NULL, ui->targetOutputs); - if(state.m_OM.RenderTargets[i].Resource != ResourceId()) + if(state.outputMerger.renderTargets[i].resourceId != ResourceId()) targets[i] = true; } - addResourceRow(D3D12ViewTag(D3D12ViewTag::OMDepth, 0, 0, state.m_OM.DepthTarget), NULL, + addResourceRow(D3D12ViewTag(D3D12ViewTag::OMDepth, 0, 0, state.outputMerger.depthTarget), NULL, ui->targetOutputs); } ui->targetOutputs->clearSelection(); @@ -1546,32 +1549,32 @@ void D3D12PipelineStateViewer::setState() ui->blends->clear(); { int i = 0; - for(const D3D12Pipe::Blend &blend : state.m_OM.m_BlendState.Blends) + for(const ColorBlend &blend : state.outputMerger.blendState.blends) { - bool filledSlot = (blend.Enabled || targets[i]); + bool filledSlot = (blend.enabled || targets[i]); bool usedSlot = (targets[i]); if(showNode(usedSlot, filledSlot)) { RDTreeWidgetItem *node = NULL; - node = new RDTreeWidgetItem({i, blend.Enabled ? tr("True") : tr("False"), - blend.LogicEnabled ? tr("True") : tr("False"), + node = new RDTreeWidgetItem( + {i, blend.enabled ? tr("True") : tr("False"), + blend.logicOperationEnabled ? tr("True") : tr("False"), - ToQStr(blend.m_Blend.Source), ToQStr(blend.m_Blend.Destination), - ToQStr(blend.m_Blend.Operation), + ToQStr(blend.colorBlend.source), ToQStr(blend.colorBlend.destination), + ToQStr(blend.colorBlend.operation), - ToQStr(blend.m_AlphaBlend.Source), - ToQStr(blend.m_AlphaBlend.Destination), - ToQStr(blend.m_AlphaBlend.Operation), + ToQStr(blend.alphaBlend.source), ToQStr(blend.alphaBlend.destination), + ToQStr(blend.alphaBlend.operation), - ToQStr(blend.Logic), + ToQStr(blend.logicOperation), - QFormatStr("%1%2%3%4") - .arg((blend.WriteMask & 0x1) == 0 ? lit("_") : lit("R")) - .arg((blend.WriteMask & 0x2) == 0 ? lit("_") : lit("G")) - .arg((blend.WriteMask & 0x4) == 0 ? lit("_") : lit("B")) - .arg((blend.WriteMask & 0x8) == 0 ? lit("_") : lit("A"))}); + QFormatStr("%1%2%3%4") + .arg((blend.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + .arg((blend.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + .arg((blend.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + .arg((blend.writeMask & 0x8) == 0 ? lit("_") : lit("A"))}); if(!filledSlot) setEmptyRow(node); @@ -1589,35 +1592,39 @@ void D3D12PipelineStateViewer::setState() ui->blends->endUpdate(); ui->blends->verticalScrollBar()->setValue(vs); - ui->alphaToCoverage->setPixmap(state.m_OM.m_BlendState.AlphaToCoverage ? tick : cross); - ui->independentBlend->setPixmap(state.m_OM.m_BlendState.IndependentBlend ? tick : cross); + ui->alphaToCoverage->setPixmap(state.outputMerger.blendState.alphaToCoverage ? tick : cross); + ui->independentBlend->setPixmap(state.outputMerger.blendState.independentBlend ? tick : cross); ui->blendFactor->setText(QFormatStr("%1, %2, %3, %4") - .arg(state.m_OM.m_BlendState.BlendFactor[0], 0, 'f', 2) - .arg(state.m_OM.m_BlendState.BlendFactor[1], 0, 'f', 2) - .arg(state.m_OM.m_BlendState.BlendFactor[2], 0, 'f', 2) - .arg(state.m_OM.m_BlendState.BlendFactor[3], 0, 'f', 2)); + .arg(state.outputMerger.blendState.blendFactor[0], 0, 'f', 2) + .arg(state.outputMerger.blendState.blendFactor[1], 0, 'f', 2) + .arg(state.outputMerger.blendState.blendFactor[2], 0, 'f', 2) + .arg(state.outputMerger.blendState.blendFactor[3], 0, 'f', 2)); - ui->depthEnabled->setPixmap(state.m_OM.m_State.DepthEnable ? tick : cross); - ui->depthFunc->setText(ToQStr(state.m_OM.m_State.DepthFunc)); - ui->depthWrite->setPixmap(state.m_OM.m_State.DepthWrites ? tick : cross); + ui->depthEnabled->setPixmap(state.outputMerger.depthStencilState.depthEnable ? tick : cross); + ui->depthFunc->setText(ToQStr(state.outputMerger.depthStencilState.depthFunction)); + ui->depthWrite->setPixmap(state.outputMerger.depthStencilState.depthWrites ? tick : cross); - ui->stencilEnabled->setPixmap(state.m_OM.m_State.StencilEnable ? tick : cross); - ui->stencilReadMask->setText(Formatter::Format(state.m_OM.m_State.StencilReadMask, true)); - ui->stencilWriteMask->setText(Formatter::Format(state.m_OM.m_State.StencilWriteMask, true)); - ui->stencilRef->setText(Formatter::Format(state.m_OM.m_State.StencilRef, true)); + ui->stencilEnabled->setPixmap(state.outputMerger.depthStencilState.stencilEnable ? tick : cross); + ui->stencilReadMask->setText( + Formatter::Format(state.outputMerger.depthStencilState.frontFace.compareMask, true)); + ui->stencilWriteMask->setText( + Formatter::Format(state.outputMerger.depthStencilState.frontFace.writeMask, true)); + ui->stencilRef->setText( + Formatter::Format(state.outputMerger.depthStencilState.frontFace.reference, true)); ui->stencils->beginUpdate(); ui->stencils->clear(); - ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Front"), ToQStr(state.m_OM.m_State.m_FrontFace.Func), - ToQStr(state.m_OM.m_State.m_FrontFace.FailOp), - ToQStr(state.m_OM.m_State.m_FrontFace.DepthFailOp), - ToQStr(state.m_OM.m_State.m_FrontFace.PassOp)})); ui->stencils->addTopLevelItem(new RDTreeWidgetItem( - {tr("Back"), ToQStr(state.m_OM.m_State.m_BackFace.Func), - ToQStr(state.m_OM.m_State.m_BackFace.FailOp), ToQStr(state.m_OM.m_State.m_BackFace.DepthFailOp), - ToQStr(state.m_OM.m_State.m_BackFace.PassOp)})); + {tr("Front"), ToQStr(state.outputMerger.depthStencilState.frontFace.function), + ToQStr(state.outputMerger.depthStencilState.frontFace.failOperation), + ToQStr(state.outputMerger.depthStencilState.frontFace.depthFailOperation), + ToQStr(state.outputMerger.depthStencilState.frontFace.passOperation)})); + ui->stencils->addTopLevelItem(new RDTreeWidgetItem( + {tr("Back"), ToQStr(state.outputMerger.depthStencilState.backFace.function), + ToQStr(state.outputMerger.depthStencilState.backFace.failOperation), + ToQStr(state.outputMerger.depthStencilState.backFace.depthFailOperation), + ToQStr(state.outputMerger.depthStencilState.backFace.passOperation)})); ui->stencils->clearSelection(); ui->stencils->endUpdate(); @@ -1632,9 +1639,10 @@ void D3D12PipelineStateViewer::setState() } else { - ui->pipeFlow->setStagesEnabled( - {true, true, state.m_HS.Object != ResourceId(), state.m_DS.Object != ResourceId(), - state.m_GS.Object != ResourceId(), true, state.m_PS.Object != ResourceId(), true, false}); + ui->pipeFlow->setStagesEnabled({true, true, state.hullShader.resourceId != ResourceId(), + state.domainShader.resourceId != ResourceId(), + state.geometryShader.resourceId != ResourceId(), true, + state.pixelShader.resourceId != ResourceId(), true, false}); } } @@ -1699,15 +1707,15 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in else if(tag.canConvert()) { D3D12ViewTag view = tag.value(); - tex = m_Ctx.GetTexture(view.res.Resource); - buf = m_Ctx.GetBuffer(view.res.Resource); + tex = m_Ctx.GetTexture(view.res.resourceId); + buf = m_Ctx.GetBuffer(view.res.resourceId); } if(tex) { - if(tex->resType == TextureDim::Buffer) + if(tex->type == TextureType::Buffer) { - IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->ID); + IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -1716,7 +1724,7 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in if(!m_Ctx.HasTextureViewer()) m_Ctx.ShowTextureViewer(); ITextureViewer *viewer = m_Ctx.GetTextureViewer(); - viewer->ViewTexture(tex->ID, true); + viewer->ViewTexture(tex->resourceId, true); } return; @@ -1730,23 +1738,23 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in uint64_t offs = 0; uint64_t size = buf->length; - if(view.res.Resource != ResourceId()) + if(view.res.resourceId != ResourceId()) { - offs = view.res.FirstElement * view.res.ElementSize; - size = uint64_t(view.res.NumElements) * view.res.ElementSize; + offs = view.res.firstElement * view.res.elementByteSize; + size = uint64_t(view.res.numElements) * view.res.elementByteSize; } else { // last thing, see if it's a streamout buffer - if(stage == &m_Ctx.CurD3D12PipelineState().m_GS) + if(stage == &m_Ctx.CurD3D12PipelineState().geometryShader) { - for(int i = 0; i < m_Ctx.CurD3D12PipelineState().m_SO.Outputs.count(); i++) + for(int i = 0; i < m_Ctx.CurD3D12PipelineState().streamOut.outputs.count(); i++) { - if(buf->ID == m_Ctx.CurD3D12PipelineState().m_SO.Outputs[i].Buffer) + if(buf->resourceId == m_Ctx.CurD3D12PipelineState().streamOut.outputs[i].resourceId) { - size -= m_Ctx.CurD3D12PipelineState().m_SO.Outputs[i].Offset; - offs += m_Ctx.CurD3D12PipelineState().m_SO.Outputs[i].Offset; + size -= m_Ctx.CurD3D12PipelineState().streamOut.outputs[i].byteOffset; + offs += m_Ctx.CurD3D12PipelineState().streamOut.outputs[i].byteOffset; break; } } @@ -1757,15 +1765,15 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in const ShaderResource *shaderRes = NULL; - if(stage->ShaderDetails) + if(stage->reflection) { const rdcarray &resArray = view.space == D3D12ViewTag::SRV - ? stage->ShaderDetails->ReadOnlyResources - : stage->ShaderDetails->ReadWriteResources; + ? stage->reflection->readOnlyResources + : stage->reflection->readWriteResources; - const rdcarray &bindArray = view.space == D3D12ViewTag::SRV - ? stage->BindpointMapping.ReadOnlyResources - : stage->BindpointMapping.ReadWriteResources; + const rdcarray &bindArray = view.space == D3D12ViewTag::SRV + ? stage->bindpointMapping.readOnlyResources + : stage->bindpointMapping.readWriteResources; for(int i = 0; i < bindArray.count(); i++) { @@ -1791,17 +1799,17 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in { const auto &desc = res.variableType.descriptor; - if(view.res.Format.Name().empty()) + if(view.res.viewFormat.Name().empty()) { format = QString(); if(desc.rowMajorStorage) format += lit("row_major "); format += ToQStr(desc.type); - if(desc.rows > 1 && desc.cols > 1) - format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.cols); - else if(desc.cols > 1) - format += QString::number(desc.cols); + if(desc.rows > 1 && desc.columns > 1) + format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.columns); + else if(desc.columns > 1) + format += QString::number(desc.columns); if(!desc.name.empty()) format += lit(" ") + desc.name; @@ -1811,7 +1819,7 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } else { - const ResourceFormat &fmt = view.res.Format; + const ResourceFormat &fmt = view.res.viewFormat; if(fmt.type == ResourceFormatType::R10G10B10A2) { if(fmt.compType == CompType::UInt) @@ -1869,7 +1877,7 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } } - if(view.res.BufferFlags & D3DBufferViewFlags::Raw) + if(view.res.bufferFlags & D3DBufferViewFlags::Raw) format = lit("xint"); format += QString::number(fmt.compCount); @@ -1878,7 +1886,7 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in } } - IBufferViewer *viewer = m_Ctx.ViewBuffer(offs, size, view.res.Resource, format); + IBufferViewer *viewer = m_Ctx.ViewBuffer(offs, size, view.res.resourceId, format); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -1901,9 +1909,9 @@ void D3D12PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int if(cb.idx == ~0U) { // unused cbuffer, open regular buffer viewer - const D3D12Pipe::CBuffer &buf = stage->Spaces[cb.space].ConstantBuffers[cb.reg]; + const D3D12Pipe::ConstantBuffer &buf = stage->spaces[cb.space].constantBuffers[cb.reg]; - IBufferViewer *viewer = m_Ctx.ViewBuffer(buf.Offset, buf.ByteSize, buf.Buffer); + IBufferViewer *viewer = m_Ctx.ViewBuffer(buf.byteOffset, buf.byteSize, buf.resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); @@ -1941,7 +1949,7 @@ void D3D12PipelineStateViewer::highlightIABind(int slot) { int idx = ((slot + 1) * 21) % 32; // space neighbouring colours reasonably distinctly - const D3D12Pipe::IA &IA = m_Ctx.CurD3D12PipelineState().m_IA; + const D3D12Pipe::InputAssembly &IA = m_Ctx.CurD3D12PipelineState().inputAssembly; QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); @@ -1959,7 +1967,7 @@ void D3D12PipelineStateViewer::highlightIABind(int slot) { RDTreeWidgetItem *item = ui->iaLayouts->topLevelItem(i); - if((int)IA.layouts[i].InputSlot != slot) + if((int)IA.layouts[i].inputSlot != slot) { item->setBackground(QBrush()); item->setForeground(QBrush()); @@ -1984,13 +1992,13 @@ void D3D12PipelineStateViewer::on_iaLayouts_mouseMove(QMouseEvent *e) vertex_leave(NULL); - const D3D12Pipe::IA &IA = m_Ctx.CurD3D12PipelineState().m_IA; + const D3D12Pipe::InputAssembly &IA = m_Ctx.CurD3D12PipelineState().inputAssembly; if(idx.isValid()) { if(idx.row() >= 0 && idx.row() < IA.layouts.count()) { - uint32_t buffer = IA.layouts[idx.row()].InputSlot; + uint32_t buffer = IA.layouts[idx.row()].inputSlot; highlightIABind((int)buffer); } @@ -2056,11 +2064,11 @@ void D3D12PipelineStateViewer::shaderView_clicked() QWidget *sender = qobject_cast(QObject::sender()); const D3D12Pipe::Shader *stage = stageForSender(sender); - if(stage == NULL || stage->Object == ResourceId()) + if(stage == NULL || stage->resourceId == ResourceId()) return; IShaderViewer *shad = - m_Ctx.ViewShader(stage->ShaderDetails, m_Ctx.CurD3D12PipelineState().pipeline); + m_Ctx.ViewShader(stage->reflection, m_Ctx.CurD3D12PipelineState().pipelineResourceId); m_Ctx.AddDockWindow(shad->Widget(), DockReference::AddTo, this); } @@ -2070,10 +2078,10 @@ void D3D12PipelineStateViewer::shaderEdit_clicked() QWidget *sender = qobject_cast(QObject::sender()); const D3D12Pipe::Shader *stage = stageForSender(sender); - if(!stage || stage->Object == ResourceId()) + if(!stage || stage->resourceId == ResourceId()) return; - const ShaderReflection *shaderDetails = stage->ShaderDetails; + const ShaderReflection *shaderDetails = stage->reflection; if(!shaderDetails) return; @@ -2094,7 +2102,7 @@ void D3D12PipelineStateViewer::shaderEdit_clicked() if(files.empty()) return; - m_Common.EditShader(stage->stage, stage->Object, shaderDetails, entryFunc, files); + m_Common.EditShader(stage->stage, stage->resourceId, shaderDetails, entryFunc, files); } void D3D12PipelineStateViewer::shaderSave_clicked() @@ -2104,9 +2112,9 @@ void D3D12PipelineStateViewer::shaderSave_clicked() if(stage == NULL) return; - ShaderReflection *shaderDetails = stage->ShaderDetails; + ShaderReflection *shaderDetails = stage->reflection; - if(stage->Object == ResourceId()) + if(stage->resourceId == ResourceId()) return; m_Common.SaveShaderFile(shaderDetails); @@ -2116,18 +2124,18 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie const ShaderResource *shaderInput, const QString &extraParams) { - QString name = - view.Resource == ResourceId() ? tr("Empty") : QString(m_Ctx.GetResourceName(view.Resource)); + QString name = view.resourceId == ResourceId() ? tr("Empty") + : QString(m_Ctx.GetResourceName(view.resourceId)); QString typeName = tr("Unknown"); QString format = tr("Unknown"); uint64_t w = 1; uint32_t h = 1, d = 1; uint32_t a = 0; - QString viewFormat = view.Format.Name(); + QString viewFormat = view.viewFormat.Name(); - TextureDescription *tex = m_Ctx.GetTexture(view.Resource); - BufferDescription *buf = m_Ctx.GetBuffer(view.Resource); + TextureDescription *tex = m_Ctx.GetTexture(view.resourceId); + BufferDescription *buf = m_Ctx.GetBuffer(view.resourceId); QString viewParams; @@ -2139,7 +2147,7 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); if(view.swizzle[0] != TextureSwizzle::Red || view.swizzle[1] != TextureSwizzle::Green || view.swizzle[2] != TextureSwizzle::Blue || view.swizzle[3] != TextureSwizzle::Alpha) @@ -2152,21 +2160,20 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie } if(tex->mips > 1) - viewParams = tr("Highest Mip: %1, Num Mips: %2").arg(view.HighestMip).arg(view.NumMipLevels); + viewParams = tr("Highest Mip: %1, Num Mips: %2").arg(view.firstMip).arg(view.numMips); if(tex->arraysize > 1) { if(!viewParams.isEmpty()) viewParams += lit(", "); - viewParams += - tr("First Slice: %1, Array Size: %2").arg(view.FirstArraySlice).arg(view.ArraySize); + viewParams += tr("First Slice: %1, Array Size: %2").arg(view.firstSlice).arg(view.numSlices); } - if(view.MinLODClamp > 0.0f) + if(view.minLODClamp > 0.0f) { if(!viewParams.isEmpty()) viewParams += lit(", "); - viewParams += tr("MinLODClamp: %1").arg(view.MinLODClamp); + viewParams += tr("MinLODClamp: %1").arg(view.minLODClamp); } } @@ -2177,29 +2184,29 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie h = 0; d = 0; a = 0; - format = view.Format.Name(); + format = view.viewFormat.Name(); typeName = lit("Buffer"); - if(view.BufferFlags & D3DBufferViewFlags::Raw) + if(view.bufferFlags & D3DBufferViewFlags::Raw) { typeName = rw ? lit("RWByteAddressBuffer") : lit("ByteAddressBuffer"); } - else if(view.ElementSize > 0) + else if(view.elementByteSize > 0) { // for structured buffers, display how many 'elements' there are in the buffer typeName = QFormatStr("%1[%2]") .arg(rw ? lit("RWStructuredBuffer") : lit("StructuredBuffer")) - .arg(buf->length / view.ElementSize); + .arg(buf->length / view.elementByteSize); } - if(view.BufferFlags & D3DBufferViewFlags::Append || view.BufferFlags & D3DBufferViewFlags::Counter) + if(view.bufferFlags & D3DBufferViewFlags::Append || view.bufferFlags & D3DBufferViewFlags::Counter) { - typeName += tr(" (Count: %1)").arg(view.BufferStructCount); + typeName += tr(" (Count: %1)").arg(view.bufferStructCount); } - if(shaderInput && !shaderInput->IsTexture) + if(shaderInput && !shaderInput->isTexture) { - if(view.Format.compType == CompType::Typeless) + if(view.viewFormat.compType == CompType::Typeless) { if(!shaderInput->variableType.members.isEmpty()) viewFormat = format = lit("struct ") + shaderInput->variableType.descriptor.name; @@ -2208,20 +2215,20 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie } else { - format = view.Format.Name(); + format = view.viewFormat.Name(); } } viewParams = tr("First Element: %1, Num Elements %2, Flags %3") - .arg(view.FirstElement) - .arg(view.NumElements) - .arg(ToQStr(view.BufferFlags)); + .arg(view.firstElement) + .arg(view.numElements) + .arg(ToQStr(view.bufferFlags)); - if(view.CounterResource != ResourceId()) + if(view.counterResourceId != ResourceId()) { viewParams += tr(", Counter in %1 at %2 bytes") - .arg(m_Ctx.GetResourceName(view.CounterResource)) - .arg(view.CounterByteOffset); + .arg(m_Ctx.GetResourceName(view.counterResourceId)) + .arg(view.counterByteOffset); } } @@ -2230,11 +2237,11 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie else viewParams += lit(", ") + extraParams; - return {name, ToQStr(view.Type), typeName, (qulonglong)w, h, d, + return {name, ToQStr(view.type), typeName, (qulonglong)w, h, d, a, viewFormat, format, viewParams}; } -void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::IA &ia) +void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::InputAssembly &ia) { { xml.writeStartElement(lit("h3")); @@ -2246,8 +2253,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe int i = 0; for(const D3D12Pipe::Layout &l : ia.layouts) { - rows.push_back({i, l.SemanticName, l.SemanticIndex, l.Format.Name(), l.InputSlot, - l.ByteOffset, (bool)l.PerInstance, l.InstanceDataStepRate}); + rows.push_back({i, l.semanticName, l.semanticIndex, l.format.Name(), l.inputSlot, + l.byteOffset, (bool)l.perInstance, l.instanceDataStepRate}); i++; } @@ -2266,25 +2273,25 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; int i = 0; - for(const D3D12Pipe::VB &vb : ia.vbuffers) + for(const D3D12Pipe::VertexBuffer &vb : ia.vertexBuffers) { - QString name = m_Ctx.GetResourceName(vb.Buffer); + QString name = m_Ctx.GetResourceName(vb.resourceId); uint64_t length = 0; - if(vb.Buffer == ResourceId()) + if(vb.resourceId == ResourceId()) { continue; } else { - BufferDescription *buf = m_Ctx.GetBuffer(vb.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(vb.resourceId); if(buf) length = buf->length; } - length = qMin(length, (uint64_t)vb.Size); + length = qMin(length, (uint64_t)vb.byteSize); - rows.push_back({i, name, vb.Stride, (qulonglong)vb.Offset, (qulonglong)length}); + rows.push_back({i, name, vb.byteStride, (qulonglong)vb.byteOffset, (qulonglong)length}); i++; } @@ -2298,21 +2305,21 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe xml.writeCharacters(tr("Index Buffer")); xml.writeEndElement(); - QString name = m_Ctx.GetResourceName(ia.ibuffer.Buffer); + QString name = m_Ctx.GetResourceName(ia.indexBuffer.resourceId); uint64_t length = 0; - if(ia.ibuffer.Buffer == ResourceId()) + if(ia.indexBuffer.resourceId == ResourceId()) { name = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(ia.ibuffer.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(ia.indexBuffer.resourceId); if(buf) length = buf->length; } - length = qMin(length, (uint64_t)ia.ibuffer.Size); + length = qMin(length, (uint64_t)ia.indexBuffer.byteSize); QString ifmt = lit("UNKNOWN"); if(m_Ctx.CurDrawcall()->indexByteWidth == 2) @@ -2321,7 +2328,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe ifmt = lit("R32_UINT"); m_Common.exportHTMLTable(xml, {tr("Buffer"), tr("Format"), tr("Offset"), tr("Byte Length")}, - {name, ifmt, (qulonglong)ia.ibuffer.Offset, (qulonglong)length}); + {name, ifmt, (qulonglong)ia.indexBuffer.byteOffset, (qulonglong)length}); } xml.writeStartElement(lit("p")); @@ -2332,7 +2339,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::Shader &sh) { - ShaderReflection *shaderDetails = sh.ShaderDetails; + ShaderReflection *shaderDetails = sh.reflection; { xml.writeStartElement(lit("h3")); @@ -2343,25 +2350,25 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe const D3D12Pipe::State &state = m_Ctx.CurD3D12PipelineState(); - if(sh.Object == ResourceId()) + if(sh.resourceId == ResourceId()) shadername = tr("Unbound"); else shadername = tr("%1 - %2 Shader") - .arg(m_Ctx.GetResourceName(state.pipeline)) + .arg(m_Ctx.GetResourceName(state.pipelineResourceId)) .arg(ToQStr(sh.stage, GraphicsAPI::D3D12)); - if(shaderDetails && !shaderDetails->DebugInfo.files.empty()) + if(shaderDetails && !shaderDetails->debugInfo.files.empty()) { shadername = QFormatStr("%1() - %2") - .arg(shaderDetails->EntryPoint) - .arg(QFileInfo(shaderDetails->DebugInfo.files[0].Filename).fileName()); + .arg(shaderDetails->entryPoint) + .arg(QFileInfo(shaderDetails->debugInfo.files[0].filename).fileName()); } xml.writeStartElement(lit("p")); xml.writeCharacters(shadername); xml.writeEndElement(); - if(sh.Object == ResourceId()) + if(sh.resourceId == ResourceId()) return; } @@ -2372,25 +2379,25 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count(); space++) + for(int space = 0; space < sh.spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].SRVs.count(); reg++) + for(int reg = 0; reg < sh.spaces[space].srvs.count(); reg++) { - const D3D12Pipe::View &v = sh.Spaces[space].SRVs[reg]; + const D3D12Pipe::View &v = sh.spaces[space].srvs[reg]; // consider this register to not exist - it's in a gap defined by sparse root signature // elements - if(v.RootElement == ~0U) + if(v.rootElement == ~0U) continue; const ShaderResource *shaderInput = NULL; - if(sh.ShaderDetails) + if(sh.reflection) { - for(int i = 0; i < sh.BindpointMapping.ReadOnlyResources.count(); i++) + for(int i = 0; i < sh.bindpointMapping.readOnlyResources.count(); i++) { - const BindpointMap &b = sh.BindpointMapping.ReadOnlyResources[i]; - const ShaderResource &res = sh.ShaderDetails->ReadOnlyResources[i]; + const Bindpoint &b = sh.bindpointMapping.readOnlyResources[i]; + const ShaderResource &res = sh.reflection->readOnlyResources[i]; bool regMatch = b.bind == reg; @@ -2407,8 +2414,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe } } - QString rootel = v.Immediate ? tr("#%1 Direct").arg(v.RootElement) - : tr("#%1 Table[%2]").arg(v.RootElement).arg(v.TableIndex); + QString rootel = v.immediate ? tr("#%1 Direct").arg(v.rootElement) + : tr("#%1 Table[%2]").arg(v.rootElement).arg(v.tableIndex); QVariantList row = exportViewHTML(v, false, shaderInput, QString()); @@ -2434,25 +2441,25 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count(); space++) + for(int space = 0; space < sh.spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].UAVs.count(); reg++) + for(int reg = 0; reg < sh.spaces[space].uavs.count(); reg++) { - const D3D12Pipe::View &v = sh.Spaces[space].UAVs[reg]; + const D3D12Pipe::View &v = sh.spaces[space].uavs[reg]; // consider this register to not exist - it's in a gap defined by sparse root signature // elements - if(v.RootElement == ~0U) + if(v.rootElement == ~0U) continue; const ShaderResource *shaderInput = NULL; - if(sh.ShaderDetails) + if(sh.reflection) { - for(int i = 0; i < sh.BindpointMapping.ReadWriteResources.count(); i++) + for(int i = 0; i < sh.bindpointMapping.readWriteResources.count(); i++) { - const BindpointMap &b = sh.BindpointMapping.ReadWriteResources[i]; - const ShaderResource &res = sh.ShaderDetails->ReadWriteResources[i]; + const Bindpoint &b = sh.bindpointMapping.readWriteResources[i]; + const ShaderResource &res = sh.reflection->readWriteResources[i]; bool regMatch = b.bind == reg; @@ -2469,8 +2476,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe } } - QString rootel = v.Immediate ? tr("#%1 Direct").arg(v.RootElement) - : tr("#%1 Table[%2]").arg(v.RootElement).arg(v.TableIndex); + QString rootel = v.immediate ? tr("#%1 Direct").arg(v.rootElement) + : tr("#%1 Table[%2]").arg(v.rootElement).arg(v.tableIndex); QVariantList row = exportViewHTML(v, true, shaderInput, QString()); @@ -2496,25 +2503,25 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count(); space++) + for(int space = 0; space < sh.spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].Samplers.count(); reg++) + for(int reg = 0; reg < sh.spaces[space].samplers.count(); reg++) { - const D3D12Pipe::Sampler &s = sh.Spaces[space].Samplers[reg]; + const D3D12Pipe::Sampler &s = sh.spaces[space].samplers[reg]; // consider this register to not exist - it's in a gap defined by sparse root signature // elements - if(s.RootElement == ~0U) + if(s.rootElement == ~0U) continue; const ShaderSampler *shaderInput = NULL; - if(sh.ShaderDetails) + if(sh.reflection) { - for(int i = 0; i < sh.BindpointMapping.Samplers.count(); i++) + for(int i = 0; i < sh.bindpointMapping.samplers.count(); i++) { - const BindpointMap &b = sh.BindpointMapping.Samplers[i]; - const ShaderSampler &res = sh.ShaderDetails->Samplers[i]; + const Bindpoint &b = sh.bindpointMapping.samplers[i]; + const ShaderSampler &res = sh.reflection->samplers[i]; bool regMatch = b.bind == reg; @@ -2531,8 +2538,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe } } - QString rootel = s.Immediate ? tr("#%1 Static").arg(s.RootElement) - : tr("#%1 Table[%2]").arg(s.RootElement).arg(s.TableIndex); + QString rootel = s.immediate ? tr("#%1 Static").arg(s.rootElement) + : tr("#%1 Table[%2]").arg(s.rootElement).arg(s.tableIndex); { QString regname = QString::number(reg); @@ -2541,17 +2548,17 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe regname += lit(": ") + shaderInput->name; QString borderColor = QFormatStr("%1, %2, %3, %4") - .arg(s.BorderColor[0]) - .arg(s.BorderColor[1]) - .arg(s.BorderColor[2]) - .arg(s.BorderColor[3]); + .arg(s.borderColor[0]) + .arg(s.borderColor[1]) + .arg(s.borderColor[2]) + .arg(s.borderColor[3]); QString addressing; QString addPrefix; QString addVal; - QString addr[] = {ToQStr(s.AddressU), ToQStr(s.AddressV), ToQStr(s.AddressW)}; + QString addr[] = {ToQStr(s.addressU), ToQStr(s.addressV), ToQStr(s.addressW)}; // arrange like either UVW: WRAP or UV: WRAP, W: CLAMP for(int a = 0; a < 3; a++) @@ -2577,21 +2584,21 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe if(s.UseBorder()) addressing += QFormatStr("<%1>").arg(borderColor); - QString filter = ToQStr(s.Filter); + QString filter = ToQStr(s.filter); - if(s.MaxAniso > 1) - filter += QFormatStr(" %1x").arg(s.MaxAniso); + if(s.maxAnisotropy > 1) + filter += QFormatStr(" %1x").arg(s.maxAnisotropy); - if(s.Filter.func == FilterFunc::Comparison) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Comparison)); - else if(s.Filter.func != FilterFunc::Normal) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Filter.func)); + if(s.filter.filter == FilterFunction::Comparison) + filter += QFormatStr(" (%1)").arg(ToQStr(s.compareFunction)); + else if(s.filter.filter != FilterFunction::Normal) + filter += QFormatStr(" (%1)").arg(ToQStr(s.filter.filter)); rows.push_back({rootel, space, regname, addressing, filter, QFormatStr("%1 - %2") - .arg(s.MinLOD == -FLT_MAX ? lit("0") : QString::number(s.MinLOD)) - .arg(s.MaxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.MaxLOD)), - s.MipLODBias}); + .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) + .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), + s.mipLODBias}); } } } @@ -2608,20 +2615,20 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count(); space++) + for(int space = 0; space < sh.spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].ConstantBuffers.count(); reg++) + for(int reg = 0; reg < sh.spaces[space].constantBuffers.count(); reg++) { - const D3D12Pipe::CBuffer &b = sh.Spaces[space].ConstantBuffers[reg]; + const D3D12Pipe::ConstantBuffer &b = sh.spaces[space].constantBuffers[reg]; const ConstantBlock *shaderCBuf = NULL; - if(sh.ShaderDetails) + if(sh.reflection) { - for(int i = 0; i < sh.BindpointMapping.ConstantBlocks.count(); i++) + for(int i = 0; i < sh.bindpointMapping.constantBlocks.count(); i++) { - const BindpointMap &bm = sh.BindpointMapping.ConstantBlocks[i]; - const ConstantBlock &res = sh.ShaderDetails->ConstantBlocks[i]; + const Bindpoint &bm = sh.bindpointMapping.constantBlocks[i]; + const ConstantBlock &res = sh.reflection->constantBlocks[i]; bool regMatch = bm.bind == reg; @@ -2640,30 +2647,30 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QString rootel; - if(b.Immediate) + if(b.immediate) { - if(!b.RootValues.empty()) - rootel = tr("#%1 Consts").arg(b.RootElement); + if(!b.rootValues.empty()) + rootel = tr("#%1 Consts").arg(b.rootElement); else - rootel = tr("#%1 Direct").arg(b.RootElement); + rootel = tr("#%1 Direct").arg(b.rootElement); } else { - rootel = tr("#%1 Table[%2]").arg(b.RootElement).arg(b.TableIndex); + rootel = tr("#%1 Table[%2]").arg(b.rootElement).arg(b.tableIndex); } { - QString name = tr("Constant Buffer %1").arg(ToQStr(b.Buffer)); - uint64_t length = b.ByteSize; - uint64_t offset = b.Offset; + QString name = tr("Constant Buffer %1").arg(ToQStr(b.resourceId)); + uint64_t length = b.byteSize; + uint64_t offset = b.byteOffset; int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t bytesize = shaderCBuf ? shaderCBuf->byteSize : 0; - if(b.Immediate && !b.RootValues.empty()) - bytesize = uint32_t(b.RootValues.count() * 4); + if(b.immediate && !b.rootValues.empty()) + bytesize = uint32_t(b.rootValues.count() * 4); - if(b.Buffer != ResourceId()) - name = m_Ctx.GetResourceName(b.Buffer); + if(b.resourceId != ResourceId()) + name = m_Ctx.GetResourceName(b.resourceId); else name = tr("Empty"); @@ -2687,7 +2694,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe } } -void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::Streamout &so) +void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::StreamOut &so) { { xml.writeStartElement(lit("h3")); @@ -2697,39 +2704,39 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; int i = 0; - for(const D3D12Pipe::SOBind &o : so.Outputs) + for(const D3D12Pipe::StreamOutBind &o : so.outputs) { - QString name = m_Ctx.GetResourceName(o.Buffer); + QString name = m_Ctx.GetResourceName(o.resourceId); uint64_t length = 0; - QString counterName = m_Ctx.GetResourceName(o.WrittenCountBuffer); + QString counterName = m_Ctx.GetResourceName(o.writtenCountResourceId); uint64_t counterLength = 0; - if(o.Buffer == ResourceId()) + if(o.resourceId == ResourceId()) { name = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(o.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(o.resourceId); if(buf) length = buf->length; } - if(o.WrittenCountBuffer == ResourceId()) + if(o.writtenCountResourceId == ResourceId()) { counterName = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(o.WrittenCountBuffer); + BufferDescription *buf = m_Ctx.GetBuffer(o.writtenCountResourceId); if(buf) counterLength = buf->length; } - length = qMin(length, o.Size); + length = qMin(length, o.byteSize); - rows.push_back({i, name, (qulonglong)o.Offset, (qulonglong)length, counterName, - (qulonglong)o.WrittenCountOffset, (qulonglong)counterLength}); + rows.push_back({i, name, (qulonglong)o.byteOffset, (qulonglong)length, counterName, + (qulonglong)o.writtenCountByteOffset, (qulonglong)counterLength}); i++; } @@ -2749,8 +2756,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe xml.writeEndElement(); m_Common.exportHTMLTable(xml, {tr("Fill Mode"), tr("Cull Mode"), tr("Front CCW")}, - {ToQStr(rs.m_State.fillMode), ToQStr(rs.m_State.cullMode), - rs.m_State.FrontCCW ? tr("Yes") : tr("No")}); + {ToQStr(rs.state.fillMode), ToQStr(rs.state.cullMode), + rs.state.frontCCW ? tr("Yes") : tr("No")}); xml.writeStartElement(lit("p")); xml.writeEndElement(); @@ -2758,19 +2765,19 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe m_Common.exportHTMLTable( xml, {tr("Line AA Enable"), tr("Multisample Enable"), tr("Forced Sample Count"), tr("Conservative Raster"), tr("Sample Mask")}, - {rs.m_State.AntialiasedLineEnable ? tr("Yes") : tr("No"), - rs.m_State.MultisampleEnable ? tr("Yes") : tr("No"), rs.m_State.ForcedSampleCount, - rs.m_State.ConservativeRasterization ? tr("Yes") : tr("No"), - Formatter::Format(rs.SampleMask, true)}); + {rs.state.antialiasedLines ? tr("Yes") : tr("No"), + rs.state.multisampleEnable ? tr("Yes") : tr("No"), rs.state.forcedSampleCount, + rs.state.conservativeRasterization ? tr("Yes") : tr("No"), + Formatter::Format(rs.sampleMask, true)}); xml.writeStartElement(lit("p")); xml.writeEndElement(); m_Common.exportHTMLTable( xml, {tr("Depth Clip"), tr("Depth Bias"), tr("Depth Bias Clamp"), tr("Slope Scaled Bias")}, - {rs.m_State.DepthClip ? tr("Yes") : tr("No"), rs.m_State.DepthBias, - Formatter::Format(rs.m_State.DepthBiasClamp), - Formatter::Format(rs.m_State.SlopeScaledDepthBias)}); + {rs.state.depthClip ? tr("Yes") : tr("No"), rs.state.depthBias, + Formatter::Format(rs.state.depthBiasClamp), + Formatter::Format(rs.state.slopeScaledDepthBias)}); } { @@ -2781,12 +2788,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; int i = 0; - for(const D3D12Pipe::Viewport &v : rs.Viewports) + for(const Viewport &v : rs.viewports) { - if(v.Width == v.Height && v.Width == 0 && v.Height == 0) - continue; - - rows.push_back({i, v.X, v.Y, v.Width, v.Height, v.MinDepth, v.MaxDepth}); + rows.push_back({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth}); i++; } @@ -2804,12 +2808,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; int i = 0; - for(const D3D12Pipe::Scissor &s : rs.Scissors) + for(const Scissor &s : rs.scissors) { - if(s.right == 0 && s.bottom == 0) - continue; - - rows.push_back({i, s.left, s.top, s.right - s.left, s.bottom - s.top}); + rows.push_back({i, s.x, s.y, s.width, s.height}); i++; } @@ -2826,15 +2827,15 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe xml.writeEndElement(); QString blendFactor = QFormatStr("%1, %2, %3, %4") - .arg(om.m_BlendState.BlendFactor[0], 0, 'f', 2) - .arg(om.m_BlendState.BlendFactor[1], 0, 'f', 2) - .arg(om.m_BlendState.BlendFactor[2], 0, 'f', 2) - .arg(om.m_BlendState.BlendFactor[3], 0, 'f', 2); + .arg(om.blendState.blendFactor[0], 0, 'f', 2) + .arg(om.blendState.blendFactor[1], 0, 'f', 2) + .arg(om.blendState.blendFactor[2], 0, 'f', 2) + .arg(om.blendState.blendFactor[3], 0, 'f', 2); m_Common.exportHTMLTable(xml, {tr("Independent Blend Enable"), tr("Alpha to Coverage"), tr("Blend Factor"), tr("Multisampling Rate")}, - {om.m_BlendState.IndependentBlend ? tr("Yes") : tr("No"), - om.m_BlendState.AlphaToCoverage ? tr("Yes") : tr("No"), blendFactor, + {om.blendState.independentBlend ? tr("Yes") : tr("No"), + om.blendState.alphaToCoverage ? tr("Yes") : tr("No"), blendFactor, tr("%1x %2 qual").arg(om.multiSampleCount).arg(om.multiSampleQuality)}); xml.writeStartElement(lit("h3")); @@ -2844,22 +2845,22 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; int i = 0; - for(const D3D12Pipe::Blend &b : om.m_BlendState.Blends) + for(const ColorBlend &b : om.blendState.blends) { - if(i >= om.RenderTargets.count()) + if(i >= om.renderTargets.count()) continue; QString mask = QFormatStr("%1%2%3%4") - .arg((b.WriteMask & 0x1) == 0 ? lit("_") : lit("R")) - .arg((b.WriteMask & 0x2) == 0 ? lit("_") : lit("G")) - .arg((b.WriteMask & 0x4) == 0 ? lit("_") : lit("B")) - .arg((b.WriteMask & 0x8) == 0 ? lit("_") : lit("A")); + .arg((b.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + .arg((b.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + .arg((b.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + .arg((b.writeMask & 0x8) == 0 ? lit("_") : lit("A")); - rows.push_back({i, b.Enabled ? tr("Yes") : tr("No"), b.LogicEnabled ? tr("Yes") : tr("No"), - ToQStr(b.m_Blend.Source), ToQStr(b.m_Blend.Destination), - ToQStr(b.m_Blend.Operation), ToQStr(b.m_AlphaBlend.Source), - ToQStr(b.m_AlphaBlend.Destination), ToQStr(b.m_AlphaBlend.Operation), - ToQStr(b.Logic), mask}); + rows.push_back({i, b.enabled ? tr("Yes") : tr("No"), + b.logicOperationEnabled ? tr("Yes") : tr("No"), ToQStr(b.colorBlend.source), + ToQStr(b.colorBlend.destination), ToQStr(b.colorBlend.operation), + ToQStr(b.alphaBlend.source), ToQStr(b.alphaBlend.destination), + ToQStr(b.alphaBlend.operation), ToQStr(b.logicOperation), mask}); i++; } @@ -2882,8 +2883,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe m_Common.exportHTMLTable( xml, {tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function")}, - {om.m_State.DepthEnable ? tr("Yes") : tr("No"), - om.m_State.DepthWrites ? tr("Yes") : tr("No"), ToQStr(om.m_State.DepthFunc)}); + {om.depthStencilState.depthEnable ? tr("Yes") : tr("No"), + om.depthStencilState.depthWrites ? tr("Yes") : tr("No"), + ToQStr(om.depthStencilState.depthFunction)}); } { @@ -2893,22 +2895,25 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe m_Common.exportHTMLTable( xml, {tr("Stencil Test Enable"), tr("Stencil Read Mask"), tr("Stencil Write Mask")}, - {om.m_State.StencilEnable ? tr("Yes") : tr("No"), - Formatter::Format(om.m_State.StencilReadMask, true), - Formatter::Format(om.m_State.StencilWriteMask, true)}); + {om.depthStencilState.stencilEnable ? tr("Yes") : tr("No"), + Formatter::Format(om.depthStencilState.frontFace.compareMask, true), + Formatter::Format(om.depthStencilState.frontFace.writeMask, true)}); xml.writeStartElement(lit("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, {tr("Face"), tr("Function"), tr("Pass Operation"), tr("Fail Operation"), - tr("Depth Fail Operation")}, - { - {tr("Front"), ToQStr(om.m_State.m_FrontFace.Func), ToQStr(om.m_State.m_FrontFace.PassOp), - ToQStr(om.m_State.m_FrontFace.FailOp), ToQStr(om.m_State.m_FrontFace.DepthFailOp)}, - {tr("Back"), ToQStr(om.m_State.m_BackFace.Func), ToQStr(om.m_State.m_BackFace.PassOp), - ToQStr(om.m_State.m_BackFace.FailOp), ToQStr(om.m_State.m_BackFace.DepthFailOp)}, - }); + m_Common.exportHTMLTable(xml, {tr("Face"), tr("Function"), tr("Pass Operation"), + tr("Fail Operation"), tr("Depth Fail Operation")}, + { + {tr("Front"), ToQStr(om.depthStencilState.frontFace.function), + ToQStr(om.depthStencilState.frontFace.passOperation), + ToQStr(om.depthStencilState.frontFace.failOperation), + ToQStr(om.depthStencilState.frontFace.depthFailOperation)}, + {tr("Back"), ToQStr(om.depthStencilState.backFace.function), + ToQStr(om.depthStencilState.backFace.passOperation), + ToQStr(om.depthStencilState.backFace.failOperation), + ToQStr(om.depthStencilState.backFace.depthFailOperation)}, + }); } { @@ -2918,12 +2923,12 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int i = 0; i < om.RenderTargets.count(); i++) + for(int i = 0; i < om.renderTargets.count(); i++) { - if(om.RenderTargets[i].Resource == ResourceId()) + if(om.renderTargets[i].resourceId == ResourceId()) continue; - QVariantList row = exportViewHTML(om.RenderTargets[i], false, NULL, QString()); + QVariantList row = exportViewHTML(om.renderTargets[i], false, NULL, QString()); row.push_front(i); rows.push_back(row); @@ -2945,11 +2950,11 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QString extra; - if(om.DepthReadOnly && om.StencilReadOnly) + if(om.depthReadOnly && om.stencilReadOnly) extra = tr("Depth & Stencil Read-Only"); - else if(om.DepthReadOnly) + else if(om.depthReadOnly) extra = tr("Depth Read-Only"); - else if(om.StencilReadOnly) + else if(om.stencilReadOnly) extra = tr("Stencil Read-Only"); m_Common.exportHTMLTable(xml, @@ -2958,7 +2963,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe tr("Height"), tr("Depth"), tr("Array Size"), tr("View Format"), tr("Resource Format"), tr("View Parameters"), }, - {exportViewHTML(om.DepthTarget, false, NULL, extra)}); + {exportViewHTML(om.depthTarget, false, NULL, extra)}); } } @@ -2991,18 +2996,18 @@ void D3D12PipelineStateViewer::on_exportHTML_clicked() switch(stage) { - case 0: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_IA); break; - case 1: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_VS); break; - case 2: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_HS); break; - case 3: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_DS); break; + case 0: exportHTML(xml, m_Ctx.CurD3D12PipelineState().inputAssembly); break; + case 1: exportHTML(xml, m_Ctx.CurD3D12PipelineState().vertexShader); break; + case 2: exportHTML(xml, m_Ctx.CurD3D12PipelineState().hullShader); break; + case 3: exportHTML(xml, m_Ctx.CurD3D12PipelineState().domainShader); break; case 4: - exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_GS); - exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_SO); + exportHTML(xml, m_Ctx.CurD3D12PipelineState().geometryShader); + exportHTML(xml, m_Ctx.CurD3D12PipelineState().streamOut); break; - case 5: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_RS); break; - case 6: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_PS); break; - case 7: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_OM); break; - case 8: exportHTML(xml, m_Ctx.CurD3D12PipelineState().m_CS); break; + case 5: exportHTML(xml, m_Ctx.CurD3D12PipelineState().rasterizer); break; + case 6: exportHTML(xml, m_Ctx.CurD3D12PipelineState().pixelShader); break; + case 7: exportHTML(xml, m_Ctx.CurD3D12PipelineState().outputMerger); break; + case 8: exportHTML(xml, m_Ctx.CurD3D12PipelineState().computeShader); break; } xml.writeEndElement(); diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.h b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.h index 806a5307c..ee3ffe0d7 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.h +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.h @@ -52,8 +52,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: // automatic slots @@ -109,9 +109,9 @@ private: QVariantList exportViewHTML(const D3D12Pipe::View &view, bool rw, const ShaderResource *shaderInput, const QString &extraParams); - void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::IA &ia); + void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::InputAssembly &ia); void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::Shader &sh); - void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::Streamout &so); + void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::StreamOut &so); void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::Rasterizer &rs); void exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::OM &om); diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 53977e024..632f9ee7f 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -426,7 +426,7 @@ void GLPipelineStateViewer::OnCaptureClosed() clearState(); } -void GLPipelineStateViewer::OnEventChanged(uint32_t eventID) +void GLPipelineStateViewer::OnEventChanged(uint32_t eventId) { setState(); } @@ -480,23 +480,23 @@ const GLPipe::Shader *GLPipelineStateViewer::stageForSender(QWidget *widget) while(widget) { if(widget == ui->stagesTabs->widget(0)) - return &m_Ctx.CurGLPipelineState().m_VS; + return &m_Ctx.CurGLPipelineState().vertexShader; if(widget == ui->stagesTabs->widget(1)) - return &m_Ctx.CurGLPipelineState().m_VS; + return &m_Ctx.CurGLPipelineState().vertexShader; if(widget == ui->stagesTabs->widget(2)) - return &m_Ctx.CurGLPipelineState().m_TCS; + return &m_Ctx.CurGLPipelineState().tessControlShader; if(widget == ui->stagesTabs->widget(3)) - return &m_Ctx.CurGLPipelineState().m_TES; + return &m_Ctx.CurGLPipelineState().tessEvalShader; if(widget == ui->stagesTabs->widget(4)) - return &m_Ctx.CurGLPipelineState().m_GS; + return &m_Ctx.CurGLPipelineState().geometryShader; if(widget == ui->stagesTabs->widget(5)) - return &m_Ctx.CurGLPipelineState().m_FS; + return &m_Ctx.CurGLPipelineState().fragmentShader; if(widget == ui->stagesTabs->widget(6)) - return &m_Ctx.CurGLPipelineState().m_FS; + return &m_Ctx.CurGLPipelineState().fragmentShader; if(widget == ui->stagesTabs->widget(7)) - return &m_Ctx.CurGLPipelineState().m_FS; + return &m_Ctx.CurGLPipelineState().fragmentShader; if(widget == ui->stagesTabs->widget(8)) - return &m_Ctx.CurGLPipelineState().m_CS; + return &m_Ctx.CurGLPipelineState().computeShader; widget = widget->parentWidget(); } @@ -597,22 +597,22 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel RDTreeWidget *ubos, RDTreeWidget *subs, RDTreeWidget *readwrites) { - ShaderReflection *shaderDetails = stage.ShaderDetails; - const ShaderBindpointMapping &mapping = stage.BindpointMapping; + ShaderReflection *shaderDetails = stage.reflection; + const ShaderBindpointMapping &mapping = stage.bindpointMapping; const GLPipe::State &state = m_Ctx.CurGLPipelineState(); - if(stage.Object == ResourceId()) + if(stage.shaderResourceId == ResourceId()) { - shader->setText(ToQStr(stage.Object)); + shader->setText(ToQStr(stage.shaderResourceId)); } else { - QString shText = ToQStr(stage.Object); + QString shText = ToQStr(stage.shaderResourceId); - shText = ToQStr(stage.Program) + lit(" > ") + shText; + shText = ToQStr(stage.programResourceId) + lit(" > ") + shText; - if(state.Pipeline != ResourceId()) - shText = ToQStr(state.Pipeline) + lit(" > ") + shText; + if(state.pipelineResourceId != ResourceId()) + shText = ToQStr(state.pipelineResourceId) + lit(" > ") + shText; shader->setText(shText); } @@ -628,27 +628,27 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel samplers->beginUpdate(); samplers->clear(); - for(int i = 0; i < state.Textures.count(); i++) + for(int i = 0; i < state.textures.count(); i++) { - const GLPipe::Texture &r = state.Textures[i]; - const GLPipe::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; + const Bindpoint *map = NULL; if(shaderDetails) { - for(const ShaderResource &bind : shaderDetails->ReadOnlyResources) + for(const ShaderResource &bind : shaderDetails->readOnlyResources) { - if(bind.IsReadOnly && mapping.ReadOnlyResources[bind.bindPoint].bind == i) + if(bind.isReadOnly && mapping.readOnlyResources[bind.bindPoint].bind == i) { shaderInput = &bind; - map = &mapping.ReadOnlyResources[bind.bindPoint]; + map = &mapping.readOnlyResources[bind.bindPoint]; } } } - bool filledSlot = (r.Resource != ResourceId()); + bool filledSlot = (r.resourceId != ResourceId()); bool usedSlot = (shaderInput && map && map->used); if(showNode(usedSlot, filledSlot)) @@ -672,7 +672,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel w = h = d = a = 0; } - TextureDescription *tex = m_Ctx.GetTexture(r.Resource); + TextureDescription *tex = m_Ctx.GetTexture(r.resourceId); if(tex) { @@ -681,32 +681,32 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); if(tex->format.type == ResourceFormatType::D16S8 || tex->format.type == ResourceFormatType::D24S8 || tex->format.type == ResourceFormatType::D32S8) { - if(r.DepthReadChannel == 0) + if(r.depthReadChannel == 0) format += tr(" Depth-Read"); - else if(r.DepthReadChannel == 1) + else if(r.depthReadChannel == 1) format += tr(" Stencil-Read"); } - else if(r.Swizzle[0] != TextureSwizzle::Red || r.Swizzle[1] != TextureSwizzle::Green || - r.Swizzle[2] != TextureSwizzle::Blue || r.Swizzle[3] != TextureSwizzle::Alpha) + else if(r.swizzle[0] != TextureSwizzle::Red || r.swizzle[1] != TextureSwizzle::Green || + r.swizzle[2] != TextureSwizzle::Blue || r.swizzle[3] != TextureSwizzle::Alpha) { format += tr(" swizzle[%1%2%3%4]") - .arg(ToQStr(r.Swizzle[0])) - .arg(ToQStr(r.Swizzle[1])) - .arg(ToQStr(r.Swizzle[2])) - .arg(ToQStr(r.Swizzle[3])); + .arg(ToQStr(r.swizzle[0])) + .arg(ToQStr(r.swizzle[1])) + .arg(ToQStr(r.swizzle[2])) + .arg(ToQStr(r.swizzle[3])); } } RDTreeWidgetItem *node = - new RDTreeWidgetItem({slotname, r.Resource, typeName, w, h, d, a, format, QString()}); + new RDTreeWidgetItem({slotname, r.resourceId, typeName, w, h, d, a, format, QString()}); - node->setTag(QVariant::fromValue(r.Resource)); + node->setTag(QVariant::fromValue(r.resourceId)); if(!filledSlot) setEmptyRow(node); @@ -725,17 +725,17 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel slotname += lit(": ") + shaderInput->name; QString borderColor = QFormatStr("%1, %2, %3, %4") - .arg(s.BorderColor[0]) - .arg(s.BorderColor[1]) - .arg(s.BorderColor[2]) - .arg(s.BorderColor[3]); + .arg(s.borderColor[0]) + .arg(s.borderColor[1]) + .arg(s.borderColor[2]) + .arg(s.borderColor[3]); QString addressing; QString addPrefix; QString addVal; - QString addr[] = {ToQStr(s.AddressS), ToQStr(s.AddressT), ToQStr(s.AddressR)}; + QString addr[] = {ToQStr(s.addressS), ToQStr(s.addressT), ToQStr(s.addressR)}; // arrange like either STR: WRAP or ST: WRAP, R: CLAMP for(int a = 0; a < 3; a++) @@ -761,27 +761,27 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel if(s.UseBorder()) addressing += QFormatStr("<%1>").arg(borderColor); - if(r.ResType == TextureDim::TextureCube || r.ResType == TextureDim::TextureCubeArray) + if(r.type == TextureType::TextureCube || r.type == TextureType::TextureCubeArray) { - addressing += s.SeamlessCube ? tr(" Seamless") : tr(" Non-Seamless"); + addressing += s.seamlessCubeMap ? tr(" Seamless") : tr(" Non-Seamless"); } - QString filter = ToQStr(s.Filter); + QString filter = ToQStr(s.filter); - if(s.MaxAniso > 1) - filter += lit(" Aniso%1x").arg(s.MaxAniso); + if(s.maxAnisotropy > 1) + filter += lit(" Aniso%1x").arg(s.maxAnisotropy); - if(s.Filter.func == FilterFunc::Comparison) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Comparison)); - else if(s.Filter.func != FilterFunc::Normal) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Filter.func)); + if(s.filter.filter == FilterFunction::Comparison) + filter += QFormatStr(" (%1)").arg(ToQStr(s.compareFunction)); + else if(s.filter.filter != FilterFunction::Normal) + filter += QFormatStr(" (%1)").arg(ToQStr(s.filter.filter)); RDTreeWidgetItem *node = new RDTreeWidgetItem( {slotname, addressing, filter, QFormatStr("%1 - %2") - .arg(s.MinLOD == -FLT_MAX ? lit("0") : QString::number(s.MinLOD)) - .arg(s.MaxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.MaxLOD)), - s.MipLODBias}); + .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) + .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), + s.mipLODBias}); if(!filledSlot) setEmptyRow(node); @@ -804,18 +804,18 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel vs = ubos->verticalScrollBar()->value(); ubos->beginUpdate(); ubos->clear(); - for(int i = 0; shaderDetails && i < shaderDetails->ConstantBlocks.count(); i++) + for(int i = 0; shaderDetails && i < shaderDetails->constantBlocks.count(); i++) { - const ConstantBlock &shaderCBuf = shaderDetails->ConstantBlocks[i]; - int bindPoint = stage.BindpointMapping.ConstantBlocks[i].bind; + const ConstantBlock &shaderCBuf = shaderDetails->constantBlocks[i]; + int bindPoint = stage.bindpointMapping.constantBlocks[i].bind; const GLPipe::Buffer *b = NULL; - if(bindPoint >= 0 && bindPoint < state.UniformBuffers.count()) - b = &state.UniformBuffers[bindPoint]; + if(bindPoint >= 0 && bindPoint < state.uniformBuffers.count()) + b = &state.uniformBuffers[bindPoint]; - bool filledSlot = !shaderCBuf.bufferBacked || (b && b->Resource != ResourceId()); - bool usedSlot = stage.BindpointMapping.ConstantBlocks[i].used; + bool filledSlot = !shaderCBuf.bufferBacked || (b && b->resourceId != ResourceId()); + bool usedSlot = stage.bindpointMapping.constantBlocks[i].used; if(showNode(usedSlot, filledSlot)) { @@ -838,10 +838,10 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel if(b) { slotname = QFormatStr("%1: %2").arg(bindPoint).arg(shaderCBuf.name); - offset = b->Offset; - length = b->Size; + offset = b->byteOffset; + length = b->byteSize; - BufferDescription *buf = m_Ctx.GetBuffer(b->Resource); + BufferDescription *buf = m_Ctx.GetBuffer(b->resourceId); if(buf) { if(length == 0) @@ -861,7 +861,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel } RDTreeWidgetItem *node = - new RDTreeWidgetItem({slotname, b->Resource, byterange, sizestr, QString()}); + new RDTreeWidgetItem({slotname, b->resourceId, byterange, sizestr, QString()}); node->setTag(QVariant::fromValue(i)); @@ -881,21 +881,21 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel vs = subs->verticalScrollBar()->value(); subs->beginUpdate(); subs->clear(); - for(int i = 0; i < stage.Subroutines.count(); i++) - subs->addTopLevelItem(new RDTreeWidgetItem({i, stage.Subroutines[i]})); + for(int i = 0; i < stage.subroutines.count(); i++) + subs->addTopLevelItem(new RDTreeWidgetItem({i, stage.subroutines[i]})); subs->clearSelection(); subs->endUpdate(); subs->verticalScrollBar()->setValue(vs); - subs->parentWidget()->setVisible(!stage.Subroutines.empty()); + subs->parentWidget()->setVisible(!stage.subroutines.empty()); vs = readwrites->verticalScrollBar()->value(); readwrites->beginUpdate(); readwrites->clear(); - for(int i = 0; shaderDetails && i < shaderDetails->ReadWriteResources.count(); i++) + for(int i = 0; shaderDetails && i < shaderDetails->readWriteResources.count(); i++) { - const ShaderResource &res = shaderDetails->ReadWriteResources[i]; - int bindPoint = stage.BindpointMapping.ReadWriteResources[i].bind; + const ShaderResource &res = shaderDetails->readWriteResources[i]; + int bindPoint = stage.bindpointMapping.readWriteResources[i].bind; GLReadWriteType readWriteType = GetGLReadWriteType(res); @@ -903,28 +903,28 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel const GLPipe::ImageLoadStore *im = NULL; ResourceId id; - if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < state.Images.count()) + if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < state.images.count()) { - im = &state.Images[bindPoint]; - id = state.Images[bindPoint].Resource; + im = &state.images[bindPoint]; + id = state.images[bindPoint].resourceId; } if(readWriteType == GLReadWriteType::Atomic && bindPoint >= 0 && - bindPoint < state.AtomicBuffers.count()) + bindPoint < state.atomicBuffers.count()) { - bf = &state.AtomicBuffers[bindPoint]; - id = state.AtomicBuffers[bindPoint].Resource; + bf = &state.atomicBuffers[bindPoint]; + id = state.atomicBuffers[bindPoint].resourceId; } if(readWriteType == GLReadWriteType::SSBO && bindPoint >= 0 && - bindPoint < state.ShaderStorageBuffers.count()) + bindPoint < state.shaderStorageBuffers.count()) { - bf = &state.ShaderStorageBuffers[bindPoint]; - id = state.ShaderStorageBuffers[bindPoint].Resource; + bf = &state.shaderStorageBuffers[bindPoint]; + id = state.shaderStorageBuffers[bindPoint].resourceId; } bool filledSlot = id != ResourceId(); - bool usedSlot = stage.BindpointMapping.ReadWriteResources[i].used; + bool usedSlot = stage.bindpointMapping.readWriteResources[i].used; if(showNode(usedSlot, filledSlot)) { @@ -945,7 +945,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel access = tr("Read-Only"); if(!im->readAllowed && im->writeAllowed) access = tr("Write-Only"); - format = im->Format.Name(); + format = im->imageFormat.Name(); } QVariant tag; @@ -982,10 +982,10 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel { uint64_t offset = 0; uint64_t length = buf->length; - if(bf && bf->Size > 0) + if(bf && bf->byteSize > 0) { - offset = bf->Offset; - length = bf->Size; + offset = bf->byteOffset; + length = bf->byteSize; } if(offset > 0) @@ -1039,21 +1039,21 @@ QString GLPipelineStateViewer::MakeGenericValueString(uint32_t compCount, CompTy if(compType == CompType::UInt) { for(uint32_t i = 0; i < compCount; i++) - ret = ret.arg(val.GenericValue.value_u[i]); + ret = ret.arg(val.genericValue.uintValue[i]); return ret; } else if(compType == CompType::SInt) { for(uint32_t i = 0; i < compCount; i++) - ret = ret.arg(val.GenericValue.value_i[i]); + ret = ret.arg(val.genericValue.intValue[i]); return ret; } else { for(uint32_t i = 0; i < compCount; i++) - ret = ret.arg(val.GenericValue.value_f[i]); + ret = ret.arg(val.genericValue.floatValue[i]); return ret; } @@ -1063,13 +1063,13 @@ GLPipelineStateViewer::GLReadWriteType GLPipelineStateViewer::GetGLReadWriteType { GLReadWriteType ret = GLReadWriteType::Image; - if(res.IsTexture) + if(res.isTexture) { ret = GLReadWriteType::Image; } else { - if(res.variableType.descriptor.rows == 1 && res.variableType.descriptor.cols == 1 && + if(res.variableType.descriptor.rows == 1 && res.variableType.descriptor.columns == 1 && res.variableType.descriptor.type == VarType::UInt) { ret = GLReadWriteType::Atomic; @@ -1112,7 +1112,7 @@ void GLPipelineStateViewer::setState() ui->viAttrs->clear(); { int i = 0; - for(const GLPipe::VertexAttribute &a : state.m_VtxIn.attributes) + for(const GLPipe::VertexAttribute &a : state.vertexInput.attributes) { bool filledSlot = true; bool usedSlot = false; @@ -1122,17 +1122,17 @@ void GLPipelineStateViewer::setState() uint32_t compCount = 4; CompType compType = CompType::Float; - if(state.m_VS.Object != ResourceId()) + if(state.vertexShader.shaderResourceId != ResourceId()) { int attrib = -1; - if(i < state.m_VS.BindpointMapping.InputAttributes.count()) - attrib = state.m_VS.BindpointMapping.InputAttributes[i]; + if(i < state.vertexShader.bindpointMapping.inputAttributes.count()) + attrib = state.vertexShader.bindpointMapping.inputAttributes[i]; - if(attrib >= 0 && attrib < state.m_VS.ShaderDetails->InputSig.count()) + if(attrib >= 0 && attrib < state.vertexShader.reflection->inputSignature.count()) { - name = state.m_VS.ShaderDetails->InputSig[attrib].varName; - compCount = state.m_VS.ShaderDetails->InputSig[attrib].compCount; - compType = state.m_VS.ShaderDetails->InputSig[attrib].compType; + name = state.vertexShader.reflection->inputSignature[attrib].varName; + compCount = state.vertexShader.reflection->inputSignature[attrib].compCount; + compType = state.vertexShader.reflection->inputSignature[attrib].compType; usedSlot = true; } } @@ -1142,12 +1142,12 @@ void GLPipelineStateViewer::setState() QString genericVal = tr("Generic=") + MakeGenericValueString(compCount, compType, a); RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, a.Enabled ? tr("Enabled") : tr("Disabled"), name, - a.Enabled ? QString(a.Format.Name()) : genericVal, a.BufferSlot, - a.RelativeOffset, QString()}); + new RDTreeWidgetItem({i, a.enabled ? tr("Enabled") : tr("Disabled"), name, + a.enabled ? QString(a.format.Name()) : genericVal, + a.vertexBufferSlot, a.byteOffset, QString()}); - if(a.Enabled) - usedBindings[a.BufferSlot] = true; + if(a.enabled) + usedBindings[a.vertexBufferSlot] = true; if(!usedSlot) setInactiveRow(node); @@ -1181,9 +1181,9 @@ void GLPipelineStateViewer::setState() if(ibufferUsed) { ui->primRestart->setVisible(true); - if(state.m_VtxIn.primitiveRestart) + if(state.vertexInput.primitiveRestart) ui->primRestart->setText( - tr("Restart Idx: 0x%1").arg(Formatter::Format(state.m_VtxIn.restartIndex, true))); + tr("Restart Idx: 0x%1").arg(Formatter::Format(state.vertexInput.restartIndex, true))); else ui->primRestart->setText(tr("Restart Idx: Disabled")); } @@ -1196,7 +1196,7 @@ void GLPipelineStateViewer::setState() ui->viBuffers->beginUpdate(); ui->viBuffers->clear(); - if(state.m_VtxIn.ibuffer != ResourceId()) + if(state.vertexInput.indexBuffer != ResourceId()) { if(ibufferUsed || showDisabled) { @@ -1205,22 +1205,22 @@ void GLPipelineStateViewer::setState() if(!ibufferUsed) length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(state.m_VtxIn.ibuffer); + BufferDescription *buf = m_Ctx.GetBuffer(state.vertexInput.indexBuffer); if(buf) length = buf->length; - RDTreeWidgetItem *node = new RDTreeWidgetItem({tr("Element"), state.m_VtxIn.ibuffer, + RDTreeWidgetItem *node = new RDTreeWidgetItem({tr("Element"), state.vertexInput.indexBuffer, draw ? draw->indexByteWidth : 0, 0, 0, (qulonglong)length, QString()}); - node->setTag( - QVariant::fromValue(GLVBIBTag(state.m_VtxIn.ibuffer, draw ? draw->indexOffset : 0))); + node->setTag(QVariant::fromValue( + GLVBIBTag(state.vertexInput.indexBuffer, draw ? draw->indexOffset : 0))); if(!ibufferUsed) setInactiveRow(node); - if(state.m_VtxIn.ibuffer == ResourceId()) + if(state.vertexInput.indexBuffer == ResourceId()) setEmptyRow(node); ui->viBuffers->addTopLevelItem(node); @@ -1233,8 +1233,8 @@ void GLPipelineStateViewer::setState() RDTreeWidgetItem *node = new RDTreeWidgetItem( {tr("Element"), tr("No Buffer Set"), lit("-"), lit("-"), lit("-"), lit("-"), QString()}); - node->setTag( - QVariant::fromValue(GLVBIBTag(state.m_VtxIn.ibuffer, draw ? draw->indexOffset : 0))); + node->setTag(QVariant::fromValue( + GLVBIBTag(state.vertexInput.indexBuffer, draw ? draw->indexOffset : 0))); setEmptyRow(node); @@ -1247,26 +1247,27 @@ void GLPipelineStateViewer::setState() m_VBNodes.clear(); - for(int i = 0; i < state.m_VtxIn.vbuffers.count(); i++) + for(int i = 0; i < state.vertexInput.vertexBuffers.count(); i++) { - const GLPipe::VB &v = state.m_VtxIn.vbuffers[i]; + const GLPipe::VertexBuffer &v = state.vertexInput.vertexBuffers[i]; - bool filledSlot = (v.Buffer != ResourceId()); + bool filledSlot = (v.resourceId != ResourceId()); bool usedSlot = (usedBindings[i]); if(showNode(usedSlot, filledSlot)) { uint64_t length = 0; - uint64_t offset = v.Offset; + uint64_t offset = v.byteOffset; - BufferDescription *buf = m_Ctx.GetBuffer(v.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(v.resourceId); if(buf) length = buf->length; - RDTreeWidgetItem *node = new RDTreeWidgetItem( - {i, v.Buffer, v.Stride, (qulonglong)offset, v.Divisor, (qulonglong)length, QString()}); + RDTreeWidgetItem *node = + new RDTreeWidgetItem({i, v.resourceId, v.byteStride, (qulonglong)offset, + v.instanceDivisor, (qulonglong)length, QString()}); - node->setTag(QVariant::fromValue(GLVBIBTag(v.Buffer, v.Offset))); + node->setTag(QVariant::fromValue(GLVBIBTag(v.resourceId, v.byteOffset))); if(!filledSlot) setEmptyRow(node); @@ -1283,45 +1284,45 @@ void GLPipelineStateViewer::setState() ui->viBuffers->endUpdate(); ui->viBuffers->verticalScrollBar()->setValue(vs); - setShaderState(state.m_VS, ui->vsShader, ui->vsTextures, ui->vsSamplers, ui->vsUBOs, + setShaderState(state.vertexShader, ui->vsShader, ui->vsTextures, ui->vsSamplers, ui->vsUBOs, ui->vsSubroutines, ui->vsReadWrite); - setShaderState(state.m_GS, ui->gsShader, ui->gsTextures, ui->gsSamplers, ui->gsUBOs, + setShaderState(state.geometryShader, ui->gsShader, ui->gsTextures, ui->gsSamplers, ui->gsUBOs, ui->gsSubroutines, ui->gsReadWrite); - setShaderState(state.m_TCS, ui->tcsShader, ui->tcsTextures, ui->tcsSamplers, ui->tcsUBOs, - ui->tcsSubroutines, ui->tcsReadWrite); - setShaderState(state.m_TES, ui->tesShader, ui->tesTextures, ui->tesSamplers, ui->tesUBOs, + setShaderState(state.tessControlShader, ui->tcsShader, ui->tcsTextures, ui->tcsSamplers, + ui->tcsUBOs, ui->tcsSubroutines, ui->tcsReadWrite); + setShaderState(state.tessEvalShader, ui->tesShader, ui->tesTextures, ui->tesSamplers, ui->tesUBOs, ui->tesSubroutines, ui->tesReadWrite); - setShaderState(state.m_FS, ui->fsShader, ui->fsTextures, ui->fsSamplers, ui->fsUBOs, + setShaderState(state.fragmentShader, ui->fsShader, ui->fsTextures, ui->fsSamplers, ui->fsUBOs, ui->fsSubroutines, ui->fsReadWrite); - setShaderState(state.m_CS, ui->csShader, ui->csTextures, ui->csSamplers, ui->csUBOs, + setShaderState(state.computeShader, ui->csShader, ui->csTextures, ui->csSamplers, ui->csUBOs, ui->csSubroutines, ui->csReadWrite); vs = ui->xfbBuffers->verticalScrollBar()->value(); ui->xfbBuffers->beginUpdate(); ui->xfbBuffers->clear(); - ui->xfbObj->setText(ToQStr(state.m_Feedback.Obj)); - if(state.m_Feedback.Active) + ui->xfbObj->setText(ToQStr(state.transformFeedback.feedbackResourceId)); + if(state.transformFeedback.active) { - ui->xfbPaused->setPixmap(state.m_Feedback.Paused ? tick : cross); - for(int i = 0; i < (int)ARRAY_COUNT(state.m_Feedback.BufferBinding); i++) + ui->xfbPaused->setPixmap(state.transformFeedback.paused ? tick : cross); + for(int i = 0; i < (int)ARRAY_COUNT(state.transformFeedback.bufferResourceId); i++) { - bool filledSlot = (state.m_Feedback.BufferBinding[i] != ResourceId()); + bool filledSlot = (state.transformFeedback.bufferResourceId[i] != ResourceId()); bool usedSlot = (filledSlot); if(showNode(usedSlot, filledSlot)) { - qulonglong length = state.m_Feedback.Size[i]; + qulonglong length = state.transformFeedback.byteSize[i]; - BufferDescription *buf = m_Ctx.GetBuffer(state.m_Feedback.BufferBinding[i]); + BufferDescription *buf = m_Ctx.GetBuffer(state.transformFeedback.bufferResourceId[i]); if(buf) length = buf->length; RDTreeWidgetItem *node = - new RDTreeWidgetItem({i, state.m_Feedback.BufferBinding[i], length, - (qulonglong)state.m_Feedback.Offset[i], QString()}); + new RDTreeWidgetItem({i, state.transformFeedback.bufferResourceId[i], length, + (qulonglong)state.transformFeedback.byteOffset[i], QString()}); - node->setTag(QVariant::fromValue(state.m_Feedback.BufferBinding[i])); + node->setTag(QVariant::fromValue(state.transformFeedback.bufferResourceId[i])); if(!filledSlot) setEmptyRow(node); @@ -1337,7 +1338,7 @@ void GLPipelineStateViewer::setState() ui->xfbBuffers->clearSelection(); ui->xfbBuffers->endUpdate(); - ui->xfbGroup->setVisible(state.m_Feedback.Active); + ui->xfbGroup->setVisible(state.transformFeedback.active); //////////////////////////////////////////////// // Rasterizer @@ -1349,15 +1350,15 @@ void GLPipelineStateViewer::setState() { // accumulate identical viewports to save on visual repetition int prev = 0; - for(int i = 0; i < state.m_Rasterizer.Viewports.count(); i++) + for(int i = 0; i < state.rasterizer.viewports.count(); i++) { - const GLPipe::Viewport &v1 = state.m_Rasterizer.Viewports[prev]; - const GLPipe::Viewport &v2 = state.m_Rasterizer.Viewports[i]; + const Viewport &v1 = state.rasterizer.viewports[prev]; + const Viewport &v2 = state.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) + if(v1.width != v2.width || v1.height != v2.height || v1.x != v2.x || v1.y != v2.y || + v1.minDepth != v2.minDepth || v1.maxDepth != v2.maxDepth) { - if(v1.Width != v1.Height || v1.Width != 0 || v1.Height != 0 || v1.MinDepth != v1.MaxDepth || + if(v1.width != v1.height || v1.width != 0 || v1.height != 0 || v1.minDepth != v1.maxDepth || ui->showEmpty->isChecked()) { QString indexstring; @@ -1367,9 +1368,9 @@ void GLPipelineStateViewer::setState() indexstring = QString::number(prev); RDTreeWidgetItem *node = new RDTreeWidgetItem( - {indexstring, v1.Left, v1.Bottom, v1.Width, v1.Height, v1.MinDepth, v1.MaxDepth}); + {indexstring, v1.x, v1.y, v1.width, v1.height, v1.minDepth, v1.maxDepth}); - if(v1.Width == 0 || v1.Height == 0 || v1.MinDepth == v1.MaxDepth) + if(v1.width == 0 || v1.height == 0 || v1.minDepth == v1.maxDepth) setEmptyRow(node); ui->viewports->addTopLevelItem(node); @@ -1380,27 +1381,27 @@ void GLPipelineStateViewer::setState() } // handle the last batch (the loop above leaves the last batch un-added) - if(prev < state.m_Rasterizer.Viewports.count()) + if(prev < state.rasterizer.viewports.count()) { - const GLPipe::Viewport &v1 = state.m_Rasterizer.Viewports[prev]; + const Viewport &v1 = state.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 // 'invalid viewport' entry. So check if last is 0 - if(v1.Width != v1.Height || v1.Width != 0 || v1.Height != 0 || v1.MinDepth != v1.MaxDepth || + if(v1.width != v1.height || v1.width != 0 || v1.height != 0 || v1.minDepth != v1.maxDepth || ui->showEmpty->isChecked() || prev == 0) { QString indexstring; - if(prev < state.m_Rasterizer.Viewports.count() - 1) - indexstring = QFormatStr("%1-%2").arg(prev).arg(state.m_Rasterizer.Viewports.count() - 1); + if(prev < state.rasterizer.viewports.count() - 1) + indexstring = QFormatStr("%1-%2").arg(prev).arg(state.rasterizer.viewports.count() - 1); else indexstring = QString::number(prev); RDTreeWidgetItem *node = new RDTreeWidgetItem( - {indexstring, v1.Left, v1.Bottom, v1.Width, v1.Height, v1.MinDepth, v1.MaxDepth}); + {indexstring, v1.x, v1.y, v1.width, v1.height, v1.minDepth, v1.maxDepth}); - if(v1.Width == 0 || v1.Height == 0 || v1.MinDepth == v1.MaxDepth) + if(v1.width == 0 || v1.height == 0 || v1.minDepth == v1.maxDepth) setEmptyRow(node); ui->viewports->addTopLevelItem(node); @@ -1419,15 +1420,15 @@ void GLPipelineStateViewer::setState() { // accumulate identical scissors to save on visual repetition int prev = 0; - for(int i = 0; i < state.m_Rasterizer.Scissors.count(); i++) + for(int i = 0; i < state.rasterizer.scissors.count(); i++) { - const GLPipe::Scissor &s1 = state.m_Rasterizer.Scissors[prev]; - const GLPipe::Scissor &s2 = state.m_Rasterizer.Scissors[i]; + const Scissor &s1 = state.rasterizer.scissors[prev]; + const Scissor &s2 = state.rasterizer.scissors[i]; - if(s1.Width != s2.Width || s1.Height != s2.Height || s1.Left != s2.Left || - s1.Bottom != s2.Bottom || s1.Enabled != s2.Enabled) + if(s1.width != s2.width || s1.height != s2.height || s1.x != s2.x || s1.y != s2.y || + s1.enabled != s2.enabled) { - if(s1.Enabled || ui->showEmpty->isChecked()) + if(s1.enabled || ui->showEmpty->isChecked()) { QString indexstring; if(prev < i - 1) @@ -1435,17 +1436,16 @@ void GLPipelineStateViewer::setState() else indexstring = QString::number(prev); - RDTreeWidgetItem *node = - new RDTreeWidgetItem({indexstring, s1.Left, s1.Bottom, s1.Width, s1.Height, - s1.Enabled ? tr("True") : tr("False")}); + RDTreeWidgetItem *node = new RDTreeWidgetItem({indexstring, s1.x, s1.y, s1.width, s1.height, + s1.enabled ? tr("True") : tr("False")}); - if(s1.Width == 0 || s1.Height == 0) + if(s1.width == 0 || s1.height == 0) setEmptyRow(node); - if(!s1.Enabled) + if(!s1.enabled) setInactiveRow(node); - anyScissorEnable = anyScissorEnable || s1.Enabled; + anyScissorEnable = anyScissorEnable || s1.enabled; ui->scissors->addTopLevelItem(node); } @@ -1455,29 +1455,28 @@ void GLPipelineStateViewer::setState() } // handle the last batch (the loop above leaves the last batch un-added) - if(prev < state.m_Rasterizer.Scissors.count()) + if(prev < state.rasterizer.scissors.count()) { - const GLPipe::Scissor &s1 = state.m_Rasterizer.Scissors[prev]; + const Scissor &s1 = state.rasterizer.scissors[prev]; - if(s1.Enabled || ui->showEmpty->isChecked()) + if(s1.enabled || ui->showEmpty->isChecked()) { QString indexstring; - if(prev < state.m_Rasterizer.Scissors.count() - 1) - indexstring = QFormatStr("%1-%2").arg(prev).arg(state.m_Rasterizer.Scissors.count() - 1); + if(prev < state.rasterizer.scissors.count() - 1) + indexstring = QFormatStr("%1-%2").arg(prev).arg(state.rasterizer.scissors.count() - 1); else indexstring = QString::number(prev); - RDTreeWidgetItem *node = - new RDTreeWidgetItem({indexstring, s1.Left, s1.Bottom, s1.Width, s1.Height, - s1.Enabled ? tr("True") : tr("False")}); + RDTreeWidgetItem *node = new RDTreeWidgetItem( + {indexstring, s1.x, s1.y, s1.width, s1.height, s1.enabled ? tr("True") : tr("False")}); - if(s1.Width == 0 || s1.Height == 0) + if(s1.width == 0 || s1.height == 0) setEmptyRow(node); - if(!s1.Enabled) + if(!s1.enabled) setInactiveRow(node); - anyScissorEnable = anyScissorEnable || s1.Enabled; + anyScissorEnable = anyScissorEnable || s1.enabled; ui->scissors->addTopLevelItem(node); } @@ -1487,28 +1486,28 @@ void GLPipelineStateViewer::setState() ui->scissors->verticalScrollBar()->setValue(vs); ui->scissors->endUpdate(); - ui->fillMode->setText(ToQStr(state.m_Rasterizer.m_State.fillMode)); - ui->cullMode->setText(ToQStr(state.m_Rasterizer.m_State.cullMode)); - ui->frontCCW->setPixmap(state.m_Rasterizer.m_State.FrontCCW ? tick : cross); + ui->fillMode->setText(ToQStr(state.rasterizer.state.fillMode)); + ui->cullMode->setText(ToQStr(state.rasterizer.state.cullMode)); + ui->frontCCW->setPixmap(state.rasterizer.state.frontCCW ? tick : cross); ui->scissorEnabled->setPixmap(anyScissorEnable ? tick : cross); - ui->provoking->setText(state.m_VtxIn.provokingVertexLast ? tr("Last") : tr("First")); + ui->provoking->setText(state.vertexInput.provokingVertexLast ? tr("Last") : tr("First")); - ui->rasterizerDiscard->setPixmap(state.m_VtxProcess.discard ? tick : cross); + ui->rasterizerDiscard->setPixmap(state.vertexProcessing.discard ? tick : cross); - if(state.m_Rasterizer.m_State.ProgrammablePointSize) + if(state.rasterizer.state.programmablePointSize) ui->pointSize->setText(tr("Program", "ProgrammablePointSize")); else - ui->pointSize->setText(Formatter::Format(state.m_Rasterizer.m_State.PointSize)); - ui->lineWidth->setText(Formatter::Format(state.m_Rasterizer.m_State.LineWidth)); + ui->pointSize->setText(Formatter::Format(state.rasterizer.state.pointSize)); + ui->lineWidth->setText(Formatter::Format(state.rasterizer.state.lineWidth)); QString clipSetup; - if(state.m_VtxProcess.clipOriginLowerLeft) + if(state.vertexProcessing.clipOriginLowerLeft) clipSetup += tr("0,0 Lower Left"); else clipSetup += tr("0,0 Upper Left"); clipSetup += lit(", "); - if(state.m_VtxProcess.clipNegativeOneToOne) + if(state.vertexProcessing.clipNegativeOneToOne) clipSetup += lit("Z= -1 to 1"); else clipSetup += lit("Z= 0 to 1"); @@ -1518,9 +1517,9 @@ void GLPipelineStateViewer::setState() QString clipDistances; int numDist = 0; - for(int i = 0; i < (int)ARRAY_COUNT(state.m_VtxProcess.clipPlanes); i++) + for(int i = 0; i < (int)ARRAY_COUNT(state.vertexProcessing.clipPlanes); i++) { - if(state.m_VtxProcess.clipPlanes[i]) + if(state.vertexProcessing.clipPlanes[i]) { if(numDist > 0) clipDistances += lit(", "); @@ -1537,30 +1536,30 @@ void GLPipelineStateViewer::setState() ui->clipDistance->setText(clipDistances); - ui->depthClamp->setPixmap(state.m_Rasterizer.m_State.DepthClamp ? tick : cross); - ui->depthBias->setText(Formatter::Format(state.m_Rasterizer.m_State.DepthBias)); - ui->slopeScaledBias->setText(Formatter::Format(state.m_Rasterizer.m_State.SlopeScaledDepthBias)); + ui->depthClamp->setPixmap(state.rasterizer.state.depthClamp ? tick : cross); + ui->depthBias->setText(Formatter::Format(state.rasterizer.state.depthBias)); + ui->slopeScaledBias->setText(Formatter::Format(state.rasterizer.state.slopeScaledDepthBias)); - if(state.m_Rasterizer.m_State.OffsetClamp == 0.0f || qIsNaN(state.m_Rasterizer.m_State.OffsetClamp)) + if(state.rasterizer.state.offsetClamp == 0.0f || qIsNaN(state.rasterizer.state.offsetClamp)) { ui->offsetClamp->setText(QString()); ui->offsetClamp->setPixmap(cross); } else { - ui->offsetClamp->setText(Formatter::Format(state.m_Rasterizer.m_State.OffsetClamp)); + ui->offsetClamp->setText(Formatter::Format(state.rasterizer.state.offsetClamp)); ui->offsetClamp->setPixmap(QPixmap()); } - ui->multisample->setPixmap(state.m_Rasterizer.m_State.MultisampleEnable ? tick : cross); - ui->sampleShading->setPixmap(state.m_Rasterizer.m_State.SampleShading ? tick : cross); - ui->minSampleShading->setText(Formatter::Format(state.m_Rasterizer.m_State.MinSampleShadingRate)); - ui->alphaToCoverage->setPixmap(state.m_Rasterizer.m_State.SampleAlphaToCoverage ? tick : cross); - ui->alphaToOne->setPixmap(state.m_Rasterizer.m_State.SampleAlphaToOne ? tick : cross); - if(state.m_Rasterizer.m_State.SampleCoverage) + ui->multisample->setPixmap(state.rasterizer.state.multisampleEnable ? tick : cross); + ui->sampleShading->setPixmap(state.rasterizer.state.sampleShading ? tick : cross); + ui->minSampleShading->setText(Formatter::Format(state.rasterizer.state.minSampleShadingRate)); + ui->alphaToCoverage->setPixmap(state.rasterizer.state.alphaToCoverage ? tick : cross); + ui->alphaToOne->setPixmap(state.rasterizer.state.alphaToOne ? tick : cross); + if(state.rasterizer.state.sampleCoverage) { - QString sampleCoverage = Formatter::Format(state.m_Rasterizer.m_State.SampleCoverageValue); - if(state.m_Rasterizer.m_State.SampleCoverageInvert) + QString sampleCoverage = Formatter::Format(state.rasterizer.state.sampleCoverageValue); + if(state.rasterizer.state.sampleCoverageInvert) sampleCoverage += tr(" inverted"); ui->sampleCoverage->setText(sampleCoverage); ui->sampleCoverage->setPixmap(QPixmap()); @@ -1571,9 +1570,9 @@ void GLPipelineStateViewer::setState() ui->sampleCoverage->setPixmap(cross); } - if(state.m_Rasterizer.m_State.SampleMask) + if(state.rasterizer.state.sampleMask) { - ui->sampleMask->setText(Formatter::Format(state.m_Rasterizer.m_State.SampleMaskValue, true)); + ui->sampleMask->setText(Formatter::Format(state.rasterizer.state.sampleMaskValue, true)); ui->sampleMask->setPixmap(QPixmap()); } else @@ -1587,23 +1586,23 @@ void GLPipelineStateViewer::setState() bool targets[32] = {}; - ui->drawFBO->setText(QFormatStr("Draw FBO: %1").arg(ToQStr(state.m_FB.m_DrawFBO.Obj))); - ui->readFBO->setText(QFormatStr("Read FBO: %1").arg(ToQStr(state.m_FB.m_ReadFBO.Obj))); + ui->drawFBO->setText(QFormatStr("Draw FBO: %1").arg(ToQStr(state.framebuffer.drawFBO.resourceId))); + ui->readFBO->setText(QFormatStr("Read FBO: %1").arg(ToQStr(state.framebuffer.readFBO.resourceId))); vs = ui->framebuffer->verticalScrollBar()->value(); ui->framebuffer->beginUpdate(); ui->framebuffer->clear(); { int i = 0; - for(int db : state.m_FB.m_DrawFBO.DrawBuffers) + for(int db : state.framebuffer.drawFBO.drawBuffers) { ResourceId p; const GLPipe::Attachment *r = NULL; - if(db >= 0 && db < state.m_FB.m_DrawFBO.Color.count()) + if(db >= 0 && db < state.framebuffer.drawFBO.colorAttachments.count()) { - p = state.m_FB.m_DrawFBO.Color[db].Obj; - r = &state.m_FB.m_DrawFBO.Color[db]; + p = state.framebuffer.drawFBO.colorAttachments[db].resourceId; + r = &state.framebuffer.drawFBO.colorAttachments[db]; } bool filledSlot = (p != ResourceId()); @@ -1631,33 +1630,36 @@ void GLPipelineStateViewer::setState() d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); - if(tex->format.srgbCorrected && !state.m_FB.FramebufferSRGB) + if(tex->format.srgbCorrected && !state.framebuffer.framebufferSRGB) format += lit(" (GL_FRAMEBUFFER_SRGB = 0)"); } - if(r && (r->Swizzle[0] != TextureSwizzle::Red || r->Swizzle[1] != TextureSwizzle::Green || - r->Swizzle[2] != TextureSwizzle::Blue || r->Swizzle[3] != TextureSwizzle::Alpha)) + if(r && (r->swizzle[0] != TextureSwizzle::Red || r->swizzle[1] != TextureSwizzle::Green || + r->swizzle[2] != TextureSwizzle::Blue || r->swizzle[3] != TextureSwizzle::Alpha)) { format += tr(" swizzle[%1%2%3%4]") - .arg(ToQStr(r->Swizzle[0])) - .arg(ToQStr(r->Swizzle[1])) - .arg(ToQStr(r->Swizzle[2])) - .arg(ToQStr(r->Swizzle[3])); + .arg(ToQStr(r->swizzle[0])) + .arg(ToQStr(r->swizzle[1])) + .arg(ToQStr(r->swizzle[2])) + .arg(ToQStr(r->swizzle[3])); } QString slotname = QString::number(i); - if(state.m_FS.ShaderDetails) + if(state.fragmentShader.reflection) { - for(int s = 0; s < state.m_FS.ShaderDetails->OutputSig.count(); s++) + for(int s = 0; s < state.fragmentShader.reflection->outputSignature.count(); s++) { - if(state.m_FS.ShaderDetails->OutputSig[s].regIndex == (uint32_t)db && - (state.m_FS.ShaderDetails->OutputSig[s].systemValue == ShaderBuiltin::Undefined || - state.m_FS.ShaderDetails->OutputSig[s].systemValue == ShaderBuiltin::ColorOutput)) + if(state.fragmentShader.reflection->outputSignature[s].regIndex == (uint32_t)db && + (state.fragmentShader.reflection->outputSignature[s].systemValue == + ShaderBuiltin::Undefined || + state.fragmentShader.reflection->outputSignature[s].systemValue == + ShaderBuiltin::ColorOutput)) { - slotname += QFormatStr(": %1").arg(state.m_FS.ShaderDetails->OutputSig[s].varName); + slotname += + QFormatStr(": %1").arg(state.fragmentShader.reflection->outputSignature[s].varName); } } } @@ -1684,7 +1686,8 @@ void GLPipelineStateViewer::setState() } ResourceId dsObjects[] = { - state.m_FB.m_DrawFBO.Depth.Obj, state.m_FB.m_DrawFBO.Stencil.Obj, + state.framebuffer.drawFBO.depthAttachment.resourceId, + state.framebuffer.drawFBO.stencilAttachment.resourceId, }; for(int dsIdx = 0; dsIdx < 2; dsIdx++) @@ -1715,7 +1718,7 @@ void GLPipelineStateViewer::setState() d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); } QString slot = tr("Depth"); @@ -1724,8 +1727,9 @@ void GLPipelineStateViewer::setState() bool depthstencil = false; - if(state.m_FB.m_DrawFBO.Depth.Obj == state.m_FB.m_DrawFBO.Stencil.Obj && - state.m_FB.m_DrawFBO.Depth.Obj != ResourceId()) + if(state.framebuffer.drawFBO.depthAttachment.resourceId == + state.framebuffer.drawFBO.stencilAttachment.resourceId && + state.framebuffer.drawFBO.depthAttachment.resourceId != ResourceId()) { depthstencil = true; slot = tr("Depth-Stencil"); @@ -1757,12 +1761,13 @@ void GLPipelineStateViewer::setState() ui->blends->beginUpdate(); ui->blends->clear(); { - bool logic = state.m_FB.m_Blending.Blends[0].Logic != LogicOp::NoOp; + bool logic = state.framebuffer.blendState.blends[0].logicOperationEnabled && + state.framebuffer.blendState.blends[0].logicOperation != LogicOperation::NoOp; int i = 0; - for(const GLPipe::Blend &blend : state.m_FB.m_Blending.Blends) + for(const ColorBlend &blend : state.framebuffer.blendState.blends) { - bool filledSlot = (blend.Enabled || targets[i]); + bool filledSlot = (blend.enabled || targets[i]); bool usedSlot = (targets[i]); // if logic operation is enabled, blending is disabled @@ -1777,32 +1782,32 @@ void GLPipelineStateViewer::setState() { node = new RDTreeWidgetItem({i, tr("True"), - lit("-"), lit("-"), ToQStr(blend.Logic), + lit("-"), lit("-"), ToQStr(blend.logicOperation), lit("-"), lit("-"), lit("-"), QFormatStr("%1%2%3%4") - .arg((blend.WriteMask & 0x1) == 0 ? lit("_") : lit("R")) - .arg((blend.WriteMask & 0x2) == 0 ? lit("_") : lit("G")) - .arg((blend.WriteMask & 0x4) == 0 ? lit("_") : lit("B")) - .arg((blend.WriteMask & 0x8) == 0 ? lit("_") : lit("A"))}); + .arg((blend.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + .arg((blend.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + .arg((blend.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + .arg((blend.writeMask & 0x8) == 0 ? lit("_") : lit("A"))}); } else { node = new RDTreeWidgetItem( - {i, blend.Enabled ? tr("True") : tr("False"), + {i, blend.enabled ? tr("True") : tr("False"), - ToQStr(blend.m_Blend.Source), ToQStr(blend.m_Blend.Destination), - ToQStr(blend.m_Blend.Operation), + ToQStr(blend.colorBlend.source), ToQStr(blend.colorBlend.destination), + ToQStr(blend.colorBlend.operation), - ToQStr(blend.m_AlphaBlend.Source), ToQStr(blend.m_AlphaBlend.Destination), - ToQStr(blend.m_AlphaBlend.Operation), + ToQStr(blend.alphaBlend.source), ToQStr(blend.alphaBlend.destination), + ToQStr(blend.alphaBlend.operation), QFormatStr("%1%2%3%4") - .arg((blend.WriteMask & 0x1) == 0 ? lit("_") : lit("R")) - .arg((blend.WriteMask & 0x2) == 0 ? lit("_") : lit("G")) - .arg((blend.WriteMask & 0x4) == 0 ? lit("_") : lit("B")) - .arg((blend.WriteMask & 0x8) == 0 ? lit("_") : lit("A"))}); + .arg((blend.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + .arg((blend.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + .arg((blend.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + .arg((blend.writeMask & 0x8) == 0 ? lit("_") : lit("A"))}); } if(!filledSlot) @@ -1822,19 +1827,19 @@ void GLPipelineStateViewer::setState() ui->blends->verticalScrollBar()->setValue(vs); ui->blendFactor->setText(QFormatStr("%1, %2, %3, %4") - .arg(state.m_FB.m_Blending.BlendFactor[0], 0, 'f', 2) - .arg(state.m_FB.m_Blending.BlendFactor[1], 0, 'f', 2) - .arg(state.m_FB.m_Blending.BlendFactor[2], 0, 'f', 2) - .arg(state.m_FB.m_Blending.BlendFactor[3], 0, 'f', 2)); + .arg(state.framebuffer.blendState.blendFactor[0], 0, 'f', 2) + .arg(state.framebuffer.blendState.blendFactor[1], 0, 'f', 2) + .arg(state.framebuffer.blendState.blendFactor[2], 0, 'f', 2) + .arg(state.framebuffer.blendState.blendFactor[3], 0, 'f', 2)); - ui->depthEnabled->setPixmap(state.m_DepthState.DepthEnable ? tick : cross); - ui->depthFunc->setText(ToQStr(state.m_DepthState.DepthFunc)); - ui->depthWrite->setPixmap(state.m_DepthState.DepthWrites ? tick : cross); + ui->depthEnabled->setPixmap(state.depthState.depthEnable ? tick : cross); + ui->depthFunc->setText(ToQStr(state.depthState.depthFunction)); + ui->depthWrite->setPixmap(state.depthState.depthWrites ? tick : cross); - if(state.m_DepthState.DepthBounds) + if(state.depthState.depthBounds) { - ui->depthBounds->setText(Formatter::Format(state.m_DepthState.NearBound) + lit("-") + - Formatter::Format(state.m_DepthState.FarBound)); + ui->depthBounds->setText(Formatter::Format(state.depthState.nearBound) + lit("-") + + Formatter::Format(state.depthState.farBound)); ui->depthBounds->setPixmap(QPixmap()); } else @@ -1845,25 +1850,25 @@ void GLPipelineStateViewer::setState() ui->stencils->beginUpdate(); ui->stencils->clear(); - if(state.m_StencilState.StencilEnable) + if(state.stencilState.stencilEnable) { ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Front"), ToQStr(state.m_StencilState.m_FrontFace.Func), - ToQStr(state.m_StencilState.m_FrontFace.FailOp), - ToQStr(state.m_StencilState.m_FrontFace.DepthFailOp), - ToQStr(state.m_StencilState.m_FrontFace.PassOp), - Formatter::Format(state.m_StencilState.m_FrontFace.WriteMask, true), - Formatter::Format(state.m_StencilState.m_FrontFace.ValueMask, true), - Formatter::Format(state.m_StencilState.m_FrontFace.Ref, true)})); + new RDTreeWidgetItem({tr("Front"), ToQStr(state.stencilState.frontFace.function), + ToQStr(state.stencilState.frontFace.failOperation), + ToQStr(state.stencilState.frontFace.depthFailOperation), + ToQStr(state.stencilState.frontFace.passOperation), + Formatter::Format(state.stencilState.frontFace.writeMask, true), + Formatter::Format(state.stencilState.frontFace.compareMask, true), + Formatter::Format(state.stencilState.frontFace.reference, true)})); ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Back"), ToQStr(state.m_StencilState.m_BackFace.Func), - ToQStr(state.m_StencilState.m_BackFace.FailOp), - ToQStr(state.m_StencilState.m_BackFace.DepthFailOp), - ToQStr(state.m_StencilState.m_BackFace.PassOp), - Formatter::Format(state.m_StencilState.m_BackFace.WriteMask, true), - Formatter::Format(state.m_StencilState.m_BackFace.ValueMask, true), - Formatter::Format(state.m_StencilState.m_BackFace.Ref, true)})); + new RDTreeWidgetItem({tr("Back"), ToQStr(state.stencilState.backFace.function), + ToQStr(state.stencilState.backFace.failOperation), + ToQStr(state.stencilState.backFace.depthFailOperation), + ToQStr(state.stencilState.backFace.passOperation), + Formatter::Format(state.stencilState.backFace.writeMask, true), + Formatter::Format(state.stencilState.backFace.compareMask, true), + Formatter::Format(state.stencilState.backFace.reference, true)})); } else { @@ -1889,12 +1894,12 @@ void GLPipelineStateViewer::setState() bool raster = true; bool fbo = true; - if(state.m_VtxProcess.discard) + if(state.vertexProcessing.discard) { raster = fbo = false; } - if(state.m_GS.Object == ResourceId() && state.m_Feedback.Active) + if(state.geometryShader.shaderResourceId == ResourceId() && state.transformFeedback.active) { ui->pipeFlow->setStageName(4, lit("XFB"), tr("Transform Feedback")); } @@ -1904,9 +1909,12 @@ void GLPipelineStateViewer::setState() } ui->pipeFlow->setStagesEnabled( - {true, true, state.m_TCS.Object != ResourceId(), state.m_TES.Object != ResourceId(), - state.m_GS.Object != ResourceId() || state.m_Feedback.Active, raster, - !state.m_VtxProcess.discard && state.m_FS.Object != ResourceId(), fbo, false}); + {true, true, state.tessControlShader.shaderResourceId != ResourceId(), + state.tessEvalShader.shaderResourceId != ResourceId(), + state.geometryShader.shaderResourceId != ResourceId() || state.transformFeedback.active, + raster, + !state.vertexProcessing.discard && state.fragmentShader.shaderResourceId != ResourceId(), + fbo, false}); } } @@ -1965,9 +1973,9 @@ void GLPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, int c if(tex) { - if(tex->resType == TextureDim::Buffer) + if(tex->type == TextureType::Buffer) { - IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->ID); + IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -1976,7 +1984,7 @@ void GLPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, int c if(!m_Ctx.HasTextureViewer()) m_Ctx.ShowTextureViewer(); ITextureViewer *viewer = m_Ctx.GetTextureViewer(); - viewer->ViewTexture(tex->ID, true); + viewer->ViewTexture(tex->resourceId, true); } return; @@ -1986,7 +1994,7 @@ void GLPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, int c { GLReadWriteTag buf = tag.value(); - const ShaderResource &shaderRes = stage->ShaderDetails->ReadWriteResources[buf.bindPoint]; + const ShaderResource &shaderRes = stage->reflection->readWriteResources[buf.bindPoint]; QString format = lit("// struct %1\n").arg(shaderRes.variableType.descriptor.name); @@ -2014,10 +2022,10 @@ void GLPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, int c format += lit("row_major "); format += ToQStr(desc.type); - if(desc.rows > 1 && desc.cols > 1) - format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.cols); - else if(desc.cols > 1) - format += QString::number(desc.cols); + if(desc.rows > 1 && desc.columns > 1) + format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.columns); + else if(desc.columns > 1) + format += QString::number(desc.columns); if(!desc.name.empty()) format += lit(" ") + desc.name; @@ -2080,7 +2088,7 @@ void GLPipelineStateViewer::highlightIABind(int slot) { int idx = ((slot + 1) * 21) % 32; // space neighbouring colours reasonably distinctly - const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState().m_VtxIn; + const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState().vertexInput; QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); @@ -2098,7 +2106,7 @@ void GLPipelineStateViewer::highlightIABind(int slot) { RDTreeWidgetItem *item = ui->viAttrs->topLevelItem(i); - if((int)VI.attributes[i].BufferSlot != slot) + if((int)VI.attributes[i].vertexBufferSlot != slot) { item->setBackground(QBrush()); item->setForeground(QBrush()); @@ -2123,13 +2131,13 @@ void GLPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e) vertex_leave(NULL); - const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState().m_VtxIn; + const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState().vertexInput; if(idx.isValid()) { if(idx.row() >= 0 && idx.row() < VI.attributes.count()) { - uint32_t buffer = VI.attributes[idx.row()].BufferSlot; + uint32_t buffer = VI.attributes[idx.row()].vertexBufferSlot; highlightIABind((int)buffer); } @@ -2190,10 +2198,10 @@ void GLPipelineStateViewer::shaderView_clicked() { const GLPipe::Shader *stage = stageForSender(qobject_cast(QObject::sender())); - if(stage == NULL || stage->Object == ResourceId()) + if(stage == NULL || stage->shaderResourceId == ResourceId()) return; - ShaderReflection *shaderDetails = stage->ShaderDetails; + ShaderReflection *shaderDetails = stage->reflection; IShaderViewer *shad = m_Ctx.ViewShader(shaderDetails, ResourceId()); @@ -2205,10 +2213,10 @@ void GLPipelineStateViewer::shaderEdit_clicked() QWidget *sender = qobject_cast(QObject::sender()); const GLPipe::Shader *stage = stageForSender(sender); - if(!stage || stage->Object == ResourceId()) + if(!stage || stage->shaderResourceId == ResourceId()) return; - const ShaderReflection *shaderDetails = stage->ShaderDetails; + const ShaderReflection *shaderDetails = stage->reflection; if(!shaderDetails) return; @@ -2229,7 +2237,7 @@ void GLPipelineStateViewer::shaderEdit_clicked() if(files.empty()) return; - m_Common.EditShader(stage->stage, stage->Object, shaderDetails, entryFunc, files); + m_Common.EditShader(stage->stage, stage->shaderResourceId, shaderDetails, entryFunc, files); } void GLPipelineStateViewer::shaderSave_clicked() @@ -2239,9 +2247,9 @@ void GLPipelineStateViewer::shaderSave_clicked() if(stage == NULL) return; - ShaderReflection *shaderDetails = stage->ShaderDetails; + ShaderReflection *shaderDetails = stage->reflection; - if(stage->Object == ResourceId()) + if(stage->shaderResourceId == ResourceId()) return; m_Common.SaveShaderFile(shaderDetails); @@ -2261,9 +2269,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert for(const GLPipe::VertexAttribute &a : vtx.attributes) { QString generic; - if(!a.Enabled) - generic = MakeGenericValueString(a.Format.compCount, a.Format.compType, a); - rows.push_back({i, (bool)a.Enabled, a.BufferSlot, a.Format.Name(), a.RelativeOffset, generic}); + if(!a.enabled) + generic = MakeGenericValueString(a.format.compCount, a.format.compType, a); + rows.push_back({i, (bool)a.enabled, a.vertexBufferSlot, a.format.Name(), a.byteOffset, generic}); i++; } @@ -2281,23 +2289,23 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert QList rows; int i = 0; - for(const GLPipe::VB &vb : vtx.vbuffers) + for(const GLPipe::VertexBuffer &vb : vtx.vertexBuffers) { - QString name = m_Ctx.GetResourceName(vb.Buffer); + QString name = m_Ctx.GetResourceName(vb.resourceId); uint64_t length = 0; - if(vb.Buffer == ResourceId()) + if(vb.resourceId == ResourceId()) { continue; } else { - BufferDescription *buf = m_Ctx.GetBuffer(vb.Buffer); + BufferDescription *buf = m_Ctx.GetBuffer(vb.resourceId); if(buf) length = buf->length; } - rows.push_back({i, name, vb.Stride, vb.Offset, vb.Divisor, (qulonglong)length}); + rows.push_back({i, name, vb.byteStride, vb.byteOffset, vb.instanceDivisor, (qulonglong)length}); i++; } @@ -2312,16 +2320,16 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert xml.writeCharacters(tr("Index Buffer")); xml.writeEndElement(); - QString name = m_Ctx.GetResourceName(vtx.ibuffer); + QString name = m_Ctx.GetResourceName(vtx.indexBuffer); uint64_t length = 0; - if(vtx.ibuffer == ResourceId()) + if(vtx.indexBuffer == ResourceId()) { name = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(vtx.ibuffer); + BufferDescription *buf = m_Ctx.GetBuffer(vtx.indexBuffer); if(buf) length = buf->length; } @@ -2356,9 +2364,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert m_Common.exportHTMLTable( xml, {tr("Rasterizer Discard"), tr("Clip Origin Lower Left"), tr("Clip Space Z")}, - {pipe.m_VtxProcess.discard ? tr("Yes") : tr("No"), - pipe.m_VtxProcess.clipOriginLowerLeft ? tr("Yes") : tr("No"), - pipe.m_VtxProcess.clipNegativeOneToOne ? tr("-1 to 1") : tr("0 to 1")}); + {pipe.vertexProcessing.discard ? tr("Yes") : tr("No"), + pipe.vertexProcessing.clipOriginLowerLeft ? tr("Yes") : tr("No"), + pipe.vertexProcessing.clipNegativeOneToOne ? tr("-1 to 1") : tr("0 to 1")}); xml.writeStartElement(tr("p")); xml.writeEndElement(); @@ -2366,7 +2374,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert QList clipPlaneRows; for(int i = 0; i < 8; i++) - clipPlaneRows.push_back({i, pipe.m_VtxProcess.clipPlanes[i] ? tr("Yes") : tr("No")}); + clipPlaneRows.push_back({i, pipe.vertexProcessing.clipPlanes[i] ? tr("Yes") : tr("No")}); m_Common.exportHTMLTable(xml, { @@ -2384,14 +2392,14 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert }, { QFormatStr("%1, %2") - .arg(pipe.m_VtxProcess.defaultInnerLevel[0]) - .arg(pipe.m_VtxProcess.defaultInnerLevel[1]), + .arg(pipe.vertexProcessing.defaultInnerLevel[0]) + .arg(pipe.vertexProcessing.defaultInnerLevel[1]), QFormatStr("%1, %2, %3, %4") - .arg(pipe.m_VtxProcess.defaultOuterLevel[0]) - .arg(pipe.m_VtxProcess.defaultOuterLevel[1]) - .arg(pipe.m_VtxProcess.defaultOuterLevel[2]) - .arg(pipe.m_VtxProcess.defaultOuterLevel[3]), + .arg(pipe.vertexProcessing.defaultOuterLevel[0]) + .arg(pipe.vertexProcessing.defaultOuterLevel[1]) + .arg(pipe.vertexProcessing.defaultOuterLevel[2]) + .arg(pipe.vertexProcessing.defaultOuterLevel[3]), }); } } @@ -2399,8 +2407,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shader &sh) { const GLPipe::State &pipe = m_Ctx.CurGLPipelineState(); - ShaderReflection *shaderDetails = sh.ShaderDetails; - const ShaderBindpointMapping &mapping = sh.BindpointMapping; + ShaderReflection *shaderDetails = sh.reflection; + const ShaderBindpointMapping &mapping = sh.bindpointMapping; { xml.writeStartElement(tr("h3")); @@ -2409,12 +2417,12 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad QString shadername = tr("Unknown"); - if(sh.Object == ResourceId()) + if(sh.shaderResourceId == ResourceId()) shadername = tr("Unbound"); else - shadername = m_Ctx.GetResourceName(sh.Object); + shadername = m_Ctx.GetResourceName(sh.shaderResourceId); - if(sh.Object == ResourceId()) + if(sh.shaderResourceId == ResourceId()) { shadername = tr("Unbound"); } @@ -2422,21 +2430,23 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad { QString shname = tr("%1 Shader").arg(ToQStr(sh.stage, GraphicsAPI::OpenGL)); - if(m_Ctx.IsAutogeneratedName(sh.Object) && m_Ctx.IsAutogeneratedName(sh.Program) && - m_Ctx.IsAutogeneratedName(pipe.Pipeline)) + if(m_Ctx.IsAutogeneratedName(sh.shaderResourceId) && + m_Ctx.IsAutogeneratedName(sh.programResourceId) && + m_Ctx.IsAutogeneratedName(pipe.pipelineResourceId)) { - shadername = QFormatStr("%1 %2").arg(shname).arg(ToQStr(sh.Object)); + shadername = QFormatStr("%1 %2").arg(shname).arg(ToQStr(sh.shaderResourceId)); } else { - if(!m_Ctx.IsAutogeneratedName(sh.Object)) - shname = m_Ctx.GetResourceName(sh.Object); + if(!m_Ctx.IsAutogeneratedName(sh.shaderResourceId)) + shname = m_Ctx.GetResourceName(sh.shaderResourceId); - if(!m_Ctx.IsAutogeneratedName(sh.Program)) - shname = QFormatStr("%1 - %2").arg(m_Ctx.GetResourceName(sh.Program)).arg(shname); + if(!m_Ctx.IsAutogeneratedName(sh.programResourceId)) + shname = QFormatStr("%1 - %2").arg(m_Ctx.GetResourceName(sh.programResourceId)).arg(shname); - if(!m_Ctx.IsAutogeneratedName(pipe.Pipeline)) - shname = QFormatStr("%1 - %2").arg(m_Ctx.GetResourceName(pipe.Pipeline)).arg(shname); + if(!m_Ctx.IsAutogeneratedName(pipe.pipelineResourceId)) + shname = + QFormatStr("%1 - %2").arg(m_Ctx.GetResourceName(pipe.pipelineResourceId)).arg(shname); shadername = shname; } @@ -2446,7 +2456,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad xml.writeCharacters(shadername); xml.writeEndElement(); - if(sh.Object == ResourceId()) + if(sh.shaderResourceId == ResourceId()) return; } @@ -2456,27 +2466,27 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad QList readwriteRows; QList subRows; - for(int i = 0; i < pipe.Textures.count(); i++) + for(int i = 0; i < pipe.textures.count(); i++) { - const GLPipe::Texture &r = pipe.Textures[i]; - const GLPipe::Sampler &s = pipe.Samplers[i]; + const GLPipe::Texture &r = pipe.textures[i]; + const GLPipe::Sampler &s = pipe.samplers[i]; const ShaderResource *shaderInput = NULL; - const BindpointMap *map = NULL; + const Bindpoint *map = NULL; if(shaderDetails) { - for(const ShaderResource &bind : shaderDetails->ReadOnlyResources) + for(const ShaderResource &bind : shaderDetails->readOnlyResources) { - if(bind.IsReadOnly && mapping.ReadOnlyResources[bind.bindPoint].bind == i) + if(bind.isReadOnly && mapping.readOnlyResources[bind.bindPoint].bind == i) { shaderInput = &bind; - map = &mapping.ReadOnlyResources[bind.bindPoint]; + map = &mapping.readOnlyResources[bind.bindPoint]; } } } - bool filledSlot = (r.Resource != ResourceId()); + bool filledSlot = (r.resourceId != ResourceId()); bool usedSlot = (shaderInput && map->used); if(shaderInput) @@ -2491,7 +2501,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad uint32_t w = 1, h = 1, d = 1; uint32_t a = 1; QString format = tr("Unknown"); - QString name = m_Ctx.GetResourceName(r.Resource); + QString name = m_Ctx.GetResourceName(r.resourceId); QString typeName = tr("Unknown"); if(!filledSlot) @@ -2502,7 +2512,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad w = h = d = a = 0; } - TextureDescription *tex = m_Ctx.GetTexture(r.Resource); + TextureDescription *tex = m_Ctx.GetTexture(r.resourceId); if(tex) { w = tex->width; @@ -2510,25 +2520,25 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad d = tex->depth; a = tex->arraysize; format = tex->format.Name(); - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); if(tex->format.type == ResourceFormatType::D16S8 || tex->format.type == ResourceFormatType::D24S8 || tex->format.type == ResourceFormatType::D32S8) { - if(r.DepthReadChannel == 0) + if(r.depthReadChannel == 0) format += tr(" Depth-Repipead"); - else if(r.DepthReadChannel == 1) + else if(r.depthReadChannel == 1) format += tr(" Stencil-Read"); } - else if(r.Swizzle[0] != TextureSwizzle::Red || r.Swizzle[1] != TextureSwizzle::Green || - r.Swizzle[2] != TextureSwizzle::Blue || r.Swizzle[3] != TextureSwizzle::Alpha) + else if(r.swizzle[0] != TextureSwizzle::Red || r.swizzle[1] != TextureSwizzle::Green || + r.swizzle[2] != TextureSwizzle::Blue || r.swizzle[3] != TextureSwizzle::Alpha) { format += QFormatStr(" swizzle[%1%2%3%4]") - .arg(ToQStr(r.Swizzle[0])) - .arg(ToQStr(r.Swizzle[1])) - .arg(ToQStr(r.Swizzle[2])) - .arg(ToQStr(r.Swizzle[3])); + .arg(ToQStr(r.swizzle[0])) + .arg(ToQStr(r.swizzle[1])) + .arg(ToQStr(r.swizzle[2])) + .arg(ToQStr(r.swizzle[3])); } } @@ -2543,17 +2553,17 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad slotname += QFormatStr(": %1").arg(shaderInput->name); QString borderColor = QFormatStr("%1, %2, %3, %4") - .arg(s.BorderColor[0]) - .arg(s.BorderColor[1]) - .arg(s.BorderColor[2]) - .arg(s.BorderColor[3]); + .arg(s.borderColor[0]) + .arg(s.borderColor[1]) + .arg(s.borderColor[2]) + .arg(s.borderColor[3]); QString addressing; QString addPrefix; QString addVal; - QString addr[] = {ToQStr(s.AddressS), ToQStr(s.AddressT), ToQStr(s.AddressR)}; + QString addr[] = {ToQStr(s.addressS), ToQStr(s.addressT), ToQStr(s.addressR)}; // arrange like either STR: WRAP or ST: WRAP, R: CLAMP for(int a = 0; a < 3; a++) @@ -2579,27 +2589,27 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad if(s.UseBorder()) addressing += QFormatStr("<%1>").arg(borderColor); - if(r.ResType == TextureDim::TextureCube || r.ResType == TextureDim::TextureCubeArray) + if(r.type == TextureType::TextureCube || r.type == TextureType::TextureCubeArray) { - addressing += s.SeamlessCube ? tr(" Seamless") : tr(" Non-Seamless"); + addressing += s.seamlessCubeMap ? tr(" Seamless") : tr(" Non-Seamless"); } - QString filter = ToQStr(s.Filter); + QString filter = ToQStr(s.filter); - if(s.MaxAniso > 1) - filter += tr(" Aniso%1x").arg(s.MaxAniso); + if(s.maxAnisotropy > 1) + filter += tr(" Aniso%1x").arg(s.maxAnisotropy); - if(s.Filter.func == FilterFunc::Comparison) - filter += QFormatStr(" %1").arg(ToQStr(s.Comparison)); - else if(s.Filter.func != FilterFunc::Normal) - filter += QFormatStr(" (%1)").arg(ToQStr(s.Filter.func)); + if(s.filter.filter == FilterFunction::Comparison) + filter += QFormatStr(" %1").arg(ToQStr(s.compareFunction)); + else if(s.filter.filter != FilterFunction::Normal) + filter += QFormatStr(" (%1)").arg(ToQStr(s.filter.filter)); samplerRows.push_back( {slotname, addressing, filter, QFormatStr("%1 - %2") - .arg(s.MinLOD == -FLT_MAX ? lit("0") : QString::number(s.MinLOD)) - .arg(s.MaxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.MaxLOD)), - s.MipLODBias}); + .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) + .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), + s.mipLODBias}); } } } @@ -2607,17 +2617,17 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad if(shaderDetails) { uint32_t i = 0; - for(const ConstantBlock &shaderCBuf : shaderDetails->ConstantBlocks) + for(const ConstantBlock &shaderCBuf : shaderDetails->constantBlocks) { - int bindPoint = mapping.ConstantBlocks[i].bind; + int bindPoint = mapping.constantBlocks[i].bind; const GLPipe::Buffer *b = NULL; - if(bindPoint >= 0 && bindPoint < pipe.UniformBuffers.count()) - b = &pipe.UniformBuffers[bindPoint]; + if(bindPoint >= 0 && bindPoint < pipe.uniformBuffers.count()) + b = &pipe.uniformBuffers[bindPoint]; - bool filledSlot = !shaderCBuf.bufferBacked || (b && b->Resource != ResourceId()); - bool usedSlot = mapping.ConstantBlocks[i].used; + bool filledSlot = !shaderCBuf.bufferBacked || (b && b->resourceId != ResourceId()); + bool usedSlot = mapping.constantBlocks[i].used; // show if { @@ -2627,7 +2637,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad uint64_t byteSize = shaderCBuf.byteSize; QString slotname = tr("Uniforms"); - QString name = m_Ctx.GetResourceName(b->Resource); + QString name = m_Ctx.GetResourceName(b->resourceId); QString sizestr = tr("%1 Variables").arg(numvars); QString byterange; @@ -2640,10 +2650,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad if(b) { slotname = QFormatStr("%1: %2").arg(bindPoint).arg(shaderCBuf.name); - offset = b->Offset; - length = b->Size; + offset = b->byteOffset; + length = b->byteSize; - BufferDescription *buf = m_Ctx.GetBuffer(b->Resource); + BufferDescription *buf = m_Ctx.GetBuffer(b->resourceId); if(buf && length == 0) length = buf->length; @@ -2664,7 +2674,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad { uint32_t i = 0; - for(uint32_t subval : sh.Subroutines) + for(uint32_t subval : sh.subroutines) { subRows.push_back({i, subval}); @@ -2675,9 +2685,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad if(shaderDetails) { uint32_t i = 0; - for(const ShaderResource &res : shaderDetails->ReadWriteResources) + for(const ShaderResource &res : shaderDetails->readWriteResources) { - int bindPoint = mapping.ReadWriteResources[i].bind; + int bindPoint = mapping.readWriteResources[i].bind; GLReadWriteType readWriteType = GetGLReadWriteType(res); @@ -2685,28 +2695,28 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad const GLPipe::ImageLoadStore *im = NULL; ResourceId id; - if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < pipe.Images.count()) + if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < pipe.images.count()) { - im = &pipe.Images[bindPoint]; - id = pipe.Images[bindPoint].Resource; + im = &pipe.images[bindPoint]; + id = pipe.images[bindPoint].resourceId; } if(readWriteType == GLReadWriteType::Atomic && bindPoint >= 0 && - bindPoint < pipe.AtomicBuffers.count()) + bindPoint < pipe.atomicBuffers.count()) { - bf = &pipe.AtomicBuffers[bindPoint]; - id = pipe.AtomicBuffers[bindPoint].Resource; + bf = &pipe.atomicBuffers[bindPoint]; + id = pipe.atomicBuffers[bindPoint].resourceId; } if(readWriteType == GLReadWriteType::SSBO && bindPoint >= 0 && - bindPoint < pipe.ShaderStorageBuffers.count()) + bindPoint < pipe.shaderStorageBuffers.count()) { - bf = &pipe.ShaderStorageBuffers[bindPoint]; - id = pipe.ShaderStorageBuffers[bindPoint].Resource; + bf = &pipe.shaderStorageBuffers[bindPoint]; + id = pipe.shaderStorageBuffers[bindPoint].resourceId; } bool filledSlot = id != ResourceId(); - bool usedSlot = mapping.ReadWriteResources[i].used; + bool usedSlot = mapping.readWriteResources[i].used; // show if { @@ -2728,7 +2738,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad access = tr("Read-Only"); if(!im->readAllowed && im->writeAllowed) access = tr("Write-Only"); - format = im->Format.Name(); + format = im->imageFormat.Name(); } // check to see if it's a texture @@ -2762,10 +2772,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad { uint64_t offset = 0; uint64_t length = buf->length; - if(bf && bf->Size > 0) + if(bf && bf->byteSize > 0) { - offset = bf->Offset; - length = bf->Size; + offset = bf->byteOffset; + length = bf->byteSize; } if(offset > 0) @@ -2848,7 +2858,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Feed m_Common.exportHTMLTable( xml, {tr("Active"), tr("Paused")}, - {xfb.Active ? tr("Yes") : tr("No"), xfb.Paused ? tr("Yes") : tr("No")}); + {xfb.active ? tr("Yes") : tr("No"), xfb.paused ? tr("Yes") : tr("No")}); } { @@ -2858,24 +2868,24 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Feed QList rows; - for(size_t i = 0; i < ARRAY_COUNT(xfb.BufferBinding); i++) + for(size_t i = 0; i < ARRAY_COUNT(xfb.bufferResourceId); i++) { - QString name = m_Ctx.GetResourceName(xfb.BufferBinding[i]); + QString name = m_Ctx.GetResourceName(xfb.bufferResourceId[i]); uint64_t length = 0; - if(xfb.BufferBinding[i] == ResourceId()) + if(xfb.bufferResourceId[i] == ResourceId()) { name = tr("Empty"); } else { - BufferDescription *buf = m_Ctx.GetBuffer(xfb.BufferBinding[i]); + BufferDescription *buf = m_Ctx.GetBuffer(xfb.bufferResourceId[i]); if(buf) length = buf->length; } - rows.push_back( - {(int)i, name, (qulonglong)xfb.Offset[i], (qulonglong)xfb.Size[i], (qulonglong)length}); + rows.push_back({(int)i, name, (qulonglong)xfb.byteOffset[i], (qulonglong)xfb.byteSize[i], + (qulonglong)length}); } m_Common.exportHTMLTable( @@ -2897,8 +2907,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast xml.writeEndElement(); m_Common.exportHTMLTable(xml, {tr("Fill Mode"), tr("Cull Mode"), tr("Front CCW")}, - {ToQStr(rs.m_State.fillMode), ToQStr(rs.m_State.cullMode), - rs.m_State.FrontCCW ? tr("Yes") : tr("No")}); + {ToQStr(rs.state.fillMode), ToQStr(rs.state.cullMode), + rs.state.frontCCW ? tr("Yes") : tr("No")}); xml.writeStartElement(tr("p")); xml.writeEndElement(); @@ -2908,14 +2918,14 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast tr("Sample Coverage"), tr("Sample Coverage Invert"), tr("Alpha to Coverage"), tr("Alpha to One"), tr("Min Sample Shading Rate")}, { - rs.m_State.MultisampleEnable ? tr("Yes") : tr("No"), - rs.m_State.SampleShading ? tr("Yes") : tr("No"), - rs.m_State.SampleMask ? Formatter::Format(rs.m_State.SampleMaskValue, true) : tr("No"), - rs.m_State.SampleCoverage ? QString::number(rs.m_State.SampleCoverageValue) : tr("No"), - rs.m_State.SampleCoverageInvert ? tr("Yes") : tr("No"), - rs.m_State.SampleAlphaToCoverage ? tr("Yes") : tr("No"), - rs.m_State.SampleAlphaToOne ? tr("Yes") : tr("No"), - Formatter::Format(rs.m_State.MinSampleShadingRate), + rs.state.multisampleEnable ? tr("Yes") : tr("No"), + rs.state.sampleShading ? tr("Yes") : tr("No"), + rs.state.sampleMask ? Formatter::Format(rs.state.sampleMaskValue, true) : tr("No"), + rs.state.sampleCoverage ? QString::number(rs.state.sampleCoverageValue) : tr("No"), + rs.state.sampleCoverageInvert ? tr("Yes") : tr("No"), + rs.state.alphaToCoverage ? tr("Yes") : tr("No"), + rs.state.alphaToOne ? tr("Yes") : tr("No"), + Formatter::Format(rs.state.minSampleShadingRate), }); xml.writeStartElement(tr("p")); @@ -2928,10 +2938,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast tr("Point Fade Threshold"), tr("Point Origin Upper Left"), }, { - rs.m_State.ProgrammablePointSize ? tr("Yes") : tr("No"), - Formatter::Format(rs.m_State.PointSize), Formatter::Format(rs.m_State.LineWidth), - Formatter::Format(rs.m_State.PointFadeThreshold), - rs.m_State.PointOriginUpperLeft ? tr("Yes") : tr("No"), + rs.state.programmablePointSize ? tr("Yes") : tr("No"), + Formatter::Format(rs.state.pointSize), Formatter::Format(rs.state.lineWidth), + Formatter::Format(rs.state.pointFadeThreshold), + rs.state.pointOriginUpperLeft ? tr("Yes") : tr("No"), }); xml.writeStartElement(tr("p")); @@ -2939,9 +2949,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast m_Common.exportHTMLTable( xml, {tr("Depth Clamp"), tr("Depth Bias"), tr("Offset Clamp"), tr("Slope Scaled Bias")}, - {rs.m_State.DepthClamp ? tr("Yes") : tr("No"), rs.m_State.DepthBias, - Formatter::Format(rs.m_State.OffsetClamp), - Formatter::Format(rs.m_State.SlopeScaledDepthBias)}); + {rs.state.depthClamp ? tr("Yes") : tr("No"), rs.state.depthBias, + Formatter::Format(rs.state.offsetClamp), Formatter::Format(rs.state.slopeScaledDepthBias)}); } { @@ -2955,10 +2964,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast tr("Derivatives"), tr("Line Smooth"), tr("Poly Smooth"), tr("Tex Compression"), }, { - ToQStr(pipe.m_Hints.Derivatives), - pipe.m_Hints.LineSmoothEnabled ? ToQStr(pipe.m_Hints.LineSmooth) : tr("Disabled"), - pipe.m_Hints.PolySmoothEnabled ? ToQStr(pipe.m_Hints.PolySmooth) : tr("Disabled"), - ToQStr(pipe.m_Hints.TexCompression), + ToQStr(pipe.hints.derivatives), + pipe.hints.lineSmoothingEnabled ? ToQStr(pipe.hints.lineSmoothing) : tr("Disabled"), + pipe.hints.polySmoothingEnabled ? ToQStr(pipe.hints.polySmoothing) : tr("Disabled"), + ToQStr(pipe.hints.textureCompression), }); } @@ -2970,14 +2979,14 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast QList rows; int i = 0; - for(const GLPipe::Viewport &v : rs.Viewports) + for(const Viewport &v : rs.viewports) { - rows.push_back({i, v.Left, v.Bottom, v.Width, v.Height, v.MinDepth, v.MaxDepth}); + rows.push_back({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth}); i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("Left"), tr("Bottom"), tr("Width"), tr("Height"), + m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Min Depth"), tr("Max Depth")}, rows); } @@ -2990,15 +2999,15 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast QList rows; int i = 0; - for(const GLPipe::Scissor &s : rs.Scissors) + for(const Scissor &s : rs.scissors) { - rows.push_back({i, (bool)s.Enabled, s.Left, s.Bottom, s.Width, s.Height}); + rows.push_back({i, (bool)s.enabled, s.x, s.y, s.width, s.height}); i++; } m_Common.exportHTMLTable( - xml, {tr("Slot"), tr("Enabled"), tr("Left"), tr("Bottom"), tr("Width"), tr("Height")}, rows); + xml, {tr("Slot"), tr("Enabled"), tr("X"), tr("Y"), tr("Width"), tr("Height")}, rows); } } @@ -3011,14 +3020,14 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram xml.writeEndElement(); QString blendFactor = QFormatStr("%1, %2, %3, %4") - .arg(fb.m_Blending.BlendFactor[0], 0, 'f', 2) - .arg(fb.m_Blending.BlendFactor[1], 0, 'f', 2) - .arg(fb.m_Blending.BlendFactor[2], 0, 'f', 2) - .arg(fb.m_Blending.BlendFactor[3], 0, 'f', 2); + .arg(fb.blendState.blendFactor[0], 0, 'f', 2) + .arg(fb.blendState.blendFactor[1], 0, 'f', 2) + .arg(fb.blendState.blendFactor[2], 0, 'f', 2) + .arg(fb.blendState.blendFactor[3], 0, 'f', 2); m_Common.exportHTMLTable(xml, {tr("Framebuffer SRGB"), tr("Blend Factor")}, { - fb.FramebufferSRGB ? tr("Yes") : tr("No"), blendFactor, + fb.framebufferSRGB ? tr("Yes") : tr("No"), blendFactor, }); xml.writeStartElement(tr("h3")); @@ -3028,19 +3037,20 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram QList rows; int i = 0; - for(const GLPipe::Blend &b : fb.m_Blending.Blends) + for(const ColorBlend &b : fb.blendState.blends) { - if(i >= fb.m_DrawFBO.Color.count()) + if(i >= fb.drawFBO.colorAttachments.count()) continue; - rows.push_back({i, b.Enabled ? tr("Yes") : tr("No"), ToQStr(b.m_Blend.Source), - ToQStr(b.m_Blend.Destination), ToQStr(b.m_Blend.Operation), - ToQStr(b.m_AlphaBlend.Source), ToQStr(b.m_AlphaBlend.Destination), - ToQStr(b.m_AlphaBlend.Operation), ToQStr(b.Logic), - ((b.WriteMask & 0x1) == 0 ? tr("_") : tr("R")) + - ((b.WriteMask & 0x2) == 0 ? tr("_") : tr("G")) + - ((b.WriteMask & 0x4) == 0 ? tr("_") : tr("B")) + - ((b.WriteMask & 0x8) == 0 ? tr("_") : tr("A"))}); + rows.push_back({i, b.enabled ? tr("Yes") : tr("No"), ToQStr(b.colorBlend.source), + ToQStr(b.colorBlend.destination), ToQStr(b.colorBlend.operation), + ToQStr(b.alphaBlend.source), ToQStr(b.alphaBlend.destination), + ToQStr(b.alphaBlend.operation), + b.logicOperationEnabled ? tr("Yes") : tr("No"), ToQStr(b.logicOperation), + ((b.writeMask & 0x1) == 0 ? tr("_") : tr("R")) + + ((b.writeMask & 0x2) == 0 ? tr("_") : tr("G")) + + ((b.writeMask & 0x4) == 0 ? tr("_") : tr("B")) + + ((b.writeMask & 0x8) == 0 ? tr("_") : tr("A"))}); i++; } @@ -3050,7 +3060,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram { tr("Slot"), tr("Blend Enable"), tr("Blend Source"), tr("Blend Destination"), tr("Blend Operation"), tr("Alpha Blend Source"), tr("Alpha Blend Destination"), - tr("Alpha Blend Operation"), tr("Logic Operation"), tr("Write Mask"), + tr("Alpha Blend Operation"), tr("Logic Operation Enabled"), tr("Logic Operation"), + tr("Write Mask"), }, rows); } @@ -3063,13 +3074,13 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram m_Common.exportHTMLTable(xml, {tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function"), tr("Depth Bounds")}, { - pipe.m_DepthState.DepthEnable ? tr("Yes") : tr("No"), - pipe.m_DepthState.DepthWrites ? tr("Yes") : tr("No"), - ToQStr(pipe.m_DepthState.DepthFunc), - pipe.m_DepthState.DepthEnable + pipe.depthState.depthEnable ? tr("Yes") : tr("No"), + pipe.depthState.depthWrites ? tr("Yes") : tr("No"), + ToQStr(pipe.depthState.depthFunction), + pipe.depthState.depthEnable ? QFormatStr("%1 - %2") - .arg(Formatter::Format(pipe.m_DepthState.NearBound)) - .arg(Formatter::Format(pipe.m_DepthState.FarBound)) + .arg(Formatter::Format(pipe.depthState.nearBound)) + .arg(Formatter::Format(pipe.depthState.farBound)) : tr("Disabled"), }); } @@ -3080,7 +3091,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram xml.writeEndElement(); m_Common.exportHTMLTable(xml, {tr("Stencil Test Enable")}, - {pipe.m_StencilState.StencilEnable ? tr("Yes") : tr("No")}); + {pipe.stencilState.stencilEnable ? tr("Yes") : tr("No")}); xml.writeStartElement(tr("p")); xml.writeEndElement(); @@ -3089,21 +3100,21 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram xml, {tr("Face"), tr("Reference"), tr("Value Mask"), tr("Write Mask"), tr("Function"), tr("Pass Operation"), tr("Fail Operation"), tr("Depth Fail Operation")}, { - {tr("Front"), Formatter::Format(pipe.m_StencilState.m_FrontFace.Ref, true), - Formatter::Format(pipe.m_StencilState.m_FrontFace.ValueMask, true), - Formatter::Format(pipe.m_StencilState.m_FrontFace.WriteMask, true), - ToQStr(pipe.m_StencilState.m_FrontFace.Func), - ToQStr(pipe.m_StencilState.m_FrontFace.PassOp), - ToQStr(pipe.m_StencilState.m_FrontFace.FailOp), - ToQStr(pipe.m_StencilState.m_FrontFace.DepthFailOp)}, + {tr("Front"), Formatter::Format(pipe.stencilState.frontFace.reference, true), + Formatter::Format(pipe.stencilState.frontFace.compareMask, true), + Formatter::Format(pipe.stencilState.frontFace.writeMask, true), + ToQStr(pipe.stencilState.frontFace.function), + ToQStr(pipe.stencilState.frontFace.passOperation), + ToQStr(pipe.stencilState.frontFace.failOperation), + ToQStr(pipe.stencilState.frontFace.depthFailOperation)}, - {tr("Back"), Formatter::Format(pipe.m_StencilState.m_BackFace.Ref, true), - Formatter::Format(pipe.m_StencilState.m_BackFace.ValueMask, true), - Formatter::Format(pipe.m_StencilState.m_BackFace.WriteMask, true), - ToQStr(pipe.m_StencilState.m_BackFace.Func), - ToQStr(pipe.m_StencilState.m_BackFace.PassOp), - ToQStr(pipe.m_StencilState.m_BackFace.FailOp), - ToQStr(pipe.m_StencilState.m_BackFace.DepthFailOp)}, + {tr("Back"), Formatter::Format(pipe.stencilState.backFace.reference, true), + Formatter::Format(pipe.stencilState.backFace.compareMask, true), + Formatter::Format(pipe.stencilState.backFace.writeMask, true), + ToQStr(pipe.stencilState.backFace.function), + ToQStr(pipe.stencilState.backFace.passOperation), + ToQStr(pipe.stencilState.backFace.failOperation), + ToQStr(pipe.stencilState.backFace.depthFailOperation)}, }); } @@ -3115,21 +3126,21 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram QList rows; QList atts; - for(const GLPipe::Attachment &att : fb.m_DrawFBO.Color) + for(const GLPipe::Attachment &att : fb.drawFBO.colorAttachments) atts.push_back(&att); - atts.push_back(&fb.m_DrawFBO.Depth); - atts.push_back(&fb.m_DrawFBO.Stencil); + atts.push_back(&fb.drawFBO.depthAttachment); + atts.push_back(&fb.drawFBO.stencilAttachment); int i = 0; for(const GLPipe::Attachment *att : atts) { const GLPipe::Attachment &a = *att; - TextureDescription *tex = m_Ctx.GetTexture(a.Obj); + TextureDescription *tex = m_Ctx.GetTexture(a.resourceId); - QString name = m_Ctx.GetResourceName(a.Obj); + QString name = m_Ctx.GetResourceName(a.resourceId); - if(a.Obj == ResourceId()) + if(a.resourceId == ResourceId()) name = tr("Empty"); QString slotname = QString::number(i); @@ -3139,7 +3150,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram else if(i == atts.count() - 1) slotname = tr("Stencil"); - rows.push_back({slotname, name, a.Mip, a.Layer}); + rows.push_back({slotname, name, a.mipLevel, a.slice}); i++; } @@ -3152,8 +3163,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram QList drawbuffers; - for(i = 0; i < fb.m_DrawFBO.DrawBuffers.count(); i++) - drawbuffers.push_back({fb.m_DrawFBO.DrawBuffers[i]}); + for(i = 0; i < fb.drawFBO.drawBuffers.count(); i++) + drawbuffers.push_back({fb.drawFBO.drawBuffers[i]}); xml.writeStartElement(tr("p")); xml.writeEndElement(); @@ -3173,21 +3184,21 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram QList rows; QList atts; - for(const GLPipe::Attachment &att : fb.m_ReadFBO.Color) + for(const GLPipe::Attachment &att : fb.readFBO.colorAttachments) atts.push_back(&att); - atts.push_back(&fb.m_ReadFBO.Depth); - atts.push_back(&fb.m_ReadFBO.Stencil); + atts.push_back(&fb.readFBO.depthAttachment); + atts.push_back(&fb.readFBO.stencilAttachment); int i = 0; for(const GLPipe::Attachment *att : atts) { const GLPipe::Attachment &a = *att; - TextureDescription *tex = m_Ctx.GetTexture(a.Obj); + TextureDescription *tex = m_Ctx.GetTexture(a.resourceId); - QString name = m_Ctx.GetResourceName(a.Obj); + QString name = m_Ctx.GetResourceName(a.resourceId); - if(a.Obj == ResourceId()) + if(a.resourceId == ResourceId()) name = tr("Empty"); QString slotname = QString::number(i); @@ -3197,7 +3208,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram else if(i == atts.count() - 1) slotname = tr("Stencil"); - rows.push_back({slotname, name, a.Mip, a.Layer}); + rows.push_back({slotname, name, a.mipLevel, a.slice}); i++; } @@ -3215,7 +3226,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram { tr("Read Buffer"), }, - {fb.m_ReadFBO.ReadBuffer}); + {fb.readFBO.readBuffer}); } } @@ -3248,18 +3259,18 @@ void GLPipelineStateViewer::on_exportHTML_clicked() switch(stage) { - case 0: exportHTML(xml, m_Ctx.CurGLPipelineState().m_VtxIn); break; - case 1: exportHTML(xml, m_Ctx.CurGLPipelineState().m_VS); break; - case 2: exportHTML(xml, m_Ctx.CurGLPipelineState().m_TCS); break; - case 3: exportHTML(xml, m_Ctx.CurGLPipelineState().m_TES); break; + case 0: exportHTML(xml, m_Ctx.CurGLPipelineState().vertexInput); break; + case 1: exportHTML(xml, m_Ctx.CurGLPipelineState().vertexShader); break; + case 2: exportHTML(xml, m_Ctx.CurGLPipelineState().tessControlShader); break; + case 3: exportHTML(xml, m_Ctx.CurGLPipelineState().tessEvalShader); break; case 4: - exportHTML(xml, m_Ctx.CurGLPipelineState().m_GS); - exportHTML(xml, m_Ctx.CurGLPipelineState().m_Feedback); + exportHTML(xml, m_Ctx.CurGLPipelineState().geometryShader); + exportHTML(xml, m_Ctx.CurGLPipelineState().transformFeedback); break; - case 5: exportHTML(xml, m_Ctx.CurGLPipelineState().m_Rasterizer); break; - case 6: exportHTML(xml, m_Ctx.CurGLPipelineState().m_FS); break; - case 7: exportHTML(xml, m_Ctx.CurGLPipelineState().m_FB); break; - case 8: exportHTML(xml, m_Ctx.CurGLPipelineState().m_CS); break; + case 5: exportHTML(xml, m_Ctx.CurGLPipelineState().rasterizer); break; + case 6: exportHTML(xml, m_Ctx.CurGLPipelineState().fragmentShader); break; + case 7: exportHTML(xml, m_Ctx.CurGLPipelineState().framebuffer); break; + case 8: exportHTML(xml, m_Ctx.CurGLPipelineState().computeShader); break; } xml.writeEndElement(); diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.h b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.h index 0386e4845..08d0f2d2b 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.h +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.h @@ -51,8 +51,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: // automatic slots diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp index 8609a0b34..1de3ce124 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp @@ -85,13 +85,13 @@ void PipelineStateViewer::OnCaptureClosed() m_Current->OnCaptureClosed(); } -void PipelineStateViewer::OnEventChanged(uint32_t eventID) +void PipelineStateViewer::OnEventChanged(uint32_t eventId) { - if(m_Ctx.CurPipelineState().DefaultType != m_Ctx.APIProps().pipelineType) + if(m_Ctx.CurPipelineState().defaultType != m_Ctx.APIProps().pipelineType) OnCaptureLoaded(); if(m_Current) - m_Current->OnEventChanged(eventID); + m_Current->OnEventChanged(eventId); } QString PipelineStateViewer::GetCurrentAPI() @@ -156,7 +156,7 @@ void PipelineStateViewer::setToD3D11() m_D3D11 = new D3D11PipelineStateViewer(m_Ctx, *this, this); ui->layout->addWidget(m_D3D11); m_Current = m_D3D11; - m_Ctx.CurPipelineState().DefaultType = GraphicsAPI::D3D11; + m_Ctx.CurPipelineState().defaultType = GraphicsAPI::D3D11; } void PipelineStateViewer::setToD3D12() @@ -169,7 +169,7 @@ void PipelineStateViewer::setToD3D12() m_D3D12 = new D3D12PipelineStateViewer(m_Ctx, *this, this); ui->layout->addWidget(m_D3D12); m_Current = m_D3D12; - m_Ctx.CurPipelineState().DefaultType = GraphicsAPI::D3D12; + m_Ctx.CurPipelineState().defaultType = GraphicsAPI::D3D12; } void PipelineStateViewer::setToGL() @@ -182,7 +182,7 @@ void PipelineStateViewer::setToGL() m_GL = new GLPipelineStateViewer(m_Ctx, *this, this); ui->layout->addWidget(m_GL); m_Current = m_GL; - m_Ctx.CurPipelineState().DefaultType = GraphicsAPI::OpenGL; + m_Ctx.CurPipelineState().defaultType = GraphicsAPI::OpenGL; } void PipelineStateViewer::setToVulkan() @@ -195,7 +195,7 @@ void PipelineStateViewer::setToVulkan() m_Vulkan = new VulkanPipelineStateViewer(m_Ctx, *this, this); ui->layout->addWidget(m_Vulkan); m_Current = m_Vulkan; - m_Ctx.CurPipelineState().DefaultType = GraphicsAPI::Vulkan; + m_Ctx.CurPipelineState().defaultType = GraphicsAPI::Vulkan; } QXmlStreamWriter *PipelineStateViewer::beginHTMLExport() @@ -542,15 +542,15 @@ void PipelineStateViewer::setMeshViewPixmap(RDLabel *meshView) bool PipelineStateViewer::PrepareShaderEditing(const ShaderReflection *shaderDetails, QString &entryFunc, rdcstrpairs &files) { - if(!shaderDetails->DebugInfo.files.empty()) + if(!shaderDetails->debugInfo.files.empty()) { - entryFunc = shaderDetails->EntryPoint; + entryFunc = shaderDetails->entryPoint; QStringList uniqueFiles; - for(const ShaderSourceFile &s : shaderDetails->DebugInfo.files) + for(const ShaderSourceFile &s : shaderDetails->debugInfo.files) { - QString filename = s.Filename; + QString filename = s.filename; if(uniqueFiles.contains(filename.toLower())) { qWarning() << lit("Duplicate full filename") << filename; @@ -558,7 +558,7 @@ bool PipelineStateViewer::PrepareShaderEditing(const ShaderReflection *shaderDet } uniqueFiles.push_back(filename.toLower()); - files.push_back(make_rdcpair(s.Filename, s.Contents)); + files.push_back(make_rdcpair(s.filename, s.contents)); } return true; @@ -610,13 +610,13 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta { QString hlsl = lit("// No HLSL available - function stub generated\n\n"); - const QString textureDim[ENUM_ARRAY_SIZE(TextureDim)] = { + const QString textureDim[ENUM_ARRAY_SIZE(TextureType)] = { lit("Unknown"), lit("Buffer"), lit("Texture1D"), lit("Texture1DArray"), lit("Texture2D"), lit("TextureRect"), lit("Texture2DArray"), lit("Texture2DMS"), lit("Texture2DMSArray"), lit("Texture3D"), lit("TextureCube"), lit("TextureCubeArray"), }; - for(const ShaderSampler &samp : shaderDetails->Samplers) + for(const ShaderSampler &samp : shaderDetails->samplers) { hlsl += lit("//SamplerComparisonState %1 : register(s%2); // can't disambiguate\n" "SamplerState %1 : register(s%2); // can't disambiguate\n") @@ -627,7 +627,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta for(int i = 0; i < 2; i++) { const rdcarray &resources = - (i == 0 ? shaderDetails->ReadOnlyResources : shaderDetails->ReadWriteResources); + (i == 0 ? shaderDetails->readOnlyResources : shaderDetails->readWriteResources); for(const ShaderResource &res : resources) { char regChar = 't'; @@ -638,7 +638,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta regChar = 'u'; } - if(res.IsTexture) + if(res.isTexture) { hlsl += lit("%1<%2> %3 : register(%4%5);\n") .arg(textureDim[(size_t)res.resType]) @@ -666,7 +666,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta QString cbuffers; int cbufIdx = 0; - for(const ConstantBlock &cbuf : shaderDetails->ConstantBlocks) + for(const ConstantBlock &cbuf : shaderDetails->constantBlocks) { if(!cbuf.name.isEmpty() && !cbuf.variables.isEmpty()) { @@ -685,7 +685,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta hlsl += lit("\n\n"); hlsl += lit("struct InputStruct {\n"); - for(const SigParameter &sig : shaderDetails->InputSig) + for(const SigParameter &sig : shaderDetails->inputSignature) hlsl += lit("\t%1 %2 : %3;\n") .arg(TypeString(sig)) .arg(!sig.varName.isEmpty() ? QString(sig.varName) : lit("param%1").arg(sig.regIndex)) @@ -693,7 +693,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta hlsl += lit("};\n\n"); hlsl += lit("struct OutputStruct {\n"); - for(const SigParameter &sig : shaderDetails->OutputSig) + for(const SigParameter &sig : shaderDetails->outputSignature) hlsl += lit("\t%1 %2 : %3;\n") .arg(TypeString(sig)) .arg(!sig.varName.isEmpty() ? QString(sig.varName) : lit("param%1").arg(sig.regIndex)) @@ -833,7 +833,7 @@ void PipelineStateViewer::EditShader(ShaderStage shaderType, ResourceId id, viewer](IReplayController *r) { rdcstr errs; - const ShaderCompileFlags &flags = shaderDetails->DebugInfo.compileFlags; + const ShaderCompileFlags &flags = shaderDetails->debugInfo.compileFlags; ResourceId from = id; ResourceId to; @@ -900,7 +900,7 @@ bool PipelineStateViewer::SaveShaderFile(const ShaderReflection *shader) QFile f(filename); if(f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - f.write((const char *)shader->RawBytes.data(), (qint64)shader->RawBytes.size()); + f.write((const char *)shader->rawBytes.data(), (qint64)shader->rawBytes.size()); } else { diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.h b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.h index 7be8d715d..7938e5ce4 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.h +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.h @@ -59,8 +59,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; QVariant persistData(); diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index a3a97ad3a..fd3be1abf 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -357,7 +357,7 @@ void VulkanPipelineStateViewer::OnCaptureClosed() clearState(); } -void VulkanPipelineStateViewer::OnEventChanged(uint32_t eventID) +void VulkanPipelineStateViewer::OnEventChanged(uint32_t eventId) { setState(); } @@ -397,47 +397,47 @@ void VulkanPipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const bin { for(const VKPipe::ImageData &im : m_Ctx.CurVulkanPipelineState().images) { - if(im.image == tex->ID) + if(im.resourceId == tex->resourceId) { text += tr("Texture is in the '%1' layout\n\n").arg(im.layouts[0].name); break; } } - if(view.viewfmt != tex->format) + if(view.viewFormat != tex->format) { text += tr("The texture is format %1, the view treats it as %2.\n") .arg(tex->format.Name()) - .arg(view.viewfmt.Name()); + .arg(view.viewFormat.Name()); viewdetails = true; } - if(tex->mips > 1 && (tex->mips != view.numMip || view.baseMip > 0)) + if(tex->mips > 1 && (tex->mips != view.numMips || view.firstMip > 0)) { - if(view.numMip == 1) + if(view.numMips == 1) text += - tr("The texture has %1 mips, the view covers mip %2.\n").arg(tex->mips).arg(view.baseMip); + tr("The texture has %1 mips, the view covers mip %2.\n").arg(tex->mips).arg(view.firstMip); else text += tr("The texture has %1 mips, the view covers mips %2-%3.\n") .arg(tex->mips) - .arg(view.baseMip) - .arg(view.baseMip + view.numMip - 1); + .arg(view.firstMip) + .arg(view.firstMip + view.numMips - 1); viewdetails = true; } - if(tex->arraysize > 1 && (tex->arraysize != view.numLayer || view.baseLayer > 0)) + if(tex->arraysize > 1 && (tex->arraysize != view.numSlices || view.firstSlice > 0)) { - if(view.numLayer == 1) + if(view.numSlices == 1) text += tr("The texture has %1 array slices, the view covers slice %2.\n") .arg(tex->arraysize) - .arg(view.baseLayer); + .arg(view.firstSlice); else text += tr("The texture has %1 array slices, the view covers slices %2-%3.\n") .arg(tex->arraysize) - .arg(view.baseLayer) - .arg(view.baseLayer + view.numLayer); + .arg(view.firstSlice) + .arg(view.firstSlice + view.numSlices); viewdetails = true; } @@ -463,11 +463,11 @@ void VulkanPipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const bin QString text; - if(view.offset > 0 || view.size < buf->length) + if(view.byteOffset > 0 || view.byteSize < buf->length) { text += tr("The view covers bytes %1-%2.\nThe buffer is %3 bytes in length.") - .arg(view.offset) - .arg(view.offset + view.size) + .arg(view.byteOffset) + .arg(view.byteOffset + view.byteSize) .arg(buf->length); } else @@ -508,23 +508,23 @@ const VKPipe::Shader *VulkanPipelineStateViewer::stageForSender(QWidget *widget) while(widget) { if(widget == ui->stagesTabs->widget(0)) - return &m_Ctx.CurVulkanPipelineState().m_VS; + return &m_Ctx.CurVulkanPipelineState().vertexShader; if(widget == ui->stagesTabs->widget(1)) - return &m_Ctx.CurVulkanPipelineState().m_VS; + return &m_Ctx.CurVulkanPipelineState().vertexShader; if(widget == ui->stagesTabs->widget(2)) - return &m_Ctx.CurVulkanPipelineState().m_TCS; + return &m_Ctx.CurVulkanPipelineState().tessControlShader; if(widget == ui->stagesTabs->widget(3)) - return &m_Ctx.CurVulkanPipelineState().m_TES; + return &m_Ctx.CurVulkanPipelineState().tessEvalShader; if(widget == ui->stagesTabs->widget(4)) - return &m_Ctx.CurVulkanPipelineState().m_GS; + return &m_Ctx.CurVulkanPipelineState().geometryShader; if(widget == ui->stagesTabs->widget(5)) - return &m_Ctx.CurVulkanPipelineState().m_FS; + return &m_Ctx.CurVulkanPipelineState().fragmentShader; if(widget == ui->stagesTabs->widget(6)) - return &m_Ctx.CurVulkanPipelineState().m_FS; + return &m_Ctx.CurVulkanPipelineState().fragmentShader; if(widget == ui->stagesTabs->widget(7)) - return &m_Ctx.CurVulkanPipelineState().m_FS; + return &m_Ctx.CurVulkanPipelineState().fragmentShader; if(widget == ui->stagesTabs->widget(8)) - return &m_Ctx.CurVulkanPipelineState().m_CS; + return &m_Ctx.CurVulkanPipelineState().computeShader; widget = widget->parentWidget(); } @@ -611,8 +611,8 @@ QVariantList VulkanPipelineStateViewer::makeSampler(const QString &bindset, cons QString filter; - QString addr[] = {ToQStr(descriptor.AddressU), ToQStr(descriptor.AddressV), - ToQStr(descriptor.AddressW)}; + QString addr[] = {ToQStr(descriptor.addressU), ToQStr(descriptor.addressV), + ToQStr(descriptor.addressW)}; // arrange like either UVW: WRAP or UV: WRAP, W: CLAMP for(int a = 0; a < 3; a++) @@ -636,28 +636,28 @@ QVariantList VulkanPipelineStateViewer::makeSampler(const QString &bindset, cons if(descriptor.UseBorder()) addressing += QFormatStr(" <%1, %2, %3, %4>") - .arg(descriptor.BorderColor[0]) - .arg(descriptor.BorderColor[1]) - .arg(descriptor.BorderColor[2]) - .arg(descriptor.BorderColor[3]); + .arg(descriptor.borderColor[0]) + .arg(descriptor.borderColor[1]) + .arg(descriptor.borderColor[2]) + .arg(descriptor.borderColor[3]); if(descriptor.unnormalized) addressing += lit(" (Un-norm)"); - filter = ToQStr(descriptor.Filter); + filter = ToQStr(descriptor.filter); - if(descriptor.maxAniso > 1.0f) - filter += lit(" Aniso %1x").arg(descriptor.maxAniso); + if(descriptor.maxAnisotropy > 1.0f) + filter += lit(" Aniso %1x").arg(descriptor.maxAnisotropy); - if(descriptor.Filter.func == FilterFunc::Comparison) - filter += QFormatStr(" (%1)").arg(ToQStr(descriptor.comparison)); - else if(descriptor.Filter.func != FilterFunc::Normal) - filter += QFormatStr(" (%1)").arg(ToQStr(descriptor.Filter.func)); + if(descriptor.filter.filter == FilterFunction::Comparison) + filter += QFormatStr(" (%1)").arg(ToQStr(descriptor.compareFunction)); + else if(descriptor.filter.filter != FilterFunction::Normal) + filter += QFormatStr(" (%1)").arg(ToQStr(descriptor.filter.filter)); QString lod = lit("LODs: %1 - %2") - .arg((descriptor.minlod == -FLT_MAX ? lit("0") : QString::number(descriptor.minlod))) - .arg((descriptor.maxlod == FLT_MAX ? lit("FLT_MAX") : QString::number(descriptor.maxlod))); + .arg((descriptor.minLOD == -FLT_MAX ? lit("0") : QString::number(descriptor.minLOD))) + .arg((descriptor.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(descriptor.maxLOD))); if(descriptor.mipBias != 0.0f) lod += lit(" Bias %1").arg(descriptor.mipBias); @@ -666,7 +666,7 @@ QVariantList VulkanPipelineStateViewer::makeSampler(const QString &bindset, cons bindset, slotname, descriptor.immutableSampler ? tr("Immutable Sampler") : tr("Sampler"), - descriptor.res, + descriptor.resourceResourceId, addressing, filter + lit(", ") + lod, QString()}; @@ -679,7 +679,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, { const ShaderResource *shaderRes = NULL; const ShaderSampler *shaderSamp = NULL; - const BindpointMap *bindMap = NULL; + const Bindpoint *bindMap = NULL; bool isrw = false; uint bindPoint = 0; @@ -706,61 +706,61 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, // there's no used resource at all, the first declared unused resource (which will prefer // resources with proper bindings over those without, as with the sorting mentioned above). - for(int i = 0; i < shaderDetails->Samplers.count(); i++) + for(int i = 0; i < shaderDetails->samplers.count(); i++) { - const ShaderSampler &s = shaderDetails->Samplers[i]; + const ShaderSampler &s = shaderDetails->samplers[i]; - if(stage.BindpointMapping.Samplers[s.bindPoint].bindset == bindset && - stage.BindpointMapping.Samplers[s.bindPoint].bind == bind) + if(stage.bindpointMapping.samplers[s.bindPoint].bindset == bindset && + stage.bindpointMapping.samplers[s.bindPoint].bind == bind) { // use this one either if we have no candidate, or the candidate we have is unused and this // one is used - if(bindMap == NULL || (!bindMap->used && stage.BindpointMapping.Samplers[s.bindPoint].used)) + if(bindMap == NULL || (!bindMap->used && stage.bindpointMapping.samplers[s.bindPoint].used)) { bindPoint = (uint)i; shaderSamp = &s; - bindMap = &stage.BindpointMapping.Samplers[s.bindPoint]; + bindMap = &stage.bindpointMapping.samplers[s.bindPoint]; } } } - for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) + for(int i = 0; i < shaderDetails->readOnlyResources.count(); i++) { - const ShaderResource &ro = shaderDetails->ReadOnlyResources[i]; + const ShaderResource &ro = shaderDetails->readOnlyResources[i]; - if(stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset == bindset && - stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind == bind) + if(stage.bindpointMapping.readOnlyResources[ro.bindPoint].bindset == bindset && + stage.bindpointMapping.readOnlyResources[ro.bindPoint].bind == bind) { // use this one either if we have no candidate, or the candidate we have is unused and this // one is used if(bindMap == NULL || - (!bindMap->used && stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].used)) + (!bindMap->used && stage.bindpointMapping.readOnlyResources[ro.bindPoint].used)) { bindPoint = (uint)i; shaderRes = &ro; shaderSamp = NULL; - bindMap = &stage.BindpointMapping.ReadOnlyResources[ro.bindPoint]; + bindMap = &stage.bindpointMapping.readOnlyResources[ro.bindPoint]; } } } - for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) + for(int i = 0; i < shaderDetails->readWriteResources.count(); i++) { - const ShaderResource &rw = shaderDetails->ReadWriteResources[i]; + const ShaderResource &rw = shaderDetails->readWriteResources[i]; - if(stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset == bindset && - stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind == bind) + if(stage.bindpointMapping.readWriteResources[rw.bindPoint].bindset == bindset && + stage.bindpointMapping.readWriteResources[rw.bindPoint].bind == bind) { // use this one either if we have no candidate, or the candidate we have is unused and this // one is used if(bindMap == NULL || - (!bindMap->used && stage.BindpointMapping.ReadWriteResources[rw.bindPoint].used)) + (!bindMap->used && stage.bindpointMapping.readWriteResources[rw.bindPoint].used)) { bindPoint = (uint)i; isrw = true; shaderRes = &rw; shaderSamp = NULL; - bindMap = &stage.BindpointMapping.ReadWriteResources[rw.bindPoint]; + bindMap = &stage.bindpointMapping.readWriteResources[rw.bindPoint]; } } } @@ -770,17 +770,17 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, BindType bindType = BindType::Unknown; ShaderStageMask stageBits = ShaderStageMask::Unknown; - if(bindset < pipe.DescSets.count() && bind < pipe.DescSets[bindset].bindings.count()) + if(bindset < pipe.descriptorSets.count() && bind < pipe.descriptorSets[bindset].bindings.count()) { - slotBinds = &pipe.DescSets[bindset].bindings[bind].binds; - bindType = pipe.DescSets[bindset].bindings[bind].type; - stageBits = pipe.DescSets[bindset].bindings[bind].stageFlags; + slotBinds = &pipe.descriptorSets[bindset].bindings[bind].binds; + bindType = pipe.descriptorSets[bindset].bindings[bind].type; + stageBits = pipe.descriptorSets[bindset].bindings[bind].stageFlags; } else { if(shaderSamp) bindType = BindType::Sampler; - else if(shaderRes && shaderRes->resType == TextureDim::Buffer) + else if(shaderRes && shaderRes->resType == TextureType::Buffer) bindType = isrw ? BindType::ReadWriteBuffer : BindType::ReadOnlyBuffer; else bindType = isrw ? BindType::ReadWriteImage : BindType::ReadOnlyImage; @@ -802,9 +802,9 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, bool filledSlot = false; for(int idx = 0; slotBinds != NULL && idx < slotBinds->count(); idx++) { - filledSlot |= (*slotBinds)[idx].res != ResourceId(); + filledSlot |= (*slotBinds)[idx].resourceResourceId != ResourceId(); if(bindType == BindType::Sampler || bindType == BindType::ImageSampler) - filledSlot |= (*slotBinds)[idx].sampler != ResourceId(); + filledSlot |= (*slotBinds)[idx].samplerResourceId != ResourceId(); } // if it's masked out by stage bits, act as if it's not filled, so it's marked in red @@ -871,34 +871,34 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, uint32_t samples = 1; uint64_t len = 0; QString format = tr("Unknown"); - TextureDim restype = TextureDim::Unknown; + TextureType restype = TextureType::Unknown; QVariant tag; TextureDescription *tex = NULL; BufferDescription *buf = NULL; - uint64_t descriptorLen = descriptorBind ? descriptorBind->size : 0; + uint64_t descriptorLen = descriptorBind ? descriptorBind->byteSize : 0; if(filledSlot && descriptorBind != NULL) { - format = descriptorBind->viewfmt.Name(); + format = descriptorBind->viewFormat.Name(); // check to see if it's a texture - tex = m_Ctx.GetTexture(descriptorBind->res); + tex = m_Ctx.GetTexture(descriptorBind->resourceResourceId); if(tex) { w = tex->width; h = tex->height; d = tex->depth; a = tex->arraysize; - restype = tex->resType; + restype = tex->type; samples = tex->msSamp; - tag = QVariant::fromValue(descriptorBind->res); + tag = QVariant::fromValue(descriptorBind->resourceResourceId); } // if not a texture, it must be a buffer - buf = m_Ctx.GetBuffer(descriptorBind->res); + buf = m_Ctx.GetBuffer(descriptorBind->resourceResourceId); if(buf) { len = buf->length; @@ -906,13 +906,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, h = 0; d = 0; a = 0; - restype = TextureDim::Buffer; + restype = TextureType::Buffer; if(descriptorLen == UINT64_MAX) - descriptorLen = len - descriptorBind->offset; + descriptorLen = len - descriptorBind->byteOffset; - tag = QVariant::fromValue( - VulkanBufferTag(isrw, bindPoint, buf->ID, descriptorBind->offset, descriptorLen)); + tag = QVariant::fromValue(VulkanBufferTag(isrw, bindPoint, buf->resourceId, + descriptorBind->byteOffset, descriptorLen)); isbuf = true; } @@ -942,12 +942,12 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, { QString range = lit("-"); if(descriptorBind != NULL) - range = QFormatStr("%1 - %2").arg(descriptorBind->offset).arg(descriptorLen); + range = QFormatStr("%1 - %2").arg(descriptorBind->byteOffset).arg(descriptorLen); node = new RDTreeWidgetItem({ QString(), bindset, slotname, ToQStr(bindType), - descriptorBind ? descriptorBind->res : ResourceId(), tr("%1 bytes").arg(len), range, - QString(), + descriptorBind ? descriptorBind->resourceResourceId : ResourceId(), + tr("%1 bytes").arg(len), range, QString(), }); node->setTag(tag); @@ -961,7 +961,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, } else if(bindType == BindType::Sampler) { - if(descriptorBind == NULL || descriptorBind->sampler == ResourceId()) + if(descriptorBind == NULL || descriptorBind->samplerResourceId == ResourceId()) { node = new RDTreeWidgetItem({ QString(), bindset, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), @@ -985,13 +985,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, sampData.node = node; node->setTag(QVariant::fromValue(sampData)); - if(!samplers.contains(descriptorBind->sampler)) - samplers.insert(descriptorBind->sampler, sampData); + if(!samplers.contains(descriptorBind->samplerResourceId)) + samplers.insert(descriptorBind->samplerResourceId, sampData); } } else { - if(descriptorBind == NULL || descriptorBind->res == ResourceId()) + if(descriptorBind == NULL || descriptorBind->resourceResourceId == ResourceId()) { node = new RDTreeWidgetItem({ QString(), bindset, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), @@ -1006,9 +1006,9 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, QString dim; - if(restype == TextureDim::Texture3D) + if(restype == TextureType::Texture3D) dim = QFormatStr("%1x%2x%3").arg(w).arg(h).arg(d); - else if(restype == TextureDim::Texture1D || restype == TextureDim::Texture1DArray) + else if(restype == TextureType::Texture1D || restype == TextureType::Texture1DArray) dim = QString::number(w); else dim = QFormatStr("%1x%2").arg(w).arg(h); @@ -1025,17 +1025,18 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, .arg(ToQStr(descriptorBind->swizzle[3])); } - if(restype == TextureDim::Texture1DArray || restype == TextureDim::Texture2DArray || - restype == TextureDim::Texture2DMSArray || restype == TextureDim::TextureCubeArray) + if(restype == TextureType::Texture1DArray || restype == TextureType::Texture2DArray || + restype == TextureType::Texture2DMSArray || restype == TextureType::TextureCubeArray) { dim += QFormatStr(" %1[%2]").arg(ToQStr(restype)).arg(a); } - if(restype == TextureDim::Texture2DMS || restype == TextureDim::Texture2DMSArray) + if(restype == TextureType::Texture2DMS || restype == TextureType::Texture2DMSArray) dim += QFormatStr(", %1x MSAA").arg(samples); node = new RDTreeWidgetItem({ - QString(), bindset, slotname, typeName, descriptorBind->res, dim, format, QString(), + QString(), bindset, slotname, typeName, descriptorBind->resourceResourceId, dim, + format, QString(), }); node->setTag(tag); @@ -1049,7 +1050,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, if(bindType == BindType::ImageSampler) { - if(descriptorBind == NULL || descriptorBind->sampler == ResourceId()) + if(descriptorBind == NULL || descriptorBind->samplerResourceId == ResourceId()) { samplerNode = new RDTreeWidgetItem({ QString(), bindset, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), @@ -1059,7 +1060,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, } else { - if(!samplers.contains(descriptorBind->sampler)) + if(!samplers.contains(descriptorBind->samplerResourceId)) { samplerNode = new RDTreeWidgetItem(makeSampler(QString(), QString(), *descriptorBind)); @@ -1073,13 +1074,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, sampData.node = samplerNode; samplerNode->setTag(QVariant::fromValue(sampData)); - samplers.insert(descriptorBind->sampler, sampData); + samplers.insert(descriptorBind->samplerResourceId, sampData); } if(node != NULL) { - m_CombinedImageSamplers[node] = samplers[descriptorBind->sampler].node; - samplers[descriptorBind->sampler].images.push_back(node); + m_CombinedImageSamplers[node] = samplers[descriptorBind->samplerResourceId].node; + samplers[descriptorBind->samplerResourceId].images.push_back(node); } } } @@ -1104,24 +1105,24 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta RDTreeWidget *ubos) { const ConstantBlock *cblock = NULL; - const BindpointMap *bindMap = NULL; + const Bindpoint *bindMap = NULL; uint32_t slot = ~0U; if(shaderDetails != NULL) { - for(slot = 0; slot < (uint)shaderDetails->ConstantBlocks.count(); slot++) + for(slot = 0; slot < (uint)shaderDetails->constantBlocks.count(); slot++) { - const ConstantBlock &cb = shaderDetails->ConstantBlocks[slot]; - if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset == bindset && - stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bind == bind) + const ConstantBlock &cb = shaderDetails->constantBlocks[slot]; + if(stage.bindpointMapping.constantBlocks[cb.bindPoint].bindset == bindset && + stage.bindpointMapping.constantBlocks[cb.bindPoint].bind == bind) { cblock = &cb; - bindMap = &stage.BindpointMapping.ConstantBlocks[cb.bindPoint]; + bindMap = &stage.bindpointMapping.constantBlocks[cb.bindPoint]; break; } } - if(slot >= (uint)shaderDetails->ConstantBlocks.count()) + if(slot >= (uint)shaderDetails->constantBlocks.count()) slot = ~0U; } @@ -1129,11 +1130,11 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta BindType bindType = BindType::ConstantBuffer; ShaderStageMask stageBits = ShaderStageMask::Unknown; - if(bindset < pipe.DescSets.count() && bind < pipe.DescSets[bindset].bindings.count()) + if(bindset < pipe.descriptorSets.count() && bind < pipe.descriptorSets[bindset].bindings.count()) { - slotBinds = &pipe.DescSets[bindset].bindings[bind].binds; - bindType = pipe.DescSets[bindset].bindings[bind].type; - stageBits = pipe.DescSets[bindset].bindings[bind].stageFlags; + slotBinds = &pipe.descriptorSets[bindset].bindings[bind].binds; + bindType = pipe.descriptorSets[bindset].bindings[bind].type; + stageBits = pipe.descriptorSets[bindset].bindings[bind].stageFlags; } bool usedSlot = bindMap != NULL && bindMap->used; @@ -1149,7 +1150,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta // consider it filled if any array element is filled (or it's push constants) bool filledSlot = cblock != NULL && !cblock->bufferBacked; for(int idx = 0; slotBinds != NULL && idx < slotBinds->count(); idx++) - filledSlot |= (*slotBinds)[idx].res != ResourceId(); + filledSlot |= (*slotBinds)[idx].resourceResourceId != ResourceId(); // if it's masked out by stage bits, act as if it's not filled, so it's marked in red if(!stageBitsIncluded) @@ -1210,19 +1211,19 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta if(filledSlot && descriptorBind != NULL) { - length = descriptorBind->size; + length = descriptorBind->byteSize; - BufferDescription *buf = m_Ctx.GetBuffer(descriptorBind->res); + BufferDescription *buf = m_Ctx.GetBuffer(descriptorBind->resourceResourceId); if(buf && length == UINT64_MAX) - length = buf->length - descriptorBind->offset; + length = buf->length - descriptorBind->byteOffset; vecrange = - QFormatStr("%1 - %2").arg(descriptorBind->offset).arg(descriptorBind->offset + length); + QFormatStr("%1 - %2").arg(descriptorBind->byteOffset).arg(descriptorBind->byteOffset + length); } QString sizestr; - QVariant name = descriptorBind ? descriptorBind->res : ResourceId(); + QVariant name = descriptorBind ? descriptorBind->resourceResourceId : ResourceId(); // push constants or specialization constants if(cblock != NULL && !cblock->bufferBacked) @@ -1268,19 +1269,20 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, const VKPipe::Pipeline &pipe, RDLabel *shader, RDTreeWidget *resources, RDTreeWidget *ubos) { - ShaderReflection *shaderDetails = stage.ShaderDetails; + ShaderReflection *shaderDetails = stage.reflection; - shader->setText(QFormatStr("%1: %2").arg(ToQStr(pipe.obj)).arg(ToQStr(stage.Object))); + shader->setText( + QFormatStr("%1: %2").arg(ToQStr(pipe.pipelineResourceId)).arg(ToQStr(stage.resourceId))); if(shaderDetails != NULL) { - QString entryFunc = shaderDetails->EntryPoint; - if(!shaderDetails->DebugInfo.files.isEmpty() || entryFunc != lit("main")) + QString entryFunc = shaderDetails->entryPoint; + if(!shaderDetails->debugInfo.files.isEmpty() || entryFunc != lit("main")) shader->setText(entryFunc + lit("()")); - if(!shaderDetails->DebugInfo.files.isEmpty()) + if(!shaderDetails->debugInfo.files.isEmpty()) shader->setText(entryFunc + lit("() - ") + - QFileInfo(shaderDetails->DebugInfo.files[0].Filename).fileName()); + QFileInfo(shaderDetails->debugInfo.files[0].filename).fileName()); } int vs = 0; @@ -1296,9 +1298,9 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, QMap samplers; - for(int bindset = 0; bindset < pipe.DescSets.count(); bindset++) + for(int bindset = 0; bindset < pipe.descriptorSets.count(); bindset++) { - for(int bind = 0; bind < pipe.DescSets[bindset].bindings.count(); bind++) + for(int bind = 0; bind < pipe.descriptorSets[bindset].bindings.count(); bind++) { addResourceRow(shaderDetails, stage, bindset, bind, pipe, resources, samplers); } @@ -1308,30 +1310,30 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // in this descriptor set (e.g. if layout mismatches) if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) + for(int i = 0; i < shaderDetails->readOnlyResources.count(); i++) { - const ShaderResource &ro = shaderDetails->ReadOnlyResources[i]; + const ShaderResource &ro = shaderDetails->readOnlyResources[i]; - if(stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset == bindset && - stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind >= - pipe.DescSets[bindset].bindings.count()) + if(stage.bindpointMapping.readOnlyResources[ro.bindPoint].bindset == bindset && + stage.bindpointMapping.readOnlyResources[ro.bindPoint].bind >= + pipe.descriptorSets[bindset].bindings.count()) { addResourceRow(shaderDetails, stage, bindset, - stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind, pipe, + stage.bindpointMapping.readOnlyResources[ro.bindPoint].bind, pipe, resources, samplers); } } - for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) + for(int i = 0; i < shaderDetails->readWriteResources.count(); i++) { - const ShaderResource &rw = shaderDetails->ReadWriteResources[i]; + const ShaderResource &rw = shaderDetails->readWriteResources[i]; - if(stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset == bindset && - stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind >= - pipe.DescSets[bindset].bindings.count()) + if(stage.bindpointMapping.readWriteResources[rw.bindPoint].bindset == bindset && + stage.bindpointMapping.readWriteResources[rw.bindPoint].bind >= + pipe.descriptorSets[bindset].bindings.count()) { addResourceRow(shaderDetails, stage, bindset, - stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind, pipe, + stage.bindpointMapping.readWriteResources[rw.bindPoint].bind, pipe, resources, samplers); } } @@ -1343,27 +1345,28 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // bound at all if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) + for(int i = 0; i < shaderDetails->readOnlyResources.count(); i++) { - const ShaderResource &ro = shaderDetails->ReadOnlyResources[i]; + const ShaderResource &ro = shaderDetails->readOnlyResources[i]; - if(stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset >= pipe.DescSets.count()) + if(stage.bindpointMapping.readOnlyResources[ro.bindPoint].bindset >= pipe.descriptorSets.count()) { addResourceRow( - shaderDetails, stage, stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset, - stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind, pipe, resources, samplers); + shaderDetails, stage, stage.bindpointMapping.readOnlyResources[ro.bindPoint].bindset, + stage.bindpointMapping.readOnlyResources[ro.bindPoint].bind, pipe, resources, samplers); } } - for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) + for(int i = 0; i < shaderDetails->readWriteResources.count(); i++) { - const ShaderResource &rw = shaderDetails->ReadWriteResources[i]; + const ShaderResource &rw = shaderDetails->readWriteResources[i]; - if(stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset >= pipe.DescSets.count()) + if(stage.bindpointMapping.readWriteResources[rw.bindPoint].bindset >= + pipe.descriptorSets.count()) { addResourceRow( - shaderDetails, stage, stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset, - stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind, pipe, resources, samplers); + shaderDetails, stage, stage.bindpointMapping.readWriteResources[rw.bindPoint].bindset, + stage.bindpointMapping.readWriteResources[rw.bindPoint].bind, pipe, resources, samplers); } } } @@ -1375,9 +1378,9 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, vs = ubos->verticalScrollBar()->value(); ubos->beginUpdate(); ubos->clear(); - for(int bindset = 0; bindset < pipe.DescSets.count(); bindset++) + for(int bindset = 0; bindset < pipe.descriptorSets.count(); bindset++) { - for(int bind = 0; bind < pipe.DescSets[bindset].bindings.count(); bind++) + for(int bind = 0; bind < pipe.descriptorSets[bindset].bindings.count(); bind++) { addConstantBlockRow(shaderDetails, stage, bindset, bind, pipe, ubos); } @@ -1387,16 +1390,16 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // in this descriptor set (e.g. if layout mismatches) if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ConstantBlocks.count(); i++) + for(int i = 0; i < shaderDetails->constantBlocks.count(); i++) { - const ConstantBlock &cb = shaderDetails->ConstantBlocks[i]; + const ConstantBlock &cb = shaderDetails->constantBlocks[i]; - if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset == bindset && - stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bind >= - pipe.DescSets[bindset].bindings.count()) + if(stage.bindpointMapping.constantBlocks[cb.bindPoint].bindset == bindset && + stage.bindpointMapping.constantBlocks[cb.bindPoint].bind >= + pipe.descriptorSets[bindset].bindings.count()) { addConstantBlockRow(shaderDetails, stage, bindset, - stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bind, pipe, ubos); + stage.bindpointMapping.constantBlocks[cb.bindPoint].bind, pipe, ubos); } } } @@ -1407,16 +1410,16 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // bound at all if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ConstantBlocks.count(); i++) + for(int i = 0; i < shaderDetails->constantBlocks.count(); i++) { - const ConstantBlock &cb = shaderDetails->ConstantBlocks[i]; + const ConstantBlock &cb = shaderDetails->constantBlocks[i]; - if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset >= pipe.DescSets.count() && + if(stage.bindpointMapping.constantBlocks[cb.bindPoint].bindset >= pipe.descriptorSets.count() && cb.bufferBacked) { addConstantBlockRow(shaderDetails, stage, - stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset, - stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bind, pipe, ubos); + stage.bindpointMapping.constantBlocks[cb.bindPoint].bindset, + stage.bindpointMapping.constantBlocks[cb.bindPoint].bind, pipe, ubos); } } } @@ -1424,9 +1427,9 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // search for push constants and add them last if(shaderDetails != NULL) { - for(int cb = 0; cb < shaderDetails->ConstantBlocks.count(); cb++) + for(int cb = 0; cb < shaderDetails->constantBlocks.count(); cb++) { - ConstantBlock &cblock = shaderDetails->ConstantBlocks[cb]; + ConstantBlock &cblock = shaderDetails->constantBlocks[cb]; if(cblock.bufferBacked == false) { // could maybe get range from ShaderVariable.reg if it's filled out @@ -1478,21 +1481,21 @@ void VulkanPipelineStateViewer::setState() ui->viAttrs->clear(); { int i = 0; - for(const VKPipe::VertexAttribute &a : state.VI.attrs) + for(const VKPipe::VertexAttribute &a : state.vertexInput.attributes) { bool usedSlot = false; QString name = tr("Attribute %1").arg(i); - if(state.m_VS.Object != ResourceId()) + if(state.vertexShader.resourceId != ResourceId()) { int attrib = -1; - if((int32_t)a.location < state.m_VS.BindpointMapping.InputAttributes.count()) - attrib = state.m_VS.BindpointMapping.InputAttributes[a.location]; + if((int32_t)a.location < state.vertexShader.bindpointMapping.inputAttributes.count()) + attrib = state.vertexShader.bindpointMapping.inputAttributes[a.location]; - if(attrib >= 0 && attrib < state.m_VS.ShaderDetails->InputSig.count()) + if(attrib >= 0 && attrib < state.vertexShader.reflection->inputSignature.count()) { - name = state.m_VS.ShaderDetails->InputSig[attrib].varName; + name = state.vertexShader.reflection->inputSignature[attrib].varName; usedSlot = true; } } @@ -1500,7 +1503,7 @@ void VulkanPipelineStateViewer::setState() if(showNode(usedSlot, /*filledSlot*/ true)) { RDTreeWidgetItem *node = new RDTreeWidgetItem( - {i, name, a.location, a.binding, a.format.Name(), a.byteoffset, QString()}); + {i, name, a.location, a.binding, a.format.Name(), a.byteOffset, QString()}); usedBindings[a.binding] = true; @@ -1533,7 +1536,7 @@ void VulkanPipelineStateViewer::setState() m_Common.setTopologyDiagram(ui->topologyDiagram, topo); - ui->primRestart->setVisible(state.IA.primitiveRestartEnable); + ui->primRestart->setVisible(state.inputAssembly.primitiveRestartEnable); vs = ui->viBuffers->verticalScrollBar()->value(); ui->viBuffers->beginUpdate(); @@ -1541,7 +1544,7 @@ void VulkanPipelineStateViewer::setState() bool ibufferUsed = draw != NULL && (draw->flags & DrawFlags::UseIBuffer); - if(state.IA.ibuffer.buf != ResourceId()) + if(state.inputAssembly.indexBuffer.resourceId != ResourceId()) { if(ibufferUsed || showDisabled) { @@ -1550,22 +1553,23 @@ void VulkanPipelineStateViewer::setState() if(!ibufferUsed) length = 0; - BufferDescription *buf = m_Ctx.GetBuffer(state.IA.ibuffer.buf); + BufferDescription *buf = m_Ctx.GetBuffer(state.inputAssembly.indexBuffer.resourceId); if(buf) length = buf->length; RDTreeWidgetItem *node = new RDTreeWidgetItem( - {tr("Index"), state.IA.ibuffer.buf, tr("Index"), (qulonglong)state.IA.ibuffer.offs, + {tr("Index"), state.inputAssembly.indexBuffer.resourceId, tr("Index"), + (qulonglong)state.inputAssembly.indexBuffer.byteOffset, draw != NULL ? draw->indexByteWidth : 0, (qulonglong)length, QString()}); - node->setTag(QVariant::fromValue( - VulkanVBIBTag(state.IA.ibuffer.buf, draw != NULL ? draw->indexOffset : 0))); + node->setTag(QVariant::fromValue(VulkanVBIBTag(state.inputAssembly.indexBuffer.resourceId, + draw != NULL ? draw->indexOffset : 0))); if(!ibufferUsed) setInactiveRow(node); - if(state.IA.ibuffer.buf == ResourceId()) + if(state.inputAssembly.indexBuffer.resourceId == ResourceId()) setEmptyRow(node); ui->viBuffers->addTopLevelItem(node); @@ -1578,8 +1582,8 @@ void VulkanPipelineStateViewer::setState() RDTreeWidgetItem *node = new RDTreeWidgetItem( {tr("Index"), ResourceId(), tr("Index"), lit("-"), lit("-"), lit("-"), QString()}); - node->setTag(QVariant::fromValue( - VulkanVBIBTag(state.IA.ibuffer.buf, draw != NULL ? draw->indexOffset : 0))); + node->setTag(QVariant::fromValue(VulkanVBIBTag(state.inputAssembly.indexBuffer.resourceId, + draw != NULL ? draw->indexOffset : 0))); setEmptyRow(node); @@ -1594,18 +1598,19 @@ void VulkanPipelineStateViewer::setState() { int i = 0; - for(; i < qMax(state.VI.vbuffers.count(), state.VI.binds.count()); i++) + for(; i < qMax(state.vertexInput.vertexBuffers.count(), state.vertexInput.bindings.count()); i++) { - const VKPipe::VB *vbuff = (i < state.VI.vbuffers.count() ? &state.VI.vbuffers[i] : NULL); + const VKPipe::VertexBuffer *vbuff = + (i < state.vertexInput.vertexBuffers.count() ? &state.vertexInput.vertexBuffers[i] : NULL); const VKPipe::VertexBinding *bind = NULL; - for(int b = 0; b < state.VI.binds.count(); b++) + for(int b = 0; b < state.vertexInput.bindings.count(); b++) { - if(state.VI.binds[b].vbufferBinding == (uint32_t)i) - bind = &state.VI.binds[b]; + if(state.vertexInput.bindings[b].vertexBufferBinding == (uint32_t)i) + bind = &state.vertexInput.bindings[b]; } - bool filledSlot = ((vbuff != NULL && vbuff->buffer != ResourceId()) || bind != NULL); + bool filledSlot = ((vbuff != NULL && vbuff->resourceId != ResourceId()) || bind != NULL); bool usedSlot = (usedBindings[i]); if(showNode(usedSlot, filledSlot)) @@ -1617,16 +1622,16 @@ void VulkanPipelineStateViewer::setState() if(vbuff != NULL) { - offset = vbuff->offset; + offset = vbuff->byteOffset; - BufferDescription *buf = m_Ctx.GetBuffer(vbuff->buffer); + BufferDescription *buf = m_Ctx.GetBuffer(vbuff->resourceId); if(buf) length = buf->length; } if(bind != NULL) { - stride = bind->bytestride; + stride = bind->byteStride; rate = bind->perInstance ? tr("Instance") : tr("Vertex"); } else @@ -1637,14 +1642,14 @@ void VulkanPipelineStateViewer::setState() RDTreeWidgetItem *node = NULL; if(filledSlot) - node = new RDTreeWidgetItem( - {i, vbuff->buffer, rate, (qulonglong)offset, stride, (qulonglong)length, QString()}); + node = new RDTreeWidgetItem({i, vbuff->resourceId, rate, (qulonglong)offset, stride, + (qulonglong)length, QString()}); else node = new RDTreeWidgetItem( {i, tr("No Binding"), lit("-"), lit("-"), lit("-"), lit("-"), QString()}); - node->setTag(QVariant::fromValue(VulkanVBIBTag(vbuff != NULL ? vbuff->buffer : ResourceId(), - vbuff != NULL ? vbuff->offset : 0))); + node->setTag(QVariant::fromValue(VulkanVBIBTag( + vbuff != NULL ? vbuff->resourceId : ResourceId(), vbuff != NULL ? vbuff->byteOffset : 0))); if(!filledSlot || bind == NULL || vbuff == NULL) setEmptyRow(node); @@ -1681,12 +1686,13 @@ void VulkanPipelineStateViewer::setState() ui->viBuffers->endUpdate(); ui->viBuffers->verticalScrollBar()->setValue(vs); - setShaderState(state.m_VS, state.graphics, ui->vsShader, ui->vsResources, ui->vsUBOs); - setShaderState(state.m_GS, state.graphics, ui->gsShader, ui->gsResources, ui->gsUBOs); - setShaderState(state.m_TCS, state.graphics, ui->tcsShader, ui->tcsResources, ui->tcsUBOs); - setShaderState(state.m_TES, state.graphics, ui->tesShader, ui->tesResources, ui->tesUBOs); - setShaderState(state.m_FS, state.graphics, ui->fsShader, ui->fsResources, ui->fsUBOs); - setShaderState(state.m_CS, state.compute, ui->csShader, ui->csResources, ui->csUBOs); + setShaderState(state.vertexShader, state.graphics, ui->vsShader, ui->vsResources, ui->vsUBOs); + setShaderState(state.geometryShader, state.graphics, ui->gsShader, ui->gsResources, ui->gsUBOs); + setShaderState(state.tessControlShader, state.graphics, ui->tcsShader, ui->tcsResources, + ui->tcsUBOs); + setShaderState(state.tessEvalShader, state.graphics, ui->tesShader, ui->tesResources, ui->tesUBOs); + setShaderState(state.fragmentShader, state.graphics, ui->fsShader, ui->fsResources, ui->fsUBOs); + setShaderState(state.computeShader, state.compute, ui->csShader, ui->csResources, ui->csUBOs); //////////////////////////////////////////////// // Rasterizer @@ -1699,16 +1705,16 @@ void VulkanPipelineStateViewer::setState() ui->scissors->beginUpdate(); ui->scissors->clear(); - if(state.Pass.renderpass.obj != ResourceId()) + if(state.currentPass.renderpass.resourceId != ResourceId()) { - ui->scissors->addTopLevelItem( - new RDTreeWidgetItem({tr("Render Area"), state.Pass.renderArea.x, state.Pass.renderArea.y, - state.Pass.renderArea.width, state.Pass.renderArea.height})); + ui->scissors->addTopLevelItem(new RDTreeWidgetItem( + {tr("Render Area"), state.currentPass.renderArea.x, state.currentPass.renderArea.y, + state.currentPass.renderArea.width, state.currentPass.renderArea.height})); } { int i = 0; - for(const VKPipe::ViewportScissor &v : state.VP.viewportScissors) + for(const VKPipe::ViewportScissor &v : state.viewportScissor.viewportScissors) { RDTreeWidgetItem *node = new RDTreeWidgetItem( {i, v.vp.x, v.vp.y, v.vp.width, v.vp.height, v.vp.minDepth, v.vp.maxDepth}); @@ -1735,24 +1741,24 @@ void VulkanPipelineStateViewer::setState() ui->viewports->endUpdate(); ui->scissors->endUpdate(); - ui->fillMode->setText(ToQStr(state.RS.fillMode)); - ui->cullMode->setText(ToQStr(state.RS.cullMode)); - ui->frontCCW->setPixmap(state.RS.FrontCCW ? tick : cross); + ui->fillMode->setText(ToQStr(state.rasterizer.fillMode)); + ui->cullMode->setText(ToQStr(state.rasterizer.cullMode)); + ui->frontCCW->setPixmap(state.rasterizer.frontCCW ? tick : cross); - ui->depthBias->setText(Formatter::Format(state.RS.depthBias)); - ui->depthBiasClamp->setText(Formatter::Format(state.RS.depthBiasClamp)); - ui->slopeScaledBias->setText(Formatter::Format(state.RS.slopeScaledDepthBias)); + ui->depthBias->setText(Formatter::Format(state.rasterizer.depthBias)); + ui->depthBiasClamp->setText(Formatter::Format(state.rasterizer.depthBiasClamp)); + ui->slopeScaledBias->setText(Formatter::Format(state.rasterizer.slopeScaledDepthBias)); - ui->depthClamp->setPixmap(state.RS.depthClampEnable ? tick : cross); - ui->rasterizerDiscard->setPixmap(state.RS.rasterizerDiscardEnable ? tick : cross); - ui->lineWidth->setText(Formatter::Format(state.RS.lineWidth)); + ui->depthClamp->setPixmap(state.rasterizer.depthClampEnable ? tick : cross); + ui->rasterizerDiscard->setPixmap(state.rasterizer.rasterizerDiscardEnable ? tick : cross); + ui->lineWidth->setText(Formatter::Format(state.rasterizer.lineWidth)); - ui->sampleCount->setText(QString::number(state.MSAA.rasterSamples)); - ui->sampleShading->setPixmap(state.MSAA.sampleShadingEnable ? tick : cross); - ui->minSampleShading->setText(Formatter::Format(state.MSAA.minSampleShading)); - ui->sampleMask->setText(Formatter::Format(state.MSAA.sampleMask, true)); - ui->alphaToOne->setPixmap(state.CB.alphaToOneEnable ? tick : cross); - ui->alphaToCoverage->setPixmap(state.CB.alphaToCoverageEnable ? tick : cross); + ui->sampleCount->setText(QString::number(state.multisample.rasterSamples)); + ui->sampleShading->setPixmap(state.multisample.sampleShadingEnable ? tick : cross); + ui->minSampleShading->setText(Formatter::Format(state.multisample.minSampleShading)); + ui->sampleMask->setText(Formatter::Format(state.multisample.sampleMask, true)); + ui->alphaToOne->setPixmap(state.colorBlend.alphaToOneEnable ? tick : cross); + ui->alphaToCoverage->setPixmap(state.colorBlend.alphaToCoverageEnable ? tick : cross); //////////////////////////////////////////////// // Output Merger @@ -1760,62 +1766,63 @@ void VulkanPipelineStateViewer::setState() bool targets[32] = {}; ui->renderpass->setText(QFormatStr("Render Pass: %1 (Subpass %2)") - .arg(ToQStr(state.Pass.renderpass.obj)) - .arg(state.Pass.renderpass.subpass)); - ui->framebuffer->setText(QFormatStr("Framebuffer: %1").arg(ToQStr(state.Pass.framebuffer.obj))); + .arg(ToQStr(state.currentPass.renderpass.resourceId)) + .arg(state.currentPass.renderpass.subpass)); + ui->framebuffer->setText( + QFormatStr("Framebuffer: %1").arg(ToQStr(state.currentPass.framebuffer.resourceId))); vs = ui->fbAttach->verticalScrollBar()->value(); ui->fbAttach->beginUpdate(); ui->fbAttach->clear(); { int i = 0; - for(const VKPipe::Attachment &p : state.Pass.framebuffer.attachments) + for(const VKPipe::Attachment &p : state.currentPass.framebuffer.attachments) { int colIdx = -1; - for(int c = 0; c < state.Pass.renderpass.colorAttachments.count(); c++) + for(int c = 0; c < state.currentPass.renderpass.colorAttachments.count(); c++) { - if(state.Pass.renderpass.colorAttachments[c] == (uint)i) + if(state.currentPass.renderpass.colorAttachments[c] == (uint)i) { colIdx = c; break; } } int resIdx = -1; - for(int c = 0; c < state.Pass.renderpass.resolveAttachments.count(); c++) + for(int c = 0; c < state.currentPass.renderpass.resolveAttachments.count(); c++) { - if(state.Pass.renderpass.resolveAttachments[c] == (uint)i) + if(state.currentPass.renderpass.resolveAttachments[c] == (uint)i) { resIdx = c; break; } } - bool filledSlot = (p.img != ResourceId()); + bool filledSlot = (p.imageResourceId != ResourceId()); bool usedSlot = - (colIdx >= 0 || resIdx >= 0 || state.Pass.renderpass.depthstencilAttachment == i); + (colIdx >= 0 || resIdx >= 0 || state.currentPass.renderpass.depthstencilAttachment == i); if(showNode(usedSlot, filledSlot)) { uint32_t w = 1, h = 1, d = 1; uint32_t a = 1; - QString format = p.viewfmt.Name(); + QString format = p.viewFormat.Name(); QString typeName = tr("Unknown"); - if(p.img == ResourceId()) + if(p.imageResourceId == ResourceId()) { format = lit("-"); typeName = lit("-"); w = h = d = a = 0; } - TextureDescription *tex = m_Ctx.GetTexture(p.img); + TextureDescription *tex = m_Ctx.GetTexture(p.imageResourceId); if(tex) { w = tex->width; h = tex->height; d = tex->depth; a = tex->arraysize; - typeName = ToQStr(tex->resType); + typeName = ToQStr(tex->type); } if(p.swizzle[0] != TextureSwizzle::Red || p.swizzle[1] != TextureSwizzle::Green || @@ -1837,26 +1844,29 @@ void VulkanPipelineStateViewer::setState() else slotname = lit("Depth"); - if(state.m_FS.ShaderDetails != NULL) + if(state.fragmentShader.reflection != NULL) { - for(int s = 0; s < state.m_FS.ShaderDetails->OutputSig.count(); s++) + for(int s = 0; s < state.fragmentShader.reflection->outputSignature.count(); s++) { - if(state.m_FS.ShaderDetails->OutputSig[s].regIndex == (uint32_t)colIdx && - (state.m_FS.ShaderDetails->OutputSig[s].systemValue == ShaderBuiltin::Undefined || - state.m_FS.ShaderDetails->OutputSig[s].systemValue == ShaderBuiltin::ColorOutput)) + if(state.fragmentShader.reflection->outputSignature[s].regIndex == (uint32_t)colIdx && + (state.fragmentShader.reflection->outputSignature[s].systemValue == + ShaderBuiltin::Undefined || + state.fragmentShader.reflection->outputSignature[s].systemValue == + ShaderBuiltin::ColorOutput)) { - slotname += QFormatStr(": %1").arg(state.m_FS.ShaderDetails->OutputSig[s].varName); + slotname += + QFormatStr(": %1").arg(state.fragmentShader.reflection->outputSignature[s].varName); } } } - RDTreeWidgetItem *node = - new RDTreeWidgetItem({slotname, p.img, typeName, w, h, d, a, format, QString()}); + RDTreeWidgetItem *node = new RDTreeWidgetItem( + {slotname, p.imageResourceId, typeName, w, h, d, a, format, QString()}); if(tex) - node->setTag(QVariant::fromValue(p.img)); + node->setTag(QVariant::fromValue(p.imageResourceId)); - if(p.img == ResourceId()) + if(p.imageResourceId == ResourceId()) { setEmptyRow(node); } @@ -1887,20 +1897,20 @@ void VulkanPipelineStateViewer::setState() ui->blends->clear(); { int i = 0; - for(const VKPipe::Blend &blend : state.CB.attachments) + for(const ColorBlend &blend : state.colorBlend.blends) { bool usedSlot = (targets[i]); if(showNode(usedSlot, /*filledSlot*/ true)) { RDTreeWidgetItem *node = new RDTreeWidgetItem( - {i, blend.blendEnable ? tr("True") : tr("False"), + {i, blend.enabled ? tr("True") : tr("False"), - ToQStr(blend.blend.Source), ToQStr(blend.blend.Destination), - ToQStr(blend.blend.Operation), + ToQStr(blend.colorBlend.source), ToQStr(blend.colorBlend.destination), + ToQStr(blend.colorBlend.operation), - ToQStr(blend.alphaBlend.Source), ToQStr(blend.alphaBlend.Destination), - ToQStr(blend.alphaBlend.Operation), + ToQStr(blend.alphaBlend.source), ToQStr(blend.alphaBlend.destination), + ToQStr(blend.alphaBlend.operation), QFormatStr("%1%2%3%4") .arg((blend.writeMask & 0x1) == 0 ? lit("_") : lit("R")) @@ -1922,20 +1932,25 @@ void VulkanPipelineStateViewer::setState() ui->blends->verticalScrollBar()->setValue(vs); ui->blendFactor->setText(QFormatStr("%1, %2, %3, %4") - .arg(state.CB.blendConst[0], 0, 'f', 2) - .arg(state.CB.blendConst[1], 0, 'f', 2) - .arg(state.CB.blendConst[2], 0, 'f', 2) - .arg(state.CB.blendConst[3], 0, 'f', 2)); - ui->logicOp->setText(state.CB.logicOpEnable ? ToQStr(state.CB.logic) : lit("-")); + .arg(state.colorBlend.blendFactor[0], 0, 'f', 2) + .arg(state.colorBlend.blendFactor[1], 0, 'f', 2) + .arg(state.colorBlend.blendFactor[2], 0, 'f', 2) + .arg(state.colorBlend.blendFactor[3], 0, 'f', 2)); + if(state.colorBlend.blends.count() > 0) + ui->logicOp->setText(state.colorBlend.blends[0].logicOperationEnabled + ? ToQStr(state.colorBlend.blends[0].logicOperation) + : lit("-")); + else + ui->logicOp->setText(lit("-")); - ui->depthEnabled->setPixmap(state.DS.depthTestEnable ? tick : cross); - ui->depthFunc->setText(ToQStr(state.DS.depthCompareOp)); - ui->depthWrite->setPixmap(state.DS.depthWriteEnable ? tick : cross); + ui->depthEnabled->setPixmap(state.depthStencil.depthTestEnable ? tick : cross); + ui->depthFunc->setText(ToQStr(state.depthStencil.depthFunction)); + ui->depthWrite->setPixmap(state.depthStencil.depthWriteEnable ? tick : cross); - if(state.DS.depthBoundsEnable) + if(state.depthStencil.depthBoundsEnable) { - ui->depthBounds->setText(Formatter::Format(state.DS.minDepthBounds) + lit("-") + - Formatter::Format(state.DS.maxDepthBounds)); + ui->depthBounds->setText(Formatter::Format(state.depthStencil.minDepthBounds) + lit("-") + + Formatter::Format(state.depthStencil.maxDepthBounds)); ui->depthBounds->setPixmap(QPixmap()); } else @@ -1946,20 +1961,24 @@ void VulkanPipelineStateViewer::setState() ui->stencils->beginUpdate(); ui->stencils->clear(); - if(state.DS.stencilTestEnable) + if(state.depthStencil.stencilTestEnable) { - ui->stencils->addTopLevelItem(new RDTreeWidgetItem( - {tr("Front"), ToQStr(state.DS.front.Func), ToQStr(state.DS.front.FailOp), - ToQStr(state.DS.front.DepthFailOp), ToQStr(state.DS.front.PassOp), - Formatter::Format(state.DS.front.writeMask, true), - Formatter::Format(state.DS.front.compareMask, true), - Formatter::Format(state.DS.front.ref, true)})); ui->stencils->addTopLevelItem( - new RDTreeWidgetItem({tr("Back"), ToQStr(state.DS.back.Func), ToQStr(state.DS.back.FailOp), - ToQStr(state.DS.back.DepthFailOp), ToQStr(state.DS.back.PassOp), - Formatter::Format(state.DS.back.writeMask, true), - Formatter::Format(state.DS.back.compareMask, true), - Formatter::Format(state.DS.back.ref, true)})); + new RDTreeWidgetItem({tr("Front"), ToQStr(state.depthStencil.frontFace.function), + ToQStr(state.depthStencil.frontFace.failOperation), + ToQStr(state.depthStencil.frontFace.depthFailOperation), + ToQStr(state.depthStencil.frontFace.passOperation), + Formatter::Format(state.depthStencil.frontFace.writeMask, true), + Formatter::Format(state.depthStencil.frontFace.compareMask, true), + Formatter::Format(state.depthStencil.frontFace.reference, true)})); + ui->stencils->addTopLevelItem( + new RDTreeWidgetItem({tr("Back"), ToQStr(state.depthStencil.backFace.function), + ToQStr(state.depthStencil.backFace.failOperation), + ToQStr(state.depthStencil.backFace.depthFailOperation), + ToQStr(state.depthStencil.backFace.passOperation), + Formatter::Format(state.depthStencil.backFace.writeMask, true), + Formatter::Format(state.depthStencil.backFace.compareMask, true), + Formatter::Format(state.depthStencil.backFace.reference, true)})); } else { @@ -1982,9 +2001,10 @@ void VulkanPipelineStateViewer::setState() } else { - ui->pipeFlow->setStagesEnabled( - {true, true, state.m_TCS.Object != ResourceId(), state.m_TES.Object != ResourceId(), - state.m_GS.Object != ResourceId(), true, state.m_FS.Object != ResourceId(), true, false}); + ui->pipeFlow->setStagesEnabled({true, true, state.tessControlShader.resourceId != ResourceId(), + state.tessEvalShader.resourceId != ResourceId(), + state.geometryShader.resourceId != ResourceId(), true, + state.fragmentShader.resourceId != ResourceId(), true, false}); } } @@ -2043,9 +2063,9 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i if(tex) { - if(tex->resType == TextureDim::Buffer) + if(tex->type == TextureType::Buffer) { - IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->ID); + IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -2054,7 +2074,7 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i if(!m_Ctx.HasTextureViewer()) m_Ctx.ShowTextureViewer(); ITextureViewer *viewer = m_Ctx.GetTextureViewer(); - viewer->ViewTexture(tex->ID, true); + viewer->ViewTexture(tex->resourceId, true); } return; @@ -2065,8 +2085,8 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i VulkanBufferTag buf = tag.value(); const ShaderResource &shaderRes = buf.rwRes - ? stage->ShaderDetails->ReadWriteResources[buf.bindPoint] - : stage->ShaderDetails->ReadOnlyResources[buf.bindPoint]; + ? stage->reflection->readWriteResources[buf.bindPoint] + : stage->reflection->readOnlyResources[buf.bindPoint]; QString format = lit("// struct %1\n").arg(shaderRes.variableType.descriptor.name); @@ -2094,10 +2114,10 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i format += lit("row_major "); format += ToQStr(desc.type); - if(desc.rows > 1 && desc.cols > 1) - format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.cols); - else if(desc.cols > 1) - format += QString::number(desc.cols); + if(desc.rows > 1 && desc.columns > 1) + format += QFormatStr("%1x%2").arg(desc.rows).arg(desc.columns); + else if(desc.columns > 1) + format += QString::number(desc.columns); if(!desc.name.isEmpty()) format += lit(" ") + desc.name; @@ -2160,7 +2180,7 @@ void VulkanPipelineStateViewer::highlightIABind(int slot) { int idx = ((slot + 1) * 21) % 32; // space neighbouring colours reasonably distinctly - const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState().VI; + const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState().vertexInput; QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); @@ -2184,7 +2204,7 @@ void VulkanPipelineStateViewer::highlightIABind(int slot) { RDTreeWidgetItem *item = ui->viAttrs->topLevelItem(i); - if((int)VI.attrs[i].binding != slot) + if((int)VI.attributes[i].binding != slot) { item->setBackground(QBrush()); item->setForeground(QBrush()); @@ -2209,13 +2229,13 @@ void VulkanPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e) vertex_leave(NULL); - const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState().VI; + const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState().vertexInput; if(idx.isValid()) { - if(idx.row() >= 0 && idx.row() < VI.attrs.count()) + if(idx.row() >= 0 && idx.row() < VI.attributes.count()) { - uint32_t binding = VI.attrs[idx.row()].binding; + uint32_t binding = VI.attributes[idx.row()].binding; highlightIABind((int)binding); } @@ -2276,14 +2296,14 @@ void VulkanPipelineStateViewer::shaderView_clicked() { const VKPipe::Shader *stage = stageForSender(qobject_cast(QObject::sender())); - if(stage == NULL || stage->Object == ResourceId()) + if(stage == NULL || stage->resourceId == ResourceId()) return; - ShaderReflection *shaderDetails = stage->ShaderDetails; + ShaderReflection *shaderDetails = stage->reflection; ResourceId pipe = stage->stage == ShaderStage::Compute - ? m_Ctx.CurVulkanPipelineState().compute.obj - : m_Ctx.CurVulkanPipelineState().graphics.obj; + ? m_Ctx.CurVulkanPipelineState().compute.pipelineResourceId + : m_Ctx.CurVulkanPipelineState().graphics.pipelineResourceId; IShaderViewer *shad = m_Ctx.ViewShader(shaderDetails, pipe); @@ -2295,14 +2315,14 @@ void VulkanPipelineStateViewer::shaderEdit_clicked() QWidget *sender = qobject_cast(QObject::sender()); const VKPipe::Shader *stage = stageForSender(sender); - if(!stage || stage->Object == ResourceId()) + if(!stage || stage->resourceId == ResourceId()) return; - const ShaderReflection *shaderDetails = stage->ShaderDetails; + const ShaderReflection *shaderDetails = stage->reflection; ResourceId pipe = stage->stage == ShaderStage::Compute - ? m_Ctx.CurVulkanPipelineState().compute.obj - : m_Ctx.CurVulkanPipelineState().graphics.obj; + ? m_Ctx.CurVulkanPipelineState().compute.pipelineResourceId + : m_Ctx.CurVulkanPipelineState().graphics.pipelineResourceId; if(!shaderDetails) return; @@ -2338,14 +2358,14 @@ void VulkanPipelineStateViewer::shaderEdit_clicked() GUIInvoke::call([this, stage, shaderDetails, entryFunc, disasm]() { rdcstrpairs fileMap; fileMap.push_back(make_rdcpair("generated.glsl", disasm)); - m_Common.EditShader(stage->stage, stage->Object, shaderDetails, entryFunc, fileMap); + m_Common.EditShader(stage->stage, stage->resourceId, shaderDetails, entryFunc, fileMap); }); }); return; } } - m_Common.EditShader(stage->stage, stage->Object, shaderDetails, entryFunc, files); + m_Common.EditShader(stage->stage, stage->resourceId, shaderDetails, entryFunc, files); } QString VulkanPipelineStateViewer::disassembleSPIRV(const ShaderReflection *shaderDetails) @@ -2363,7 +2383,7 @@ QString VulkanPipelineStateViewer::disassembleSPIRV(const ShaderReflection *shad if(binHandle.open(QFile::WriteOnly | QIODevice::Truncate)) { binHandle.write( - QByteArray((const char *)shaderDetails->RawBytes.data(), shaderDetails->RawBytes.count())); + QByteArray((const char *)shaderDetails->rawBytes.data(), shaderDetails->rawBytes.count())); binHandle.close(); } else @@ -2439,9 +2459,9 @@ void VulkanPipelineStateViewer::shaderSave_clicked() if(stage == NULL) return; - ShaderReflection *shaderDetails = stage->ShaderDetails; + ShaderReflection *shaderDetails = stage->reflection; - if(stage->Object == ResourceId()) + if(stage->resourceId == ResourceId()) return; m_Common.SaveShaderFile(shaderDetails); @@ -2456,8 +2476,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(const VKPipe::VertexAttribute &attr : vi.attrs) - rows.push_back({attr.location, attr.binding, attr.format.Name(), attr.byteoffset}); + for(const VKPipe::VertexAttribute &attr : vi.attributes) + rows.push_back({attr.location, attr.binding, attr.format.Name(), attr.byteOffset}); m_Common.exportHTMLTable(xml, {tr("Location"), tr("Binding"), tr("Format"), tr("Offset")}, rows); } @@ -2469,8 +2489,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(const VKPipe::VertexBinding &attr : vi.binds) - rows.push_back({attr.vbufferBinding, attr.bytestride, + for(const VKPipe::VertexBinding &attr : vi.bindings) + rows.push_back({attr.vertexBufferBinding, attr.byteStride, attr.perInstance ? tr("PER_INSTANCE") : tr("PER_VERTEX")}); m_Common.exportHTMLTable(xml, {tr("Binding"), tr("Byte Stride"), tr("Step Rate")}, rows); @@ -2484,22 +2504,22 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; int i = 0; - for(const VKPipe::VB &vb : vi.vbuffers) + for(const VKPipe::VertexBuffer &vb : vi.vertexBuffers) { uint64_t length = 0; - if(vb.buffer == ResourceId()) + if(vb.resourceId == ResourceId()) { continue; } else { - BufferDescription *buf = m_Ctx.GetBuffer(vb.buffer); + BufferDescription *buf = m_Ctx.GetBuffer(vb.resourceId); if(buf) length = buf->length; } - rows.push_back({i, vb.buffer, (qulonglong)vb.offset, (qulonglong)length}); + rows.push_back({i, vb.resourceId, (qulonglong)vb.byteOffset, (qulonglong)length}); i++; } @@ -2516,14 +2536,14 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: xml.writeCharacters(tr("Index Buffer")); xml.writeEndElement(); - BufferDescription *ib = m_Ctx.GetBuffer(ia.ibuffer.buf); + BufferDescription *ib = m_Ctx.GetBuffer(ia.indexBuffer.resourceId); QString name = tr("Empty"); uint64_t length = 0; if(ib) { - name = m_Ctx.GetResourceName(ia.ibuffer.buf); + name = m_Ctx.GetResourceName(ia.indexBuffer.resourceId); length = ib->length; } @@ -2535,21 +2555,21 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: m_Common.exportHTMLTable( xml, {tr("Buffer"), tr("Format"), tr("Offset"), tr("Byte Length"), tr("Primitive Restart")}, - {name, ifmt, (qulonglong)ia.ibuffer.offs, (qulonglong)length, + {name, ifmt, (qulonglong)ia.indexBuffer.byteOffset, (qulonglong)length, ia.primitiveRestartEnable ? tr("Yes") : tr("No")}); } xml.writeStartElement(lit("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, {tr("Primitive Topology"), tr("Tessellation Control Points")}, - {ToQStr(m_Ctx.CurDrawcall()->topology), m_Ctx.CurVulkanPipelineState().Tess.numControlPoints}); + m_Common.exportHTMLTable(xml, {tr("Primitive Topology"), tr("Tessellation Control Points")}, + {ToQStr(m_Ctx.CurDrawcall()->topology), + m_Ctx.CurVulkanPipelineState().tessellation.numControlPoints}); } void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::Shader &sh) { - ShaderReflection *shaderDetails = sh.ShaderDetails; + ShaderReflection *shaderDetails = sh.reflection; { xml.writeStartElement(lit("h3")); @@ -2558,27 +2578,27 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QString shadername = tr("Unknown"); - if(sh.Object == ResourceId()) + if(sh.resourceId == ResourceId()) shadername = tr("Unbound"); else - shadername = m_Ctx.GetResourceName(sh.Object); + shadername = m_Ctx.GetResourceName(sh.resourceId); if(shaderDetails) { - QString entryFunc = shaderDetails->EntryPoint; + QString entryFunc = shaderDetails->entryPoint; if(entryFunc != lit("main")) shadername = QFormatStr("%1()").arg(entryFunc); - else if(!shaderDetails->DebugInfo.files.isEmpty()) + else if(!shaderDetails->debugInfo.files.isEmpty()) shadername = QFormatStr("%1() - %2") .arg(entryFunc) - .arg(QFileInfo(shaderDetails->DebugInfo.files[0].Filename).fileName()); + .arg(QFileInfo(shaderDetails->debugInfo.files[0].filename).fileName()); } xml.writeStartElement(lit("p")); xml.writeCharacters(shadername); xml.writeEndElement(); - if(sh.Object == ResourceId()) + if(sh.resourceId == ResourceId()) return; } @@ -2586,7 +2606,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: (sh.stage == ShaderStage::Compute ? m_Ctx.CurVulkanPipelineState().compute : m_Ctx.CurVulkanPipelineState().graphics); - if(shaderDetails && !shaderDetails->ConstantBlocks.isEmpty()) + if(shaderDetails && !shaderDetails->constantBlocks.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("UBOs")); @@ -2594,10 +2614,10 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(int i = 0; i < shaderDetails->ConstantBlocks.count(); i++) + for(int i = 0; i < shaderDetails->constantBlocks.count(); i++) { - const ConstantBlock &b = shaderDetails->ConstantBlocks[i]; - const BindpointMap &bindMap = sh.BindpointMapping.ConstantBlocks[i]; + const ConstantBlock &b = shaderDetails->constantBlocks[i]; + const Bindpoint &bindMap = sh.bindpointMapping.constantBlocks[i]; if(!bindMap.used) continue; @@ -2614,9 +2634,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: } const VKPipe::DescriptorSet &set = - pipeline.DescSets[sh.BindpointMapping.ConstantBlocks[i].bindset]; + pipeline.descriptorSets[sh.bindpointMapping.constantBlocks[i].bindset]; const VKPipe::DescriptorBinding &bind = - set.bindings[sh.BindpointMapping.ConstantBlocks[i].bind]; + set.bindings[sh.bindpointMapping.constantBlocks[i].bind]; QString setname = QString::number(bindMap.bindset); @@ -2626,17 +2646,17 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: { const VKPipe::BindingElement &descriptorBind = bind.binds[a]; - ResourceId id = bind.binds[a].res; + ResourceId id = bind.binds[a].resourceResourceId; if(bindMap.arraySize > 1) slotname = QFormatStr("%1: %2[%3]").arg(bindMap.bind).arg(b.name).arg(a); - QString name = m_Ctx.GetResourceName(descriptorBind.res); - uint64_t byteOffset = descriptorBind.offset; - uint64_t length = descriptorBind.size; + QString name = m_Ctx.GetResourceName(descriptorBind.resourceResourceId); + uint64_t byteOffset = descriptorBind.byteOffset; + uint64_t length = descriptorBind.byteSize; int numvars = b.variables.count(); - if(descriptorBind.res == ResourceId()) + if(descriptorBind.resourceResourceId == ResourceId()) { name = tr("Empty"); length = 0; @@ -2659,7 +2679,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: rows); } - if(shaderDetails && !shaderDetails->ReadOnlyResources.isEmpty()) + if(shaderDetails && !shaderDetails->readOnlyResources.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Read-only Resources")); @@ -2667,18 +2687,18 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) + for(int i = 0; i < shaderDetails->readOnlyResources.count(); i++) { - const ShaderResource &b = shaderDetails->ReadOnlyResources[i]; - const BindpointMap &bindMap = sh.BindpointMapping.ReadOnlyResources[i]; + const ShaderResource &b = shaderDetails->readOnlyResources[i]; + const Bindpoint &bindMap = sh.bindpointMapping.readOnlyResources[i]; if(!bindMap.used) continue; const VKPipe::DescriptorSet &set = - pipeline.DescSets[sh.BindpointMapping.ReadOnlyResources[i].bindset]; + pipeline.descriptorSets[sh.bindpointMapping.readOnlyResources[i].bindset]; const VKPipe::DescriptorBinding &bind = - set.bindings[sh.BindpointMapping.ReadOnlyResources[i].bind]; + set.bindings[sh.bindpointMapping.readOnlyResources[i].bind]; QString setname = QString::number(bindMap.bindset); @@ -2688,14 +2708,14 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: { const VKPipe::BindingElement &descriptorBind = bind.binds[a]; - ResourceId id = bind.binds[a].res; + ResourceId id = descriptorBind.resourceResourceId; if(bindMap.arraySize > 1) slotname = QFormatStr("%1: %2[%3]").arg(bindMap.bind).arg(b.name).arg(a); QString name = m_Ctx.GetResourceName(id); - if(descriptorBind.res == ResourceId()) + if(id == ResourceId()) name = tr("Empty"); BufferDescription *buf = m_Ctx.GetBuffer(id); @@ -2718,8 +2738,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: if(tex->mips > 1) { viewParams = tr("Mips: %1-%2") - .arg(descriptorBind.baseMip) - .arg(descriptorBind.baseMip + descriptorBind.numMip - 1); + .arg(descriptorBind.firstMip) + .arg(descriptorBind.firstMip + descriptorBind.numMips - 1); } if(tex->arraysize > 1) @@ -2727,8 +2747,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: if(!viewParams.isEmpty()) viewParams += lit(", "); viewParams += tr("Layers: %1-%2") - .arg(descriptorBind.baseLayer) - .arg(descriptorBind.baseLayer + descriptorBind.numLayer - 1); + .arg(descriptorBind.firstSlice) + .arg(descriptorBind.firstSlice + descriptorBind.numSlices - 1); } } @@ -2740,13 +2760,14 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: a = 0; format = lit("-"); - uint64_t length = descriptorBind.size; + uint64_t length = descriptorBind.byteSize; if(length == UINT64_MAX) - length = buf->length - descriptorBind.offset; + length = buf->length - descriptorBind.byteOffset; - viewParams = - tr("Byte Range: %1 - %2").arg(descriptorBind.offset).arg(descriptorBind.offset + length); + viewParams = tr("Byte Range: %1 - %2") + .arg(descriptorBind.byteOffset) + .arg(descriptorBind.byteOffset + length); } if(bind.type != BindType::Sampler) @@ -2771,7 +2792,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: rows); } - if(shaderDetails && !shaderDetails->ReadWriteResources.isEmpty()) + if(shaderDetails && !shaderDetails->readWriteResources.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Read-write Resources")); @@ -2779,18 +2800,18 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) + for(int i = 0; i < shaderDetails->readWriteResources.count(); i++) { - const ShaderResource &b = shaderDetails->ReadWriteResources[i]; - const BindpointMap &bindMap = sh.BindpointMapping.ReadWriteResources[i]; + const ShaderResource &b = shaderDetails->readWriteResources[i]; + const Bindpoint &bindMap = sh.bindpointMapping.readWriteResources[i]; if(!bindMap.used) continue; const VKPipe::DescriptorSet &set = - pipeline.DescSets[sh.BindpointMapping.ReadWriteResources[i].bindset]; + pipeline.descriptorSets[sh.bindpointMapping.readWriteResources[i].bindset]; const VKPipe::DescriptorBinding &bind = - set.bindings[sh.BindpointMapping.ReadWriteResources[i].bind]; + set.bindings[sh.bindpointMapping.readWriteResources[i].bind]; QString setname = QString::number(bindMap.bindset); @@ -2800,16 +2821,12 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: { const VKPipe::BindingElement &descriptorBind = bind.binds[a]; - ResourceId id = bind.binds[a].res; + ResourceId id = descriptorBind.resourceResourceId; if(bindMap.arraySize > 1) slotname = QFormatStr("%1: %2[%3]").arg(bindMap.bind).arg(b.name).arg(a); - QString name = m_Ctx.GetResourceName(descriptorBind.res); - ; - - if(descriptorBind.res == ResourceId()) - name = tr("Empty"); + QString name = m_Ctx.GetResourceName(id); BufferDescription *buf = m_Ctx.GetBuffer(id); @@ -2832,8 +2849,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: if(tex->mips > 1) { viewParams = tr("Mips: %1-%2") - .arg(descriptorBind.baseMip) - .arg(descriptorBind.baseMip + descriptorBind.numMip - 1); + .arg(descriptorBind.firstMip) + .arg(descriptorBind.firstMip + descriptorBind.numMips - 1); } if(tex->arraysize > 1) @@ -2841,8 +2858,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: if(!viewParams.isEmpty()) viewParams += lit(", "); viewParams += tr("Layers: %1-%2") - .arg(descriptorBind.baseLayer) - .arg(descriptorBind.baseLayer + descriptorBind.numLayer - 1); + .arg(descriptorBind.firstSlice) + .arg(descriptorBind.firstSlice + descriptorBind.numSlices - 1); } } @@ -2854,13 +2871,14 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: a = 0; format = lit("-"); - uint64_t length = descriptorBind.size; + uint64_t length = descriptorBind.byteSize; if(length == UINT64_MAX) - length = buf->length - descriptorBind.offset; + length = buf->length - descriptorBind.byteOffset; - viewParams = - tr("Byte Range: %1 - %2").arg(descriptorBind.offset).arg(descriptorBind.offset + length); + viewParams = tr("Byte Range: %1 - %2") + .arg(descriptorBind.byteOffset) + .arg(descriptorBind.byteOffset + length); } rows.push_back({setname, slotname, name, ToQStr(bind.type), (qulonglong)w, h, d, arr, @@ -2875,7 +2893,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: } } -void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::Raster &rs) +void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::Rasterizer &rs) { { xml.writeStartElement(lit("h3")); @@ -2884,7 +2902,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: m_Common.exportHTMLTable( xml, {tr("Fill Mode"), tr("Cull Mode"), tr("Front CCW")}, - {ToQStr(rs.fillMode), ToQStr(rs.cullMode), rs.FrontCCW ? tr("Yes") : tr("No")}); + {ToQStr(rs.fillMode), ToQStr(rs.cullMode), rs.frontCCW ? tr("Yes") : tr("No")}); xml.writeStartElement(lit("p")); xml.writeEndElement(); @@ -2902,7 +2920,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: Formatter::Format(rs.slopeScaledDepthBias), Formatter::Format(rs.lineWidth)}); } - const VKPipe::MultiSample &msaa = m_Ctx.CurVulkanPipelineState().MSAA; + const VKPipe::MultiSample &msaa = m_Ctx.CurVulkanPipelineState().multisample; { xml.writeStartElement(lit("h3")); @@ -2916,7 +2934,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: Formatter::Format(msaa.minSampleShading), Formatter::Format(msaa.sampleMask, true)}); } - const VKPipe::ViewState &vp = m_Ctx.CurVulkanPipelineState().VP; + const VKPipe::ViewState &vp = m_Ctx.CurVulkanPipelineState().viewportScissor; { xml.writeStartElement(lit("h3")); @@ -2928,7 +2946,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: int i = 0; for(const VKPipe::ViewportScissor &vs : vp.viewportScissors) { - const VKPipe::Viewport &v = vs.vp; + const Viewport &v = vs.vp; rows.push_back({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth}); @@ -2950,7 +2968,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: int i = 0; for(const VKPipe::ViewportScissor &vs : vp.viewportScissors) { - const VKPipe::Scissor &s = vs.scissor; + const Scissor &s = vs.scissor; rows.push_back({i, s.x, s.y, s.width, s.height}); @@ -2961,24 +2979,26 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: } } -void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::ColorBlend &cb) +void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::ColorBlendState &cb) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Color Blend State")); xml.writeEndElement(); QString blendConst = QFormatStr("%1, %2, %3, %4") - .arg(cb.blendConst[0], 0, 'f', 2) - .arg(cb.blendConst[1], 0, 'f', 2) - .arg(cb.blendConst[2], 0, 'f', 2) - .arg(cb.blendConst[3], 0, 'f', 2); + .arg(cb.blendFactor[0], 0, 'f', 2) + .arg(cb.blendFactor[1], 0, 'f', 2) + .arg(cb.blendFactor[2], 0, 'f', 2) + .arg(cb.blendFactor[3], 0, 'f', 2); + + bool logic = !cb.blends.isEmpty() && cb.blends[0].logicOperationEnabled; m_Common.exportHTMLTable( xml, {tr("Alpha to Coverage"), tr("Alpha to One"), tr("Logic Op"), tr("Blend Constant")}, { cb.alphaToCoverageEnable ? tr("Yes") : tr("No"), cb.alphaToOneEnable ? tr("Yes") : tr("No"), - cb.logicOpEnable ? ToQStr(cb.logic) : tr("Disabled"), blendConst, + logic ? ToQStr(cb.blends[0].logicOperation) : tr("Disabled"), blendConst, }); xml.writeStartElement(lit("h3")); @@ -2988,15 +3008,16 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; int i = 0; - for(const VKPipe::Blend &b : cb.attachments) + for(const ColorBlend &b : cb.blends) { - rows.push_back( - {i, b.blendEnable ? tr("Yes") : tr("No"), ToQStr(b.blend.Source), ToQStr(b.blend.Destination), - ToQStr(b.blend.Operation), ToQStr(b.alphaBlend.Source), ToQStr(b.alphaBlend.Destination), - ToQStr(b.alphaBlend.Operation), ((b.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + - ((b.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + - ((b.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + - ((b.writeMask & 0x8) == 0 ? lit("_") : lit("A"))}); + rows.push_back({i, b.enabled ? tr("Yes") : tr("No"), ToQStr(b.colorBlend.source), + ToQStr(b.colorBlend.destination), ToQStr(b.colorBlend.operation), + ToQStr(b.alphaBlend.source), ToQStr(b.alphaBlend.destination), + ToQStr(b.alphaBlend.operation), + ((b.writeMask & 0x1) == 0 ? lit("_") : lit("R")) + + ((b.writeMask & 0x2) == 0 ? lit("_") : lit("G")) + + ((b.writeMask & 0x4) == 0 ? lit("_") : lit("B")) + + ((b.writeMask & 0x8) == 0 ? lit("_") : lit("A"))}); i++; } @@ -3023,11 +3044,11 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: tr("Depth Bounds")}, { ds.depthTestEnable ? tr("Yes") : tr("No"), ds.depthWriteEnable ? tr("Yes") : tr("No"), - ToQStr(ds.depthCompareOp), ds.depthBoundsEnable - ? QFormatStr("%1 - %2") - .arg(Formatter::Format(ds.minDepthBounds)) - .arg(Formatter::Format(ds.maxDepthBounds)) - : tr("Disabled"), + ToQStr(ds.depthFunction), ds.depthBoundsEnable + ? QFormatStr("%1 - %2") + .arg(Formatter::Format(ds.minDepthBounds)) + .arg(Formatter::Format(ds.maxDepthBounds)) + : tr("Disabled"), }); } @@ -3041,17 +3062,19 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; rows.push_back({ - tr("Front"), Formatter::Format(ds.front.ref, true), - Formatter::Format(ds.front.compareMask, true), - Formatter::Format(ds.front.writeMask, true), ToQStr(ds.front.Func), - ToQStr(ds.front.PassOp), ToQStr(ds.front.FailOp), ToQStr(ds.front.DepthFailOp), + tr("Front"), Formatter::Format(ds.frontFace.reference, true), + Formatter::Format(ds.frontFace.compareMask, true), + Formatter::Format(ds.frontFace.writeMask, true), ToQStr(ds.frontFace.function), + ToQStr(ds.frontFace.passOperation), ToQStr(ds.frontFace.failOperation), + ToQStr(ds.frontFace.depthFailOperation), }); rows.push_back({ - tr("back"), Formatter::Format(ds.back.ref, true), - Formatter::Format(ds.back.compareMask, true), Formatter::Format(ds.back.writeMask, true), - ToQStr(ds.back.Func), ToQStr(ds.back.PassOp), ToQStr(ds.back.FailOp), - ToQStr(ds.back.DepthFailOp), + tr("back"), Formatter::Format(ds.backFace.reference, true), + Formatter::Format(ds.backFace.compareMask, true), + Formatter::Format(ds.backFace.writeMask, true), ToQStr(ds.backFace.function), + ToQStr(ds.backFace.passOperation), ToQStr(ds.backFace.failOperation), + ToQStr(ds.backFace.depthFailOperation), }); m_Common.exportHTMLTable(xml, @@ -3084,11 +3107,11 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: int i = 0; for(const VKPipe::Attachment &a : pass.framebuffer.attachments) { - TextureDescription *tex = m_Ctx.GetTexture(a.img); + TextureDescription *tex = m_Ctx.GetTexture(a.imageResourceId); - QString name = m_Ctx.GetResourceName(a.img); + QString name = m_Ctx.GetResourceName(a.imageResourceId); - rows.push_back({i, name, a.baseMip, a.numMip, a.baseLayer, a.numLayer}); + rows.push_back({i, name, a.firstMip, a.numMips, a.firstSlice, a.numSlices}); i++; } @@ -3194,37 +3217,37 @@ void VulkanPipelineStateViewer::on_exportHTML_clicked() xml.writeStartElement(lit("h2")); xml.writeCharacters(tr("Input Assembly")); xml.writeEndElement(); - exportHTML(xml, m_Ctx.CurVulkanPipelineState().IA); + exportHTML(xml, m_Ctx.CurVulkanPipelineState().inputAssembly); xml.writeStartElement(lit("h2")); xml.writeCharacters(tr("Vertex Input")); xml.writeEndElement(); - exportHTML(xml, m_Ctx.CurVulkanPipelineState().VI); + exportHTML(xml, m_Ctx.CurVulkanPipelineState().vertexInput); break; - case 1: exportHTML(xml, m_Ctx.CurVulkanPipelineState().m_VS); break; - case 2: exportHTML(xml, m_Ctx.CurVulkanPipelineState().m_TCS); break; - case 3: exportHTML(xml, m_Ctx.CurVulkanPipelineState().m_TES); break; - case 4: exportHTML(xml, m_Ctx.CurVulkanPipelineState().m_GS); break; - case 5: exportHTML(xml, m_Ctx.CurVulkanPipelineState().RS); break; - case 6: exportHTML(xml, m_Ctx.CurVulkanPipelineState().m_FS); break; + case 1: exportHTML(xml, m_Ctx.CurVulkanPipelineState().vertexShader); break; + case 2: exportHTML(xml, m_Ctx.CurVulkanPipelineState().tessControlShader); break; + case 3: exportHTML(xml, m_Ctx.CurVulkanPipelineState().tessEvalShader); break; + case 4: exportHTML(xml, m_Ctx.CurVulkanPipelineState().geometryShader); break; + case 5: exportHTML(xml, m_Ctx.CurVulkanPipelineState().rasterizer); break; + case 6: exportHTML(xml, m_Ctx.CurVulkanPipelineState().fragmentShader); break; case 7: // FB xml.writeStartElement(lit("h2")); xml.writeCharacters(tr("Color Blend")); xml.writeEndElement(); - exportHTML(xml, m_Ctx.CurVulkanPipelineState().CB); + exportHTML(xml, m_Ctx.CurVulkanPipelineState().colorBlend); xml.writeStartElement(lit("h2")); xml.writeCharacters(tr("Depth Stencil")); xml.writeEndElement(); - exportHTML(xml, m_Ctx.CurVulkanPipelineState().DS); + exportHTML(xml, m_Ctx.CurVulkanPipelineState().depthStencil); xml.writeStartElement(lit("h2")); xml.writeCharacters(tr("Current Pass")); xml.writeEndElement(); - exportHTML(xml, m_Ctx.CurVulkanPipelineState().Pass); + exportHTML(xml, m_Ctx.CurVulkanPipelineState().currentPass); break; - case 8: exportHTML(xml, m_Ctx.CurVulkanPipelineState().m_CS); break; + case 8: exportHTML(xml, m_Ctx.CurVulkanPipelineState().computeShader); break; } xml.writeEndElement(); diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.h b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.h index 02d9acf15..075b81373 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.h +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.h @@ -57,8 +57,8 @@ public: void OnCaptureLoaded(); void OnCaptureClosed(); - void OnSelectedEventChanged(uint32_t eventID) {} - void OnEventChanged(uint32_t eventID); + void OnSelectedEventChanged(uint32_t eventId) {} + void OnEventChanged(uint32_t eventId); private slots: // automatic slots @@ -120,8 +120,8 @@ private: void exportHTML(QXmlStreamWriter &xml, const VKPipe::VertexInput &vi); void exportHTML(QXmlStreamWriter &xml, const VKPipe::InputAssembly &ia); void exportHTML(QXmlStreamWriter &xml, const VKPipe::Shader &sh); - void exportHTML(QXmlStreamWriter &xml, const VKPipe::Raster &rs); - void exportHTML(QXmlStreamWriter &xml, const VKPipe::ColorBlend &cb); + void exportHTML(QXmlStreamWriter &xml, const VKPipe::Rasterizer &rs); + void exportHTML(QXmlStreamWriter &xml, const VKPipe::ColorBlendState &cb); void exportHTML(QXmlStreamWriter &xml, const VKPipe::DepthStencil &ds); void exportHTML(QXmlStreamWriter &xml, const VKPipe::CurrentPass &pass); diff --git a/qrenderdoc/Windows/PixelHistoryView.cpp b/qrenderdoc/Windows/PixelHistoryView.cpp index ac8dc4f6b..02b14b7c0 100644 --- a/qrenderdoc/Windows/PixelHistoryView.cpp +++ b/qrenderdoc/Windows/PixelHistoryView.cpp @@ -32,7 +32,7 @@ struct EventTag { - uint32_t eventID = 0; + uint32_t eventId = 0; uint32_t primitive = ~0U; }; @@ -93,10 +93,10 @@ public: m_History.reserve(m_ModList.count()); for(const PixelModification &h : m_ModList) { - if(!show && !h.passed()) + if(!show && !h.Passed()) continue; - if(m_History.isEmpty() || m_History.back().back().eventID != h.eventID) + if(m_History.isEmpty() || m_History.back().back().eventId != h.eventId) m_History.push_back({h}); else m_History.back().push_back(h); @@ -133,7 +133,7 @@ public: if(isEvent(parent)) { const QList &mods = getMods(parent); - const DrawcallDescription *draw = m_Ctx.GetDrawcall(mods.front().eventID); + const DrawcallDescription *draw = m_Ctx.GetDrawcall(mods.front().eventId); if(draw && draw->flags & DrawFlags::Clear) return 0; @@ -193,7 +193,7 @@ public: if(isEvent(index)) { const QList &mods = getMods(index); - const DrawcallDescription *drawcall = m_Ctx.GetDrawcall(mods.front().eventID); + const DrawcallDescription *drawcall = m_Ctx.GetDrawcall(mods.front().eventId); if(!drawcall) return QVariant(); @@ -229,10 +229,10 @@ public: if(mods.front().directShaderWrite) { ret += tr("EID %1\n%2\nBound as UAV or copy - potential modification") - .arg(mods.front().eventID) + .arg(mods.front().eventId) .arg(drawcall->name); - if(memcmp(mods[0].preMod.col.value_u, mods[0].postMod.col.value_u, + if(memcmp(mods[0].preMod.col.uintValue, mods[0].postMod.col.uintValue, sizeof(uint32_t) * 4) == 0) { ret += tr("\nNo change in tex value"); @@ -243,12 +243,12 @@ public: { passed = false; for(const PixelModification &m : mods) - passed |= m.passed(); + passed |= m.Passed(); QString failure = passed ? QString() : failureString(mods[0]); ret += tr("EID %1\n%2%3\n%4 Fragments touching pixel\n") - .arg(mods.front().eventID) + .arg(mods.front().eventId) .arg(drawcall->name) .arg(failure) .arg(mods.count()); @@ -264,10 +264,10 @@ public: { QString ret = tr("Potential UAV/Copy write"); - if(mod.preMod.col.value_u[0] == mod.postMod.col.value_u[0] && - mod.preMod.col.value_u[1] == mod.postMod.col.value_u[1] && - mod.preMod.col.value_u[2] == mod.postMod.col.value_u[2] && - mod.preMod.col.value_u[3] == mod.postMod.col.value_u[3]) + if(mod.preMod.col.uintValue[0] == mod.postMod.col.uintValue[0] && + mod.preMod.col.uintValue[1] == mod.postMod.col.uintValue[1] && + mod.preMod.col.uintValue[2] == mod.postMod.col.uintValue[2] && + mod.preMod.col.uintValue[3] == mod.postMod.col.uintValue[3]) { ret += tr("\nNo change in tex value"); } @@ -343,11 +343,11 @@ public: bool passed = false; for(const PixelModification &m : mods) - passed |= m.passed(); + passed |= m.Passed(); if(mods[0].directShaderWrite && - memcmp(mods[0].preMod.col.value_u, mods[0].postMod.col.value_u, sizeof(uint32_t) * 4) == - 0) + memcmp(mods[0].preMod.col.uintValue, mods[0].postMod.col.uintValue, + sizeof(uint32_t) * 4) == 0) return QBrush(QColor::fromRgb(235, 235, 235)); return passed ? QBrush(QColor::fromRgb(235, 255, 235)) @@ -366,13 +366,13 @@ public: if(isEvent(index)) { - tag.eventID = getMods(index).first().eventID; + tag.eventId = getMods(index).first().eventId; } else { const PixelModification &mod = getMod(index); - tag.eventID = mod.eventID; + tag.eventId = mod.eventId; if(!mod.directShaderWrite) tag.primitive = mod.primitiveID; } @@ -385,7 +385,7 @@ public: } const QVector &modifications() { return m_ModList; } - ResourceId texID() { return m_Tex->ID; } + ResourceId texID() { return m_Tex->resourceId; } private: ICaptureContext &m_Ctx; @@ -447,34 +447,34 @@ private: QBrush backgroundBrush(const ModificationValue &val) const { - float rangesize = (m_Display.rangemax - m_Display.rangemin); + float rangesize = (m_Display.rangeMax - m_Display.rangeMin); - float r = val.col.value_f[0]; - float g = val.col.value_f[1]; - float b = val.col.value_f[2]; + float r = val.col.floatValue[0]; + float g = val.col.floatValue[1]; + float b = val.col.floatValue[2]; - if(!m_Display.Red) + if(!m_Display.red) r = 0.0f; - if(!m_Display.Green) + if(!m_Display.green) g = 0.0f; - if(!m_Display.Blue) + if(!m_Display.blue) b = 0.0f; - if(m_Display.Red && !m_Display.Green && !m_Display.Blue && !m_Display.Alpha) + if(m_Display.red && !m_Display.green && !m_Display.blue && !m_Display.alpha) g = b = r; - if(!m_Display.Red && m_Display.Green && !m_Display.Blue && !m_Display.Alpha) + if(!m_Display.red && m_Display.green && !m_Display.blue && !m_Display.alpha) r = b = g; - if(!m_Display.Red && !m_Display.Green && m_Display.Blue && !m_Display.Alpha) + if(!m_Display.red && !m_Display.green && m_Display.blue && !m_Display.alpha) g = r = b; - if(!m_Display.Red && !m_Display.Green && !m_Display.Blue && m_Display.Alpha) - g = b = r = val.col.value_f[3]; + if(!m_Display.red && !m_Display.green && !m_Display.blue && m_Display.alpha) + g = b = r = val.col.floatValue[3]; - r = qBound(0.0f, (r - m_Display.rangemin) / rangesize, 1.0f); - g = qBound(0.0f, (g - m_Display.rangemin) / rangesize, 1.0f); - b = qBound(0.0f, (b - m_Display.rangemin) / rangesize, 1.0f); + r = qBound(0.0f, (r - m_Display.rangeMin) / rangesize, 1.0f); + g = qBound(0.0f, (g - m_Display.rangeMin) / rangesize, 1.0f); + b = qBound(0.0f, (b - m_Display.rangeMin) / rangesize, 1.0f); if(m_IsDepth) - r = g = b = qBound(0.0f, (val.depth - m_Display.rangemin) / rangesize, 1.0f); + r = g = b = qBound(0.0f, (val.depth - m_Display.rangeMin) / rangesize, 1.0f); { r = (float)powf(r, 1.0f / 2.2f); @@ -498,17 +498,17 @@ private: if(m_IsUint) { for(int i = 0; i < numComps; i++) - s += colourLetterPrefix[i] + Formatter::Format(val.col.value_u[i]) + lit("\n"); + s += colourLetterPrefix[i] + Formatter::Format(val.col.uintValue[i]) + lit("\n"); } else if(m_IsSint) { for(int i = 0; i < numComps; i++) - s += colourLetterPrefix[i] + Formatter::Format(val.col.value_i[i]) + lit("\n"); + s += colourLetterPrefix[i] + Formatter::Format(val.col.intValue[i]) + lit("\n"); } else { for(int i = 0; i < numComps; i++) - s += colourLetterPrefix[i] + Formatter::Format(val.col.value_f[i]) + lit("\n"); + s += colourLetterPrefix[i] + Formatter::Format(val.col.floatValue[i]) + lit("\n"); } } @@ -569,11 +569,11 @@ PixelHistoryView::PixelHistoryView(ICaptureContext &ctx, ResourceId id, QPoint p updateWindowTitle(); QString channelStr; - if(display.Red) + if(display.red) channelStr += lit("R"); - if(display.Green) + if(display.green) channelStr += lit("G"); - if(display.Blue) + if(display.blue) channelStr += lit("B"); if(channelStr.length() > 1) @@ -581,13 +581,13 @@ PixelHistoryView::PixelHistoryView(ICaptureContext &ctx, ResourceId id, QPoint p else channelStr += tr(" channel"); - if(!display.Red && !display.Green && !display.Blue && display.Alpha) + if(!display.red && !display.green && !display.blue && display.alpha) channelStr = lit("Alpha"); QString text; text = tr("Preview colours displayed in visible range %1 - %2 with %3 visible.\n\n") - .arg(Formatter::Format(display.rangemin)) - .arg(Formatter::Format(display.rangemax)) + .arg(Formatter::Format(display.rangeMin)) + .arg(Formatter::Format(display.rangeMax)) .arg(channelStr); text += tr("Double click to jump to an event.\n" @@ -665,7 +665,7 @@ void PixelHistoryView::OnCaptureClosed() ToolWindowManager::closeToolWindow(this); } -void PixelHistoryView::OnEventChanged(uint32_t eventID) +void PixelHistoryView::OnEventChanged(uint32_t eventId) { updateWindowTitle(); } @@ -679,7 +679,7 @@ void PixelHistoryView::SetHistory(const rdcarray &history) void PixelHistoryView::startDebug(EventTag tag) { - m_Ctx.SetEventID({this}, tag.eventID, tag.eventID); + m_Ctx.SetEventID({this}, tag.eventId, tag.eventId); ShaderDebugTrace *trace = NULL; @@ -712,7 +712,7 @@ void PixelHistoryView::startDebug(EventTag tag) void PixelHistoryView::jumpToPrimitive(EventTag tag) { - m_Ctx.SetEventID({this}, tag.eventID, tag.eventID); + m_Ctx.SetEventID({this}, tag.eventId, tag.eventId); m_Ctx.ShowMeshPreview(); IBufferViewer *viewer = m_Ctx.GetMeshPreview(); @@ -752,27 +752,27 @@ void PixelHistoryView::on_events_customContextMenuRequested(const QPoint &pos) } EventTag tag = m_Model->data(index, Qt::UserRole).value(); - if(tag.eventID == 0) + if(tag.eventId == 0) { RDDialog::show(&contextMenu, ui->events->viewport()->mapToGlobal(pos)); return; } - QAction jumpAction(tr("&Go to primitive %1 at Event %2").arg(tag.primitive).arg(tag.eventID), this); + QAction jumpAction(tr("&Go to primitive %1 at Event %2").arg(tag.primitive).arg(tag.eventId), this); QString debugText; if(tag.primitive == ~0U) { debugText = - tr("&Debug Pixel (%1, %2) at Event %3").arg(m_Pixel.x()).arg(m_Pixel.y()).arg(tag.eventID); + tr("&Debug Pixel (%1, %2) at Event %3").arg(m_Pixel.x()).arg(m_Pixel.y()).arg(tag.eventId); } else { debugText = tr("&Debug Pixel (%1, %2) primitive %3 at Event %4") .arg(m_Pixel.x()) .arg(m_Pixel.y()) - .arg(tag.eventID) + .arg(tag.eventId) .arg(tag.primitive); contextMenu.addAction(&jumpAction); @@ -791,6 +791,6 @@ void PixelHistoryView::on_events_customContextMenuRequested(const QPoint &pos) void PixelHistoryView::on_events_doubleClicked(const QModelIndex &index) { EventTag tag = m_Model->data(index, Qt::UserRole).value(); - if(tag.eventID > 0) - m_Ctx.SetEventID({this}, tag.eventID, tag.eventID); + if(tag.eventId > 0) + m_Ctx.SetEventID({this}, tag.eventId, tag.eventId); } diff --git a/qrenderdoc/Windows/PixelHistoryView.h b/qrenderdoc/Windows/PixelHistoryView.h index 94f81c636..adad5b809 100644 --- a/qrenderdoc/Windows/PixelHistoryView.h +++ b/qrenderdoc/Windows/PixelHistoryView.h @@ -51,8 +51,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: // automatic slots void on_events_customContextMenuRequested(const QPoint &pos); diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 4c93c076e..def1e5d59 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -94,9 +94,9 @@ struct CaptureContextInvoker : ICaptureContext virtual const rdcarray &GetTextures() override { return m_Ctx.GetTextures(); } virtual BufferDescription *GetBuffer(ResourceId id) override { return m_Ctx.GetBuffer(id); } virtual const rdcarray &GetBuffers() override { return m_Ctx.GetBuffers(); } - virtual const DrawcallDescription *GetDrawcall(uint32_t eventID) override + virtual const DrawcallDescription *GetDrawcall(uint32_t eventId) override { - return m_Ctx.GetDrawcall(eventID); + return m_Ctx.GetDrawcall(eventId); } virtual const SDFile &GetStructuredFile() override { return m_Ctx.GetStructuredFile(); } virtual WindowingSystem CurWindowingSystem() override { return m_Ctx.CurWindowingSystem(); } @@ -171,9 +171,9 @@ struct CaptureContextInvoker : ICaptureContext } virtual void CloseCapture() override { InvokeVoidFunction(&ICaptureContext::CloseCapture); } virtual void SetEventID(const rdcarray &exclude, uint32_t selectedEventID, - uint32_t eventID, bool force = false) override + uint32_t eventId, bool force = false) override { - InvokeVoidFunction(&ICaptureContext::SetEventID, exclude, selectedEventID, eventID, force); + InvokeVoidFunction(&ICaptureContext::SetEventID, exclude, selectedEventID, eventId, force); } virtual void RefreshStatus() override { InvokeVoidFunction(&ICaptureContext::RefreshStatus); } virtual void AddCaptureViewer(ICaptureViewer *viewer) override diff --git a/qrenderdoc/Windows/ResourceInspector.cpp b/qrenderdoc/Windows/ResourceInspector.cpp index 0c5e0d180..c110a3aa4 100644 --- a/qrenderdoc/Windows/ResourceInspector.cpp +++ b/qrenderdoc/Windows/ResourceInspector.cpp @@ -77,13 +77,13 @@ public: const ResourceDescription &desc = resources[index.row()]; if(role == Qt::DisplayRole) - return m_Ctx.GetResourceName(desc.ID); + return m_Ctx.GetResourceName(desc.resourceId); if(role == ResourceIdRole) - return QVariant::fromValue(desc.ID); + return QVariant::fromValue(desc.resourceId); if(role == FilterRole) - return ToQStr(desc.type) + lit(" ") + m_Ctx.GetResourceName(desc.ID); + return ToQStr(desc.type) + lit(" ") + m_Ctx.GetResourceName(desc.resourceId); } } @@ -303,7 +303,7 @@ void ResourceInspector::OnCaptureClosed() m_Resource = ResourceId(); } -void ResourceInspector::OnEventChanged(uint32_t eventID) +void ResourceInspector::OnEventChanged(uint32_t eventId) { Inspect(m_Resource); @@ -385,9 +385,9 @@ void ResourceInspector::on_viewContents_clicked() if(tex) { - if(tex->resType == TextureDim::Buffer) + if(tex->type == TextureType::Buffer) { - IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->ID); + IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(0, 0, tex->resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -396,12 +396,12 @@ void ResourceInspector::on_viewContents_clicked() if(!m_Ctx.HasTextureViewer()) m_Ctx.ShowTextureViewer(); ITextureViewer *viewer = m_Ctx.GetTextureViewer(); - viewer->ViewTexture(tex->ID, true); + viewer->ViewTexture(tex->resourceId, true); } } else if(buf) { - IBufferViewer *viewer = m_Ctx.ViewBuffer(0, buf->length, buf->ID); + IBufferViewer *viewer = m_Ctx.ViewBuffer(0, buf->length, buf->resourceId); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } diff --git a/qrenderdoc/Windows/ResourceInspector.h b/qrenderdoc/Windows/ResourceInspector.h index f01c931bf..cc8039cb3 100644 --- a/qrenderdoc/Windows/ResourceInspector.h +++ b/qrenderdoc/Windows/ResourceInspector.h @@ -52,8 +52,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; public slots: // automatic slots void on_renameResource_clicked(); diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 3424bb803..6e268be0a 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -301,7 +301,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR if(shader) { - m_Stage = shader->Stage; + m_Stage = shader->stage; m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) { rdcarray targets = r->GetDisassemblyTargets(); @@ -364,20 +364,20 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR &ShaderViewer::disasm_tooltipHide); } - if(shader && !shader->DebugInfo.files.isEmpty()) + if(shader && !shader->debugInfo.files.isEmpty()) { if(trace) - setWindowTitle(QFormatStr("Debug %1() - %2").arg(shader->EntryPoint).arg(debugContext)); + setWindowTitle(QFormatStr("Debug %1() - %2").arg(shader->entryPoint).arg(debugContext)); else - setWindowTitle(shader->EntryPoint); + setWindowTitle(shader->entryPoint); int fileIdx = 0; QWidget *sel = NULL; - for(const ShaderSourceFile &f : shader->DebugInfo.files) + for(const ShaderSourceFile &f : shader->debugInfo.files) { - QString name = QFileInfo(f.Filename).fileName(); - QString text = f.Contents; + QString name = QFileInfo(f.filename).fileName(); + QString text = f.contents; ScintillaEdit *scintilla = AddFileScintilla(name, text); @@ -390,7 +390,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR if(trace || sel == NULL) sel = m_DisassemblyView; - if(shader->DebugInfo.files.size() > 2) + if(shader->debugInfo.files.size() > 2) addFileList(); ToolWindowManager::raiseToolWindow(sel); @@ -516,7 +516,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR if(shader) { - for(const SigParameter &s : shader->InputSig) + for(const SigParameter &s : shader->inputSignature) { QString name = s.varName.isEmpty() ? QString(s.semanticName) @@ -535,7 +535,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR } bool multipleStreams = false; - for(const SigParameter &s : shader->OutputSig) + for(const SigParameter &s : shader->outputSignature) { if(s.stream > 0) { @@ -544,7 +544,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR } } - for(const SigParameter &s : shader->OutputSig) + for(const SigParameter &s : shader->outputSignature) { QString name = s.varName.isEmpty() ? QString(s.semanticName) @@ -621,7 +621,7 @@ void ShaderViewer::OnCaptureClosed() ToolWindowManager::closeToolWindow(this); } -void ShaderViewer::OnEventChanged(uint32_t eventID) +void ShaderViewer::OnEventChanged(uint32_t eventId) { updateDebugging(); updateWindowTitle(); @@ -1050,18 +1050,18 @@ QString ShaderViewer::stringRep(const ShaderVariable &var, bool useType) return RowString(var, 0, VarType::Float); } -RDTreeWidgetItem *ShaderViewer::makeResourceRegister(const BindpointMap &bind, uint32_t idx, +RDTreeWidgetItem *ShaderViewer::makeResourceRegister(const Bindpoint &bind, uint32_t idx, const BoundResource &bound, const ShaderResource &res) { QString name = QFormatStr(" (%1)").arg(res.name); - const TextureDescription *tex = m_Ctx.GetTexture(bound.Id); - const BufferDescription *buf = m_Ctx.GetBuffer(bound.Id); + const TextureDescription *tex = m_Ctx.GetTexture(bound.resourceId); + const BufferDescription *buf = m_Ctx.GetBuffer(bound.resourceId); QChar regChar(QLatin1Char('u')); - if(res.IsReadOnly) + if(res.isReadOnly) regChar = QLatin1Char('t'); QString regname; @@ -1086,19 +1086,21 @@ RDTreeWidgetItem *ShaderViewer::makeResourceRegister(const BindpointMap &bind, u .arg(tex->depth > 1 ? tex->depth : tex->arraysize) .arg(tex->mips) .arg(tex->format.Name()) - .arg(m_Ctx.GetResourceName(bound.Id)); + .arg(m_Ctx.GetResourceName(bound.resourceId)); return new RDTreeWidgetItem({regname + name, lit("Texture"), type}); } else if(buf) { - QString type = QFormatStr("%1 - %2").arg(buf->length).arg(m_Ctx.GetResourceName(bound.Id)); + QString type = + QFormatStr("%1 - %2").arg(buf->length).arg(m_Ctx.GetResourceName(bound.resourceId)); return new RDTreeWidgetItem({regname + name, lit("Buffer"), type}); } else { - return new RDTreeWidgetItem({regname + name, lit("Resource"), m_Ctx.GetResourceName(bound.Id)}); + return new RDTreeWidgetItem( + {regname + name, lit("Resource"), m_Ctx.GetResourceName(bound.resourceId)}); } } @@ -1161,15 +1163,16 @@ void ShaderViewer::updateDebugging() if(ui->constants->topLevelItemCount() == 0) { - for(int i = 0; i < m_Trace->cbuffers.count(); i++) + for(int i = 0; i < m_Trace->constantBlocks.count(); i++) { - for(int j = 0; j < m_Trace->cbuffers[i].members.count(); j++) + for(int j = 0; j < m_Trace->constantBlocks[i].members.count(); j++) { - if(m_Trace->cbuffers[i].members[j].rows > 0 || m_Trace->cbuffers[i].members[j].columns > 0) + if(m_Trace->constantBlocks[i].members[j].rows > 0 || + m_Trace->constantBlocks[i].members[j].columns > 0) { RDTreeWidgetItem *node = - new RDTreeWidgetItem({m_Trace->cbuffers[i].members[j].name, lit("cbuffer"), - stringRep(m_Trace->cbuffers[i].members[j], false)}); + new RDTreeWidgetItem({m_Trace->constantBlocks[i].members[j].name, lit("cbuffer"), + stringRep(m_Trace->constantBlocks[i].members[j], false)}); node->setTag(QVariant::fromValue(VariableTag(VariableCategory::Constants, j, i))); ui->constants->addTopLevelItem(node); @@ -1197,35 +1200,35 @@ void ShaderViewer::updateDebugging() bool tree = false; for(int i = 0; - i < m_Mapping->ReadWriteResources.count() && i < m_ShaderDetails->ReadWriteResources.count(); + i < m_Mapping->readWriteResources.count() && i < m_ShaderDetails->readWriteResources.count(); i++) { - BindpointMap bind = m_Mapping->ReadWriteResources[i]; + Bindpoint bind = m_Mapping->readWriteResources[i]; if(!bind.used) continue; int idx = rw.indexOf(bind); - if(idx < 0 || rw[idx].Resources.isEmpty()) + if(idx < 0 || rw[idx].resources.isEmpty()) continue; if(bind.arraySize == 1) { - RDTreeWidgetItem *node = makeResourceRegister(bind, 0, rw[idx].Resources[0], - m_ShaderDetails->ReadWriteResources[i]); + RDTreeWidgetItem *node = makeResourceRegister(bind, 0, rw[idx].resources[0], + m_ShaderDetails->readWriteResources[i]); if(node) ui->constants->addTopLevelItem(node); } else { RDTreeWidgetItem *node = - new RDTreeWidgetItem({m_ShaderDetails->ReadWriteResources[i].name, + new RDTreeWidgetItem({m_ShaderDetails->readWriteResources[i].name, QFormatStr("[%1]").arg(bind.arraySize), QString()}); for(uint32_t a = 0; a < bind.arraySize; a++) - node->addChild(makeResourceRegister(bind, a, rw[idx].Resources[a], - m_ShaderDetails->ReadWriteResources[i])); + node->addChild(makeResourceRegister(bind, a, rw[idx].resources[a], + m_ShaderDetails->readWriteResources[i])); tree = true; @@ -1234,35 +1237,35 @@ void ShaderViewer::updateDebugging() } for(int i = 0; - i < m_Mapping->ReadOnlyResources.count() && i < m_ShaderDetails->ReadOnlyResources.count(); + i < m_Mapping->readOnlyResources.count() && i < m_ShaderDetails->readOnlyResources.count(); i++) { - BindpointMap bind = m_Mapping->ReadOnlyResources[i]; + Bindpoint bind = m_Mapping->readOnlyResources[i]; if(!bind.used) continue; int idx = ro.indexOf(bind); - if(idx < 0 || ro[idx].Resources.isEmpty()) + if(idx < 0 || ro[idx].resources.isEmpty()) continue; if(bind.arraySize == 1) { - RDTreeWidgetItem *node = makeResourceRegister(bind, 0, ro[idx].Resources[0], - m_ShaderDetails->ReadOnlyResources[i]); + RDTreeWidgetItem *node = makeResourceRegister(bind, 0, ro[idx].resources[0], + m_ShaderDetails->readOnlyResources[i]); if(node) ui->constants->addTopLevelItem(node); } else { RDTreeWidgetItem *node = - new RDTreeWidgetItem({m_ShaderDetails->ReadOnlyResources[i].name, + new RDTreeWidgetItem({m_ShaderDetails->readOnlyResources[i].name, QFormatStr("[%1]").arg(bind.arraySize), QString()}); for(uint32_t a = 0; a < bind.arraySize; a++) - node->addChild(makeResourceRegister(bind, a, ro[idx].Resources[a], - m_ShaderDetails->ReadOnlyResources[i])); + node->addChild(makeResourceRegister(bind, a, ro[idx].resources[a], + m_ShaderDetails->readOnlyResources[i])); tree = true; @@ -1968,7 +1971,8 @@ const rdcarray *ShaderViewer::GetVariableList(VariableCategory v break; case VariableCategory::Inputs: vars = &m_Trace->inputs; break; case VariableCategory::Constants: - vars = arrayIdx < m_Trace->cbuffers.count() ? &m_Trace->cbuffers[arrayIdx].members : NULL; + vars = arrayIdx < m_Trace->constantBlocks.count() ? &m_Trace->constantBlocks[arrayIdx].members + : NULL; break; case VariableCategory::Outputs: vars = &state.outputs; break; } diff --git a/qrenderdoc/Windows/ShaderViewer.h b/qrenderdoc/Windows/ShaderViewer.h index 08064b360..c3ad1a911 100644 --- a/qrenderdoc/Windows/ShaderViewer.h +++ b/qrenderdoc/Windows/ShaderViewer.h @@ -102,8 +102,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; private slots: // automatic slots @@ -236,6 +236,6 @@ private: void runTo(int runToInstruction, bool forward, ShaderEvents condition = ShaderEvents::NoEvent); QString stringRep(const ShaderVariable &var, bool useType); - RDTreeWidgetItem *makeResourceRegister(const BindpointMap &bind, uint32_t idx, + RDTreeWidgetItem *makeResourceRegister(const Bindpoint &bind, uint32_t idx, const BoundResource &ro, const ShaderResource &resources); }; diff --git a/qrenderdoc/Windows/StatisticsViewer.cpp b/qrenderdoc/Windows/StatisticsViewer.cpp index 2852e4c2b..582ac40cf 100644 --- a/qrenderdoc/Windows/StatisticsViewer.cpp +++ b/qrenderdoc/Windows/StatisticsViewer.cpp @@ -460,7 +460,7 @@ void StatisticsViewer::AppendResourceBindStatistics() { uint32_t count = totalResourcesForAllStages.types[s]; int slice = SliceForString(Stars, count, maxCount); - TextureDim type = (TextureDim)s; + TextureType type = (TextureType)s; m_Report.append( QFormatStr("%1: %2 %3\n").arg(ToQStr(type), 20).arg(Stars.left(slice)).arg(CountOrEmpty(count))); } @@ -518,7 +518,7 @@ void StatisticsViewer::AppendUpdateStatistics() { uint32_t count = totalUpdates.types[s]; int slice = SliceForString(Stars, count, maxCount); - TextureDim type = (TextureDim)s; + TextureType type = (TextureType)s; m_Report.append( QFormatStr("%1: %2 %3\n").arg(ToQStr(type), 20).arg(Stars.left(slice)).arg(CountOrEmpty(count))); } @@ -694,7 +694,7 @@ void StatisticsViewer::GenerateReport() CountContributingEvents(d, drawCount, dispatchCount, diagnosticCount); uint32_t numAPIcalls = - m_Ctx.GetLastDrawcall()->eventID - (drawCount + dispatchCount + diagnosticCount); + m_Ctx.GetLastDrawcall()->eventId - (drawCount + dispatchCount + diagnosticCount); int numTextures = m_Ctx.GetTextures().count(); int numBuffers = m_Ctx.GetBuffers().count(); diff --git a/qrenderdoc/Windows/StatisticsViewer.h b/qrenderdoc/Windows/StatisticsViewer.h index b06557468..34606d971 100644 --- a/qrenderdoc/Windows/StatisticsViewer.h +++ b/qrenderdoc/Windows/StatisticsViewer.h @@ -45,8 +45,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override {} + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override {} private: Ui::StatisticsViewer *ui; ICaptureContext &m_Ctx; diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index cc5809091..3d66fe79e 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -95,12 +95,12 @@ void Following::GetDrawContext(ICaptureContext &ctx, bool ©, bool &clear, bo int Following::GetHighestMip(ICaptureContext &ctx) { - return GetBoundResource(ctx, arrayEl).HighestMip; + return GetBoundResource(ctx, arrayEl).firstMip; } int Following::GetFirstArraySlice(ICaptureContext &ctx) { - return GetBoundResource(ctx, arrayEl).FirstSlice; + return GetBoundResource(ctx, arrayEl).firstSlice; } CompType Following::GetTypeHint(ICaptureContext &ctx) @@ -110,7 +110,7 @@ CompType Following::GetTypeHint(ICaptureContext &ctx) ResourceId Following::GetResourceId(ICaptureContext &ctx) { - return GetBoundResource(ctx, arrayEl).Id; + return GetBoundResource(ctx, arrayEl).resourceId; } BoundResource Following::GetBoundResource(ICaptureContext &ctx, int arrayIdx) @@ -134,13 +134,13 @@ BoundResource Following::GetBoundResource(ICaptureContext &ctx, int arrayIdx) ShaderBindpointMapping mapping = GetMapping(ctx); - if(index < mapping.ReadWriteResources.count()) + if(index < mapping.readWriteResources.count()) { - BindpointMap &key = mapping.ReadWriteResources[index]; + Bindpoint &key = mapping.readWriteResources[index]; int residx = rw.indexOf(key); if(residx >= 0) - ret = rw[residx].Resources[arrayIdx]; + ret = rw[residx].resources[arrayIdx]; } } else if(Type == FollowType::ReadOnly) @@ -149,13 +149,13 @@ BoundResource Following::GetBoundResource(ICaptureContext &ctx, int arrayIdx) ShaderBindpointMapping mapping = GetMapping(ctx); - if(index < mapping.ReadOnlyResources.count()) + if(index < mapping.readOnlyResources.count()) { - BindpointMap &key = mapping.ReadOnlyResources[index]; + Bindpoint &key = mapping.readOnlyResources[index]; int residx = ro.indexOf(key); if(residx >= 0) - ret = ro[residx].Resources[arrayIdx]; + ret = ro[residx].resources[arrayIdx]; } } @@ -188,7 +188,7 @@ rdcarray Following::GetOutputTargets(ICaptureContext &ctx) for(const TextureDescription &tex : ctx.GetTextures()) { if(tex.creationFlags & TextureCategory::SwapBuffer) - return {BoundResource(tex.ID)}; + return {BoundResource(tex.resourceId)}; } } @@ -247,7 +247,7 @@ rdcarray Following::GetReadOnlyResources(ICaptureContext &ct // only return copy source for one stage if(copy && stage == ShaderStage::Pixel) - ret.push_back(BoundResourceArray(BindpointMap(0, 0), {BoundResource(curDraw->copySource)})); + ret.push_back(BoundResourceArray(Bindpoint(0, 0), {BoundResource(curDraw->copySource)})); return ret; } @@ -299,9 +299,9 @@ const ShaderBindpointMapping &Following::GetMapping(ICaptureContext &ctx, Shader // for PS only add a single mapping to get the copy source if(copy && stage == ShaderStage::Pixel) - mapping.ReadOnlyResources = {BindpointMap(0, 0)}; + mapping.readOnlyResources = {Bindpoint(0, 0)}; else - mapping.ReadOnlyResources.clear(); + mapping.readOnlyResources.clear(); return mapping; } @@ -363,7 +363,7 @@ public: { if(filter.isEmpty()) texs.push_back(t); - else if(QString(m_Ctx.GetResourceName(t.ID)).contains(filter, Qt::CaseInsensitive)) + else if(QString(m_Ctx.GetResourceName(t.resourceId)).contains(filter, Qt::CaseInsensitive)) texs.push_back(t); } } @@ -397,12 +397,12 @@ public: if(role == Qt::DisplayRole) { if(index.row() >= 0 && index.row() < texs.count()) - return m_Ctx.GetResourceName(texs[index.row()].ID); + return m_Ctx.GetResourceName(texs[index.row()].resourceId); } if(role == Qt::UserRole) { - return QVariant::fromValue(texs[index.row()].ID); + return QVariant::fromValue(texs[index.row()].resourceId); } if(role == Qt::DecorationRole) @@ -474,7 +474,7 @@ void TextureViewer::UI_UpdateCachedTexture() id = m_Following.GetResourceId(m_Ctx); if(id == ResourceId()) - id = m_TexDisplay.texid; + id = m_TexDisplay.resourceId; m_CachedTexture = m_Ctx.GetTexture(id); } @@ -669,14 +669,14 @@ void TextureViewer::RT_FetchCurrentPixel(uint32_t x, uint32_t y, PixelValue &pic if(texptr == NULL) return; - if(m_TexDisplay.FlipY) + if(m_TexDisplay.flipY) y = (texptr->height - 1) - y; - pickValue = m_Output->PickPixel(m_TexDisplay.texid, true, x, y, m_TexDisplay.sliceFace, + pickValue = m_Output->PickPixel(m_TexDisplay.resourceId, true, x, y, m_TexDisplay.sliceFace, m_TexDisplay.mip, m_TexDisplay.sampleIdx); - if(m_TexDisplay.CustomShader != ResourceId()) - realValue = m_Output->PickPixel(m_TexDisplay.texid, false, x, y, m_TexDisplay.sliceFace, + if(m_TexDisplay.customShaderId != ResourceId()) + realValue = m_Output->PickPixel(m_TexDisplay.resourceId, false, x, y, m_TexDisplay.sliceFace, m_TexDisplay.mip, m_TexDisplay.sampleIdx); } @@ -733,12 +733,12 @@ void TextureViewer::RT_UpdateVisualRange(IReplayController *) ResourceFormat fmt = texptr->format; - if(m_TexDisplay.CustomShader != ResourceId()) + if(m_TexDisplay.customShaderId != ResourceId()) fmt.compCount = 4; bool channels[] = { - m_TexDisplay.Red ? true : false, m_TexDisplay.Green && fmt.compCount > 1, - m_TexDisplay.Blue && fmt.compCount > 2, m_TexDisplay.Alpha && fmt.compCount > 3, + m_TexDisplay.red ? true : false, m_TexDisplay.green && fmt.compCount > 1, + m_TexDisplay.blue && fmt.compCount > 2, m_TexDisplay.alpha && fmt.compCount > 3, }; rdcarray histogram = m_Output->GetHistogram(ui->rangeHistogram->rangeMin(), @@ -787,9 +787,9 @@ void TextureViewer::UI_UpdateStatusText() } else { - float r = qBound(0.0f, m_CurHoverValue.value_f[0], 1.0f); - float g = qBound(0.0f, m_CurHoverValue.value_f[1], 1.0f); - float b = qBound(0.0f, m_CurHoverValue.value_f[2], 1.0f); + float r = qBound(0.0f, m_CurHoverValue.floatValue[0], 1.0f); + float g = qBound(0.0f, m_CurHoverValue.floatValue[1], 1.0f); + float b = qBound(0.0f, m_CurHoverValue.floatValue[2], 1.0f); if(tex.format.srgbCorrected || (tex.creationFlags & TextureCategory::SwapBuffer)) { @@ -817,7 +817,7 @@ void TextureViewer::UI_UpdateStatusText() if(m_Ctx.APIProps().pipelineType == GraphicsAPI::OpenGL) y = (int)(mipHeight - 1) - y; - if(m_TexDisplay.FlipY) + if(m_TexDisplay.flipY) y = (int)(mipHeight - 1) - y; y = qMax(0, y); @@ -846,7 +846,7 @@ void TextureViewer::UI_UpdateStatusText() y = m_PickedPoint.y() >> (int)m_TexDisplay.mip; if(m_Ctx.APIProps().pipelineType == GraphicsAPI::OpenGL) y = (int)(mipHeight - 1) - y; - if(m_TexDisplay.FlipY) + if(m_TexDisplay.flipY) y = (int)(mipHeight - 1) - y; y = qMax(0, y); @@ -855,13 +855,13 @@ void TextureViewer::UI_UpdateStatusText() PixelValue val = m_CurPixelValue; - if(m_TexDisplay.CustomShader != ResourceId()) + if(m_TexDisplay.customShaderId != ResourceId()) { statusText += QFormatStr("%1, %2, %3, %4") - .arg(Formatter::Format(val.value_f[0])) - .arg(Formatter::Format(val.value_f[1])) - .arg(Formatter::Format(val.value_f[2])) - .arg(Formatter::Format(val.value_f[3])); + .arg(Formatter::Format(val.floatValue[0])) + .arg(Formatter::Format(val.floatValue[1])) + .arg(Formatter::Format(val.floatValue[2])) + .arg(Formatter::Format(val.floatValue[3])); val = m_CurRealValue; @@ -873,17 +873,14 @@ void TextureViewer::UI_UpdateStatusText() statusText += tr("Depth "); if(uintTex) { - if(tex.format.compByteWidth == 2) - statusText += Formatter::Format(val.value_u16[0]); - else - statusText += Formatter::Format(val.value_u[0]); + statusText += Formatter::Format(val.uintValue[0]); } else { - statusText += Formatter::Format(val.value_f[0]); + statusText += Formatter::Format(val.floatValue[0]); } - int stencil = (int)(255.0f * val.value_f[1]); + int stencil = (int)(255.0f * val.floatValue[1]); statusText += tr(", Stencil %1 / 0x%2").arg(stencil).arg(Formatter::Format(uint8_t(stencil & 0xff), true)); @@ -893,30 +890,30 @@ void TextureViewer::UI_UpdateStatusText() if(uintTex) { statusText += QFormatStr("%1, %2, %3, %4") - .arg(Formatter::Format(val.value_u[0])) - .arg(Formatter::Format(val.value_u[1])) - .arg(Formatter::Format(val.value_u[2])) - .arg(Formatter::Format(val.value_u[3])); + .arg(Formatter::Format(val.uintValue[0])) + .arg(Formatter::Format(val.uintValue[1])) + .arg(Formatter::Format(val.uintValue[2])) + .arg(Formatter::Format(val.uintValue[3])); } else if(sintTex) { statusText += QFormatStr("%1, %2, %3, %4") - .arg(Formatter::Format(val.value_i[0])) - .arg(Formatter::Format(val.value_i[1])) - .arg(Formatter::Format(val.value_i[2])) - .arg(Formatter::Format(val.value_i[3])); + .arg(Formatter::Format(val.intValue[0])) + .arg(Formatter::Format(val.intValue[1])) + .arg(Formatter::Format(val.intValue[2])) + .arg(Formatter::Format(val.intValue[3])); } else { statusText += QFormatStr("%1, %2, %3, %4") - .arg(Formatter::Format(val.value_f[0])) - .arg(Formatter::Format(val.value_f[1])) - .arg(Formatter::Format(val.value_f[2])) - .arg(Formatter::Format(val.value_f[3])); + .arg(Formatter::Format(val.floatValue[0])) + .arg(Formatter::Format(val.floatValue[1])) + .arg(Formatter::Format(val.floatValue[2])) + .arg(Formatter::Format(val.floatValue[3])); } } - if(m_TexDisplay.CustomShader != ResourceId()) + if(m_TexDisplay.customShaderId != ResourceId()) statusText += lit(")"); // PixelPicked = true; @@ -1050,32 +1047,32 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) TextureDescription &tex = *texptr; - bool newtex = (m_TexDisplay.texid != tex.ID); + bool newtex = (m_TexDisplay.resourceId != tex.resourceId); // save settings for this current texture if(m_Ctx.Config().TextureViewer_PerTexSettings) { - m_TextureSettings[m_TexDisplay.texid].r = ui->channelRed->isChecked(); - m_TextureSettings[m_TexDisplay.texid].g = ui->channelGreen->isChecked(); - m_TextureSettings[m_TexDisplay.texid].b = ui->channelBlue->isChecked(); - m_TextureSettings[m_TexDisplay.texid].a = ui->channelAlpha->isChecked(); + m_TextureSettings[m_TexDisplay.resourceId].r = ui->channelRed->isChecked(); + m_TextureSettings[m_TexDisplay.resourceId].g = ui->channelGreen->isChecked(); + m_TextureSettings[m_TexDisplay.resourceId].b = ui->channelBlue->isChecked(); + m_TextureSettings[m_TexDisplay.resourceId].a = ui->channelAlpha->isChecked(); - m_TextureSettings[m_TexDisplay.texid].displayType = qMax(0, ui->channels->currentIndex()); - m_TextureSettings[m_TexDisplay.texid].customShader = ui->customShader->currentText(); + m_TextureSettings[m_TexDisplay.resourceId].displayType = qMax(0, ui->channels->currentIndex()); + m_TextureSettings[m_TexDisplay.resourceId].customShader = ui->customShader->currentText(); - m_TextureSettings[m_TexDisplay.texid].depth = ui->depthDisplay->isChecked(); - m_TextureSettings[m_TexDisplay.texid].stencil = ui->stencilDisplay->isChecked(); + m_TextureSettings[m_TexDisplay.resourceId].depth = ui->depthDisplay->isChecked(); + m_TextureSettings[m_TexDisplay.resourceId].stencil = ui->stencilDisplay->isChecked(); - m_TextureSettings[m_TexDisplay.texid].mip = qMax(0, ui->mipLevel->currentIndex()); - m_TextureSettings[m_TexDisplay.texid].slice = qMax(0, ui->sliceFace->currentIndex()); + m_TextureSettings[m_TexDisplay.resourceId].mip = qMax(0, ui->mipLevel->currentIndex()); + m_TextureSettings[m_TexDisplay.resourceId].slice = qMax(0, ui->sliceFace->currentIndex()); - m_TextureSettings[m_TexDisplay.texid].minrange = ui->rangeHistogram->blackPoint(); - m_TextureSettings[m_TexDisplay.texid].maxrange = ui->rangeHistogram->whitePoint(); + m_TextureSettings[m_TexDisplay.resourceId].minrange = ui->rangeHistogram->blackPoint(); + m_TextureSettings[m_TexDisplay.resourceId].maxrange = ui->rangeHistogram->whitePoint(); - m_TextureSettings[m_TexDisplay.texid].typeHint = m_Following.GetTypeHint(m_Ctx); + m_TextureSettings[m_TexDisplay.resourceId].typeHint = m_Following.GetTypeHint(m_Ctx); } - m_TexDisplay.texid = tex.ID; + m_TexDisplay.resourceId = tex.resourceId; // interpret the texture according to the currently following type. if(!currentTextureIsLocked()) @@ -1084,8 +1081,9 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) m_TexDisplay.typeHint = 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 && m_TextureSettings.contains(m_TexDisplay.texid)) - m_TexDisplay.typeHint = m_TextureSettings[m_TexDisplay.texid].typeHint; + if(m_TexDisplay.typeHint == CompType::Typeless && + m_TextureSettings.contains(m_TexDisplay.resourceId)) + m_TexDisplay.typeHint = m_TextureSettings[m_TexDisplay.resourceId].typeHint; // try to maintain the pan in the new texture. If the new texture // is approx an integer multiple of the old texture, just changing @@ -1099,8 +1097,8 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) if(prevArea > 0.0f) { - float prevX = m_TexDisplay.offx; - float prevY = m_TexDisplay.offy; + float prevX = m_TexDisplay.xOffset; + float prevY = m_TexDisplay.yOffset; // allow slight difference in aspect ratio for rounding errors // in downscales (e.g. 1680x1050 -> 840x525 -> 420x262 in the @@ -1117,8 +1115,8 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) // similar ish float scaleFactor = (float)(sqrt(curArea) / sqrt(prevArea)); - m_TexDisplay.offx = prevX * scaleFactor; - m_TexDisplay.offy = prevY * scaleFactor; + m_TexDisplay.xOffset = prevX * scaleFactor; + m_TexDisplay.yOffset = prevY * scaleFactor; } } @@ -1253,36 +1251,36 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) // even if we don't switch to a new texture. // Note that if the slice or mip was changed because that slice or mip is the selected one // at the API level, we leave this alone. - if(m_Ctx.Config().TextureViewer_PerTexSettings && m_TextureSettings.contains(tex.ID)) + if(m_Ctx.Config().TextureViewer_PerTexSettings && m_TextureSettings.contains(tex.resourceId)) { if(usemipsettings) - ui->mipLevel->setCurrentIndex(m_TextureSettings[tex.ID].mip); + ui->mipLevel->setCurrentIndex(m_TextureSettings[tex.resourceId].mip); if(useslicesettings) - ui->sliceFace->setCurrentIndex(m_TextureSettings[tex.ID].slice); + ui->sliceFace->setCurrentIndex(m_TextureSettings[tex.resourceId].slice); } // handling for if we've switched to a new texture if(newtex) { // if we save certain settings per-texture, restore them (if we have any) - if(m_Ctx.Config().TextureViewer_PerTexSettings && m_TextureSettings.contains(tex.ID)) + if(m_Ctx.Config().TextureViewer_PerTexSettings && m_TextureSettings.contains(tex.resourceId)) { - ui->channels->setCurrentIndex(m_TextureSettings[tex.ID].displayType); + ui->channels->setCurrentIndex(m_TextureSettings[tex.resourceId].displayType); - ui->customShader->setCurrentText(m_TextureSettings[tex.ID].customShader); + ui->customShader->setCurrentText(m_TextureSettings[tex.resourceId].customShader); - ui->channelRed->setChecked(m_TextureSettings[tex.ID].r); - ui->channelGreen->setChecked(m_TextureSettings[tex.ID].g); - ui->channelBlue->setChecked(m_TextureSettings[tex.ID].b); - ui->channelAlpha->setChecked(m_TextureSettings[tex.ID].a); + ui->channelRed->setChecked(m_TextureSettings[tex.resourceId].r); + ui->channelGreen->setChecked(m_TextureSettings[tex.resourceId].g); + ui->channelBlue->setChecked(m_TextureSettings[tex.resourceId].b); + ui->channelAlpha->setChecked(m_TextureSettings[tex.resourceId].a); - ui->depthDisplay->setChecked(m_TextureSettings[tex.ID].depth); - ui->stencilDisplay->setChecked(m_TextureSettings[tex.ID].stencil); + ui->depthDisplay->setChecked(m_TextureSettings[tex.resourceId].depth); + ui->stencilDisplay->setChecked(m_TextureSettings[tex.resourceId].stencil); m_NoRangePaint = true; - ui->rangeHistogram->setRange(m_TextureSettings[m_TexDisplay.texid].minrange, - m_TextureSettings[m_TexDisplay.texid].maxrange); + ui->rangeHistogram->setRange(m_TextureSettings[m_TexDisplay.resourceId].minrange, + m_TextureSettings[m_TexDisplay.resourceId].maxrange); m_NoRangePaint = false; } else if(m_Ctx.Config().TextureViewer_PerTexSettings) @@ -1329,7 +1327,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) }); if(m_Ctx.HasTimelineBar()) - m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->ID); + m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->resourceId); } void TextureViewer::UI_SetHistogramRange(const TextureDescription *tex, CompType typeHint) @@ -1396,25 +1394,25 @@ void TextureViewer::UI_UpdateChannels() SHOW(ui->depthDisplay); SHOW(ui->stencilDisplay); - m_TexDisplay.Red = ui->depthDisplay->isChecked(); - m_TexDisplay.Green = ui->stencilDisplay->isChecked(); - m_TexDisplay.Blue = false; - m_TexDisplay.Alpha = false; + m_TexDisplay.red = ui->depthDisplay->isChecked(); + m_TexDisplay.green = ui->stencilDisplay->isChecked(); + m_TexDisplay.blue = false; + m_TexDisplay.alpha = false; - if(m_TexDisplay.Red == m_TexDisplay.Green && !m_TexDisplay.Red) + if(m_TexDisplay.red == m_TexDisplay.green && !m_TexDisplay.red) { - m_TexDisplay.Red = true; + m_TexDisplay.red = true; ui->depthDisplay->setChecked(true); } - m_TexDisplay.HDRMul = -1.0f; - if(m_TexDisplay.CustomShader != ResourceId()) + m_TexDisplay.hdrMultiplier = -1.0f; + if(m_TexDisplay.customShaderId != ResourceId()) { - memset(m_CurPixelValue.value_f, 0, sizeof(float) * 4); - memset(m_CurRealValue.value_f, 0, sizeof(float) * 4); + memset(m_CurPixelValue.floatValue, 0, sizeof(float) * 4); + memset(m_CurRealValue.floatValue, 0, sizeof(float) * 4); UI_UpdateStatusText(); } - m_TexDisplay.CustomShader = ResourceId(); + m_TexDisplay.customShaderId = ResourceId(); } else if(ui->channels->currentIndex() == 0 || !m_Ctx.IsCaptureLoaded()) { @@ -1433,19 +1431,19 @@ void TextureViewer::UI_UpdateChannels() HIDE(ui->depthDisplay); HIDE(ui->stencilDisplay); - m_TexDisplay.Red = ui->channelRed->isChecked(); - m_TexDisplay.Green = ui->channelGreen->isChecked(); - m_TexDisplay.Blue = ui->channelBlue->isChecked(); - m_TexDisplay.Alpha = ui->channelAlpha->isChecked(); + m_TexDisplay.red = ui->channelRed->isChecked(); + m_TexDisplay.green = ui->channelGreen->isChecked(); + m_TexDisplay.blue = ui->channelBlue->isChecked(); + m_TexDisplay.alpha = ui->channelAlpha->isChecked(); - m_TexDisplay.HDRMul = -1.0f; - if(m_TexDisplay.CustomShader != ResourceId()) + m_TexDisplay.hdrMultiplier = -1.0f; + if(m_TexDisplay.customShaderId != ResourceId()) { - memset(m_CurPixelValue.value_f, 0, sizeof(float) * 4); - memset(m_CurRealValue.value_f, 0, sizeof(float) * 4); + memset(m_CurPixelValue.floatValue, 0, sizeof(float) * 4); + memset(m_CurRealValue.floatValue, 0, sizeof(float) * 4); UI_UpdateStatusText(); } - m_TexDisplay.CustomShader = ResourceId(); + m_TexDisplay.customShaderId = ResourceId(); } else if(ui->channels->currentIndex() == 1) { @@ -1464,10 +1462,10 @@ void TextureViewer::UI_UpdateChannels() HIDE(ui->depthDisplay); HIDE(ui->stencilDisplay); - m_TexDisplay.Red = ui->channelRed->isChecked(); - m_TexDisplay.Green = ui->channelGreen->isChecked(); - m_TexDisplay.Blue = ui->channelBlue->isChecked(); - m_TexDisplay.Alpha = false; + m_TexDisplay.red = ui->channelRed->isChecked(); + m_TexDisplay.green = ui->channelGreen->isChecked(); + m_TexDisplay.blue = ui->channelBlue->isChecked(); + m_TexDisplay.alpha = false; bool ok = false; float mul = ui->hdrMul->currentText().toFloat(&ok); @@ -1478,14 +1476,14 @@ void TextureViewer::UI_UpdateChannels() ui->hdrMul->setCurrentText(lit("32")); } - m_TexDisplay.HDRMul = mul; - if(m_TexDisplay.CustomShader != ResourceId()) + m_TexDisplay.hdrMultiplier = mul; + if(m_TexDisplay.customShaderId != ResourceId()) { - memset(m_CurPixelValue.value_f, 0, sizeof(float) * 4); - memset(m_CurRealValue.value_f, 0, sizeof(float) * 4); + memset(m_CurPixelValue.floatValue, 0, sizeof(float) * 4); + memset(m_CurRealValue.floatValue, 0, sizeof(float) * 4); UI_UpdateStatusText(); } - m_TexDisplay.CustomShader = ResourceId(); + m_TexDisplay.customShaderId = ResourceId(); } else if(ui->channels->currentIndex() == 2) { @@ -1504,26 +1502,26 @@ void TextureViewer::UI_UpdateChannels() HIDE(ui->depthDisplay); HIDE(ui->stencilDisplay); - m_TexDisplay.Red = ui->channelRed->isChecked(); - m_TexDisplay.Green = ui->channelGreen->isChecked(); - m_TexDisplay.Blue = ui->channelBlue->isChecked(); - m_TexDisplay.Alpha = ui->channelAlpha->isChecked(); + m_TexDisplay.red = ui->channelRed->isChecked(); + m_TexDisplay.green = ui->channelGreen->isChecked(); + m_TexDisplay.blue = ui->channelBlue->isChecked(); + m_TexDisplay.alpha = ui->channelAlpha->isChecked(); - m_TexDisplay.HDRMul = -1.0f; + m_TexDisplay.hdrMultiplier = -1.0f; - m_TexDisplay.CustomShader = ResourceId(); + m_TexDisplay.customShaderId = ResourceId(); QString shaderName = ui->customShader->currentText().toUpper(); if(m_CustomShaders.contains(shaderName)) { - if(m_TexDisplay.CustomShader == ResourceId()) + if(m_TexDisplay.customShaderId == ResourceId()) { - memset(m_CurPixelValue.value_f, 0, sizeof(float) * 4); - memset(m_CurRealValue.value_f, 0, sizeof(float) * 4); + memset(m_CurPixelValue.floatValue, 0, sizeof(float) * 4); + memset(m_CurRealValue.floatValue, 0, sizeof(float) * 4); UI_UpdateStatusText(); } - m_TexDisplay.CustomShader = m_CustomShaders[shaderName]; + m_TexDisplay.customShaderId = m_CustomShaders[shaderName]; ui->customDelete->setEnabled(true); ui->customEdit->setEnabled(true); } @@ -1539,7 +1537,7 @@ void TextureViewer::UI_UpdateChannels() #undef ENABLE #undef DISABLE - m_TexDisplay.FlipY = ui->flip_y->isChecked(); + m_TexDisplay.flipY = ui->flip_y->isChecked(); INVOKE_MEMFN(RT_UpdateAndDisplay); INVOKE_MEMFN(RT_UpdateVisualRange); @@ -1667,7 +1665,7 @@ void TextureViewer::GotoLocation(int x, int y) uint32_t mipHeight = qMax(1U, tex->height >> (int)m_TexDisplay.mip); if(m_Ctx.APIProps().pipelineType == GraphicsAPI::OpenGL) m_PickedPoint.setY((int)(mipHeight - 1) - m_PickedPoint.y()); - if(m_TexDisplay.FlipY) + if(m_TexDisplay.flipY) m_PickedPoint.setY((int)(mipHeight - 1) - m_PickedPoint.x()); if(m_Output != NULL) @@ -1916,26 +1914,26 @@ void TextureViewer::InitResourcePreview(ResourcePreview *prev, ResourceId id, Co void TextureViewer::InitStageResourcePreviews(ShaderStage stage, const rdcarray &resourceDetails, - const rdcarray &mapping, + const rdcarray &mapping, rdcarray &ResList, ThumbnailStrip *prevs, int &prevIndex, bool copy, bool rw) { for(int idx = 0; idx < mapping.count(); idx++) { - const BindpointMap &key = mapping[idx]; + const Bindpoint &key = mapping[idx]; const rdcarray *resArray = NULL; int residx = ResList.indexOf(key); if(residx >= 0) - resArray = &ResList[residx].Resources; + resArray = &ResList[residx].resources; int arrayLen = resArray != NULL ? resArray->count() : 1; for(int arrayIdx = 0; arrayIdx < arrayLen; arrayIdx++) { - ResourceId id = resArray != NULL ? resArray->at(arrayIdx).Id : ResourceId(); + ResourceId id = resArray != NULL ? resArray->at(arrayIdx).resourceId : ResourceId(); CompType typeHint = resArray != NULL ? resArray->at(arrayIdx).typeHint : CompType::Typeless; bool used = key.used; @@ -2055,7 +2053,7 @@ void TextureViewer::thumb_clicked(QMouseEvent *e) ResourceId id = follow.GetResourceId(m_Ctx); if(id == ResourceId() && follow == m_Following) - id = m_TexDisplay.texid; + id = m_TexDisplay.resourceId; rdcarray empty; @@ -2093,12 +2091,12 @@ void TextureViewer::render_mouseMove(QMouseEvent *e) if(m_Output == NULL) return; - m_CurHoverPixel.setX(int((float(e->x() * ui->render->devicePixelRatio()) - m_TexDisplay.offx) / + m_CurHoverPixel.setX(int((float(e->x() * ui->render->devicePixelRatio()) - m_TexDisplay.xOffset) / m_TexDisplay.scale)); - m_CurHoverPixel.setY(int((float(e->y() * ui->render->devicePixelRatio()) - m_TexDisplay.offy) / + m_CurHoverPixel.setY(int((float(e->y() * ui->render->devicePixelRatio()) - m_TexDisplay.yOffset) / m_TexDisplay.scale)); - if(m_TexDisplay.texid != ResourceId()) + if(m_TexDisplay.resourceId != ResourceId()) { TextureDescription *texptr = GetCurrentTexture(); @@ -2257,26 +2255,26 @@ float TextureViewer::CurMaxScrollY() QPoint TextureViewer::getScrollPosition() { - return QPoint((int)m_TexDisplay.offx, m_TexDisplay.offy); + return QPoint((int)m_TexDisplay.xOffset, m_TexDisplay.yOffset); } void TextureViewer::setScrollPosition(const QPoint &pos) { - m_TexDisplay.offx = qMax(CurMaxScrollX(), (float)pos.x()); - m_TexDisplay.offy = qMax(CurMaxScrollY(), (float)pos.y()); + m_TexDisplay.xOffset = qMax(CurMaxScrollX(), (float)pos.x()); + m_TexDisplay.yOffset = qMax(CurMaxScrollY(), (float)pos.y()); - m_TexDisplay.offx = qMin(0.0f, m_TexDisplay.offx); - m_TexDisplay.offy = qMin(0.0f, m_TexDisplay.offy); + m_TexDisplay.xOffset = qMin(0.0f, m_TexDisplay.xOffset); + m_TexDisplay.yOffset = qMin(0.0f, m_TexDisplay.yOffset); if(ScrollUpdateScrollbars) { ScrollUpdateScrollbars = false; if(ui->renderHScroll->isEnabled()) - ui->renderHScroll->setValue(qBound(0, -int(m_TexDisplay.offx), ui->renderHScroll->maximum())); + ui->renderHScroll->setValue(qBound(0, -int(m_TexDisplay.xOffset), ui->renderHScroll->maximum())); if(ui->renderVScroll->isEnabled()) - ui->renderVScroll->setValue(qBound(0, -int(m_TexDisplay.offy), ui->renderVScroll->maximum())); + ui->renderVScroll->setValue(qBound(0, -int(m_TexDisplay.yOffset), ui->renderVScroll->maximum())); ScrollUpdateScrollbars = true; } @@ -2548,14 +2546,14 @@ void TextureViewer::OnCaptureClosed() ui->viewTexBuffer->setEnabled(false); } -void TextureViewer::OnEventChanged(uint32_t eventID) +void TextureViewer::OnEventChanged(uint32_t eventId) { UI_UpdateCachedTexture(); TextureDescription *CurrentTexture = GetCurrentTexture(); if(!currentTextureIsLocked() || - (CurrentTexture != NULL && m_TexDisplay.texid != CurrentTexture->ID)) + (CurrentTexture != NULL && m_TexDisplay.resourceId != CurrentTexture->resourceId)) UI_OnTextureSelectionChanged(true); if(m_Output == NULL) @@ -2599,7 +2597,8 @@ void TextureViewer::OnEventChanged(uint32_t eventID) ? tr("DST") : (m_Ctx.CurPipelineState().OutputAbbrev() + QString::number(rt)); - InitResourcePreview(prev, RTs[rt].Id, RTs[rt].typeHint, false, follow, bindName, slotName); + InitResourcePreview(prev, RTs[rt].resourceId, RTs[rt].typeHint, false, follow, bindName, + slotName); } // depth @@ -2615,7 +2614,7 @@ void TextureViewer::OnEventChanged(uint32_t eventID) Following follow(FollowType::OutputDepth, ShaderStage::Pixel, 0, 0); - InitResourcePreview(prev, Depth.Id, Depth.typeHint, false, follow, QString(), tr("DS")); + InitResourcePreview(prev, Depth.resourceId, Depth.typeHint, false, follow, QString(), tr("DS")); } ShaderStage stages[] = {ShaderStage::Vertex, ShaderStage::Hull, ShaderStage::Domain, @@ -2642,12 +2641,12 @@ void TextureViewer::OnEventChanged(uint32_t eventID) const ShaderReflection *details = Following::GetReflection(m_Ctx, stage); const ShaderBindpointMapping &mapping = Following::GetMapping(m_Ctx, stage); - InitStageResourcePreviews(stage, details != NULL ? details->ReadWriteResources : empty, - mapping.ReadWriteResources, RWs, ui->outputThumbs, outIndex, copy, + InitStageResourcePreviews(stage, details != NULL ? details->readWriteResources : empty, + mapping.readWriteResources, RWs, ui->outputThumbs, outIndex, copy, true); - InitStageResourcePreviews(stage, details != NULL ? details->ReadOnlyResources : empty, - mapping.ReadOnlyResources, ROs, ui->inputThumbs, inIndex, copy, false); + InitStageResourcePreviews(stage, details != NULL ? details->readOnlyResources : empty, + mapping.readOnlyResources, ROs, ui->inputThumbs, inIndex, copy, false); } // hide others @@ -2903,11 +2902,11 @@ void TextureViewer::channelsWidget_mouseClicked(QMouseEvent *event) void TextureViewer::range_rangeUpdated() { - m_TexDisplay.rangemin = ui->rangeHistogram->blackPoint(); - m_TexDisplay.rangemax = ui->rangeHistogram->whitePoint(); + m_TexDisplay.rangeMin = ui->rangeHistogram->blackPoint(); + m_TexDisplay.rangeMax = ui->rangeHistogram->whitePoint(); - ui->rangeBlack->setText(Formatter::Format(m_TexDisplay.rangemin)); - ui->rangeWhite->setText(Formatter::Format(m_TexDisplay.rangemax)); + ui->rangeBlack->setText(Formatter::Format(m_TexDisplay.rangeMin)); + ui->rangeWhite->setText(Formatter::Format(m_TexDisplay.rangeMax)); if(m_NoRangePaint) return; @@ -3033,7 +3032,7 @@ void TextureViewer::AutoFitRange() ResourceFormat fmt = GetCurrentTexture()->format; - if(m_TexDisplay.CustomShader != ResourceId()) + if(m_TexDisplay.customShaderId != ResourceId()) { fmt.compType = CompType::Float; } @@ -3042,38 +3041,38 @@ void TextureViewer::AutoFitRange() { if(fmt.compType == CompType::UInt) { - min.value_f[i] = min.value_u[i]; - max.value_f[i] = max.value_u[i]; + min.floatValue[i] = min.uintValue[i]; + max.floatValue[i] = max.uintValue[i]; } else if(fmt.compType == CompType::SInt) { - min.value_f[i] = min.value_i[i]; - max.value_f[i] = max.value_i[i]; + min.floatValue[i] = min.intValue[i]; + max.floatValue[i] = max.intValue[i]; } } - if(m_TexDisplay.Red) + if(m_TexDisplay.red) { - minval = qMin(minval, min.value_f[0]); - maxval = qMax(maxval, max.value_f[0]); + minval = qMin(minval, min.floatValue[0]); + maxval = qMax(maxval, max.floatValue[0]); changeRange = true; } - if(m_TexDisplay.Green && fmt.compCount > 1) + if(m_TexDisplay.green && fmt.compCount > 1) { - minval = qMin(minval, min.value_f[1]); - maxval = qMax(maxval, max.value_f[1]); + minval = qMin(minval, min.floatValue[1]); + maxval = qMax(maxval, max.floatValue[1]); changeRange = true; } - if(m_TexDisplay.Blue && fmt.compCount > 2) + if(m_TexDisplay.blue && fmt.compCount > 2) { - minval = qMin(minval, min.value_f[2]); - maxval = qMax(maxval, max.value_f[2]); + minval = qMin(minval, min.floatValue[2]); + maxval = qMax(maxval, max.floatValue[2]); changeRange = true; } - if(m_TexDisplay.Alpha && fmt.compCount > 3) + if(m_TexDisplay.alpha && fmt.compCount > 3) { - minval = qMin(minval, min.value_f[3]); - maxval = qMax(maxval, max.value_f[3]); + minval = qMin(minval, min.floatValue[3]); + maxval = qMax(maxval, max.floatValue[3]); changeRange = true; } @@ -3224,7 +3223,7 @@ void TextureViewer::ShowGotoPopup() if(m_Ctx.APIProps().pipelineType == GraphicsAPI::OpenGL) p.setY((int)(mipHeight - 1) - p.y()); - if(m_TexDisplay.FlipY) + if(m_TexDisplay.flipY) p.setY((int)(mipHeight - 1) - p.y()); m_Goto->show(ui->render, p); @@ -3309,8 +3308,8 @@ void TextureViewer::on_viewTexBuffer_clicked() QString format = QFormatStr("%1 %2[%3];").arg(baseType).arg(varName).arg(w); - IBufferViewer *viewer = - m_Ctx.ViewTextureAsBuffer(m_TexDisplay.sliceFace, m_TexDisplay.mip, texptr->ID, format); + IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer(m_TexDisplay.sliceFace, m_TexDisplay.mip, + texptr->resourceId, format); m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); } @@ -3325,7 +3324,7 @@ void TextureViewer::on_resourceDetails_clicked() if(!m_Ctx.HasResourceInspector()) m_Ctx.ShowResourceInspector(); - m_Ctx.GetResourceInspector()->Inspect(texptr->ID); + m_Ctx.GetResourceInspector()->Inspect(texptr->resourceId); ToolWindowManager::raiseToolWindow(m_Ctx.GetResourceInspector()->Widget()); } @@ -3342,7 +3341,7 @@ void TextureViewer::on_saveTex_clicked() memset(&config, 0, sizeof(config)); config.jpegQuality = 90; - config.id = m_TexDisplay.texid; + config.id = m_TexDisplay.resourceId; config.typeHint = m_TexDisplay.typeHint; config.slice.sliceIndex = (int)m_TexDisplay.sliceFace; config.mip = (int)m_TexDisplay.mip; @@ -3351,23 +3350,23 @@ void TextureViewer::on_saveTex_clicked() config.slice.sliceIndex = (int)m_TexDisplay.sliceFace >> (int)m_TexDisplay.mip; config.channelExtract = -1; - if(m_TexDisplay.Red && !m_TexDisplay.Green && !m_TexDisplay.Blue && !m_TexDisplay.Alpha) + if(m_TexDisplay.red && !m_TexDisplay.green && !m_TexDisplay.blue && !m_TexDisplay.alpha) config.channelExtract = 0; - if(!m_TexDisplay.Red && m_TexDisplay.Green && !m_TexDisplay.Blue && !m_TexDisplay.Alpha) + if(!m_TexDisplay.red && m_TexDisplay.green && !m_TexDisplay.blue && !m_TexDisplay.alpha) config.channelExtract = 1; - if(!m_TexDisplay.Red && !m_TexDisplay.Green && m_TexDisplay.Blue && !m_TexDisplay.Alpha) + if(!m_TexDisplay.red && !m_TexDisplay.green && m_TexDisplay.blue && !m_TexDisplay.alpha) config.channelExtract = 2; - if(!m_TexDisplay.Red && !m_TexDisplay.Green && !m_TexDisplay.Blue && m_TexDisplay.Alpha) + if(!m_TexDisplay.red && !m_TexDisplay.green && !m_TexDisplay.blue && m_TexDisplay.alpha) config.channelExtract = 3; - config.comp.blackPoint = m_TexDisplay.rangemin; - config.comp.whitePoint = m_TexDisplay.rangemax; + config.comp.blackPoint = m_TexDisplay.rangeMin; + config.comp.whitePoint = m_TexDisplay.rangeMax; config.alphaCol = m_TexDisplay.backgroundColor; - config.alpha = m_TexDisplay.Alpha ? AlphaMapping::BlendToCheckerboard : AlphaMapping::Discard; - if(m_TexDisplay.Alpha && !ui->checkerBack->isChecked()) + config.alpha = m_TexDisplay.alpha ? AlphaMapping::BlendToCheckerboard : AlphaMapping::Discard; + if(m_TexDisplay.alpha && !ui->checkerBack->isChecked()) config.alpha = AlphaMapping::BlendToColor; - if(m_TexDisplay.CustomShader != ResourceId()) + if(m_TexDisplay.customShaderId != ResourceId()) { ResourceId id; m_Ctx.Replay().BlockInvoke( @@ -3460,7 +3459,7 @@ void TextureViewer::on_pixelHistory_clicked() int x = m_PickedPoint.x() >> (int)m_TexDisplay.mip; int y = m_PickedPoint.y() >> (int)m_TexDisplay.mip; - IPixelHistoryView *hist = m_Ctx.ViewPixelHistory(texptr->ID, x, y, m_TexDisplay); + IPixelHistoryView *hist = m_Ctx.ViewPixelHistory(texptr->resourceId, x, y, m_TexDisplay); m_Ctx.AddDockWindow(hist->Widget(), DockReference::RightOf, this, 0.3f); @@ -3474,7 +3473,7 @@ void TextureViewer::on_pixelHistory_clicked() QThread::msleep(150); m_Ctx.Replay().AsyncInvoke([this, texptr, x, y, hist, histWidget](IReplayController *r) { rdcarray history = - r->PixelHistory(texptr->ID, (uint32_t)x, (int32_t)y, m_TexDisplay.sliceFace, + r->PixelHistory(texptr->resourceId, (uint32_t)x, (int32_t)y, m_TexDisplay.sliceFace, m_TexDisplay.mip, m_TexDisplay.sampleIdx, m_TexDisplay.typeHint); GUIInvoke::call([hist, histWidget, history] { diff --git a/qrenderdoc/Windows/TextureViewer.h b/qrenderdoc/Windows/TextureViewer.h index 0e2c221b4..81ffb75fe 100644 --- a/qrenderdoc/Windows/TextureViewer.h +++ b/qrenderdoc/Windows/TextureViewer.h @@ -134,8 +134,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; QVariant persistData(); void setPersistData(const QVariant &persistData); @@ -234,7 +234,7 @@ private: Following &follow, const QString &bindName, const QString &slotName); void InitStageResourcePreviews(ShaderStage stage, const rdcarray &resourceDetails, - const rdcarray &mapping, + const rdcarray &mapping, rdcarray &ResList, ThumbnailStrip *prevs, int &prevIndex, bool copy, bool rw); diff --git a/qrenderdoc/Windows/TimelineBar.cpp b/qrenderdoc/Windows/TimelineBar.cpp index 07b6ef604..76f3d7853 100644 --- a/qrenderdoc/Windows/TimelineBar.cpp +++ b/qrenderdoc/Windows/TimelineBar.cpp @@ -137,7 +137,7 @@ void TimelineBar::OnCaptureLoaded() layout(); } -void TimelineBar::OnEventChanged(uint32_t eventID) +void TimelineBar::OnEventChanged(uint32_t eventId) { if(!m_HistoryTarget.isEmpty()) m_HistoryTarget = m_Ctx.GetResourceName(m_ID); @@ -258,7 +258,7 @@ void TimelineBar::mousePressEvent(QMouseEvent *e) { auto it = std::find_if(m_HistoryEvents.begin(), m_HistoryEvents.end(), [this, eid](const PixelModification &mod) { - if(mod.eventID == eid) + if(mod.eventId == eid) return true; return false; @@ -274,7 +274,7 @@ void TimelineBar::mousePressEvent(QMouseEvent *e) { auto it = std::find_if(m_UsageEvents.begin(), m_UsageEvents.end(), [this, eid](const EventUsage &use) { - if(use.eventID == eid) + if(use.eventId == eid) return true; return false; @@ -697,12 +697,12 @@ void TimelineBar::paintEvent(QPaintEvent *e) { QPointF pos; - pos.setX(offsetOf(mod.eventID) + m_eidWidth / 2 - triRadius); + pos.setX(offsetOf(mod.eventId) + m_eidWidth / 2 - triRadius); pos.setY(pipsRect.y()); QPainterPath path = triangle.translated(aliasAlign(pos)); - if(mod.passed()) + if(mod.Passed()) paths[HistoryPassed] = paths[HistoryPassed].united(path); else paths[HistoryFailed] = paths[HistoryFailed].united(path); @@ -714,7 +714,7 @@ void TimelineBar::paintEvent(QPaintEvent *e) { QPointF pos; - pos.setX(offsetOf(use.eventID) + m_eidWidth / 2 - triRadius); + pos.setX(offsetOf(use.eventId) + m_eidWidth / 2 - triRadius); pos.setY(pipsRect.y()); QPainterPath path = triangle.translated(aliasAlign(pos)); @@ -935,7 +935,7 @@ uint32_t TimelineBar::processDraws(QVector &markers, QVector & Marker &m = markers.back(); m.name = d.name; - m.eidStart = d.eventID; + m.eidStart = d.eventId; m.eidEnd = processDraws(m.children, m.draws, d.children); maxEID = qMax(maxEID, m.eidEnd); @@ -954,12 +954,12 @@ uint32_t TimelineBar::processDraws(QVector &markers, QVector & { if((d.flags & (DrawFlags::SetMarker | DrawFlags::APICalls)) != DrawFlags::SetMarker) { - m_Draws.push_back(d.eventID); - draws.push_back(d.eventID); + m_Draws.push_back(d.eventId); + draws.push_back(d.eventId); } } - maxEID = qMax(maxEID, d.eventID); + maxEID = qMax(maxEID, d.eventId); } return maxEID; diff --git a/qrenderdoc/Windows/TimelineBar.h b/qrenderdoc/Windows/TimelineBar.h index cf4ab521e..c1624e25c 100644 --- a/qrenderdoc/Windows/TimelineBar.h +++ b/qrenderdoc/Windows/TimelineBar.h @@ -44,8 +44,8 @@ public: // ICaptureViewer void OnCaptureLoaded() override; void OnCaptureClosed() override; - void OnSelectedEventChanged(uint32_t eventID) override {} - void OnEventChanged(uint32_t eventID) override; + void OnSelectedEventChanged(uint32_t eventId) override {} + void OnEventChanged(uint32_t eventId) override; protected: void mousePressEvent(QMouseEvent *e) override; diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt index 682aab380..293890a0b 100644 --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt @@ -59,6 +59,7 @@ set(sources api/replay/structured_data.h api/replay/capture_options.h api/replay/control_types.h + api/replay/common_pipestate.h api/replay/d3d11_pipestate.h api/replay/data_types.h api/replay/gl_pipestate.h diff --git a/renderdoc/api/replay/capture_options.h b/renderdoc/api/replay/capture_options.h index 92be74ea8..a22b7b93b 100644 --- a/renderdoc/api/replay/capture_options.h +++ b/renderdoc/api/replay/capture_options.h @@ -47,7 +47,7 @@ Default - enabled ``False`` - vsync is force disabled. )"); - bool AllowVSync; + bool allowVSync; DOCUMENT(R"(Allow the application to enable fullscreen. @@ -57,7 +57,7 @@ Default - enabled ``False`` - fullscreen is force disabled. )"); - bool AllowFullscreen; + bool allowFullscreen; DOCUMENT(R"(Record API debugging events and messages @@ -68,7 +68,7 @@ the capture logfile, which is matched up with events on replay. ``False`` - no API debugging is forcibly enabled. )"); - bool APIValidation; + bool apiValidation; DOCUMENT(R"(Capture CPU callstacks for API events @@ -78,10 +78,10 @@ Default - disabled ``False`` - no callstacks are captured. )"); - bool CaptureCallstacks; + bool captureCallstacks; DOCUMENT(R"(When capturing CPU callstacks, only capture them from drawcalls. -This option does nothing if :data:`CaptureCallstacks` is not enabled. +This option does nothing if :data:`captureCallstacks` is not enabled. Default - disabled @@ -89,7 +89,7 @@ Default - disabled ``False`` - Callstacks, if enabled, are captured for every event. )"); - bool CaptureCallstacksOnlyDraws; + bool captureCallstacksOnlyDraws; DOCUMENT(R"(Specify a delay in seconds to wait for a debugger to attach, after creating or injecting into a process, before continuing to allow it to run. @@ -98,7 +98,7 @@ creating or injecting into a process, before continuing to allow it to run. Default - 0 seconds )"); - uint32_t DelayForDebugger; + uint32_t delayForDebugger; DOCUMENT(R"(Verify any writes to mapped buffers, by checking the memory after the bounds of the returned pointer to detect any modification. @@ -110,7 +110,7 @@ Default - disabled ``False`` - No verification is performed, and overwriting bounds may cause crashes or corruption in RenderDoc. )"); - bool VerifyMapWrites; + bool verifyMapWrites; DOCUMENT(R"(Hooks any system API calls that create child processes, and injects RenderDoc into them recursively with the same options. @@ -121,7 +121,7 @@ Default - disabled ``False`` - Child processes are not hooked by RenderDoc. )"); - bool HookIntoChildren; + bool hookIntoChildren; DOCUMENT(R"(By default RenderDoc only includes resources in the final logfile necessary for that frame, this allows you to override that behaviour. @@ -133,7 +133,7 @@ and available for inspection. ``False`` - only the resources referenced by the captured frame are included. )"); - bool RefAllResources; + bool refAllResources; DOCUMENT(R"(By default RenderDoc skips saving initial states for resources where the previous contents don't appear to be used, assuming that writes before @@ -147,7 +147,7 @@ Default - disabled ``False`` - unless a read is detected, initial contents will not be saved and will appear as black or empty data. )"); - bool SaveAllInitials; + bool saveAllInitials; DOCUMENT(R"(In APIs that allow for the recording of command lists to be replayed later, RenderDoc may choose to not capture command lists before a frame capture is @@ -165,7 +165,7 @@ capture. ``False`` - Command lists are only captured if their recording begins during the period when a frame capture is in progress. )"); - bool CaptureAllCmdLists; + bool captureAllCmdLists; DOCUMENT(R"(Mute API debugging output when the API validation mode option is enabled. @@ -175,7 +175,7 @@ Default - enabled ``False`` - API debugging is displayed as normal. )"); - bool DebugOutputMute; + bool debugOutputMute; }; DECLARE_REFLECTION_STRUCT(CaptureOptions); diff --git a/renderdoc/api/replay/common_pipestate.h b/renderdoc/api/replay/common_pipestate.h new file mode 100644 index 000000000..4ce03871c --- /dev/null +++ b/renderdoc/api/replay/common_pipestate.h @@ -0,0 +1,210 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2017 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ + +#pragma once + +DOCUMENT("Information about a viewport."); +struct Viewport +{ + DOCUMENT(""); + bool operator==(const Viewport &o) const + { + return x == o.x && y == o.y && width == o.width && height == o.height && + minDepth == o.minDepth && maxDepth == o.maxDepth; + } + bool operator<(const Viewport &o) const + { + if(!(x == o.x)) + return x < o.x; + if(!(y == o.y)) + return y < o.y; + if(!(width == o.width)) + return width < o.width; + if(!(height == o.height)) + return height < o.height; + if(!(minDepth == o.minDepth)) + return minDepth < o.minDepth; + if(!(maxDepth == o.maxDepth)) + return maxDepth < o.maxDepth; + return false; + } + Viewport() = default; + Viewport(float X, float Y, float W, float H, float MN, float MX, bool en = true) + : x(X), y(Y), width(W), height(H), minDepth(MN), maxDepth(MX), enabled(en) + { + } + + DOCUMENT("Is this viewport enabled."); + bool enabled = true; + DOCUMENT("The X co-ordinate of the viewport."); + float x = 0.0f; + DOCUMENT("The Y co-ordinate of the viewport."); + float y = 0.0f; + DOCUMENT("The width of the viewport."); + float width = 0.0f; + DOCUMENT("The height of the viewport."); + float height = 0.0f; + DOCUMENT("The minimum depth of the viewport."); + float minDepth = 0.0f; + DOCUMENT("The maximum depth of the viewport."); + float maxDepth = 0.0f; +}; + +DECLARE_REFLECTION_STRUCT(Viewport); + +DOCUMENT("Describes a single scissor region."); +struct Scissor +{ + DOCUMENT(""); + bool operator==(const Scissor &o) const + { + return x == o.x && y == o.y && width == o.width && height == o.height && enabled == o.enabled; + } + bool operator<(const Scissor &o) const + { + if(!(x == o.x)) + return x < o.x; + if(!(y == o.y)) + return y < o.y; + if(!(width == o.width)) + return width < o.width; + if(!(height == o.height)) + return height < o.height; + if(!(enabled == o.enabled)) + return enabled < o.enabled; + return false; + } + Scissor() = default; + Scissor(int X, int Y, int W, int H, bool en = true) : x(X), y(Y), width(W), height(H), enabled(en) + { + } + DOCUMENT("X co-ordinate of the scissor region."); + int32_t x = 0; + DOCUMENT("Y co-ordinate of the scissor region."); + int32_t y = 0; + DOCUMENT("Width of the scissor region."); + int32_t width = 0; + DOCUMENT("Height of the scissor region."); + int32_t height = 0; + DOCUMENT("``True`` if this scissor region is enabled."); + bool enabled = true; +}; + +DECLARE_REFLECTION_STRUCT(Scissor); + +DOCUMENT("Describes the details of a blend operation."); +struct BlendEquation +{ + DOCUMENT(""); + bool operator==(const BlendEquation &o) const + { + return source == o.source && destination == o.destination && operation == o.operation; + } + bool operator<(const BlendEquation &o) const + { + if(!(source == o.source)) + return source < o.source; + if(!(destination == o.destination)) + return destination < o.destination; + if(!(operation == o.operation)) + return operation < o.operation; + return false; + } + DOCUMENT("The :class:`BlendMultiplier` for the source blend value."); + BlendMultiplier source = BlendMultiplier::One; + DOCUMENT("The :class:`BlendMultiplier` for the destination blend value."); + BlendMultiplier destination = BlendMultiplier::One; + DOCUMENT("The :class:`BlendOperation` to use in the blend calculation."); + BlendOperation operation = BlendOperation::Add; +}; + +DECLARE_REFLECTION_STRUCT(BlendEquation); + +DOCUMENT("Describes the blend configuration for a given output target."); +struct ColorBlend +{ + DOCUMENT(""); + bool operator==(const ColorBlend &o) const + { + return enabled == o.enabled && logicOperationEnabled == o.logicOperationEnabled && + colorBlend == o.colorBlend && alphaBlend == o.alphaBlend && + logicOperation == o.logicOperation && writeMask == o.writeMask; + } + bool operator<(const ColorBlend &o) const + { + if(!(enabled == o.enabled)) + return enabled < o.enabled; + if(!(logicOperationEnabled == o.logicOperationEnabled)) + return logicOperationEnabled < o.logicOperationEnabled; + if(!(colorBlend == o.colorBlend)) + return colorBlend < o.colorBlend; + if(!(alphaBlend == o.alphaBlend)) + return alphaBlend < o.alphaBlend; + if(!(logicOperation == o.logicOperation)) + return logicOperation < o.logicOperation; + if(!(writeMask == o.writeMask)) + return writeMask < o.writeMask; + return false; + } + + DOCUMENT("A :class:`BlendEquation` describing the blending for color values."); + BlendEquation colorBlend; + DOCUMENT("A :class:`BlendEquation` describing the blending for alpha values."); + BlendEquation alphaBlend; + + DOCUMENT(R"(The :class:`LogicOperation` to use for logic operations, if +:data:`logicOperationEnabled` is ``True``. +)"); + LogicOperation logicOperation = LogicOperation::NoOp; + + DOCUMENT("``True`` if blending is enabled for this target."); + bool enabled = false; + DOCUMENT("``True`` if the logic operation in :data:`logicOperation` should be used."); + bool logicOperationEnabled = false; + DOCUMENT("The mask for writes to the render target."); + byte writeMask = 0; +}; + +DECLARE_REFLECTION_STRUCT(ColorBlend); + +DOCUMENT("Describes the details of a stencil operation."); +struct StencilFace +{ + DOCUMENT("The :class:`StencilOperation` to apply if the stencil-test fails."); + StencilOperation failOperation = StencilOperation::Keep; + DOCUMENT("the :class:`StencilOperation` to apply if the depth-test fails."); + StencilOperation depthFailOperation = StencilOperation::Keep; + DOCUMENT("the :class:`StencilOperation` to apply if the stencil-test passes."); + StencilOperation passOperation = StencilOperation::Keep; + DOCUMENT("the :class:`CompareFunction` to use for testing stencil values."); + CompareFunction function = CompareFunction::AlwaysTrue; + DOCUMENT("The current stencil reference value."); + uint32_t reference = 0; + DOCUMENT("The mask for testing stencil values."); + uint32_t compareMask = 0; + DOCUMENT("The mask for writing stencil values."); + uint32_t writeMask = 0; +}; + +DECLARE_REFLECTION_STRUCT(StencilFace); \ No newline at end of file diff --git a/renderdoc/api/replay/control_types.h b/renderdoc/api/replay/control_types.h index 1ced21c17..12c098e4e 100644 --- a/renderdoc/api/replay/control_types.h +++ b/renderdoc/api/replay/control_types.h @@ -35,36 +35,36 @@ struct MeshFormat { MeshFormat() { - idxoffs = 0; - idxByteWidth = 0; + indexByteOffset = 0; + indexByteStride = 0; baseVertex = 0; - offset = 0; - stride = 0; + vertexByteOffset = 0; + vertexByteStride = 0; showAlpha = false; - topo = Topology::Unknown; - numVerts = 0; + topology = Topology::Unknown; + numIndices = 0; unproject = false; nearPlane = farPlane = 0.0f; } DOCUMENT("The :class:`ResourceId` of the index buffer that goes with this mesh element."); - ResourceId idxbuf; + ResourceId indexResourceId; DOCUMENT("The offset in bytes where the indices start in idxbuf."); - uint64_t idxoffs; + uint64_t indexByteOffset; DOCUMENT("The width in bytes of each index. Valid values are 1 (depending on API), 2 or 4."); - uint32_t idxByteWidth; + uint32_t indexByteStride; DOCUMENT("For indexed meshes, a value added to each index before using it to read the vertex."); int32_t baseVertex; DOCUMENT("The :class:`ResourceId` of the vertex buffer containing this mesh element."); - ResourceId buf; + ResourceId vertexResourceId; DOCUMENT("The offset in bytes to the start of the vertex data."); - uint64_t offset; + uint64_t vertexByteOffset; DOCUMENT("The stride in bytes between the start of one vertex and the start of another."); - uint32_t stride; + uint32_t vertexByteStride; DOCUMENT("The :class:`ResourceFormat` describing this mesh component."); - ResourceFormat fmt; + ResourceFormat format; DOCUMENT( "The color to use for rendering the wireframe of this mesh element, as a " @@ -72,9 +72,9 @@ struct MeshFormat FloatVector meshColor; DOCUMENT("The :class:`Topology` that describes the primitives in this mesh."); - Topology topo; + Topology topology; DOCUMENT("The number of vertices in the mesh."); - uint32_t numVerts; + uint32_t numIndices; DOCUMENT("The near plane for the projection matrix."); float nearPlane; @@ -165,16 +165,16 @@ particular subresource (such as array slice, mip or multi-sampled sample). struct TextureDisplay { DOCUMENT("The :class:`ResourceId` of the texture to display."); - ResourceId texid; + ResourceId resourceId; DOCUMENT("An optional :class:`CompType` hint to use when displaying a typeless texture."); CompType typeHint; DOCUMENT("The value in each channel to map to the black point."); - float rangemin; + float rangeMin; DOCUMENT("The value in each channel to map to the white point."); - float rangemax; + float rangeMax; DOCUMENT(R"(The scale to apply to the texture when rendering as a floating point value. @@ -186,32 +186,32 @@ struct TextureDisplay If only one channel is selected, it will be rendered in grayscale )"); - bool Red; + bool red; DOCUMENT(R"(``True`` if the green channel should be visible. If only one channel is selected, it will be rendered in grayscale )"); - bool Green; + bool green; DOCUMENT(R"(``True`` if the blue channel should be visible. If only one channel is selected, it will be rendered in grayscale )"); - bool Blue; + bool blue; DOCUMENT(R"(``True`` if the alpha channel should be visible. If enabled with any of RGB, the texture will be blended to the background color or checkerboard. If only one channel is selected, it will be rendered in grayscale )"); - bool Alpha; + bool alpha; DOCUMENT("``True`` if the texture should be flipped vertically when rendering."); - bool FlipY; + bool flipY; DOCUMENT("If ``>= 0.0`` the RGBA values will be viewed as HDRM with this as the multiplier."); - float HDRMul; + float hdrMultiplier; DOCUMENT(R"(``True`` if the texture should be interpreted as gamma. @@ -223,7 +223,7 @@ See :ref:`the FAQ entry `. See :meth:`ReplayController.BuildCustomShader` for creating an appropriate custom shader. )"); - ResourceId CustomShader; + ResourceId customShaderId; DOCUMENT("Select the mip of the texture to display."); uint32_t mip; @@ -243,15 +243,15 @@ samples. This is primarily useful when rendering to a floating point target for retrieving pixel data from the input texture in cases where it isn't easy to directly fetch the input texture data. )"); - bool rawoutput; + bool rawOutput; DOCUMENT("The offset to pan in the X axis."); - float offx; + float xOffset; DOCUMENT("The offset to pan in the Y axis."); - float offy; + float yOffset; - DOCUMENT(R"(The background colour to use behind the texture display. + DOCUMENT(R"(The background color to use behind the texture display. If set to (0, 0, 0, 0) the global checkerboard colors are used. )"); @@ -373,7 +373,7 @@ written int32_t mip; DOCUMENT(R"(Controls black/white point mapping for output formats that are normal -:data:`8-bit SRGB `, values are +:attr:`8-bit SRGB `, values are )"); TextureComponentMapping comp; @@ -396,7 +396,7 @@ It is an :class:`AlphaMapping` that controls what behaviour to use. )"); AlphaMapping alpha; - DOCUMENT("The background color if :data:`alpha` is set to :data:`AlphaMapping.BlendToColor`"); + DOCUMENT("The background color if :data:`alpha` is set to :attr:`AlphaMapping.BlendToColor`"); FloatVector alphaCol; DOCUMENT("The quality to use when saving to a ``JPG`` file. Valid values are between 1 and 100."); @@ -410,7 +410,7 @@ DOCUMENT("Information about the a new capture created by the target."); struct NewCaptureData { DOCUMENT("An identifier to use to refer to this capture."); - uint32_t ID = 0; + uint32_t captureId = 0; DOCUMENT("The time the capture was created, as a unix timestamp in UTC."); uint64_t timestamp = 0; DOCUMENT("The raw bytes that contain the capture thumbnail, as RGB8 data."); @@ -427,20 +427,23 @@ struct NewCaptureData DECLARE_REFLECTION_STRUCT(NewCaptureData); -DOCUMENT("Information about the API that the target has begun using."); -struct RegisterAPIData +DOCUMENT("Information about the API that the target is using."); +struct APIUseData { - DOCUMENT("The name of the new API."); - rdcstr APIName; + DOCUMENT("The name of the API."); + rdcstr name; + + DOCUMENT("``True`` if the API is presenting to a swapchain"); + bool presenting = false; }; -DECLARE_REFLECTION_STRUCT(RegisterAPIData); +DECLARE_REFLECTION_STRUCT(APIUseData); DOCUMENT("Information about why the target is busy."); struct BusyData { DOCUMENT("The name of the client currently connected to the target."); - rdcstr ClientName; + rdcstr clientName; }; DECLARE_REFLECTION_STRUCT(BusyData); @@ -449,7 +452,7 @@ DOCUMENT("Information about a new child process spawned by the target."); struct NewChildData { DOCUMENT("The PID (Process ID) of the new child."); - uint32_t PID = 0; + uint32_t processId = 0; DOCUMENT("The ident where the new child's target control is active."); uint32_t ident = 0; }; @@ -460,16 +463,16 @@ DOCUMENT("A message from a target control connection."); struct TargetControlMessage { DOCUMENT("The :class:`type ` of message received"); - TargetControlMessageType Type = TargetControlMessageType::Unknown; + TargetControlMessageType type = TargetControlMessageType::Unknown; DOCUMENT("The :class:`new capture data `."); - NewCaptureData NewCapture; - DOCUMENT("The :class:`API registration data `."); - RegisterAPIData RegisterAPI; + NewCaptureData newCapture; + DOCUMENT("The :class:`API use data `."); + APIUseData apiUse; DOCUMENT("The :class:`busy signal data `."); - BusyData Busy; - DOCUMENT("The :class:`new child process data `."); - NewChildData NewChild; + BusyData busy; + DOCUMENT("The :class:`new child process data `."); + NewChildData newChild; }; DECLARE_REFLECTION_STRUCT(TargetControlMessage); diff --git a/renderdoc/api/replay/d3d11_pipestate.h b/renderdoc/api/replay/d3d11_pipestate.h index d31b80ba5..78d2f19a5 100644 --- a/renderdoc/api/replay/d3d11_pipestate.h +++ b/renderdoc/api/replay/d3d11_pipestate.h @@ -25,6 +25,7 @@ #pragma once +#include "common_pipestate.h" #include "shader_types.h" namespace D3D11Pipe @@ -33,125 +34,125 @@ DOCUMENT(R"(Describes a single D3D11 input layout element for one vertex input. .. data:: TightlyPacked - Value for :data:`ByteOffset` that indicates this element is tightly packed. + Value for :data:`byteOffset` that indicates this element is tightly packed. )"); struct Layout { DOCUMENT(""); bool operator==(const Layout &o) const { - return SemanticName == o.SemanticName && SemanticIndex == o.SemanticIndex && - Format == o.Format && InputSlot == o.InputSlot && ByteOffset == o.ByteOffset && - PerInstance == o.PerInstance && InstanceDataStepRate == o.InstanceDataStepRate; + return semanticName == o.semanticName && semanticIndex == o.semanticIndex && + format == o.format && inputSlot == o.inputSlot && byteOffset == o.byteOffset && + perInstance == o.perInstance && instanceDataStepRate == o.instanceDataStepRate; } bool operator<(const Layout &o) const { - if(!(SemanticName == o.SemanticName)) - return SemanticName < o.SemanticName; - if(!(SemanticIndex == o.SemanticIndex)) - return SemanticIndex < o.SemanticIndex; - if(!(Format == o.Format)) - return Format < o.Format; - if(!(InputSlot == o.InputSlot)) - return InputSlot < o.InputSlot; - if(!(ByteOffset == o.ByteOffset)) - return ByteOffset < o.ByteOffset; - if(!(PerInstance == o.PerInstance)) - return PerInstance < o.PerInstance; - if(!(InstanceDataStepRate == o.InstanceDataStepRate)) - return InstanceDataStepRate < o.InstanceDataStepRate; + if(!(semanticName == o.semanticName)) + return semanticName < o.semanticName; + if(!(semanticIndex == o.semanticIndex)) + return semanticIndex < o.semanticIndex; + if(!(format == o.format)) + return format < o.format; + if(!(inputSlot == o.inputSlot)) + return inputSlot < o.inputSlot; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(perInstance == o.perInstance)) + return perInstance < o.perInstance; + if(!(instanceDataStepRate == o.instanceDataStepRate)) + return instanceDataStepRate < o.instanceDataStepRate; return false; } DOCUMENT("The semantic name for this input."); - rdcstr SemanticName; + rdcstr semanticName; DOCUMENT("The semantic index for this input."); - uint32_t SemanticIndex = 0; + uint32_t semanticIndex = 0; DOCUMENT("The :class:`ResourceFormat` describing how the input data is interpreted."); - ResourceFormat Format; + ResourceFormat format; DOCUMENT("The vertex buffer input slot where the data is sourced from."); - uint32_t InputSlot = 0; + uint32_t inputSlot = 0; DOCUMENT(R"(The byte offset from the start of the vertex data in the vertex buffer from -:data:`InputSlot`. +:data:`inputSlot`. If the value is :data:`TightlyPacked` then the element is packed tightly after the previous element, or 0 if this is the first element. )"); - uint32_t ByteOffset = 0; + uint32_t byteOffset = 0; DOCUMENT("``True`` if the vertex data is instance-rate."); - bool PerInstance = false; + bool perInstance = false; - DOCUMENT(R"(If :data:`PerInstance` is ``True`` then this is how many times each instance data is + DOCUMENT(R"(If :data:`perInstance` is ``True`` then this is how many times each instance data is used before advancing to the next instance. E.g. if this value is two, then two instances will be drawn with the first instance data, then two with the next instance data. )"); - uint32_t InstanceDataStepRate = 0; + uint32_t instanceDataStepRate = 0; // D3D11_APPEND_ALIGNED_ELEMENT static const uint32_t TightlyPacked = ~0U; }; DOCUMENT("Describes a single D3D11 vertex buffer binding.") -struct VB +struct VertexBuffer { DOCUMENT(""); - bool operator==(const VB &o) const + bool operator==(const VertexBuffer &o) const { - return Buffer == o.Buffer && Stride == o.Stride && Offset == o.Offset; + return resourceId == o.resourceId && byteStride == o.byteStride && byteOffset == o.byteOffset; } - bool operator<(const VB &o) const + bool operator<(const VertexBuffer &o) const { - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(Stride == o.Stride)) - return Stride < o.Stride; - if(!(Offset == o.Offset)) - return Offset < o.Offset; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteStride == o.byteStride)) + return byteStride < o.byteStride; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; return false; } DOCUMENT("The :class:`ResourceId` of the buffer bound to this slot."); - ResourceId Buffer; - - DOCUMENT("The byte stride between the start of one set of vertex data and the next."); - uint32_t Stride = 0; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer to the beginning of the vertex data."); - uint32_t Offset = 0; + uint32_t byteOffset = 0; + + DOCUMENT("The byte stride between the start of one set of vertex data and the next."); + uint32_t byteStride = 0; }; DOCUMENT("Describes the D3D11 index buffer binding.") -struct IB +struct IndexBuffer { DOCUMENT("The :class:`ResourceId` of the index buffer."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer to the beginning of the index data."); - uint32_t Offset = 0; + uint32_t byteOffset = 0; }; DOCUMENT("Describes the input assembler data."); -struct IA +struct InputAssembly { - DOCUMENT("A list of :class:`D3D11_Layout` describing the input layout elements in this layout."); + DOCUMENT("A list of :class:`D3D11Layout` describing the input layout elements in this layout."); rdcarray layouts; DOCUMENT("The :class:`ResourceId` of the layout object."); - ResourceId layout; + ResourceId resourceId; DOCUMENT("A :class:`ShaderReflection` describing the bytecode used to create the input layout."); - ShaderReflection *Bytecode = NULL; + ShaderReflection *bytecode = NULL; - DOCUMENT("A list of :class:`D3D11_VB` with the vertex buffers that are bound."); - rdcarray vbuffers; + DOCUMENT("A list of :class:`D3D11VertexBuffer` with the vertex buffers that are bound."); + rdcarray vertexBuffers; - DOCUMENT("The :class:`D3D11_IB` describing the index buffer."); - IB ibuffer; + DOCUMENT("The :class:`D3D11IndexBuffer` describing the index buffer."); + IndexBuffer indexBuffer; }; DOCUMENT("Describes the details of a D3D11 resource view - any one of UAV, SRV, RTV or DSV."); @@ -160,85 +161,85 @@ struct View DOCUMENT(""); bool operator==(const View &o) const { - return Object == o.Object && Resource == o.Resource && Type == o.Type && Format == o.Format && - Structured == o.Structured && BufferStructCount == o.BufferStructCount && - ElementSize == o.ElementSize && FirstElement == o.FirstElement && - NumElements == o.NumElements && Flags == o.Flags && HighestMip == o.HighestMip && - NumMipLevels == o.NumMipLevels && ArraySize == o.ArraySize && - FirstArraySlice == o.FirstArraySlice; + return viewResourceId == o.viewResourceId && resourceResourceId == o.resourceResourceId && + type == o.type && viewFormat == o.viewFormat && structured == o.structured && + bufferStructCount == o.bufferStructCount && elementByteSize == o.elementByteSize && + firstElement == o.firstElement && numElements == o.numElements && + bufferFlags == o.bufferFlags && firstMip == o.firstMip && numMips == o.numMips && + numSlices == o.numSlices && firstSlice == o.firstSlice; } bool operator<(const View &o) const { - if(!(Object == o.Object)) - return Object < o.Object; - if(!(Resource == o.Resource)) - return Resource < o.Resource; - if(!(Type == o.Type)) - return Type < o.Type; - if(!(Format == o.Format)) - return Format < o.Format; - if(!(Structured == o.Structured)) - return Structured < o.Structured; - if(!(BufferStructCount == o.BufferStructCount)) - return BufferStructCount < o.BufferStructCount; - if(!(ElementSize == o.ElementSize)) - return ElementSize < o.ElementSize; - if(!(FirstElement == o.FirstElement)) - return FirstElement < o.FirstElement; - if(!(NumElements == o.NumElements)) - return NumElements < o.NumElements; - if(!(Flags == o.Flags)) - return Flags < o.Flags; - if(!(HighestMip == o.HighestMip)) - return HighestMip < o.HighestMip; - if(!(NumMipLevels == o.NumMipLevels)) - return NumMipLevels < o.NumMipLevels; - if(!(ArraySize == o.ArraySize)) - return ArraySize < o.ArraySize; - if(!(FirstArraySlice == o.FirstArraySlice)) - return FirstArraySlice < o.FirstArraySlice; + if(!(viewResourceId == o.viewResourceId)) + return viewResourceId < o.viewResourceId; + if(!(resourceResourceId == o.resourceResourceId)) + return resourceResourceId < o.resourceResourceId; + if(!(type == o.type)) + return type < o.type; + if(!(viewFormat == o.viewFormat)) + return viewFormat < o.viewFormat; + if(!(structured == o.structured)) + return structured < o.structured; + if(!(bufferStructCount == o.bufferStructCount)) + return bufferStructCount < o.bufferStructCount; + if(!(elementByteSize == o.elementByteSize)) + return elementByteSize < o.elementByteSize; + if(!(firstElement == o.firstElement)) + return firstElement < o.firstElement; + if(!(numElements == o.numElements)) + return numElements < o.numElements; + if(!(bufferFlags == o.bufferFlags)) + return bufferFlags < o.bufferFlags; + if(!(firstMip == o.firstMip)) + return firstMip < o.firstMip; + if(!(numMips == o.numMips)) + return numMips < o.numMips; + if(!(numSlices == o.numSlices)) + return numSlices < o.numSlices; + if(!(firstSlice == o.firstSlice)) + return firstSlice < o.firstSlice; return false; } DOCUMENT("The :class:`ResourceId` of the view itself."); - ResourceId Object; + ResourceId viewResourceId; DOCUMENT("The :class:`ResourceId` of the underlying resource the view refers to."); - ResourceId Resource; + ResourceId resourceResourceId; - DOCUMENT("The :class:`TextureDim` of the view type."); - TextureDim Type; + DOCUMENT("The :class:`TextureType` of the view type."); + TextureType type; DOCUMENT("The :class:`ResourceFormat` that the view uses."); - ResourceFormat Format; + ResourceFormat viewFormat; DOCUMENT("``True`` if this view describes a structured buffer."); - bool Structured = false; + bool structured = false; DOCUMENT("If the view has a hidden counter, this stores the current value of the counter."); - uint32_t BufferStructCount = 0; + uint32_t bufferStructCount = 0; - DOCUMENT(R"(The byte size of a single element in the view. Either the byte size of :data:`Format`, -or the structured buffer element size, as appropriate. + DOCUMENT(R"(The byte size of a single element in the view. Either the byte size of +:data:`viewFormat`, or the structured buffer element size, as appropriate. )"); - uint32_t ElementSize = 0; + uint32_t elementByteSize = 0; DOCUMENT("Valid for buffers - the first element to be used in the view."); - uint32_t FirstElement = 0; + uint32_t firstElement = 0; DOCUMENT("Valid for buffers - the number of elements to be used in the view."); - uint32_t NumElements = 1; + uint32_t numElements = 1; DOCUMENT("Valid for buffers - the flags for additional view properties."); - D3DBufferViewFlags Flags = D3DBufferViewFlags::NoFlags; + D3DBufferViewFlags bufferFlags = D3DBufferViewFlags::NoFlags; - DOCUMENT("Valid for textures - the highest mip that is available through the view."); - uint32_t HighestMip = 0; + DOCUMENT("Valid for textures - the first mip that is available through the view."); + uint32_t firstMip = 0; DOCUMENT("Valid for textures - the number of mip levels in the view."); - uint32_t NumMipLevels = 0; + uint32_t numMips = 0; - DOCUMENT("Valid for texture arrays or 3D textures - the number of slices in the view."); - uint32_t ArraySize = 1; DOCUMENT("Valid for texture arrays or 3D textures - the first slice available through the view."); - uint32_t FirstArraySlice = 0; + uint32_t firstSlice = 0; + DOCUMENT("Valid for texture arrays or 3D textures - the number of slices in the view."); + uint32_t numSlices = 1; }; DOCUMENT("Describes a sampler state object."); @@ -247,67 +248,67 @@ struct Sampler DOCUMENT(""); bool operator==(const Sampler &o) const { - return Samp == o.Samp && AddressU == o.AddressU && AddressV == o.AddressV && - AddressW == o.AddressW && BorderColor[0] == o.BorderColor[0] && - BorderColor[1] == o.BorderColor[1] && BorderColor[2] == o.BorderColor[2] && - BorderColor[3] == o.BorderColor[3] && Comparison == o.Comparison && Filter == o.Filter && - MaxAniso == o.MaxAniso && MaxLOD == o.MaxLOD && MinLOD == o.MinLOD && - MipLODBias == o.MipLODBias; + return resourceId == o.resourceId && addressU == o.addressU && addressV == o.addressV && + addressW == o.addressW && borderColor[0] == o.borderColor[0] && + borderColor[1] == o.borderColor[1] && borderColor[2] == o.borderColor[2] && + borderColor[3] == o.borderColor[3] && compareFunction == o.compareFunction && + filter == o.filter && maxAnisotropy == o.maxAnisotropy && maxLOD == o.maxLOD && + minLOD == o.minLOD && mipLODBias == o.mipLODBias; } bool operator<(const Sampler &o) const { - if(!(Samp == o.Samp)) - return Samp < o.Samp; - if(!(AddressU == o.AddressU)) - return AddressU < o.AddressU; - if(!(AddressV == o.AddressV)) - return AddressV < o.AddressV; - if(!(AddressW == o.AddressW)) - return AddressW < o.AddressW; - if(!(BorderColor[0] == o.BorderColor[0])) - return BorderColor[0] < o.BorderColor[0]; - if(!(BorderColor[1] == o.BorderColor[1])) - return BorderColor[1] < o.BorderColor[1]; - if(!(BorderColor[2] == o.BorderColor[2])) - return BorderColor[2] < o.BorderColor[2]; - if(!(BorderColor[3] == o.BorderColor[3])) - return BorderColor[3] < o.BorderColor[3]; - if(!(Comparison == o.Comparison)) - return Comparison < o.Comparison; - if(!(Filter == o.Filter)) - return Filter < o.Filter; - if(!(MaxAniso == o.MaxAniso)) - return MaxAniso < o.MaxAniso; - if(!(MaxLOD == o.MaxLOD)) - return MaxLOD < o.MaxLOD; - if(!(MinLOD == o.MinLOD)) - return MinLOD < o.MinLOD; - if(!(MipLODBias == o.MipLODBias)) - return MipLODBias < o.MipLODBias; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(addressU == o.addressU)) + return addressU < o.addressU; + if(!(addressV == o.addressV)) + return addressV < o.addressV; + if(!(addressW == o.addressW)) + return addressW < o.addressW; + if(!(borderColor[0] == o.borderColor[0])) + return borderColor[0] < o.borderColor[0]; + if(!(borderColor[1] == o.borderColor[1])) + return borderColor[1] < o.borderColor[1]; + if(!(borderColor[2] == o.borderColor[2])) + return borderColor[2] < o.borderColor[2]; + if(!(borderColor[3] == o.borderColor[3])) + return borderColor[3] < o.borderColor[3]; + if(!(compareFunction == o.compareFunction)) + return compareFunction < o.compareFunction; + if(!(filter == o.filter)) + return filter < o.filter; + if(!(maxAnisotropy == o.maxAnisotropy)) + return maxAnisotropy < o.maxAnisotropy; + if(!(maxLOD == o.maxLOD)) + return maxLOD < o.maxLOD; + if(!(minLOD == o.minLOD)) + return minLOD < o.minLOD; + if(!(mipLODBias == o.mipLODBias)) + return mipLODBias < o.mipLODBias; return false; } DOCUMENT("The :class:`ResourceId` of the sampler state object."); - ResourceId Samp; + ResourceId resourceId; DOCUMENT("The :class:`AddressMode` in the U direction."); - AddressMode AddressU = AddressMode::Wrap; + AddressMode addressU = AddressMode::Wrap; DOCUMENT("The :class:`AddressMode` in the V direction."); - AddressMode AddressV = AddressMode::Wrap; + AddressMode addressV = AddressMode::Wrap; DOCUMENT("The :class:`AddressMode` in the W direction."); - AddressMode AddressW = AddressMode::Wrap; + AddressMode addressW = AddressMode::Wrap; DOCUMENT("The RGBA border color."); - float BorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - DOCUMENT("The :class:`CompareFunc` for comparison samplers."); - CompareFunc Comparison = CompareFunc::AlwaysTrue; + float borderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + DOCUMENT("The :class:`CompareFunction` for comparison samplers."); + CompareFunction compareFunction = CompareFunction::AlwaysTrue; DOCUMENT("The :class:`TextureFilter` describing the filtering mode."); - TextureFilter Filter; + TextureFilter filter; DOCUMENT("The maximum anisotropic filtering level to use."); - uint32_t MaxAniso = 0; + uint32_t maxAnisotropy = 0; DOCUMENT("The maximum mip level that can be used."); - float MaxLOD = 0.0f; + float maxLOD = 0.0f; DOCUMENT("The minimum mip level that can be used."); - float MinLOD = 0.0f; + float minLOD = 0.0f; DOCUMENT("A bias to apply to the calculated mip level before sampling."); - float MipLODBias = 0.0f; + float mipLODBias = 0.0f; DOCUMENT(R"(Check if the border color is used in this D3D11 sampler. @@ -316,195 +317,112 @@ struct Sampler )"); bool UseBorder() const { - return AddressU == AddressMode::ClampBorder || AddressV == AddressMode::ClampBorder || - AddressW == AddressMode::ClampBorder; + return addressU == AddressMode::ClampBorder || addressV == AddressMode::ClampBorder || + addressW == AddressMode::ClampBorder; } }; DOCUMENT("Describes a constant buffer binding."); -struct CBuffer +struct ConstantBuffer { DOCUMENT(""); - bool operator==(const CBuffer &o) const + bool operator==(const ConstantBuffer &o) const { - return Buffer == o.Buffer && VecOffset == o.VecOffset && VecCount == o.VecCount; + return resourceId == o.resourceId && vecOffset == o.vecOffset && vecCount == o.vecCount; } - bool operator<(const CBuffer &o) const + bool operator<(const ConstantBuffer &o) const { - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(VecOffset == o.VecOffset)) - return VecOffset < o.VecOffset; - if(!(VecCount == o.VecCount)) - return VecCount < o.VecCount; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(vecOffset == o.vecOffset)) + return vecOffset < o.vecOffset; + if(!(vecCount == o.vecCount)) + return vecCount < o.vecCount; return false; } DOCUMENT("The :class:`ResourceId` of the buffer."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT(R"(The offset of the buffer binding, in units of ``float4`` (16 bytes). If the capture isn't using the D3D11.1 binding methods, this offset will be 0. )"); - uint32_t VecOffset = 0; + uint32_t vecOffset = 0; DOCUMENT(R"(The size of the buffer binding, in units of ``float4`` (16 bytes). If the capture isn't using the D3D11.1 binding methods, this offset will be 4096 (64 kiB). )"); - uint32_t VecCount = 0; + uint32_t vecCount = 0; }; DOCUMENT("Describes a D3D11 shader stage."); struct Shader { - DOCUMENT("The :class:`ResourceId` of the shader object itself."); - ResourceId Object; + DOCUMENT("The :class:`ResourceId` of the shader itself."); + ResourceId resourceId; DOCUMENT("A :class:`ShaderReflection` describing the reflection data for this shader."); - ShaderReflection *ShaderDetails = NULL; - DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`ShaderDetails` with the bindpoint + ShaderReflection *reflection = NULL; + DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`reflection` with the bindpoint mapping data. )"); - ShaderBindpointMapping BindpointMapping; + ShaderBindpointMapping bindpointMapping; DOCUMENT("A :class:`ShaderStage` identifying which stage this shader is bound to."); ShaderStage stage = ShaderStage::Vertex; - DOCUMENT("A list of :class:`D3D11_View` with the bound SRVs."); - rdcarray SRVs; + DOCUMENT("A list of :class:`D3D11View` with the bound SRVs."); + rdcarray srvs; - DOCUMENT("A list of :class:`D3D11_View` with the bound UAVs - only valid for the compute stage."); - rdcarray UAVs; + DOCUMENT("A list of :class:`D3D11View` with the bound UAVs - only valid for the compute stage."); + rdcarray uavs; - DOCUMENT("A list of :class:`D3D11_Sampler` with the bound samplers."); - rdcarray Samplers; + DOCUMENT("A list of :class:`D3D11Sampler` with the bound samplers."); + rdcarray samplers; - DOCUMENT("A list of :class:`D3D11_CBuffer` with the bound constant buffers."); - rdcarray ConstantBuffers; + DOCUMENT("A list of :class:`D3D11ConstantBuffer` with the bound constant buffers."); + rdcarray constantBuffers; DOCUMENT("A list of ``str`` with the bound class instance names."); - rdcarray ClassInstances; + rdcarray classInstances; }; DOCUMENT("Describes a binding on the D3D11 stream-out stage."); -struct SOBind +struct StreamOutBind { DOCUMENT(""); - bool operator==(const SOBind &o) const { return Buffer == o.Buffer && Offset == o.Offset; } - bool operator<(const SOBind &o) const + bool operator==(const StreamOutBind &o) const { - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(Offset == o.Offset)) - return Offset < o.Offset; + return resourceId == o.resourceId && byteOffset == o.byteOffset; + } + bool operator<(const StreamOutBind &o) const + { + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; return false; } DOCUMENT("The :class:`ResourceId` of the buffer."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The byte offset of the stream-output binding."); - uint32_t Offset = 0; + uint32_t byteOffset = 0; }; DOCUMENT("Describes the stream-out stage bindings."); -struct SO +struct StreamOut { - DOCUMENT("A list of ``D3D11_SOBind`` with the bound buffers."); - rdcarray Outputs; -}; - -DOCUMENT("Describes a single D3D11 viewport."); -struct Viewport -{ - DOCUMENT(""); - bool operator==(const Viewport &o) const - { - return X == o.X && Y == o.Y && Width == o.Width && Height == o.Height && - MinDepth == o.MinDepth && MaxDepth == o.MaxDepth; - } - bool operator<(const Viewport &o) const - { - if(!(X == o.X)) - return X < o.X; - if(!(Y == o.Y)) - return Y < o.Y; - if(!(Width == o.Width)) - return Width < o.Width; - if(!(Height == o.Height)) - return Height < o.Height; - if(!(MinDepth == o.MinDepth)) - return MinDepth < o.MinDepth; - if(!(MaxDepth == o.MaxDepth)) - return MaxDepth < o.MaxDepth; - return false; - } - Viewport() = default; - Viewport(float TX, float TY, float W, float H, float MN, float MX, bool en) - : X(TX), Y(TY), Width(W), Height(H), MinDepth(MN), MaxDepth(MX), Enabled(en) - { - } - - DOCUMENT("Top-left X co-ordinate of the viewport."); - float X = 0.0f; - DOCUMENT("Top-left Y co-ordinate of the viewport."); - float Y = 0.0f; - DOCUMENT("The width of the viewport."); - float Width = 0.0f; - DOCUMENT("The height of the viewport."); - float Height = 0.0f; - DOCUMENT("The minimum depth of the viewport."); - float MinDepth = 0.0f; - DOCUMENT("The maximum depth of the viewport."); - float MaxDepth = 0.0f; - DOCUMENT("``True`` if this viewport is enabled."); - bool Enabled = false; -}; - -DOCUMENT("Describes a single D3D11 scissor rect."); -struct Scissor -{ - DOCUMENT(""); - bool operator==(const Scissor &o) const - { - return left == o.left && top == o.top && right == o.right && bottom == o.bottom && - Enabled == o.Enabled; - } - bool operator<(const Scissor &o) const - { - if(!(left == o.left)) - return left < o.left; - if(!(top == o.top)) - return top < o.top; - if(!(right == o.right)) - return right < o.right; - if(!(bottom == o.bottom)) - return bottom < o.bottom; - if(!(Enabled == o.Enabled)) - return Enabled < o.Enabled; - return false; - } - Scissor() = default; - Scissor(int l, int t, int r, int b, bool en) : left(l), top(t), right(r), bottom(b), Enabled(en) - { - } - DOCUMENT("Top-left X co-ordinate of the viewport."); - int32_t left = 0; - DOCUMENT("Top-left Y co-ordinate of the viewport."); - int32_t top = 0; - DOCUMENT("Bottom-right X co-ordinate of the viewport."); - int32_t right = 0; - DOCUMENT("Bottom-right Y co-ordinate of the viewport."); - int32_t bottom = 0; - DOCUMENT("``True`` if this scissor region is enabled."); - bool Enabled = false; + DOCUMENT("A list of ``D3D11StreamOutBind`` with the bound buffers."); + rdcarray outputs; }; DOCUMENT("Describes a rasterizer state object."); struct RasterizerState { DOCUMENT("The :class:`ResourceId` of the rasterizer state object."); - ResourceId State; + ResourceId resourceId; DOCUMENT("The polygon fill mode."); FillMode fillMode = FillMode::Solid; DOCUMENT("The polygon culling mode."); @@ -512,268 +430,174 @@ struct RasterizerState DOCUMENT(R"(``True`` if counter-clockwise polygons are front-facing. ``False`` if clockwise polygons are front-facing. )"); - bool FrontCCW = false; + bool frontCCW = false; DOCUMENT("The fixed depth bias value to apply to z-values."); - int32_t DepthBias = 0; - DOCUMENT(R"(The clamp value for calculated depth bias from :data:`DepthBias` and -:data:`SlopeScaledDepthBias` + int32_t depthBias = 0; + DOCUMENT(R"(The clamp value for calculated depth bias from :data:`depthBias` and +:data:`slopeScaledDepthBias` )"); - float DepthBiasClamp = 0.0f; + float depthBiasClamp = 0.0f; DOCUMENT("The slope-scaled depth bias value to apply to z-values."); - float SlopeScaledDepthBias = 0.0f; + float slopeScaledDepthBias = 0.0f; DOCUMENT("``True`` if pixels outside of the near and far depth planes should be clipped."); - bool DepthClip = false; + bool depthClip = false; DOCUMENT("``True`` if the scissor test should be applied."); - bool ScissorEnable = false; + bool scissorEnable = false; DOCUMENT("``True`` if the quadrilateral MSAA algorithm should be used on MSAA targets."); - bool MultisampleEnable = false; + bool multisampleEnable = false; DOCUMENT( - "``True`` if lines should be anti-aliased. Ignored if :data:`MultisampleEnable` is " + "``True`` if lines should be anti-aliased. Ignored if :data:`multisampleEnable` is " "``False``."); - bool AntialiasedLineEnable = false; + bool antialiasedLines = false; DOCUMENT(R"(A sample count to force rasterization to when UAV rendering or rasterizing, or 0 to not force any sample count. )"); - uint32_t ForcedSampleCount = 0; + uint32_t forcedSampleCount = 0; DOCUMENT("``True`` if a conservative rasterization algorithm should be used."); - bool ConservativeRasterization = false; + bool conservativeRasterization = false; }; DOCUMENT("Describes the rasterization state of the D3D11 pipeline."); struct Rasterizer { - DOCUMENT("A list of :class:`D3D11_Viewport` with the bound viewports."); - rdcarray Viewports; + DOCUMENT("A list of :class:`Viewport` with the bound viewports."); + rdcarray viewports; - DOCUMENT("A list of :class:`D3D11_Scissor` with the bound scissor regions."); - rdcarray Scissors; + DOCUMENT("A list of :class:`Scissor` with the bound scissor regions."); + rdcarray scissors; - DOCUMENT("A :class:`D3D11_RasterizerState` with the details of the rasterization state."); - RasterizerState m_State; -}; - -DOCUMENT("Describes the details of a D3D11 stencil operation."); -struct StencilFace -{ - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test fails."); - StencilOp FailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the depth-test fails."); - StencilOp DepthFailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test passes."); - StencilOp PassOp = StencilOp::Keep; - DOCUMENT("The :class:`CompareFunc` to use for testing stencil values."); - CompareFunc Func = CompareFunc::AlwaysTrue; + DOCUMENT("A :class:`D3D11RasterizerState` with the details of the rasterization state."); + RasterizerState state; }; DOCUMENT("Describes a depth-stencil state object."); struct DepthStencilState { DOCUMENT("The :class:`ResourceId` of the depth-stencil state object."); - ResourceId State; + ResourceId resourceId; DOCUMENT("``True`` if depth testing should be performed."); - bool DepthEnable = false; - DOCUMENT("The :class:`CompareFunc` to use for testing depth values."); - CompareFunc DepthFunc = CompareFunc::AlwaysTrue; + bool depthEnable = false; + DOCUMENT("The :class:`CompareFunction` to use for testing depth values."); + CompareFunction depthFunction = CompareFunction::AlwaysTrue; DOCUMENT("``True`` if depth values should be written to the depth target."); - bool DepthWrites = false; + bool depthWrites = false; DOCUMENT("``True`` if stencil operations should be performed."); - bool StencilEnable = false; - DOCUMENT("The mask for reading stencil values."); - byte StencilReadMask = 0; - DOCUMENT("The mask for writing stencil values."); - byte StencilWriteMask = 0; + bool stencilEnable = false; - DOCUMENT("A :class:`D3D11_StencilFace` describing what happens for front-facing polygons."); - StencilFace m_FrontFace; - DOCUMENT("A :class:`D3D11_StencilFace` describing what happens for back-facing polygons."); - StencilFace m_BackFace; - - DOCUMENT("The current stencil reference value."); - uint32_t StencilRef = 0; -}; - -DOCUMENT("Describes the details of a D3D11 blend operation."); -struct BlendEquation -{ - DOCUMENT(""); - bool operator==(const BlendEquation &o) const - { - return Source == o.Source && Destination == o.Destination && Operation == o.Operation; - } - bool operator<(const BlendEquation &o) const - { - if(!(Source == o.Source)) - return Source < o.Source; - if(!(Destination == o.Destination)) - return Destination < o.Destination; - if(!(Operation == o.Operation)) - return Operation < o.Operation; - return false; - } - DOCUMENT("The :class:`BlendMultiplier` for the source blend value."); - BlendMultiplier Source = BlendMultiplier::One; - DOCUMENT("The :class:`BlendMultiplier` for the destination blend value."); - BlendMultiplier Destination = BlendMultiplier::One; - DOCUMENT("The :class:`BlendOp` to use in the blend calculation."); - BlendOp Operation = BlendOp::Add; -}; - -DOCUMENT("Describes the blend configuration for a given D3D11 target."); -struct Blend -{ - DOCUMENT(""); - bool operator==(const Blend &o) const - { - return Enabled == o.Enabled && LogicEnabled == o.LogicEnabled && m_Blend == o.m_Blend && - m_AlphaBlend == o.m_AlphaBlend && Logic == o.Logic && WriteMask == o.WriteMask; - } - bool operator<(const Blend &o) const - { - if(!(Enabled == o.Enabled)) - return Enabled < o.Enabled; - if(!(LogicEnabled == o.LogicEnabled)) - return LogicEnabled < o.LogicEnabled; - if(!(m_Blend == o.m_Blend)) - return m_Blend < o.m_Blend; - if(!(m_AlphaBlend == o.m_AlphaBlend)) - return m_AlphaBlend < o.m_AlphaBlend; - if(!(Logic == o.Logic)) - return Logic < o.Logic; - if(!(WriteMask == o.WriteMask)) - return WriteMask < o.WriteMask; - return false; - } - - DOCUMENT("A :class:`D3D11_BlendEquation` describing the blending for colour values."); - BlendEquation m_Blend; - DOCUMENT("A :class:`D3D11_BlendEquation` describing the blending for alpha values."); - BlendEquation m_AlphaBlend; - - DOCUMENT( - "The :class:`LogicOp` to use for logic operations, if :data:`LogicEnabled` is ``True``."); - LogicOp Logic = LogicOp::NoOp; - - DOCUMENT("``True`` if blending is enabled for this target."); - bool Enabled = false; - DOCUMENT("``True`` if the logic operation in :data:`Logic` should be used."); - bool LogicEnabled = false; - DOCUMENT("The mask for writes to the render target."); - byte WriteMask = 0; + DOCUMENT("A :class:`StencilFace` describing what happens for front-facing polygons."); + StencilFace frontFace; + DOCUMENT("A :class:`StencilFace` describing what happens for back-facing polygons."); + StencilFace backFace; }; DOCUMENT("Describes a blend state object."); struct BlendState { DOCUMENT("The :class:`ResourceId` of the blend state object."); - ResourceId State; + ResourceId resourceId; DOCUMENT("``True`` if alpha-to-coverage should be used when blending to an MSAA target."); - bool AlphaToCoverage = false; + bool alphaToCoverage = false; DOCUMENT(R"(``True`` if independent blending for each target should be used. ``False`` if the first blend should be applied to all targets. )"); - bool IndependentBlend = false; + bool independentBlend = false; - DOCUMENT("A list of :class:`D3D11_Blend` describing the blend operations for each target."); - rdcarray Blends; + DOCUMENT("A list of :class:`ColorBlend` describing the blend operations for each target."); + rdcarray blends; DOCUMENT("The constant blend factor to use in blend equations."); - float BlendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + float blendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; DOCUMENT("The mask determining which samples are written to."); - uint32_t SampleMask = ~0U; + uint32_t sampleMask = ~0U; }; DOCUMENT("Describes the current state of the output-merger stage of the D3D11 pipeline."); -struct OM +struct OutputMerger { - DOCUMENT("A :class:`D3D11_DepthStencilState` with the details of the depth-stencil state."); - DepthStencilState m_State; - DOCUMENT("A :class:`D3D11_BlendState` with the details of the blend state."); - BlendState m_BlendState; + DOCUMENT("A :class:`D3D11DepthStencilState` with the details of the depth-stencil state."); + DepthStencilState depthStencilState; + DOCUMENT("A :class:`D3D11BlendState` with the details of the blend state."); + BlendState blendState; - DOCUMENT("A list of :class:`D3D11_View` describing the bound render targets."); - rdcarray RenderTargets; + DOCUMENT("A list of :class:`D3D11View` describing the bound render targets."); + rdcarray renderTargets; DOCUMENT("Which slot in the output targets is the first UAV."); - uint32_t UAVStartSlot = 0; - DOCUMENT("A list of :class:`D3D11_View` describing the bound UAVs."); - rdcarray UAVs; + uint32_t uavStartSlot = 0; + DOCUMENT("A list of :class:`D3D11View` describing the bound UAVs."); + rdcarray uavs; - DOCUMENT("A :class:`D3D11_View` with details of the bound depth-stencil target."); - View DepthTarget; + DOCUMENT("A :class:`D3D11View` with details of the bound depth-stencil target."); + View depthTarget; DOCUMENT("``True`` if depth access to the depth-stencil target is read-only."); - bool DepthReadOnly = false; + bool depthReadOnly = false; DOCUMENT("``True`` if stencil access to the depth-stencil target is read-only."); - bool StencilReadOnly = false; + bool stencilReadOnly = false; }; DOCUMENT("Describes the current state of predicated rendering."); struct Predication { DOCUMENT("The :class:`ResourceId` of the active predicate."); - ResourceId Obj; + ResourceId resourceId; DOCUMENT("The value to go along with the predicate."); - bool Value = false; + bool value = false; DOCUMENT("``True`` if the current predicate would render."); - bool Passing = false; + bool isPassing = false; }; DOCUMENT("The full current D3D11 pipeline state."); struct State { - DOCUMENT("A :class:`D3D11_IA` describing the input assembly pipeline stage."); - IA m_IA; + DOCUMENT("A :class:`D3D11InputAssembly` describing the input assembly pipeline stage."); + InputAssembly inputAssembly; - DOCUMENT("A :class:`D3D11_Shader` describing the vertex shader stage."); - Shader m_VS; - DOCUMENT("A :class:`D3D11_Shader` describing the hull shader stage."); - Shader m_HS; - DOCUMENT("A :class:`D3D11_Shader` describing the domain shader stage."); - Shader m_DS; - DOCUMENT("A :class:`D3D11_Shader` describing the geometry shader stage."); - Shader m_GS; - DOCUMENT("A :class:`D3D11_Shader` describing the pixel shader stage."); - Shader m_PS; - DOCUMENT("A :class:`D3D11_Shader` describing the compute shader stage."); - Shader m_CS; + DOCUMENT("A :class:`D3D11Shader` describing the vertex shader stage."); + Shader vertexShader; + DOCUMENT("A :class:`D3D11Shader` describing the hull shader stage."); + Shader hullShader; + DOCUMENT("A :class:`D3D11Shader` describing the domain shader stage."); + Shader domainShader; + DOCUMENT("A :class:`D3D11Shader` describing the geometry shader stage."); + Shader geometryShader; + DOCUMENT("A :class:`D3D11Shader` describing the pixel shader stage."); + Shader pixelShader; + DOCUMENT("A :class:`D3D11Shader` describing the compute shader stage."); + Shader computeShader; - DOCUMENT("A :class:`D3D11_SO` describing the stream-out pipeline stage."); - SO m_SO; + DOCUMENT("A :class:`D3D11StreamOut` describing the stream-out pipeline stage."); + StreamOut streamOut; - DOCUMENT("A :class:`D3D11_Rasterizer` describing the rasterizer pipeline stage."); - Rasterizer m_RS; + DOCUMENT("A :class:`D3D11Rasterizer` describing the rasterizer pipeline stage."); + Rasterizer rasterizer; - DOCUMENT("A :class:`D3D11_OM` describing the output merger pipeline stage."); - OM m_OM; + DOCUMENT("A :class:`D3D11OutputMerger` describing the output merger pipeline stage."); + OutputMerger outputMerger; - DOCUMENT("A :class:`Predication` describing the predicated rendering state."); - Predication m_Predicate; + DOCUMENT("A :class:`D3D11Predication` describing the predicated rendering state."); + Predication predication; }; }; // namespace D3D11Pipe DECLARE_REFLECTION_STRUCT(D3D11Pipe::Layout); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::VB); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::IB); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::IA); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::VertexBuffer); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::IndexBuffer); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::InputAssembly); DECLARE_REFLECTION_STRUCT(D3D11Pipe::View); DECLARE_REFLECTION_STRUCT(D3D11Pipe::Sampler); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::CBuffer); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::ConstantBuffer); DECLARE_REFLECTION_STRUCT(D3D11Pipe::Shader); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::SOBind); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::SO); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::Viewport); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::Scissor); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::StreamOutBind); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::StreamOut); DECLARE_REFLECTION_STRUCT(D3D11Pipe::RasterizerState); DECLARE_REFLECTION_STRUCT(D3D11Pipe::Rasterizer); DECLARE_REFLECTION_STRUCT(D3D11Pipe::DepthStencilState); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::StencilFace); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::Blend); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::BlendEquation); DECLARE_REFLECTION_STRUCT(D3D11Pipe::BlendState); -DECLARE_REFLECTION_STRUCT(D3D11Pipe::OM); +DECLARE_REFLECTION_STRUCT(D3D11Pipe::OutputMerger); DECLARE_REFLECTION_STRUCT(D3D11Pipe::Predication); DECLARE_REFLECTION_STRUCT(D3D11Pipe::State); diff --git a/renderdoc/api/replay/d3d12_pipestate.h b/renderdoc/api/replay/d3d12_pipestate.h index 33b81148d..6a469bbb9 100644 --- a/renderdoc/api/replay/d3d12_pipestate.h +++ b/renderdoc/api/replay/d3d12_pipestate.h @@ -24,6 +24,7 @@ #pragma once +#include "common_pipestate.h" #include "shader_types.h" namespace D3D12Pipe @@ -32,127 +33,128 @@ DOCUMENT(R"(Describes a single D3D12 input layout element for one vertex input. .. data:: TightlyPacked - Value for :data:`ByteOffset` that indicates this element is tightly packed. + Value for :data:`byteOffset` that indicates this element is tightly packed. )"); struct Layout { DOCUMENT(""); bool operator==(const Layout &o) const { - return SemanticName == o.SemanticName && SemanticIndex == o.SemanticIndex && - Format == o.Format && InputSlot == o.InputSlot && ByteOffset == o.ByteOffset && - PerInstance == o.PerInstance && InstanceDataStepRate == o.InstanceDataStepRate; + return semanticName == o.semanticName && semanticIndex == o.semanticIndex && + format == o.format && inputSlot == o.inputSlot && byteOffset == o.byteOffset && + perInstance == o.perInstance && instanceDataStepRate == o.instanceDataStepRate; } bool operator<(const Layout &o) const { - if(!(SemanticName == o.SemanticName)) - return SemanticName < o.SemanticName; - if(!(SemanticIndex == o.SemanticIndex)) - return SemanticIndex < o.SemanticIndex; - if(!(Format == o.Format)) - return Format < o.Format; - if(!(InputSlot == o.InputSlot)) - return InputSlot < o.InputSlot; - if(!(ByteOffset == o.ByteOffset)) - return ByteOffset < o.ByteOffset; - if(!(PerInstance == o.PerInstance)) - return PerInstance < o.PerInstance; - if(!(InstanceDataStepRate == o.InstanceDataStepRate)) - return InstanceDataStepRate < o.InstanceDataStepRate; + if(!(semanticName == o.semanticName)) + return semanticName < o.semanticName; + if(!(semanticIndex == o.semanticIndex)) + return semanticIndex < o.semanticIndex; + if(!(format == o.format)) + return format < o.format; + if(!(inputSlot == o.inputSlot)) + return inputSlot < o.inputSlot; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(perInstance == o.perInstance)) + return perInstance < o.perInstance; + if(!(instanceDataStepRate == o.instanceDataStepRate)) + return instanceDataStepRate < o.instanceDataStepRate; return false; } DOCUMENT("The semantic name for this input."); - rdcstr SemanticName; + rdcstr semanticName; DOCUMENT("The semantic index for this input."); - uint32_t SemanticIndex = 0; + uint32_t semanticIndex = 0; DOCUMENT("The :class:`ResourceFormat` describing how the input data is interpreted."); - ResourceFormat Format; + ResourceFormat format; DOCUMENT("The vertex buffer input slot where the data is sourced from."); - uint32_t InputSlot = 0; + uint32_t inputSlot = 0; DOCUMENT(R"(The byte offset from the start of the vertex data in the vertex buffer from -:data:`InputSlot`. +:data:`inputSlot`. If the value is :data:`TightlyPacked` then the element is packed tightly after the previous element, or 0 if this is the first element. )"); - uint32_t ByteOffset = 0; + uint32_t byteOffset = 0; DOCUMENT("``True`` if the vertex data is instance-rate."); - bool PerInstance = false; + bool perInstance = false; - DOCUMENT(R"(If :data:`PerInstance` is ``True`` then this is how many times each instance data is + DOCUMENT(R"(If :data:`perInstance` is ``True`` then this is how many times each instance data is used before advancing to the next instance. E.g. if this value is two, then two instances will be drawn with the first instance data, then two with the next instance data. )"); - uint32_t InstanceDataStepRate = 0; + uint32_t instanceDataStepRate = 0; // D3D12_APPEND_ALIGNED_ELEMENT static const uint32_t TightlyPacked = ~0U; }; DOCUMENT("Describes a single D3D12 vertex buffer binding.") -struct VB +struct VertexBuffer { DOCUMENT(""); - bool operator==(const VB &o) const + bool operator==(const VertexBuffer &o) const { - return Buffer == o.Buffer && Stride == o.Stride && Size == o.Size && Offset == o.Offset; + return resourceId == o.resourceId && byteStride == o.byteStride && byteSize == o.byteSize && + byteOffset == o.byteOffset; } - bool operator<(const VB &o) const + bool operator<(const VertexBuffer &o) const { - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(Stride == o.Stride)) - return Stride < o.Stride; - if(!(Size == o.Size)) - return Size < o.Size; - if(!(Offset == o.Offset)) - return Offset < o.Offset; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteStride == o.byteStride)) + return byteStride < o.byteStride; + if(!(byteSize == o.byteSize)) + return byteSize < o.byteSize; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; return false; } DOCUMENT("The :class:`ResourceId` of the buffer bound to this slot."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer to the beginning of the vertex data."); - uint64_t Offset = 0; + uint64_t byteOffset = 0; DOCUMENT("The number of bytes available in this vertex buffer."); - uint32_t Size = 0; + uint32_t byteSize = 0; DOCUMENT("The byte stride between the start of one set of vertex data and the next."); - uint32_t Stride = 0; + uint32_t byteStride = 0; }; DOCUMENT("Describes the D3D12 index buffer binding.") -struct IB +struct IndexBuffer { DOCUMENT("The :class:`ResourceId` of the index buffer."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer to the beginning of the index data."); - uint64_t Offset = 0; + uint64_t byteOffset = 0; DOCUMENT("The number of bytes available in this index buffer."); - uint32_t Size = 0; + uint32_t byteSize = 0; }; DOCUMENT("Describes the input assembler state in the PSO."); -struct IA +struct InputAssembly { - DOCUMENT("A list of :class:`D3D12_Layout` describing the input layout elements in this layout."); + DOCUMENT("A list of :class:`D3D12Layout` describing the input layout elements in this layout."); rdcarray layouts; - DOCUMENT("A list of :class:`D3D12_VB` with the vertex buffers that are bound."); - rdcarray vbuffers; + DOCUMENT("A list of :class:`D3D12VertexBuffer` with the vertex buffers that are bound."); + rdcarray vertexBuffers; - DOCUMENT("The :class:`D3D12_IB` describing the index buffer."); - IB ibuffer; + DOCUMENT("The :class:`D3D12IndexBuffer` describing the index buffer."); + IndexBuffer indexBuffer; DOCUMENT(R"(The index value to use for cutting strips. Either ``0``, ``0xffff`` or ``0xffffffff``. If the value is 0, strip cutting is disabled. @@ -160,8 +162,8 @@ If the value is 0, strip cutting is disabled. uint32_t indexStripCutValue = 0; }; -// Immediate indicates either a root parameter (not in a table), or static samplers -// RootElement is the index in the original root signature that this descriptor came from. +// immediate indicates either a root parameter (not in a table), or static samplers +// rootElement is the index in the original root signature that this descriptor came from. DOCUMENT("Describes the details of a D3D12 resource view - any one of UAV, SRV, RTV or DSV."); struct View @@ -169,23 +171,23 @@ struct View DOCUMENT(""); bool operator==(const View &o) const { - return Resource == o.Resource && Type == o.Type && Format == o.Format && + return resourceId == o.resourceId && type == o.type && viewFormat == o.viewFormat && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && swizzle[2] == o.swizzle[2] && - swizzle[3] == o.swizzle[3] && BufferFlags == o.BufferFlags && - BufferStructCount == o.BufferStructCount && ElementSize == o.ElementSize && - FirstElement == o.FirstElement && NumElements == o.NumElements && - CounterResource == o.CounterResource && CounterByteOffset == o.CounterByteOffset && - HighestMip == o.HighestMip && NumMipLevels == o.NumMipLevels && - ArraySize == o.ArraySize && FirstArraySlice == o.FirstArraySlice; + swizzle[3] == o.swizzle[3] && bufferFlags == o.bufferFlags && + bufferStructCount == o.bufferStructCount && elementByteSize == o.elementByteSize && + firstElement == o.firstElement && numElements == o.numElements && + counterResourceId == o.counterResourceId && counterByteOffset == o.counterByteOffset && + firstMip == o.firstMip && numMips == o.numMips && numSlices == o.numSlices && + firstSlice == o.firstSlice; } bool operator<(const View &o) const { - if(!(Resource == o.Resource)) - return Resource < o.Resource; - if(!(Type == o.Type)) - return Type < o.Type; - if(!(Format == o.Format)) - return Format < o.Format; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(type == o.type)) + return type < o.type; + if(!(viewFormat == o.viewFormat)) + return viewFormat < o.viewFormat; if(!(swizzle[0] == o.swizzle[0])) return swizzle[0] < o.swizzle[0]; if(!(swizzle[1] == o.swizzle[1])) @@ -194,77 +196,77 @@ struct View return swizzle[2] < o.swizzle[2]; if(!(swizzle[3] == o.swizzle[3])) return swizzle[3] < o.swizzle[3]; - if(!(BufferFlags == o.BufferFlags)) - return BufferFlags < o.BufferFlags; - if(!(BufferStructCount == o.BufferStructCount)) - return BufferStructCount < o.BufferStructCount; - if(!(ElementSize == o.ElementSize)) - return ElementSize < o.ElementSize; - if(!(FirstElement == o.FirstElement)) - return FirstElement < o.FirstElement; - if(!(NumElements == o.NumElements)) - return NumElements < o.NumElements; - if(!(CounterResource == o.CounterResource)) - return CounterResource < o.CounterResource; - if(!(CounterByteOffset == o.CounterByteOffset)) - return CounterByteOffset < o.CounterByteOffset; - if(!(HighestMip == o.HighestMip)) - return HighestMip < o.HighestMip; - if(!(NumMipLevels == o.NumMipLevels)) - return NumMipLevels < o.NumMipLevels; - if(!(ArraySize == o.ArraySize)) - return ArraySize < o.ArraySize; - if(!(FirstArraySlice == o.FirstArraySlice)) - return FirstArraySlice < o.FirstArraySlice; + if(!(bufferFlags == o.bufferFlags)) + return bufferFlags < o.bufferFlags; + if(!(bufferStructCount == o.bufferStructCount)) + return bufferStructCount < o.bufferStructCount; + if(!(elementByteSize == o.elementByteSize)) + return elementByteSize < o.elementByteSize; + if(!(firstElement == o.firstElement)) + return firstElement < o.firstElement; + if(!(numElements == o.numElements)) + return numElements < o.numElements; + if(!(counterResourceId == o.counterResourceId)) + return counterResourceId < o.counterResourceId; + if(!(counterByteOffset == o.counterByteOffset)) + return counterByteOffset < o.counterByteOffset; + if(!(firstMip == o.firstMip)) + return firstMip < o.firstMip; + if(!(numMips == o.numMips)) + return numMips < o.numMips; + if(!(numSlices == o.numSlices)) + return numSlices < o.numSlices; + if(!(firstSlice == o.firstSlice)) + return firstSlice < o.firstSlice; return false; } DOCUMENT("``True`` if this view is a root parameter (i.e. not in a table)."); - bool Immediate = false; + bool immediate = false; DOCUMENT("The index in the original root signature that this descriptor came from."); - uint32_t RootElement = ~0U; + uint32_t rootElement = ~0U; DOCUMENT("The index in the the parent descriptor table where this descriptor came from."); - uint32_t TableIndex = ~0U; + uint32_t tableIndex = ~0U; DOCUMENT("The :class:`ResourceId` of the underlying resource the view refers to."); - ResourceId Resource; - DOCUMENT("The :class:`TextureDim` of the view type."); - TextureDim Type; + ResourceId resourceId; + DOCUMENT("The :class:`TextureType` of the view type."); + TextureType type; DOCUMENT("The :class:`ResourceFormat` that the view uses."); - ResourceFormat Format; + ResourceFormat viewFormat; DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture."); TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, TextureSwizzle::Alpha}; DOCUMENT("The :class:`D3DBufferViewFlags` set for the buffer."); - D3DBufferViewFlags BufferFlags = D3DBufferViewFlags::NoFlags; + D3DBufferViewFlags bufferFlags = D3DBufferViewFlags::NoFlags; DOCUMENT("If the view has a hidden counter, this stores the current value of the counter."); - uint32_t BufferStructCount = 0; - DOCUMENT(R"(The byte size of a single element in the view. Either the byte size of :data:`Format`, -or the structured buffer element size, as appropriate. + uint32_t bufferStructCount = 0; + DOCUMENT(R"(The byte size of a single element in the view. Either the byte size of +:data:`viewFormat`, or the structured buffer element size, as appropriate. )"); - uint32_t ElementSize = 0; + uint32_t elementByteSize = 0; DOCUMENT("Valid for buffers - the first element to be used in the view."); - uint64_t FirstElement = 0; + uint64_t firstElement = 0; DOCUMENT("Valid for buffers - the number of elements to be used in the view."); - uint32_t NumElements = 1; + uint32_t numElements = 1; DOCUMENT("The :class:`ResourceId` of the resource where the hidden buffer counter is stored."); - ResourceId CounterResource; - DOCUMENT("The byte offset in :data:`CounterResource` where the counter is stored."); - uint64_t CounterByteOffset = 0; + ResourceId counterResourceId; + DOCUMENT("The byte offset in :data:`counterResourceId` where the counter is stored."); + uint64_t counterByteOffset = 0; DOCUMENT("Valid for textures - the highest mip that is available through the view."); - uint32_t HighestMip = 0; + uint32_t firstMip = 0; DOCUMENT("Valid for textures - the number of mip levels in the view."); - uint32_t NumMipLevels = 1; + uint32_t numMips = 1; - DOCUMENT("Valid for texture arrays or 3D textures - the number of slices in the view."); - uint32_t ArraySize = 1; DOCUMENT("Valid for texture arrays or 3D textures - the first slice available through the view."); - uint32_t FirstArraySlice = 0; + uint32_t firstSlice = 0; + DOCUMENT("Valid for texture arrays or 3D textures - the number of slices in the view."); + uint32_t numSlices = 1; DOCUMENT("The minimum mip-level clamp applied when sampling this texture."); - float MinLODClamp = 0.0f; + float minLODClamp = 0.0f; }; DOCUMENT("Describes the details of a sampler descriptor."); @@ -273,76 +275,77 @@ struct Sampler DOCUMENT(""); bool operator==(const Sampler &o) const { - return Immediate == o.Immediate && RootElement == o.RootElement && TableIndex == o.TableIndex && - AddressU == o.AddressU && AddressV == o.AddressV && AddressW == o.AddressW && - BorderColor[0] == o.BorderColor[0] && BorderColor[1] == o.BorderColor[1] && - BorderColor[2] == o.BorderColor[2] && BorderColor[3] == o.BorderColor[3] && - Comparison == o.Comparison && Filter == o.Filter && MaxAniso == o.MaxAniso && - MaxLOD == o.MaxLOD && MinLOD == o.MinLOD && MipLODBias == o.MipLODBias; + return immediate == o.immediate && rootElement == o.rootElement && tableIndex == o.tableIndex && + addressU == o.addressU && addressV == o.addressV && addressW == o.addressW && + borderColor[0] == o.borderColor[0] && borderColor[1] == o.borderColor[1] && + borderColor[2] == o.borderColor[2] && borderColor[3] == o.borderColor[3] && + compareFunction == o.compareFunction && filter == o.filter && + maxAnisotropy == o.maxAnisotropy && maxLOD == o.maxLOD && minLOD == o.minLOD && + mipLODBias == o.mipLODBias; } bool operator<(const Sampler &o) const { - if(!(Immediate == o.Immediate)) - return Immediate < o.Immediate; - if(!(RootElement == o.RootElement)) - return RootElement < o.RootElement; - if(!(TableIndex == o.TableIndex)) - return TableIndex < o.TableIndex; - if(!(AddressU == o.AddressU)) - return AddressU < o.AddressU; - if(!(AddressV == o.AddressV)) - return AddressV < o.AddressV; - if(!(AddressW == o.AddressW)) - return AddressW < o.AddressW; - if(!(BorderColor[0] == o.BorderColor[0])) - return BorderColor[0] < o.BorderColor[0]; - if(!(BorderColor[1] == o.BorderColor[1])) - return BorderColor[1] < o.BorderColor[1]; - if(!(BorderColor[2] == o.BorderColor[2])) - return BorderColor[2] < o.BorderColor[2]; - if(!(BorderColor[3] == o.BorderColor[3])) - return BorderColor[3] < o.BorderColor[3]; - if(!(Comparison == o.Comparison)) - return Comparison < o.Comparison; - if(!(Filter == o.Filter)) - return Filter < o.Filter; - if(!(MaxAniso == o.MaxAniso)) - return MaxAniso < o.MaxAniso; - if(!(MaxLOD == o.MaxLOD)) - return MaxLOD < o.MaxLOD; - if(!(MinLOD == o.MinLOD)) - return MinLOD < o.MinLOD; - if(!(MipLODBias == o.MipLODBias)) - return MipLODBias < o.MipLODBias; + if(!(immediate == o.immediate)) + return immediate < o.immediate; + if(!(rootElement == o.rootElement)) + return rootElement < o.rootElement; + if(!(tableIndex == o.tableIndex)) + return tableIndex < o.tableIndex; + if(!(addressU == o.addressU)) + return addressU < o.addressU; + if(!(addressV == o.addressV)) + return addressV < o.addressV; + if(!(addressW == o.addressW)) + return addressW < o.addressW; + if(!(borderColor[0] == o.borderColor[0])) + return borderColor[0] < o.borderColor[0]; + if(!(borderColor[1] == o.borderColor[1])) + return borderColor[1] < o.borderColor[1]; + if(!(borderColor[2] == o.borderColor[2])) + return borderColor[2] < o.borderColor[2]; + if(!(borderColor[3] == o.borderColor[3])) + return borderColor[3] < o.borderColor[3]; + if(!(compareFunction == o.compareFunction)) + return compareFunction < o.compareFunction; + if(!(filter == o.filter)) + return filter < o.filter; + if(!(maxAnisotropy == o.maxAnisotropy)) + return maxAnisotropy < o.maxAnisotropy; + if(!(maxLOD == o.maxLOD)) + return maxLOD < o.maxLOD; + if(!(minLOD == o.minLOD)) + return minLOD < o.minLOD; + if(!(mipLODBias == o.mipLODBias)) + return mipLODBias < o.mipLODBias; return false; } DOCUMENT("``True`` if this view is a static sampler (i.e. not in a table)."); - bool Immediate = 0; + bool immediate = 0; DOCUMENT("The index in the original root signature that this descriptor came from."); - uint32_t RootElement = ~0U; + uint32_t rootElement = ~0U; DOCUMENT("The index in the the parent descriptor table where this descriptor came from."); - uint32_t TableIndex = ~0U; + uint32_t tableIndex = ~0U; DOCUMENT("The :class:`AddressMode` in the U direction."); - AddressMode AddressU = AddressMode::Wrap; + AddressMode addressU = AddressMode::Wrap; DOCUMENT("The :class:`AddressMode` in the V direction."); - AddressMode AddressV = AddressMode::Wrap; + AddressMode addressV = AddressMode::Wrap; DOCUMENT("The :class:`AddressMode` in the W direction."); - AddressMode AddressW = AddressMode::Wrap; + AddressMode addressW = AddressMode::Wrap; DOCUMENT("The RGBA border color."); - float BorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - DOCUMENT("The :class:`CompareFunc` for comparison samplers."); - CompareFunc Comparison = CompareFunc::AlwaysTrue; + float borderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + DOCUMENT("The :class:`CompareFunction` for comparison samplers."); + CompareFunction compareFunction = CompareFunction::AlwaysTrue; DOCUMENT("The :class:`TextureFilter` describing the filtering mode."); - TextureFilter Filter; + TextureFilter filter; DOCUMENT("The maximum anisotropic filtering level to use."); - uint32_t MaxAniso = 0; + uint32_t maxAnisotropy = 0; DOCUMENT("The maximum mip level that can be used."); - float MaxLOD = 0.0f; + float maxLOD = 0.0f; DOCUMENT("The minimum mip level that can be used."); - float MinLOD = 0.0f; + float minLOD = 0.0f; DOCUMENT("A bias to apply to the calculated mip level before sampling."); - float MipLODBias = 0.0f; + float mipLODBias = 0.0f; DOCUMENT(R"(Check if the border color is used in this D3D12 sampler. @@ -351,57 +354,57 @@ struct Sampler )"); bool UseBorder() const { - return AddressU == AddressMode::ClampBorder || AddressV == AddressMode::ClampBorder || - AddressW == AddressMode::ClampBorder; + return addressU == AddressMode::ClampBorder || addressV == AddressMode::ClampBorder || + addressW == AddressMode::ClampBorder; } }; DOCUMENT("Describes the details of a constant buffer view descriptor."); -struct CBuffer +struct ConstantBuffer { DOCUMENT(""); - bool operator==(const CBuffer &o) const + bool operator==(const ConstantBuffer &o) const { - return Immediate == o.Immediate && RootElement == o.RootElement && TableIndex == o.TableIndex && - Buffer == o.Buffer && Offset == o.Offset && ByteSize == o.ByteSize && - RootValues == o.RootValues; + return immediate == o.immediate && rootElement == o.rootElement && tableIndex == o.tableIndex && + resourceId == o.resourceId && byteOffset == o.byteOffset && byteSize == o.byteSize && + rootValues == o.rootValues; } - bool operator<(const CBuffer &o) const + bool operator<(const ConstantBuffer &o) const { - if(!(Immediate == o.Immediate)) - return Immediate < o.Immediate; - if(!(RootElement == o.RootElement)) - return RootElement < o.RootElement; - if(!(TableIndex == o.TableIndex)) - return TableIndex < o.TableIndex; - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(Offset == o.Offset)) - return Offset < o.Offset; - if(!(ByteSize == o.ByteSize)) - return ByteSize < o.ByteSize; - if(!(RootValues == o.RootValues)) - return RootValues < o.RootValues; + if(!(immediate == o.immediate)) + return immediate < o.immediate; + if(!(rootElement == o.rootElement)) + return rootElement < o.rootElement; + if(!(tableIndex == o.tableIndex)) + return tableIndex < o.tableIndex; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(byteSize == o.byteSize)) + return byteSize < o.byteSize; + if(!(rootValues == o.rootValues)) + return rootValues < o.rootValues; return false; } DOCUMENT("``True`` if this view is a root constant (i.e. not in a table)."); - bool Immediate = false; + bool immediate = false; DOCUMENT("The index in the original root signature that this descriptor came from."); - uint32_t RootElement = ~0U; + uint32_t rootElement = ~0U; DOCUMENT("The index in the the parent descriptor table where this descriptor came from."); - uint32_t TableIndex = ~0U; + uint32_t tableIndex = ~0U; DOCUMENT("The :class:`ResourceId` of the underlying buffer resource."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The byte offset where the buffer view starts in the underlying buffer."); - uint64_t Offset = 0; + uint64_t byteOffset = 0; DOCUMENT("How many bytes are in this constant buffer view."); - uint32_t ByteSize = 0; + uint32_t byteSize = 0; - DOCUMENT(R"(If :data:`Immediate` is ``True`` and this is a root constant, this contains a list of + DOCUMENT(R"(If :data:`immediate` is ``True`` and this is a root constant, this contains a list of ``int`` values with the root values set. )"); - rdcarray RootValues; + rdcarray rootValues; }; DOCUMENT("Contains all of the registers in a single register space mapped to by a root signature."); @@ -410,171 +413,97 @@ struct RegisterSpace DOCUMENT(""); bool operator==(const RegisterSpace &o) const { - return ConstantBuffers == o.ConstantBuffers && Samplers == o.Samplers && SRVs == o.SRVs && - UAVs == o.UAVs; + return constantBuffers == o.constantBuffers && samplers == o.samplers && srvs == o.srvs && + uavs == o.uavs; } bool operator<(const RegisterSpace &o) const { - if(!(ConstantBuffers == o.ConstantBuffers)) - return ConstantBuffers < o.ConstantBuffers; - if(!(Samplers == o.Samplers)) - return Samplers < o.Samplers; - if(!(SRVs == o.SRVs)) - return SRVs < o.SRVs; - if(!(UAVs == o.UAVs)) - return UAVs < o.UAVs; + if(!(constantBuffers == o.constantBuffers)) + return constantBuffers < o.constantBuffers; + if(!(samplers == o.samplers)) + return samplers < o.samplers; + if(!(srvs == o.srvs)) + return srvs < o.srvs; + if(!(uavs == o.uavs)) + return uavs < o.uavs; return false; } - DOCUMENT("List of :class:`D3D12_CBuffer` containing the constant buffers."); - rdcarray ConstantBuffers; - DOCUMENT("List of :class:`D3D12_Sampler` containing the samplers."); - rdcarray Samplers; - DOCUMENT("List of :class:`D3D12_View` containing the SRVs."); - rdcarray SRVs; - DOCUMENT("List of :class:`D3D12_View` containing the UAVs."); - rdcarray UAVs; + DOCUMENT("List of :class:`D3D12ConstantBuffer` containing the constant buffers."); + rdcarray constantBuffers; + DOCUMENT("List of :class:`D3D12Sampler` containing the samplers."); + rdcarray samplers; + DOCUMENT("List of :class:`D3D12View` containing the SRVs."); + rdcarray srvs; + DOCUMENT("List of :class:`D3D12View` containing the UAVs."); + rdcarray uavs; }; DOCUMENT("Describes a D3D12 shader stage."); struct Shader { DOCUMENT("The :class:`ResourceId` of the shader object itself."); - ResourceId Object; + ResourceId resourceId; DOCUMENT("A :class:`ShaderReflection` describing the reflection data for this shader."); - ShaderReflection *ShaderDetails = NULL; - DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`ShaderDetails` with the bindpoint + ShaderReflection *reflection = NULL; + DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`reflection` with the bindpoint mapping data. )"); - ShaderBindpointMapping BindpointMapping; + ShaderBindpointMapping bindpointMapping; DOCUMENT("A :class:`ShaderStage` identifying which stage this shader is bound to."); ShaderStage stage = ShaderStage::Vertex; - DOCUMENT("A list of :class:`D3D12_RegisterSpace` with the register spaces for this stage."); - rdcarray Spaces; + DOCUMENT("A list of :class:`D3D12RegisterSpace` with the register spaces for this stage."); + rdcarray spaces; }; DOCUMENT("Describes a binding on the D3D12 stream-out stage."); -struct SOBind +struct StreamOutBind { DOCUMENT(""); - bool operator==(const SOBind &o) const + bool operator==(const StreamOutBind &o) const { - return Buffer == o.Buffer && Offset == o.Offset && Size == o.Size && - WrittenCountBuffer == o.WrittenCountBuffer && WrittenCountOffset == o.WrittenCountOffset; + return resourceId == o.resourceId && byteOffset == o.byteOffset && byteSize == o.byteSize && + writtenCountResourceId == o.writtenCountResourceId && + writtenCountByteOffset == o.writtenCountByteOffset; } - bool operator<(const SOBind &o) const + bool operator<(const StreamOutBind &o) const { - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(Offset == o.Offset)) - return Offset < o.Offset; - if(!(Size == o.Size)) - return Size < o.Size; - if(!(WrittenCountBuffer == o.WrittenCountBuffer)) - return WrittenCountBuffer < o.WrittenCountBuffer; - if(!(WrittenCountOffset == o.WrittenCountOffset)) - return WrittenCountOffset < o.WrittenCountOffset; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(byteSize == o.byteSize)) + return byteSize < o.byteSize; + if(!(writtenCountResourceId == o.writtenCountResourceId)) + return writtenCountResourceId < o.writtenCountResourceId; + if(!(writtenCountByteOffset == o.writtenCountByteOffset)) + return writtenCountByteOffset < o.writtenCountByteOffset; return false; } DOCUMENT("The :class:`ResourceId` of the buffer."); - ResourceId Buffer; - DOCUMENT( - "The byte offset in :data:`Buffer` where the buffer view starts in the underlying buffer."); - uint64_t Offset = 0; + ResourceId resourceId; + DOCUMENT(R"(The byte offset in :data:`resourceId` where the buffer view starts in the underlying +buffer. +)"); + uint64_t byteOffset = 0; DOCUMENT("How many bytes are in this stream-out buffer view."); - uint64_t Size = 0; + uint64_t byteSize = 0; DOCUMENT("The :class:`ResourceId` of the buffer where the written count will be stored."); - ResourceId WrittenCountBuffer; - DOCUMENT( - "The byte offset in :data:`WrittenCountBuffer` where the stream-out count will be written."); - uint64_t WrittenCountOffset = 0; + ResourceId writtenCountResourceId; + DOCUMENT(R"(The byte offset in :data:`writtenCountResourceId` where the stream-out count will be +written. +)"); + uint64_t writtenCountByteOffset = 0; }; DOCUMENT("Describes the stream-out state in the PSO."); -struct Streamout +struct StreamOut { - DOCUMENT("A list of ``D3D12_SOBind`` with the bound buffers."); - rdcarray Outputs; -}; - -DOCUMENT("Describes a single D3D12 viewport."); -struct Viewport -{ - DOCUMENT(""); - bool operator==(const Viewport &o) const - { - return X == o.X && Y == o.Y && Width == o.Width && Height == o.Height && - MinDepth == o.MinDepth && MaxDepth == o.MaxDepth; - } - bool operator<(const Viewport &o) const - { - if(!(X == o.X)) - return X < o.X; - if(!(Y == o.Y)) - return Y < o.Y; - if(!(Width == o.Width)) - return Width < o.Width; - if(!(Height == o.Height)) - return Height < o.Height; - if(!(MinDepth == o.MinDepth)) - return MinDepth < o.MinDepth; - if(!(MaxDepth == o.MaxDepth)) - return MaxDepth < o.MaxDepth; - return false; - } - Viewport() = default; - Viewport(float TX, float TY, float W, float H, float MN, float MX) - : X(TX), Y(TY), Width(W), Height(H), MinDepth(MN), MaxDepth(MX) - { - } - - DOCUMENT("Top-left X co-ordinate of the viewport."); - float X = 0.0f; - DOCUMENT("Top-left Y co-ordinate of the viewport."); - float Y = 0.0f; - DOCUMENT("The width of the viewport."); - float Width = 0.0f; - DOCUMENT("The height of the viewport."); - float Height = 0.0f; - DOCUMENT("The minimum depth of the viewport."); - float MinDepth = 0.0f; - DOCUMENT("The maximum depth of the viewport."); - float MaxDepth = 0.0f; -}; - -DOCUMENT("Describes a single D3D12 scissor rect."); -struct Scissor -{ - DOCUMENT(""); - bool operator==(const Scissor &o) const - { - return left == o.left && top == o.top && right == o.right && bottom == o.bottom; - } - bool operator<(const Scissor &o) const - { - if(!(left == o.left)) - return left < o.left; - if(!(top == o.top)) - return top < o.top; - if(!(right == o.right)) - return right < o.right; - if(!(bottom == o.bottom)) - return bottom < o.bottom; - return false; - } - Scissor() = default; - Scissor(int l, int t, int r, int b) : left(l), top(t), right(r), bottom(b) {} - DOCUMENT("Top-left X co-ordinate of the viewport."); - int32_t left = 0; - DOCUMENT("Top-left Y co-ordinate of the viewport."); - int32_t top = 0; - DOCUMENT("Bottom-right X co-ordinate of the viewport."); - int32_t right = 0; - DOCUMENT("Bottom-right Y co-ordinate of the viewport."); - int32_t bottom = 0; + DOCUMENT("A list of ``D3D12SOBind`` with the bound buffers."); + rdcarray outputs; }; DOCUMENT("Describes the rasterizer state in the PSO."); @@ -587,188 +516,100 @@ struct RasterizerState DOCUMENT(R"(``True`` if counter-clockwise polygons are front-facing. ``False`` if clockwise polygons are front-facing. )"); - bool FrontCCW = false; + bool frontCCW = false; DOCUMENT("The fixed depth bias value to apply to z-values."); - int32_t DepthBias = 0; - DOCUMENT(R"(The clamp value for calculated depth bias from :data:`DepthBias` and -:data:`SlopeScaledDepthBias` + int32_t depthBias = 0; + DOCUMENT(R"(The clamp value for calculated depth bias from :data:`depthBias` and +:data:`slopeScaledDepthBias` )"); - float DepthBiasClamp = 0.0f; + float depthBiasClamp = 0.0f; DOCUMENT("The slope-scaled depth bias value to apply to z-values."); - float SlopeScaledDepthBias = 0.0f; + float slopeScaledDepthBias = 0.0f; DOCUMENT("``True`` if pixels outside of the near and far depth planes should be clipped."); - bool DepthClip = false; + bool depthClip = false; DOCUMENT("``True`` if the quadrilateral MSAA algorithm should be used on MSAA targets."); - bool MultisampleEnable = false; + bool multisampleEnable = false; DOCUMENT( - "``True`` if lines should be anti-aliased. Ignored if :data:`MultisampleEnable` is " + "``True`` if lines should be anti-aliased. Ignored if :data:`multisampleEnable` is " "``False``."); - bool AntialiasedLineEnable = false; + bool antialiasedLines = false; DOCUMENT(R"(A sample count to force rasterization to when UAV rendering or rasterizing, or 0 to not force any sample count. )"); - uint32_t ForcedSampleCount = 0; + uint32_t forcedSampleCount = 0; DOCUMENT("``True`` if a conservative rasterization algorithm should be used."); - bool ConservativeRasterization = false; + bool conservativeRasterization = false; }; DOCUMENT("Describes the rasterization state of the D3D12 pipeline."); struct Rasterizer { DOCUMENT("The mask determining which samples are written to."); - uint32_t SampleMask = ~0U; + uint32_t sampleMask = ~0U; - DOCUMENT("A list of :class:`D3D12_Viewport` with the bound viewports."); - rdcarray Viewports; + DOCUMENT("A list of :class:`Viewport` with the bound viewports."); + rdcarray viewports; - DOCUMENT("A list of :class:`D3D12_Scissor` with the bound scissor regions."); - rdcarray Scissors; + DOCUMENT("A list of :class:`Scissor` with the bound scissor regions."); + rdcarray scissors; - DOCUMENT("A :class:`D3D12_RasterizerState` with the details of the rasterization state."); - RasterizerState m_State; -}; - -DOCUMENT("Describes the details of a D3D12 stencil operation."); -struct StencilFace -{ - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test fails."); - StencilOp FailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the depth-test fails."); - StencilOp DepthFailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test passes."); - StencilOp PassOp = StencilOp::Keep; - DOCUMENT("The :class:`CompareFunc` to use for testing stencil values."); - CompareFunc Func = CompareFunc::AlwaysTrue; + DOCUMENT("A :class:`D3D12RasterizerState` with the details of the rasterization state."); + RasterizerState state; }; DOCUMENT("Describes the state of the depth-stencil state in the PSO."); struct DepthStencilState { DOCUMENT("``True`` if depth testing should be performed."); - bool DepthEnable = false; + bool depthEnable = false; DOCUMENT("``True`` if depth values should be written to the depth target."); - bool DepthWrites = false; - DOCUMENT("The :class:`CompareFunc` to use for testing depth values."); - CompareFunc DepthFunc = CompareFunc::AlwaysTrue; + bool depthWrites = false; + DOCUMENT("The :class:`CompareFunction` to use for testing depth values."); + CompareFunction depthFunction = CompareFunction::AlwaysTrue; DOCUMENT("``True`` if stencil operations should be performed."); - bool StencilEnable = false; - DOCUMENT("The mask for reading stencil values."); - byte StencilReadMask = 0; - DOCUMENT("The mask for writing stencil values."); - byte StencilWriteMask = 0; + bool stencilEnable = false; - DOCUMENT("A :class:`D3D12_StencilFace` describing what happens for front-facing polygons."); - StencilFace m_FrontFace; - DOCUMENT("A :class:`D3D12_StencilFace` describing what happens for back-facing polygons."); - StencilFace m_BackFace; - - DOCUMENT("The current stencil reference value."); - uint32_t StencilRef = 0; -}; - -DOCUMENT("Describes the details of a D3D12 blend operation."); -struct BlendEquation -{ - DOCUMENT(""); - bool operator==(const BlendEquation &o) const - { - return Source == o.Source && Destination == o.Destination && Operation == o.Operation; - } - bool operator<(const BlendEquation &o) const - { - if(!(Source == o.Source)) - return Source < o.Source; - if(!(Destination == o.Destination)) - return Destination < o.Destination; - if(!(Operation == o.Operation)) - return Operation < o.Operation; - return false; - } - DOCUMENT("The :class:`BlendMultiplier` for the source blend value."); - BlendMultiplier Source = BlendMultiplier::One; - DOCUMENT("The :class:`BlendMultiplier` for the destination blend value."); - BlendMultiplier Destination = BlendMultiplier::One; - DOCUMENT("The :class:`BlendOp` to use in the blend calculation."); - BlendOp Operation = BlendOp::Add; -}; - -DOCUMENT("Describes the blend configuration for a given D3D12 target."); -struct Blend -{ - DOCUMENT(""); - bool operator==(const Blend &o) const - { - return Enabled == o.Enabled && LogicEnabled == o.LogicEnabled && m_Blend == o.m_Blend && - m_AlphaBlend == o.m_AlphaBlend && Logic == o.Logic && WriteMask == o.WriteMask; - } - bool operator<(const Blend &o) const - { - if(!(Enabled == o.Enabled)) - return Enabled < o.Enabled; - if(!(LogicEnabled == o.LogicEnabled)) - return LogicEnabled < o.LogicEnabled; - if(!(m_Blend == o.m_Blend)) - return m_Blend < o.m_Blend; - if(!(m_AlphaBlend == o.m_AlphaBlend)) - return m_AlphaBlend < o.m_AlphaBlend; - if(!(Logic == o.Logic)) - return Logic < o.Logic; - if(!(WriteMask == o.WriteMask)) - return WriteMask < o.WriteMask; - return false; - } - DOCUMENT("A :class:`D3D12_BlendEquation` describing the blending for colour values."); - BlendEquation m_Blend; - DOCUMENT("A :class:`D3D12_BlendEquation` describing the blending for alpha values."); - BlendEquation m_AlphaBlend; - - DOCUMENT( - "The :class:`LogicOp` to use for logic operations, if :data:`LogicEnabled` is ``True``."); - LogicOp Logic = LogicOp::NoOp; - - DOCUMENT("``True`` if blending is enabled for this target."); - bool Enabled = false; - DOCUMENT("``True`` if the logic operation in :data:`Logic` should be used."); - bool LogicEnabled = false; - DOCUMENT("The mask for writes to the render target."); - byte WriteMask = 0; + DOCUMENT("A :class:`StencilFace` describing what happens for front-facing polygons."); + StencilFace frontFace; + DOCUMENT("A :class:`StencilFace` describing what happens for back-facing polygons."); + StencilFace backFace; }; DOCUMENT("Describes the blend state in the PSO."); struct BlendState { DOCUMENT("``True`` if alpha-to-coverage should be used when blending to an MSAA target."); - bool AlphaToCoverage = false; + bool alphaToCoverage = false; DOCUMENT(R"(``True`` if independent blending for each target should be used. ``False`` if the first blend should be applied to all targets. )"); - bool IndependentBlend = false; + bool independentBlend = false; - DOCUMENT("A list of :class:`D3D12_Blend` describing the blend operations for each target."); - rdcarray Blends; + DOCUMENT("A list of :class:`ColorBlend` describing the blend operations for each target."); + rdcarray blends; DOCUMENT("The constant blend factor to use in blend equations."); - float BlendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + float blendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; }; DOCUMENT("Describes the current state of the output-merger stage of the D3D12 pipeline."); struct OM { - DOCUMENT("A :class:`D3D12_DepthStencilState` with the details of the depth-stencil state."); - DepthStencilState m_State; - DOCUMENT("A :class:`D3D12_BlendState` with the details of the blend state."); - BlendState m_BlendState; + DOCUMENT("A :class:`D3D12DepthStencilState` with the details of the depth-stencil state."); + DepthStencilState depthStencilState; + DOCUMENT("A :class:`D3D12BlendState` with the details of the blend state."); + BlendState blendState; - DOCUMENT("A list of :class:`D3D12_View` describing the bound render targets."); - rdcarray RenderTargets; + DOCUMENT("A list of :class:`D3D12View` describing the bound render targets."); + rdcarray renderTargets; - DOCUMENT("A :class:`D3D12_View` with details of the bound depth-stencil target."); - View DepthTarget; + DOCUMENT("A :class:`D3D12View` with details of the bound depth-stencil target."); + View depthTarget; DOCUMENT("``True`` if depth access to the depth-stencil target is read-only."); - bool DepthReadOnly = false; + bool depthReadOnly = false; DOCUMENT("``True`` if stenncil access to the depth-stencil target is read-only."); - bool StencilReadOnly = false; + bool stencilReadOnly = false; DOCUMENT("The sample count used for rendering."); uint32_t multiSampleCount = 1; @@ -795,19 +636,22 @@ DOCUMENT("Contains the current state of a given resource."); struct ResourceData { DOCUMENT(""); - bool operator==(const ResourceData &o) const { return id == o.id && states == o.states; } + bool operator==(const ResourceData &o) const + { + return resourceId == o.resourceId && states == o.states; + } bool operator<(const ResourceData &o) const { - if(!(id == o.id)) - return id < o.id; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; if(!(states == o.states)) return states < o.states; return false; } DOCUMENT("The :class:`ResourceId` of the resource."); - ResourceId id; + ResourceId resourceId; - DOCUMENT("A list of :class:`D3D12_ResourceState` entries, one for each subresource."); + DOCUMENT("A list of :class:`D3D12ResourceState` entries, one for each subresource."); rdcarray states; }; @@ -815,61 +659,56 @@ DOCUMENT("The full current D3D12 pipeline state."); struct State { DOCUMENT("The :class:`ResourceId` of the pipeline state object."); - ResourceId pipeline; + ResourceId pipelineResourceId; DOCUMENT("The :class:`ResourceId` of the root signature object."); - ResourceId rootSig; + ResourceId rootSignatureResourceId; - DOCUMENT("A :class:`D3D12_IA` describing the input assembly pipeline stage."); - IA m_IA; + DOCUMENT("A :class:`D3D12InputAssembly` describing the input assembly pipeline stage."); + InputAssembly inputAssembly; - DOCUMENT("A :class:`D3D12_Shader` describing the vertex shader stage."); - Shader m_VS; - DOCUMENT("A :class:`D3D12_Shader` describing the hull shader stage."); - Shader m_HS; - DOCUMENT("A :class:`D3D12_Shader` describing the domain shader stage."); - Shader m_DS; - DOCUMENT("A :class:`D3D12_Shader` describing the geometry shader stage."); - Shader m_GS; - DOCUMENT("A :class:`D3D12_Shader` describing the pixel shader stage."); - Shader m_PS; - DOCUMENT("A :class:`D3D12_Shader` describing the compute shader stage."); - Shader m_CS; + DOCUMENT("A :class:`D3D12Shader` describing the vertex shader stage."); + Shader vertexShader; + DOCUMENT("A :class:`D3D12Shader` describing the hull shader stage."); + Shader hullShader; + DOCUMENT("A :class:`D3D12Shader` describing the domain shader stage."); + Shader domainShader; + DOCUMENT("A :class:`D3D12Shader` describing the geometry shader stage."); + Shader geometryShader; + DOCUMENT("A :class:`D3D12Shader` describing the pixel shader stage."); + Shader pixelShader; + DOCUMENT("A :class:`D3D12Shader` describing the compute shader stage."); + Shader computeShader; - DOCUMENT("A :class:`D3D12_SO` describing the stream-out pipeline stage."); - Streamout m_SO; + DOCUMENT("A :class:`D3D12StreamOut` describing the stream-out pipeline stage."); + StreamOut streamOut; - DOCUMENT("A :class:`D3D12_Rasterizer` describing the rasterizer pipeline stage."); - Rasterizer m_RS; + DOCUMENT("A :class:`D3D12Rasterizer` describing the rasterizer pipeline stage."); + Rasterizer rasterizer; - DOCUMENT("A :class:`D3D12_OM` describing the output merger pipeline stage."); - OM m_OM; + DOCUMENT("A :class:`D3D12OM` describing the output merger pipeline stage."); + OM outputMerger; - DOCUMENT("A list of :class:`D3D12_ResourceData` entries, one for each resource."); - rdcarray Resources; + DOCUMENT("A list of :class:`D3D12ResourceData` entries, one for each resource."); + rdcarray resourceStates; }; }; // namespace D3D12Pipe DECLARE_REFLECTION_STRUCT(D3D12Pipe::Layout); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::VB); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::IB); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::IA); +DECLARE_REFLECTION_STRUCT(D3D12Pipe::VertexBuffer); +DECLARE_REFLECTION_STRUCT(D3D12Pipe::IndexBuffer); +DECLARE_REFLECTION_STRUCT(D3D12Pipe::InputAssembly); DECLARE_REFLECTION_STRUCT(D3D12Pipe::View); DECLARE_REFLECTION_STRUCT(D3D12Pipe::Sampler); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::CBuffer); +DECLARE_REFLECTION_STRUCT(D3D12Pipe::ConstantBuffer); DECLARE_REFLECTION_STRUCT(D3D12Pipe::RegisterSpace); DECLARE_REFLECTION_STRUCT(D3D12Pipe::Shader); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::SOBind); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::Streamout); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::Viewport); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::Scissor); +DECLARE_REFLECTION_STRUCT(D3D12Pipe::StreamOutBind); +DECLARE_REFLECTION_STRUCT(D3D12Pipe::StreamOut); DECLARE_REFLECTION_STRUCT(D3D12Pipe::RasterizerState); DECLARE_REFLECTION_STRUCT(D3D12Pipe::Rasterizer); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::StencilFace); DECLARE_REFLECTION_STRUCT(D3D12Pipe::DepthStencilState); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::BlendEquation); -DECLARE_REFLECTION_STRUCT(D3D12Pipe::Blend); DECLARE_REFLECTION_STRUCT(D3D12Pipe::BlendState); DECLARE_REFLECTION_STRUCT(D3D12Pipe::OM); DECLARE_REFLECTION_STRUCT(D3D12Pipe::ResourceState); diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index b234c898a..561984dae 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -169,7 +169,7 @@ struct ResourceFormat )"); bool Special() const { return type != ResourceFormatType::Regular; } DOCUMENT(R"(The :class:`ResourceFormatType` of this format. If the value is not -:data:`ResourceFormatType.Regular` then it's a non-uniform layout like block-compressed. +:attr:`ResourceFormatType.Regular` then it's a non-uniform layout like block-compressed. )"); ResourceFormatType type; @@ -194,7 +194,7 @@ struct TextureFilter DOCUMENT(""); bool operator==(const TextureFilter &o) const { - return minify == o.minify && magnify == o.magnify && mip == o.mip && func == o.func; + return minify == o.minify && magnify == o.magnify && mip == o.mip && filter == o.filter; } bool operator<(const TextureFilter &o) const { @@ -204,8 +204,8 @@ struct TextureFilter return magnify < o.magnify; if(!(mip == o.mip)) return mip < o.mip; - if(!(func == o.func)) - return func < o.func; + if(!(filter == o.filter)) + return filter < o.filter; return false; } DOCUMENT("The :class:`FilterMode` to use when minifying the texture."); @@ -214,8 +214,8 @@ struct TextureFilter FilterMode magnify = FilterMode::NoFilter; DOCUMENT("The :class:`FilterMode` to use when interpolating between mips."); FilterMode mip = FilterMode::NoFilter; - DOCUMENT("The :class:`FilterFunc` to apply after interpolating values."); - FilterFunc func = FilterFunc::Normal; + DOCUMENT("The :class:`FilterFunction` to apply after interpolating values."); + FilterFunction filter = FilterFunction::Normal; }; DECLARE_REFLECTION_STRUCT(TextureFilter); @@ -224,10 +224,10 @@ DOCUMENT("A description of any type of resource."); struct ResourceDescription { DOCUMENT(""); - bool operator==(const ResourceDescription &o) const { return ID == o.ID; } - bool operator<(const ResourceDescription &o) const { return ID < o.ID; } + bool operator==(const ResourceDescription &o) const { return resourceId == o.resourceId; } + bool operator<(const ResourceDescription &o) const { return resourceId < o.resourceId; } DOCUMENT("The unique :class:`ResourceId` that identifies this resource."); - ResourceId ID; + ResourceId resourceId; DOCUMENT("The :class:`ResourceType` of the resource."); ResourceType type = ResourceType::Unknown; @@ -280,12 +280,12 @@ struct BufferDescription DOCUMENT(""); bool operator==(const BufferDescription &o) const { - return ID == o.ID && creationFlags == o.creationFlags && length == o.length; + return resourceId == o.resourceId && creationFlags == o.creationFlags && length == o.length; } bool operator<(const BufferDescription &o) const { - if(!(ID == o.ID)) - return ID < o.ID; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; if(!(creationFlags == o.creationFlags)) return creationFlags < o.creationFlags; if(!(length == o.length)) @@ -293,7 +293,7 @@ struct BufferDescription return false; } DOCUMENT("The unique :class:`ResourceId` that identifies this buffer."); - ResourceId ID; + ResourceId resourceId; DOCUMENT("The way this buffer will be used in the pipeline."); BufferCategory creationFlags; @@ -310,8 +310,8 @@ struct TextureDescription DOCUMENT(""); bool operator==(const TextureDescription &o) const { - return format == o.format && dimension == o.dimension && resType == o.resType && - width == o.width && height == o.height && depth == o.depth && ID == o.ID && + return format == o.format && dimension == o.dimension && type == o.type && width == o.width && + height == o.height && depth == o.depth && resourceId == o.resourceId && cubemap == o.cubemap && mips == o.mips && arraysize == o.arraysize && creationFlags == o.creationFlags && msQual == o.msQual && msSamp == o.msSamp && byteSize == o.byteSize; @@ -322,16 +322,16 @@ struct TextureDescription return format < o.format; if(!(dimension == o.dimension)) return dimension < o.dimension; - if(!(resType == o.resType)) - return resType < o.resType; + if(!(type == o.type)) + return type < o.type; if(!(width == o.width)) return width < o.width; if(!(height == o.height)) return height < o.height; if(!(depth == o.depth)) return depth < o.depth; - if(!(ID == o.ID)) - return ID < o.ID; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; if(!(cubemap == o.cubemap)) return cubemap < o.cubemap; if(!(mips == o.mips)) @@ -354,8 +354,8 @@ struct TextureDescription DOCUMENT("The base dimension of the texture - either 1, 2, or 3."); uint32_t dimension; - DOCUMENT("The :class:`TextureDim` of the texture."); - TextureDim resType; + DOCUMENT("The :class:`TextureType` of the texture."); + TextureType type; DOCUMENT("The width of the texture, or length for buffer textures."); uint32_t width; @@ -366,8 +366,8 @@ struct TextureDescription DOCUMENT("The depth of the texture, or 1 if not applicable."); uint32_t depth; - DOCUMENT("The unique :class:`ResourceId` that identifies this buffer."); - ResourceId ID; + DOCUMENT("The unique :class:`ResourceId` that identifies this texture."); + ResourceId resourceId; DOCUMENT("``True`` if this texture is used as a cubemap or cubemap array."); bool cubemap; @@ -397,23 +397,23 @@ DOCUMENT("An individual API-level event, generally corresponds one-to-one with a struct APIEvent { DOCUMENT(""); - bool operator==(const APIEvent &o) const { return eventID == o.eventID; } - bool operator<(const APIEvent &o) const { return eventID < o.eventID; } - DOCUMENT(R"(The API event's Event ID (EID). + bool operator==(const APIEvent &o) const { return eventId == o.eventId; } + bool operator<(const APIEvent &o) const { return eventId < o.eventId; } + DOCUMENT(R"(The API event's Event ID. -This is a 1-based count of API events in the capture. The EID is used as a reference point in +This is a 1-based count of API events in the capture. The eventId is used as a reference point in many places in the API to represent where in the capture the 'current state' is, and to perform analysis in reference to the state at a particular point in the frame. -EIDs are always increasing and positive, but they may not be contiguous - in some circumstances +eventIds are always increasing and positive, but they may not be contiguous - in some circumstances there may be gaps if some events are consumed entirely internally, such as debug marker pops which only modify the internal drawcall tree structures. -Also EIDs may not correspond directly to an actual function call - sometimes a function such as a -multi draw indirect will be one function call that expands to multiple events to allow inspection of -results part way through the multi draw. +Also eventIds may not correspond directly to an actual function call - sometimes a function such as +a multi draw indirect will be one function call that expands to multiple events to allow inspection +of results part way through the multi draw. )"); - uint32_t eventID; + uint32_t eventId; DOCUMENT("A list of addresses in the CPU callstack where this function was called."); rdcarray callstack; @@ -437,13 +437,13 @@ struct DebugMessage DOCUMENT(""); bool operator==(const DebugMessage &o) const { - return eventID == o.eventID && category == o.category && severity == o.severity && + return eventId == o.eventId && category == o.category && severity == o.severity && source == o.source && messageID == o.messageID && description == o.description; } bool operator<(const DebugMessage &o) const { - if(!(eventID == o.eventID)) - return eventID < o.eventID; + if(!(eventId == o.eventId)) + return eventId < o.eventId; if(!(category == o.category)) return category < o.category; if(!(severity == o.severity)) @@ -456,8 +456,8 @@ struct DebugMessage return description < o.description; return false; } - DOCUMENT("The :data:`EID ` where this debug message was found."); - uint32_t eventID; + DOCUMENT("The :data:`eventId ` where this debug message was found."); + uint32_t eventId; DOCUMENT("The :class:`category ` of this debug message."); MessageCategory category; @@ -559,7 +559,7 @@ struct ResourceBindStats DOCUMENT("How many objects were unbound."); uint32_t nulls; - DOCUMENT(R"(A list with one element for each type in :class:`TextureDim`. + DOCUMENT(R"(A list with one element for each type in :class:`TextureType`. The Nth element contains the number of times a resource of that type was bound. )"); @@ -595,7 +595,7 @@ struct ResourceUpdateStats DOCUMENT("How many of :data:`calls` were batched updates written in the command queue."); uint32_t servers; - DOCUMENT(R"(A list with one element for each type in :class:`TextureDim`. + DOCUMENT(R"(A list with one element for each type in :class:`TextureType`. The Nth element contains the number of times a resource of that type was updated. )"); @@ -904,23 +904,24 @@ this counts the frame number when the capture was made. DECLARE_REFLECTION_STRUCT(FrameDescription); -DOCUMENT("Describes a particular use of a resource at a specific :data:`EID `."); +DOCUMENT( + "Describes a particular use of a resource at a specific :data:`eventId `."); struct EventUsage { DOCUMENT(""); - EventUsage() : eventID(0), usage(ResourceUsage::Unused) {} - EventUsage(uint32_t e, ResourceUsage u) : eventID(e), usage(u) {} - EventUsage(uint32_t e, ResourceUsage u, ResourceId v) : eventID(e), usage(u), view(v) {} + EventUsage() : eventId(0), usage(ResourceUsage::Unused) {} + EventUsage(uint32_t e, ResourceUsage u) : eventId(e), usage(u) {} + EventUsage(uint32_t e, ResourceUsage u, ResourceId v) : eventId(e), usage(u), view(v) {} bool operator<(const EventUsage &o) const { - if(!(eventID == o.eventID)) - return eventID < o.eventID; + if(!(eventId == o.eventId)) + return eventId < o.eventId; return usage < o.usage; } - bool operator==(const EventUsage &o) const { return eventID == o.eventID && usage == o.usage; } - DOCUMENT("The :data:`EID ` where this usage happened."); - uint32_t eventID; + bool operator==(const EventUsage &o) const { return eventId == o.eventId && usage == o.usage; } + DOCUMENT("The :data:`eventId ` where this usage happened."); + uint32_t eventId; DOCUMENT("The :class:`ResourceUsage` in question."); ResourceUsage usage; @@ -938,8 +939,8 @@ struct DrawcallDescription DOCUMENT("Resets the drawcall back to a default/empty state."); void Reset() { - eventID = 0; - drawcallID = 0; + eventId = 0; + drawcallId = 0; flags = DrawFlags::NoFlags; markerColor[0] = markerColor[1] = markerColor[2] = markerColor[3] = 0.0f; numIndices = 0; @@ -967,12 +968,12 @@ struct DrawcallDescription depthOut = ResourceId(); } DOCUMENT(""); - bool operator==(const DrawcallDescription &o) const { return eventID == o.eventID; } - bool operator<(const DrawcallDescription &o) const { return eventID < o.eventID; } - DOCUMENT("The :data:`EID ` that actually produced the drawcall."); - uint32_t eventID; + bool operator==(const DrawcallDescription &o) const { return eventId == o.eventId; } + bool operator<(const DrawcallDescription &o) const { return eventId < o.eventId; } + DOCUMENT("The :data:`eventId ` that actually produced the drawcall."); + uint32_t eventId; DOCUMENT("A 1-based index of this drawcall relative to other drawcalls."); - uint32_t drawcallID; + uint32_t drawcallId; DOCUMENT(R"(The name of this drawcall. Typically a summarised/concise list of parameters. @@ -984,7 +985,7 @@ struct DrawcallDescription DOCUMENT("A set of :class:`DrawFlags` properties describing what kind of drawcall this is."); DrawFlags flags; - DOCUMENT("A RGBA colour specified by a debug marker call."); + DOCUMENT("A RGBA color specified by a debug marker call."); float markerColor[4]; DOCUMENT("The number of indices or vertices as appropriate for the drawcall. 0 if not used."); @@ -1030,21 +1031,21 @@ operation. )"); ResourceId copyDestination; - DOCUMENT(R"(The :data:`EID ` of the parent of this drawcall, or ``0`` if there + DOCUMENT(R"(The :data:`eventId ` of the parent of this drawcall, or ``0`` if there is no parent for this drawcall. )"); int64_t parent; - DOCUMENT(R"(The :data:`EID ` of the previous drawcall in the frame, or ``0`` if + DOCUMENT(R"(The :data:`eventId ` of the previous drawcall in the frame, or ``0`` if this is the first drawcall in the frame. )"); int64_t previous; - DOCUMENT(R"(The :data:`EID ` of the next drawcall in the frame, or ``0`` if this + DOCUMENT(R"(The :data:`eventId ` of the next drawcall in the frame, or ``0`` if this is the last drawcall in the frame. )"); int64_t next; - DOCUMENT(R"(A simple list of the :class:`ResourceId` ids for the colour outputs, which can be used + DOCUMENT(R"(A simple list of the :class:`ResourceId` ids for the color outputs, which can be used for very coarse bucketing of drawcalls into similar passes by their outputs. )"); ResourceId outputs[8]; @@ -1128,7 +1129,7 @@ struct CounterDescription .. note:: The value may not correspond to any of the predefined values if it's a hardware-specific counter value. )"); - GPUCounter counterID; + GPUCounter counter; DOCUMENT("A short human-readable name for the counter."); rdcstr name; @@ -1174,20 +1175,14 @@ DECLARE_REFLECTION_STRUCT(CounterValue); DOCUMENT("The resulting value from a counter at an event."); struct CounterResult { - CounterResult() : eventID(0), counterID(GPUCounter::EventGPUDuration) { value.u64 = 0; } - CounterResult(uint32_t EID, GPUCounter c, float data) : eventID(EID), counterID(c) - { - value.f = data; - } - CounterResult(uint32_t EID, GPUCounter c, double data) : eventID(EID), counterID(c) - { - value.d = data; - } - CounterResult(uint32_t EID, GPUCounter c, uint32_t data) : eventID(EID), counterID(c) + CounterResult() : eventId(0), counter(GPUCounter::EventGPUDuration) { value.u64 = 0; } + CounterResult(uint32_t e, GPUCounter c, float data) : eventId(e), counter(c) { value.f = data; } + CounterResult(uint32_t e, GPUCounter c, double data) : eventId(e), counter(c) { value.d = data; } + CounterResult(uint32_t e, GPUCounter c, uint32_t data) : eventId(e), counter(c) { value.u32 = data; } - CounterResult(uint32_t EID, GPUCounter c, uint64_t data) : eventID(EID), counterID(c) + CounterResult(uint32_t e, GPUCounter c, uint64_t data) : eventId(e), counter(c) { value.u64 = data; } @@ -1195,10 +1190,10 @@ struct CounterResult DOCUMENT("Compares two ``CounterResult`` objects for less-than."); bool operator<(const CounterResult &o) const { - if(!(eventID == o.eventID)) - return eventID < o.eventID; - if(!(counterID == o.counterID)) - return counterID < o.counterID; + if(!(eventId == o.eventId)) + return eventId < o.eventId; + if(!(counter == o.counter)) + return counter < o.counter; // don't compare values, just consider equal return false; @@ -1207,15 +1202,15 @@ struct CounterResult DOCUMENT("Compares two ``CounterResult`` objects for equality."); bool operator==(const CounterResult &o) const { - // don't compare values, just consider equal by EID/counterID - return eventID == o.eventID && counterID == o.counterID; + // don't compare values, just consider equal by eventId/counterID + return eventId == o.eventId && counter == o.counter; } - DOCUMENT("The :data:`EID ` that produced this value."); - uint32_t eventID; + DOCUMENT("The :data:`eventId ` that produced this value."); + uint32_t eventId; DOCUMENT("The :data:`counter ` that produced this value."); - GPUCounter counterID; + GPUCounter counter; DOCUMENT("The value itself."); CounterValue value; @@ -1227,13 +1222,11 @@ DOCUMENT("The contents of an RGBA pixel."); union PixelValue { DOCUMENT("The RGBA value interpreted as ``float``."); - float value_f[4]; + float floatValue[4]; DOCUMENT("The RGBA value interpreted as 32-bit unsigned integer."); - uint32_t value_u[4]; + uint32_t uintValue[4]; DOCUMENT("The RGBA value interpreted as 32-bit signed integer."); - int32_t value_i[4]; - DOCUMENT("The RGBA value interpreted as 16-bit unsigned integer."); - uint16_t value_u16[4]; + int32_t intValue[4]; }; DECLARE_REFLECTION_STRUCT(PixelValue); @@ -1256,7 +1249,7 @@ struct ModificationValue return stencil < o.stencil; return false; } - DOCUMENT("The colour value."); + DOCUMENT("The color value."); PixelValue col; DOCUMENT("The depth output, as a ``float``."); @@ -1274,7 +1267,7 @@ struct PixelModification DOCUMENT(""); bool operator==(const PixelModification &o) const { - return eventID == o.eventID && directShaderWrite == o.directShaderWrite && + return eventId == o.eventId && directShaderWrite == o.directShaderWrite && unboundPS == o.unboundPS && fragIndex == o.fragIndex && primitiveID == o.primitiveID && preMod == o.preMod && shaderOut == o.shaderOut && postMod == o.postMod && sampleMasked == o.sampleMasked && backfaceCulled == o.backfaceCulled && @@ -1284,8 +1277,8 @@ struct PixelModification } bool operator<(const PixelModification &o) const { - if(!(eventID == o.eventID)) - return eventID < o.eventID; + if(!(eventId == o.eventId)) + return eventId < o.eventId; if(!(directShaderWrite == o.directShaderWrite)) return directShaderWrite < o.directShaderWrite; if(!(unboundPS == o.unboundPS)) @@ -1318,8 +1311,8 @@ struct PixelModification return stencilTestFailed < o.stencilTestFailed; return false; } - DOCUMENT("The :data:`EID ` where the modification happened."); - uint32_t eventID; + DOCUMENT("The :data:`eventId ` where the modification happened."); + uint32_t eventId; DOCUMENT("``True`` if this event came as part of an arbitrary shader write."); bool directShaderWrite; @@ -1370,7 +1363,7 @@ pixel. :return: ``True`` if it passed all tests, ``False`` if it failed any. :rtype: ``bool`` )"); - bool passed() const + bool Passed() const { return !sampleMasked && !backfaceCulled && !depthClipped && !viewClipped && !scissorClipped && !shaderDiscarded && !depthTestFailed && !stencilTestFailed && !predicationSkipped; diff --git a/renderdoc/api/replay/gl_pipestate.h b/renderdoc/api/replay/gl_pipestate.h index f3b396667..11d23573d 100644 --- a/renderdoc/api/replay/gl_pipestate.h +++ b/renderdoc/api/replay/gl_pipestate.h @@ -25,6 +25,7 @@ #pragma once +#include "common_pipestate.h" #include "data_types.h" namespace GLPipe @@ -39,67 +40,68 @@ struct VertexAttribute DOCUMENT(""); bool operator==(const VertexAttribute &o) const { - return Enabled == o.Enabled && Format == o.Format && - !memcmp(&GenericValue, &o.GenericValue, sizeof(GenericValue)) && - BufferSlot == o.BufferSlot && RelativeOffset == o.RelativeOffset; + return enabled == o.enabled && format == o.format && + !memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) && + vertexBufferSlot == o.vertexBufferSlot && byteOffset == o.byteOffset; } bool operator<(const VertexAttribute &o) const { - if(!(Enabled == o.Enabled)) - return Enabled < o.Enabled; - if(!(Format == o.Format)) - return Format < o.Format; - if(memcmp(&GenericValue, &o.GenericValue, sizeof(GenericValue)) < 0) + if(!(enabled == o.enabled)) + return enabled < o.enabled; + if(!(format == o.format)) + return format < o.format; + if(memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) < 0) return true; - if(!(BufferSlot == o.BufferSlot)) - return BufferSlot < o.BufferSlot; - if(!(RelativeOffset == o.RelativeOffset)) - return RelativeOffset < o.RelativeOffset; + if(!(vertexBufferSlot == o.vertexBufferSlot)) + return vertexBufferSlot < o.vertexBufferSlot; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; return false; } DOCUMENT("``True`` if this vertex attribute is enabled."); - bool Enabled = false; + bool enabled = false; DOCUMENT("The :class:`ResourceFormat` of the vertex attribute."); - ResourceFormat Format; + ResourceFormat format; DOCUMENT("A :class:`PixelValue` containing the generic value of a vertex attribute."); - PixelValue GenericValue; + PixelValue genericValue; DOCUMENT("The vertex buffer input slot where the data is sourced from."); - uint32_t BufferSlot = 0; + uint32_t vertexBufferSlot = 0; DOCUMENT(R"(The byte offset from the start of the vertex data in the vertex buffer from -:data:`BufferSlot`. +:data:`vertexBufferSlot`. )"); - uint32_t RelativeOffset = 0; + uint32_t byteOffset = 0; }; DOCUMENT("Describes a single OpenGL vertex buffer binding.") -struct VB +struct VertexBuffer { DOCUMENT(""); - bool operator==(const VB &o) const + bool operator==(const VertexBuffer &o) const { - return Buffer == o.Buffer && Stride == o.Stride && Offset == o.Offset && Divisor == o.Divisor; + return resourceId == o.resourceId && byteStride == o.byteStride && byteOffset == o.byteOffset && + instanceDivisor == o.instanceDivisor; } - bool operator<(const VB &o) const + bool operator<(const VertexBuffer &o) const { - if(!(Buffer == o.Buffer)) - return Buffer < o.Buffer; - if(!(Stride == o.Stride)) - return Stride < o.Stride; - if(!(Offset == o.Offset)) - return Offset < o.Offset; - if(!(Divisor == o.Divisor)) - return Divisor < o.Divisor; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteStride == o.byteStride)) + return byteStride < o.byteStride; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(instanceDivisor == o.instanceDivisor)) + return instanceDivisor < o.instanceDivisor; return false; } DOCUMENT("The :class:`ResourceId` of the buffer bound to this slot."); - ResourceId Buffer; + ResourceId resourceId; DOCUMENT("The byte stride between the start of one set of vertex data and the next."); - uint32_t Stride = 0; + uint32_t byteStride = 0; DOCUMENT("The byte offset from the start of the buffer to the beginning of the vertex data."); - uint32_t Offset = 0; + uint32_t byteOffset = 0; DOCUMENT(R"(The instance rate divisor. If this is ``0`` then the vertex buffer is read at vertex rate. @@ -107,20 +109,20 @@ If this is ``0`` then the vertex buffer is read at vertex rate. If it's ``1`` then one element is read for each instance, and for ``N`` greater than ``1`` then ``N`` instances read the same element before advancing. )"); - uint32_t Divisor = 0; + uint32_t instanceDivisor = 0; }; DOCUMENT("Describes the setup for fixed-function vertex input fetch."); struct VertexInput { - DOCUMENT("A list of :class:`GL_VertexAttribute` with the vertex attributes."); + DOCUMENT("A list of :class:`GLVertexAttribute` with the vertex attributes."); rdcarray attributes; - DOCUMENT("A list of :class:`GL_VB` with the vertex buffers."); - rdcarray vbuffers; + DOCUMENT("A list of :class:`GLVertexBuffer` with the vertex buffers."); + rdcarray vertexBuffers; DOCUMENT("The :class:`ResourceId` of the index buffer."); - ResourceId ibuffer; + ResourceId indexBuffer; DOCUMENT("``True`` if primitive restart is enabled for strip primitives."); bool primitiveRestart = false; DOCUMENT("The index value to use to indicate a strip restart."); @@ -137,23 +139,23 @@ DOCUMENT("Describes an OpenGL shader stage."); struct Shader { DOCUMENT("The :class:`ResourceId` of the shader object itself."); - ResourceId Object; + ResourceId shaderResourceId; DOCUMENT("The :class:`ResourceId` of the program bound to this stage."); - ResourceId Program; + ResourceId programResourceId; DOCUMENT("A :class:`ShaderReflection` describing the reflection data for this shader."); - ShaderReflection *ShaderDetails = NULL; - DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`ShaderDetails` with the bindpoint + ShaderReflection *reflection = NULL; + DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`reflection` with the bindpoint mapping data. )"); - ShaderBindpointMapping BindpointMapping; + ShaderBindpointMapping bindpointMapping; DOCUMENT("A :class:`ShaderStage` identifying which stage this shader is bound to."); ShaderStage stage = ShaderStage::Vertex; DOCUMENT("A list of integers with the subroutine values."); - rdcarray Subroutines; + rdcarray subroutines; }; DOCUMENT("Describes the setup for fixed vertex processing operations."); @@ -186,44 +188,44 @@ struct Texture DOCUMENT(""); bool operator==(const Texture &o) const { - return Resource == o.Resource && FirstSlice == o.FirstSlice && HighestMip == o.HighestMip && - ResType == o.ResType && Swizzle[0] == o.Swizzle[0] && Swizzle[1] == o.Swizzle[1] && - Swizzle[2] == o.Swizzle[2] && Swizzle[3] == o.Swizzle[3] && - DepthReadChannel == o.DepthReadChannel; + return resourceId == o.resourceId && firstSlice == o.firstSlice && firstMip == o.firstMip && + type == o.type && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && + swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] && + depthReadChannel == o.depthReadChannel; } bool operator<(const Texture &o) const { - if(!(Resource == o.Resource)) - return Resource < o.Resource; - if(!(FirstSlice == o.FirstSlice)) - return FirstSlice < o.FirstSlice; - if(!(HighestMip == o.HighestMip)) - return HighestMip < o.HighestMip; - if(!(ResType == o.ResType)) - return ResType < o.ResType; - if(!(Swizzle[0] == o.Swizzle[0])) - return Swizzle[0] < o.Swizzle[0]; - if(!(Swizzle[1] == o.Swizzle[1])) - return Swizzle[1] < o.Swizzle[1]; - if(!(Swizzle[2] == o.Swizzle[2])) - return Swizzle[2] < o.Swizzle[2]; - if(!(Swizzle[3] == o.Swizzle[3])) - return Swizzle[3] < o.Swizzle[3]; - if(!(DepthReadChannel == o.DepthReadChannel)) - return DepthReadChannel < o.DepthReadChannel; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(firstSlice == o.firstSlice)) + return firstSlice < o.firstSlice; + if(!(firstMip == o.firstMip)) + return firstMip < o.firstMip; + if(!(type == o.type)) + return type < o.type; + if(!(swizzle[0] == o.swizzle[0])) + return swizzle[0] < o.swizzle[0]; + if(!(swizzle[1] == o.swizzle[1])) + return swizzle[1] < o.swizzle[1]; + if(!(swizzle[2] == o.swizzle[2])) + return swizzle[2] < o.swizzle[2]; + if(!(swizzle[3] == o.swizzle[3])) + return swizzle[3] < o.swizzle[3]; + if(!(depthReadChannel == o.depthReadChannel)) + return depthReadChannel < o.depthReadChannel; return false; } DOCUMENT("The :class:`ResourceId` of the underlying resource the view refers to."); - ResourceId Resource; + ResourceId resourceId; DOCUMENT("Valid for texture arrays or 3D textures - the first slice available."); - uint32_t FirstSlice = 0; + uint32_t firstSlice = 0; DOCUMENT("Valid for textures - the highest mip that is available."); - uint32_t HighestMip = 0; - DOCUMENT("The :class:`TextureDim` of the texture."); - TextureDim ResType = TextureDim::Unknown; + uint32_t firstMip = 0; + DOCUMENT("The :class:`TextureType` of the texture."); + TextureType type = TextureType::Unknown; DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture."); - TextureSwizzle Swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, + TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, TextureSwizzle::Alpha}; DOCUMENT(R"(The channel to read from in a depth-stencil texture. @@ -233,7 +235,7 @@ struct Texture ``1`` if stencil should be read. )"); - int32_t DepthReadChannel = -1; + int32_t depthReadChannel = -1; }; DOCUMENT("Describes the sampler properties of a texture."); @@ -242,71 +244,72 @@ struct Sampler DOCUMENT(""); bool operator==(const Sampler &o) const { - return Samp == o.Samp && AddressS == o.AddressS && AddressT == o.AddressT && - AddressR == o.AddressR && BorderColor[0] == o.BorderColor[0] && - BorderColor[1] == o.BorderColor[1] && BorderColor[2] == o.BorderColor[2] && - BorderColor[3] == o.BorderColor[3] && Comparison == o.Comparison && Filter == o.Filter && - SeamlessCube == o.SeamlessCube && MaxAniso == o.MaxAniso && MaxLOD == o.MaxLOD && - MinLOD == o.MinLOD && MipLODBias == o.MipLODBias; + return resourceId == o.resourceId && addressS == o.addressS && addressT == o.addressT && + addressR == o.addressR && borderColor[0] == o.borderColor[0] && + borderColor[1] == o.borderColor[1] && borderColor[2] == o.borderColor[2] && + borderColor[3] == o.borderColor[3] && compareFunction == o.compareFunction && + filter == o.filter && seamlessCubeMap == o.seamlessCubeMap && + maxAnisotropy == o.maxAnisotropy && maxLOD == o.maxLOD && minLOD == o.minLOD && + mipLODBias == o.mipLODBias; } bool operator<(const Sampler &o) const { - if(!(Samp == o.Samp)) - return Samp < o.Samp; - if(!(AddressS == o.AddressS)) - return AddressS < o.AddressS; - if(!(AddressT == o.AddressT)) - return AddressT < o.AddressT; - if(!(AddressR == o.AddressR)) - return AddressR < o.AddressR; - if(!(BorderColor[0] == o.BorderColor[0])) - return BorderColor[0] < o.BorderColor[0]; - if(!(BorderColor[1] == o.BorderColor[1])) - return BorderColor[1] < o.BorderColor[1]; - if(!(BorderColor[2] == o.BorderColor[2])) - return BorderColor[2] < o.BorderColor[2]; - if(!(BorderColor[3] == o.BorderColor[3])) - return BorderColor[3] < o.BorderColor[3]; - if(!(Comparison == o.Comparison)) - return Comparison < o.Comparison; - if(!(Filter == o.Filter)) - return Filter < o.Filter; - if(!(SeamlessCube == o.SeamlessCube)) - return SeamlessCube < o.SeamlessCube; - if(!(MaxAniso == o.MaxAniso)) - return MaxAniso < o.MaxAniso; - if(!(MaxLOD == o.MaxLOD)) - return MaxLOD < o.MaxLOD; - if(!(MinLOD == o.MinLOD)) - return MinLOD < o.MinLOD; - if(!(MipLODBias == o.MipLODBias)) - return MipLODBias < o.MipLODBias; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(addressS == o.addressS)) + return addressS < o.addressS; + if(!(addressT == o.addressT)) + return addressT < o.addressT; + if(!(addressR == o.addressR)) + return addressR < o.addressR; + if(!(borderColor[0] == o.borderColor[0])) + return borderColor[0] < o.borderColor[0]; + if(!(borderColor[1] == o.borderColor[1])) + return borderColor[1] < o.borderColor[1]; + if(!(borderColor[2] == o.borderColor[2])) + return borderColor[2] < o.borderColor[2]; + if(!(borderColor[3] == o.borderColor[3])) + return borderColor[3] < o.borderColor[3]; + if(!(compareFunction == o.compareFunction)) + return compareFunction < o.compareFunction; + if(!(filter == o.filter)) + return filter < o.filter; + if(!(seamlessCubeMap == o.seamlessCubeMap)) + return seamlessCubeMap < o.seamlessCubeMap; + if(!(maxAnisotropy == o.maxAnisotropy)) + return maxAnisotropy < o.maxAnisotropy; + if(!(maxLOD == o.maxLOD)) + return maxLOD < o.maxLOD; + if(!(minLOD == o.minLOD)) + return minLOD < o.minLOD; + if(!(mipLODBias == o.mipLODBias)) + return mipLODBias < o.mipLODBias; return false; } DOCUMENT("The :class:`ResourceId` of the sampler object, if a separate one is set."); - ResourceId Samp; + ResourceId resourceId; DOCUMENT("The :class:`AddressMode` in the S direction."); - AddressMode AddressS = AddressMode::Wrap; + AddressMode addressS = AddressMode::Wrap; DOCUMENT("The :class:`AddressMode` in the T direction."); - AddressMode AddressT = AddressMode::Wrap; + AddressMode addressT = AddressMode::Wrap; DOCUMENT("The :class:`AddressMode` in the R direction."); - AddressMode AddressR = AddressMode::Wrap; + AddressMode addressR = AddressMode::Wrap; DOCUMENT("The RGBA border color."); - float BorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - DOCUMENT("The :class:`CompareFunc` for comparison samplers."); - CompareFunc Comparison = CompareFunc::AlwaysTrue; + float borderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + DOCUMENT("The :class:`CompareFunction` for comparison samplers."); + CompareFunction compareFunction = CompareFunction::AlwaysTrue; DOCUMENT("The :class:`TextureFilter` describing the filtering mode."); - TextureFilter Filter; + TextureFilter filter; DOCUMENT("``True`` if seamless cubemap filtering is enabled for this texture."); - bool SeamlessCube = false; + bool seamlessCubeMap = false; DOCUMENT("The maximum anisotropic filtering level to use."); - float MaxAniso = 0.0f; + float maxAnisotropy = 0.0f; DOCUMENT("The maximum mip level that can be used."); - float MaxLOD = 0.0f; + float maxLOD = 0.0f; DOCUMENT("The minimum mip level that can be used."); - float MinLOD = 0.0f; + float minLOD = 0.0f; DOCUMENT("A bias to apply to the calculated mip level before sampling."); - float MipLODBias = 0.0f; + float mipLODBias = 0.0f; DOCUMENT(R"(Check if the border color is used in this OpenGL sampler. @@ -315,8 +318,8 @@ struct Sampler )"); bool UseBorder() const { - return AddressS == AddressMode::ClampBorder || AddressT == AddressMode::ClampBorder || - AddressR == AddressMode::ClampBorder; + return addressS == AddressMode::ClampBorder || addressT == AddressMode::ClampBorder || + addressR == AddressMode::ClampBorder; } }; @@ -326,24 +329,24 @@ struct Buffer DOCUMENT(""); bool operator==(const Buffer &o) const { - return Resource == o.Resource && Offset == o.Offset && Size == o.Size; + return resourceId == o.resourceId && byteOffset == o.byteOffset && byteSize == o.byteSize; } bool operator<(const Buffer &o) const { - if(!(Resource == o.Resource)) - return Resource < o.Resource; - if(!(Offset == o.Offset)) - return Offset < o.Offset; - if(!(Size == o.Size)) - return Size < o.Size; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(byteSize == o.byteSize)) + return byteSize < o.byteSize; return false; } DOCUMENT("The :class:`ResourceId` of the buffer object."); - ResourceId Resource; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer."); - uint64_t Offset = 0; + uint64_t byteOffset = 0; DOCUMENT("The byte size of the buffer."); - uint64_t Size = 0; + uint64_t byteSize = 0; }; DOCUMENT("Describes the properties of a load/store image."); @@ -352,139 +355,65 @@ struct ImageLoadStore DOCUMENT(""); bool operator==(const ImageLoadStore &o) const { - return Resource == o.Resource && Level == o.Level && Layered == o.Layered && Layer == o.Layer && - ResType == o.ResType && readAllowed == o.readAllowed && writeAllowed == o.writeAllowed && - Format == o.Format; + return resourceId == o.resourceId && mipLevel == o.mipLevel && layered == o.layered && + slice == o.slice && type == o.type && readAllowed == o.readAllowed && + writeAllowed == o.writeAllowed && imageFormat == o.imageFormat; } bool operator<(const ImageLoadStore &o) const { - if(!(Resource == o.Resource)) - return Resource < o.Resource; - if(!(Level == o.Level)) - return Level < o.Level; - if(!(Layered == o.Layered)) - return Layered < o.Layered; - if(!(Layer == o.Layer)) - return Layer < o.Layer; - if(!(ResType == o.ResType)) - return ResType < o.ResType; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(mipLevel == o.mipLevel)) + return mipLevel < o.mipLevel; + if(!(layered == o.layered)) + return layered < o.layered; + if(!(slice == o.slice)) + return slice < o.slice; + if(!(type == o.type)) + return type < o.type; if(!(readAllowed == o.readAllowed)) return readAllowed < o.readAllowed; if(!(writeAllowed == o.writeAllowed)) return writeAllowed < o.writeAllowed; - if(!(Format == o.Format)) - return Format < o.Format; + if(!(imageFormat == o.imageFormat)) + return imageFormat < o.imageFormat; return false; } DOCUMENT("The :class:`ResourceId` of the texture object."); - ResourceId Resource; + ResourceId resourceId; DOCUMENT("The mip of the texture that's used in the attachment."); - uint32_t Level = 0; + uint32_t mipLevel = 0; DOCUMENT(R"(``True`` if multiple layers are bound together to the image. ``False`` if only one layer is bound. )"); - bool Layered = false; + bool layered = false; DOCUMENT("The slice of the texture that's used in the attachment."); - uint32_t Layer = 0; - DOCUMENT("The :class:`TextureDim` of the texture."); - TextureDim ResType = TextureDim::Unknown; + uint32_t slice = 0; + DOCUMENT("The :class:`TextureType` of the texture."); + TextureType type = TextureType::Unknown; DOCUMENT("``True`` if loading from the image is allowed."); bool readAllowed = false; DOCUMENT("``True`` if storing to the image is allowed."); bool writeAllowed = false; DOCUMENT("The :class:`ResourceFormat` that the image is bound as."); - ResourceFormat Format; + ResourceFormat imageFormat; }; DOCUMENT("Describes the current feedback state."); struct Feedback { DOCUMENT("The :class:`ResourceId` of the transform feedback binding."); - ResourceId Obj; + ResourceId feedbackResourceId; DOCUMENT("A list of :class:`ResourceId` with the buffer bindings."); - ResourceId BufferBinding[4]; + ResourceId bufferResourceId[4]; DOCUMENT("A list of ``int`` with the buffer byte offsets."); - uint64_t Offset[4] = {0, 0, 0, 0}; + uint64_t byteOffset[4] = {0, 0, 0, 0}; DOCUMENT("A list of ``int`` with the buffer byte sizes."); - uint64_t Size[4] = {0, 0, 0, 0}; + uint64_t byteSize[4] = {0, 0, 0, 0}; DOCUMENT("``True`` if the transform feedback object is currently active."); - bool Active = false; + bool active = false; DOCUMENT("``True`` if the transform feedback object is currently paused."); - bool Paused = false; -}; - -DOCUMENT("Describes a single OpenGL viewport."); -struct Viewport -{ - DOCUMENT(""); - bool operator==(const Viewport &o) const - { - return Left == o.Left && Bottom == o.Bottom && Width == o.Width && Height == o.Height && - MinDepth == o.MinDepth && MaxDepth == o.MaxDepth; - } - bool operator<(const Viewport &o) const - { - if(!(Left == o.Left)) - return Left < o.Left; - if(!(Bottom == o.Bottom)) - return Bottom < o.Bottom; - if(!(Width == o.Width)) - return Width < o.Width; - if(!(Height == o.Height)) - return Height < o.Height; - if(!(MinDepth == o.MinDepth)) - return MinDepth < o.MinDepth; - if(!(MaxDepth == o.MaxDepth)) - return MaxDepth < o.MaxDepth; - return false; - } - DOCUMENT("The X co-ordinate of the left side of the viewport."); - float Left = 0.0f; - DOCUMENT("The Y co-ordinate of the bottom side of the viewport."); - float Bottom = 0.0f; - DOCUMENT("The width of the viewport."); - float Width = 0.0f; - DOCUMENT("The height of the viewport."); - float Height = 0.0f; - DOCUMENT("The minimum depth of the viewport."); - double MinDepth = 0.0; - DOCUMENT("The maximum depth of the viewport."); - double MaxDepth = 0.0; -}; - -DOCUMENT("Describes a single OpenGL scissor region."); -struct Scissor -{ - DOCUMENT(""); - bool operator==(const Scissor &o) const - { - return Left == o.Left && Bottom == o.Bottom && Width == o.Width && Height == o.Height && - Enabled == o.Enabled; - } - bool operator<(const Scissor &o) const - { - if(!(Left == o.Left)) - return Left < o.Left; - if(!(Bottom == o.Bottom)) - return Bottom < o.Bottom; - if(!(Width == o.Width)) - return Width < o.Width; - if(!(Height == o.Height)) - return Height < o.Height; - if(!(Enabled == o.Enabled)) - return Enabled < o.Enabled; - return false; - } - DOCUMENT("The X co-ordinate of the left side of the scissor region."); - int32_t Left = 0; - DOCUMENT("The Y co-ordinate of the bottom side of the scissor region."); - int32_t Bottom = 0; - DOCUMENT("The width of the scissor region."); - int32_t Width = 0; - DOCUMENT("The height of the scissor region."); - int32_t Height = 0; - DOCUMENT("``True`` if this scissor region is enabled."); - bool Enabled = false; + bool paused = false; }; DOCUMENT("Describes the rasterizer state toggles."); @@ -497,116 +426,97 @@ struct RasterizerState DOCUMENT(R"(``True`` if counter-clockwise polygons are front-facing. ``False`` if clockwise polygons are front-facing. )"); - bool FrontCCW = false; + bool frontCCW = false; DOCUMENT("The fixed depth bias value to apply to z-values."); - float DepthBias = 0.0f; + float depthBias = 0.0f; DOCUMENT("The slope-scaled depth bias value to apply to z-values."); - float SlopeScaledDepthBias = 0.0f; - DOCUMENT(R"(The clamp value for calculated depth bias from :data:`DepthBias` and -:data:`SlopeScaledDepthBias` + float slopeScaledDepthBias = 0.0f; + DOCUMENT(R"(The clamp value for calculated depth bias from :data:`depthBias` and +:data:`slopeScaledDepthBias` )"); - float OffsetClamp = 0.0f; + float offsetClamp = 0.0f; DOCUMENT(R"(``True`` if pixels outside of the near and far depth planes should be clamped and to ``0.0`` to ``1.0`` and not clipped. )"); - bool DepthClamp = false; + bool depthClamp = false; DOCUMENT("``True`` if multisampling should be used during rendering."); - bool MultisampleEnable = false; + bool multisampleEnable = false; DOCUMENT("``True`` if rendering should happen at sample-rate frequency."); - bool SampleShading = false; + bool sampleShading = false; DOCUMENT(R"(``True`` if the generated samples should be bitwise ``AND`` masked with -:data:`SampleMaskValue`. +:data:`sampleMaskValue`. )"); - bool SampleMask = false; + bool sampleMask = false; DOCUMENT("The sample mask value that should be masked against the generated coverage."); - uint32_t SampleMaskValue = ~0U; - DOCUMENT(R"(``True`` if a temporary mask using :data:`SampleCoverageValue` should be used to + uint32_t sampleMaskValue = ~0U; + DOCUMENT(R"(``True`` if a temporary mask using :data:`sampleCoverageValue` should be used to resolve the final output color. )"); - bool SampleCoverage = false; + bool sampleCoverage = false; DOCUMENT("``True`` if the temporary sample coverage mask should be inverted."); - bool SampleCoverageInvert = false; - DOCUMENT("The sample coverage value used if :data:`SampleCoverage` is ``True``."); - float SampleCoverageValue = 1.0f; + bool sampleCoverageInvert = false; + DOCUMENT("The sample coverage value used if :data:`sampleCoverage` is ``True``."); + float sampleCoverageValue = 1.0f; DOCUMENT("``True`` if alpha-to-coverage should be used when blending to an MSAA target."); - bool SampleAlphaToCoverage = false; + bool alphaToCoverage = false; DOCUMENT("``True`` if alpha-to-one should be used when blending to an MSAA target."); - bool SampleAlphaToOne = false; + bool alphaToOne = false; DOCUMENT("The minimum sample shading rate."); - float MinSampleShadingRate = 0.0f; + float minSampleShadingRate = 0.0f; DOCUMENT("``True`` if the point size can be programmably exported from a shader."); - bool ProgrammablePointSize = false; + bool programmablePointSize = false; DOCUMENT("The fixed point size in pixels."); - float PointSize = 1.0f; + float pointSize = 1.0f; DOCUMENT("The fixed line width in pixels."); - float LineWidth = 1.0f; + float lineWidth = 1.0f; DOCUMENT("The threshold value at which points are clipped if they exceed this size."); - float PointFadeThreshold = 0.0f; + float pointFadeThreshold = 0.0f; DOCUMENT("``True`` if the point sprite texture origin is upper-left. ``False`` if lower-left."); - bool PointOriginUpperLeft = false; + bool pointOriginUpperLeft = false; }; DOCUMENT("Describes the rasterization state of the OpenGL pipeline."); struct Rasterizer { - DOCUMENT("A list of :class:`GL_Viewport` with the bound viewports."); - rdcarray Viewports; + DOCUMENT("A list of :class:`Viewport` with the bound viewports."); + rdcarray viewports; - DOCUMENT("A list of :class:`GL_Scissor` with the bound scissor regions."); - rdcarray Scissors; + DOCUMENT("A list of :class:`Scissor` with the bound scissor regions."); + rdcarray scissors; - DOCUMENT("A :class:`GL_RasterizerState` with the details of the rasterization state."); - RasterizerState m_State; + DOCUMENT("A :class:`GLRasterizerState` with the details of the rasterization state."); + RasterizerState state; }; DOCUMENT("Describes the depth state."); struct DepthState { DOCUMENT("``True`` if depth testing should be performed."); - bool DepthEnable = false; - DOCUMENT("The :class:`CompareFunc` to use for testing depth values."); - CompareFunc DepthFunc = CompareFunc::AlwaysTrue; + bool depthEnable = false; + DOCUMENT("The :class:`CompareFunction` to use for testing depth values."); + CompareFunction depthFunction = CompareFunction::AlwaysTrue; DOCUMENT("``True`` if depth values should be written to the depth target."); - bool DepthWrites = false; + bool depthWrites = false; DOCUMENT("``True`` if depth bounds tests should be applied."); - bool DepthBounds = false; + bool depthBounds = false; DOCUMENT("The near plane bounding value."); - double NearBound = 0.0; + double nearBound = 0.0; DOCUMENT("The far plane bounding value."); - double FarBound = 0.0; -}; - -DOCUMENT("Describes the details of an OpenGL stencil operation."); -struct StencilFace -{ - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test fails."); - StencilOp FailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the depth-test fails."); - StencilOp DepthFailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test passes."); - StencilOp PassOp = StencilOp::Keep; - DOCUMENT("The :class:`CompareFunc` to use for testing stencil values."); - CompareFunc Func = CompareFunc::AlwaysTrue; - DOCUMENT("The current stencil reference value."); - uint8_t Ref = 0; - DOCUMENT("The mask for testing stencil values."); - uint8_t ValueMask = 0; - DOCUMENT("The mask for writing stencil values."); - uint8_t WriteMask = 0; + double farBound = 0.0; }; DOCUMENT("Describes the stencil state."); struct StencilState { DOCUMENT("``True`` if stencil operations should be performed."); - bool StencilEnable = false; + bool stencilEnable = false; - DOCUMENT("A :class:`GL_StencilFace` describing what happens for front-facing polygons."); - StencilFace m_FrontFace; - DOCUMENT("A :class:`GL_StencilFace` describing what happens for back-facing polygons."); - StencilFace m_BackFace; + DOCUMENT("A :class:`StencilFace` describing what happens for front-facing polygons."); + StencilFace frontFace; + DOCUMENT("A :class:`StencilFace` describing what happens for back-facing polygons."); + StencilFace backFace; }; DOCUMENT("Describes the state of a framebuffer attachment."); @@ -615,35 +525,36 @@ struct Attachment DOCUMENT(""); bool operator==(const Attachment &o) const { - return Obj == o.Obj && Layer == o.Layer && Mip == o.Mip && Swizzle[0] == o.Swizzle[0] && - Swizzle[1] == o.Swizzle[1] && Swizzle[2] == o.Swizzle[2] && Swizzle[3] == o.Swizzle[3]; + return resourceId == o.resourceId && slice == o.slice && mipLevel == o.mipLevel && + swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && swizzle[2] == o.swizzle[2] && + swizzle[3] == o.swizzle[3]; } bool operator<(const Attachment &o) const { - if(!(Obj == o.Obj)) - return Obj < o.Obj; - if(!(Layer == o.Layer)) - return Layer < o.Layer; - if(!(Mip == o.Mip)) - return Mip < o.Mip; - if(!(Swizzle[0] == o.Swizzle[0])) - return Swizzle[0] < o.Swizzle[0]; - if(!(Swizzle[1] == o.Swizzle[1])) - return Swizzle[1] < o.Swizzle[1]; - if(!(Swizzle[2] == o.Swizzle[2])) - return Swizzle[2] < o.Swizzle[2]; - if(!(Swizzle[3] == o.Swizzle[3])) - return Swizzle[3] < o.Swizzle[3]; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(slice == o.slice)) + return slice < o.slice; + if(!(mipLevel == o.mipLevel)) + return mipLevel < o.mipLevel; + if(!(swizzle[0] == o.swizzle[0])) + return swizzle[0] < o.swizzle[0]; + if(!(swizzle[1] == o.swizzle[1])) + return swizzle[1] < o.swizzle[1]; + if(!(swizzle[2] == o.swizzle[2])) + return swizzle[2] < o.swizzle[2]; + if(!(swizzle[3] == o.swizzle[3])) + return swizzle[3] < o.swizzle[3]; return false; } DOCUMENT("The :class:`ResourceId` of the texture bound to this attachment."); - ResourceId Obj; + ResourceId resourceId; DOCUMENT("The slice of the texture that's used in the attachment."); - uint32_t Layer = 0; + uint32_t slice = 0; DOCUMENT("The mip of the texture that's used in the attachment."); - uint32_t Mip = 0; + uint32_t mipLevel = 0; DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture."); - TextureSwizzle Swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, + TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, TextureSwizzle::Alpha}; }; @@ -651,91 +562,28 @@ DOCUMENT("Describes the contents of a framebuffer object."); struct FBO { DOCUMENT("The :class:`ResourceId` of the framebuffer."); - ResourceId Obj; - DOCUMENT("The list of :class:`GL_Attachment` with the framebuffer color attachments."); - rdcarray Color; - DOCUMENT("The :class:`GL_Attachment` with the framebuffer depth attachment."); - Attachment Depth; - DOCUMENT("The :class:`GL_Attachment` with the framebuffer stencil attachment."); - Attachment Stencil; + ResourceId resourceId; + DOCUMENT("The list of :class:`GLAttachment` with the framebuffer color attachments."); + rdcarray colorAttachments; + DOCUMENT("The :class:`GLAttachment` with the framebuffer depth attachment."); + Attachment depthAttachment; + DOCUMENT("The :class:`GLAttachment` with the framebuffer stencil attachment."); + Attachment stencilAttachment; - DOCUMENT("The list of draw buffer indices into the :data:`Color` attachment list."); - rdcarray DrawBuffers; - DOCUMENT("The read buffer index in the :data:`Color` attachment list."); - int32_t ReadBuffer = 0; -}; - -DOCUMENT("Describes the details of an OpenGL blend operation."); -struct BlendEquation -{ - DOCUMENT(""); - bool operator==(const BlendEquation &o) const - { - return Source == o.Source && Destination == o.Destination && Operation == o.Operation; - } - bool operator<(const BlendEquation &o) const - { - if(!(Source == o.Source)) - return Source < o.Source; - if(!(Destination == o.Destination)) - return Destination < o.Destination; - if(!(Operation == o.Operation)) - return Operation < o.Operation; - return false; - } - DOCUMENT("The :class:`BlendMultiplier` for the source blend value."); - BlendMultiplier Source = BlendMultiplier::One; - DOCUMENT("The :class:`BlendMultiplier` for the destination blend value."); - BlendMultiplier Destination = BlendMultiplier::One; - DOCUMENT("The :class:`BlendOp` to use in the blend calculation."); - BlendOp Operation = BlendOp::Add; -}; - -DOCUMENT("Describes the blend configuration for a given OpenGL attachment."); -struct Blend -{ - DOCUMENT(""); - bool operator==(const Blend &o) const - { - return Enabled == o.Enabled && m_Blend == o.m_Blend && m_AlphaBlend == o.m_AlphaBlend && - Logic == o.Logic && WriteMask == o.WriteMask; - } - bool operator<(const Blend &o) const - { - if(!(Enabled == o.Enabled)) - return Enabled < o.Enabled; - if(!(m_Blend == o.m_Blend)) - return m_Blend < o.m_Blend; - if(!(m_AlphaBlend == o.m_AlphaBlend)) - return m_AlphaBlend < o.m_AlphaBlend; - if(!(Logic == o.Logic)) - return Logic < o.Logic; - if(!(WriteMask == o.WriteMask)) - return WriteMask < o.WriteMask; - return false; - } - DOCUMENT("A :class:`GL_BlendEquation` describing the blending for colour values."); - BlendEquation m_Blend; - DOCUMENT("A :class:`GL_BlendEquation` describing the blending for alpha values."); - BlendEquation m_AlphaBlend; - - DOCUMENT("The :class:`LogicOp` to use for logic operations."); - LogicOp Logic = LogicOp::NoOp; - - DOCUMENT("``True`` if blending is enabled for this target."); - bool Enabled = false; - DOCUMENT("The mask for writes to the render target."); - byte WriteMask = 0; + DOCUMENT("The list of draw buffer indices into the :data:`colorAttachments` attachment list."); + rdcarray drawBuffers; + DOCUMENT("The read buffer index in the :data:`colorAttachments` attachment list."); + int32_t readBuffer = 0; }; DOCUMENT("Describes the blend pipeline state."); struct BlendState { - DOCUMENT("A list of :class:`GL_Blend` describing the blend operations for each target."); - rdcarray Blends; + DOCUMENT("A list of :class:`ColorBlend` describing the blend operations for each target."); + rdcarray blends; DOCUMENT("The constant blend factor to use in blend equations."); - float BlendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + float blendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; }; DOCUMENT("Describes the current state of the framebuffer stage of the pipeline."); @@ -743,100 +591,100 @@ struct FrameBuffer { DOCUMENT( "``True`` if sRGB correction should be applied when writing to an sRGB-formatted texture."); - bool FramebufferSRGB = false; + bool framebufferSRGB = false; DOCUMENT("``True`` if dithering should be used when writing to color buffers."); - bool Dither = false; + bool dither = false; - DOCUMENT("A :class:`GL_FBO` with the information about a draw framebuffer."); - FBO m_DrawFBO; - DOCUMENT("A :class:`GL_FBO` with the information about a read framebuffer."); - FBO m_ReadFBO; + DOCUMENT("A :class:`GLFBO` with the information about a draw framebuffer."); + FBO drawFBO; + DOCUMENT("A :class:`GLFBO` with the information about a read framebuffer."); + FBO readFBO; - DOCUMENT("A :class:`GL_BlendState` with the details of the blending state."); - BlendState m_Blending; + DOCUMENT("A :class:`GLBlendState` with the details of the blending state."); + BlendState blendState; }; DOCUMENT("Describes the current state of GL hints and smoothing."); struct Hints { DOCUMENT("A :class:`QualityHint` with the derivatives hint."); - QualityHint Derivatives = QualityHint::DontCare; + QualityHint derivatives = QualityHint::DontCare; DOCUMENT("A :class:`QualityHint` with the line smoothing hint."); - QualityHint LineSmooth = QualityHint::DontCare; + QualityHint lineSmoothing = QualityHint::DontCare; DOCUMENT("A :class:`QualityHint` with the polygon smoothing hint."); - QualityHint PolySmooth = QualityHint::DontCare; + QualityHint polySmoothing = QualityHint::DontCare; DOCUMENT("A :class:`QualityHint` with the texture compression hint."); - QualityHint TexCompression = QualityHint::DontCare; + QualityHint textureCompression = QualityHint::DontCare; DOCUMENT("``True`` if line smoothing is enabled."); - bool LineSmoothEnabled = false; + bool lineSmoothingEnabled = false; DOCUMENT("``True`` if polygon smoothing is enabled."); - bool PolySmoothEnabled = false; + bool polySmoothingEnabled = false; }; DOCUMENT("The full current OpenGL pipeline state."); struct State { - DOCUMENT("A :class:`GL_VertexInput` describing the vertex input stage."); - VertexInput m_VtxIn; + DOCUMENT("A :class:`GLVertexInput` describing the vertex input stage."); + VertexInput vertexInput; - DOCUMENT("A :class:`GL_Shader` describing the vertex shader stage."); - Shader m_VS; - DOCUMENT("A :class:`GL_Shader` describing the tessellation control shader stage."); - Shader m_TCS; - DOCUMENT("A :class:`GL_Shader` describing the tessellation evaluation shader stage."); - Shader m_TES; - DOCUMENT("A :class:`GL_Shader` describing the geometry shader stage."); - Shader m_GS; - DOCUMENT("A :class:`GL_Shader` describing the fragment shader stage."); - Shader m_FS; - DOCUMENT("A :class:`GL_Shader` describing the compute shader stage."); - Shader m_CS; + DOCUMENT("A :class:`GLShader` describing the vertex shader stage."); + Shader vertexShader; + DOCUMENT("A :class:`GLShader` describing the tessellation control shader stage."); + Shader tessControlShader; + DOCUMENT("A :class:`GLShader` describing the tessellation evaluation shader stage."); + Shader tessEvalShader; + DOCUMENT("A :class:`GLShader` describing the geometry shader stage."); + Shader geometryShader; + DOCUMENT("A :class:`GLShader` describing the fragment shader stage."); + Shader fragmentShader; + DOCUMENT("A :class:`GLShader` describing the compute shader stage."); + Shader computeShader; DOCUMENT("The :class:`ResourceId` of the program pipeline (if active)."); - ResourceId Pipeline; + ResourceId pipelineResourceId; DOCUMENT( - "A :class:`GL_FixedVertexProcessing` describing the fixed-function vertex processing stage."); - FixedVertexProcessing m_VtxProcess; + "A :class:`GLFixedVertexProcessing` describing the fixed-function vertex processing stage."); + FixedVertexProcessing vertexProcessing; - DOCUMENT("A list of :class:`GL_Texture` with the currently bound textures."); - rdcarray Textures; - DOCUMENT("A list of :class:`GL_Sampler` with the currently bound samplers."); - rdcarray Samplers; + DOCUMENT("A list of :class:`GLTexture` with the currently bound textures."); + rdcarray textures; + DOCUMENT("A list of :class:`GLSampler` with the currently bound samplers."); + rdcarray samplers; - DOCUMENT("A list of :class:`GL_Buffer` with the currently bound atomic buffers."); - rdcarray AtomicBuffers; - DOCUMENT("A list of :class:`GL_Buffer` with the currently bound uniform buffers."); - rdcarray UniformBuffers; - DOCUMENT("A list of :class:`GL_Buffer` with the currently bound shader storage buffers."); - rdcarray ShaderStorageBuffers; + DOCUMENT("A list of :class:`GLBuffer` with the currently bound atomic buffers."); + rdcarray atomicBuffers; + DOCUMENT("A list of :class:`GLBuffer` with the currently bound uniform buffers."); + rdcarray uniformBuffers; + DOCUMENT("A list of :class:`GLBuffer` with the currently bound shader storage buffers."); + rdcarray shaderStorageBuffers; - DOCUMENT("A list of :class:`GL_ImageLoadStore` with the currently bound load/store images."); - rdcarray Images; + DOCUMENT("A list of :class:`GLImageLoadStore` with the currently bound load/store images."); + rdcarray images; - DOCUMENT("A :class:`GL_Feedback` describing the transform feedback stage."); - Feedback m_Feedback; + DOCUMENT("A :class:`GLFeedback` describing the transform feedback stage."); + Feedback transformFeedback; - DOCUMENT("A :class:`GL_Rasterizer` describing rasterization."); - Rasterizer m_Rasterizer; + DOCUMENT("A :class:`GLRasterizer` describing rasterization."); + Rasterizer rasterizer; - DOCUMENT("A :class:`GL_DepthState` describing depth processing."); - DepthState m_DepthState; + DOCUMENT("A :class:`GLDepthState` describing depth processing."); + DepthState depthState; - DOCUMENT("A :class:`GL_StencilState` describing stencil processing."); - StencilState m_StencilState; + DOCUMENT("A :class:`GLStencilState` describing stencil processing."); + StencilState stencilState; - DOCUMENT("A :class:`GL_FrameBuffer` describing the framebuffer."); - FrameBuffer m_FB; + DOCUMENT("A :class:`GLFrameBuffer` describing the framebuffer."); + FrameBuffer framebuffer; - DOCUMENT("A :class:`GL_Hints` describing the hint state."); - Hints m_Hints; + DOCUMENT("A :class:`GLHints` describing the hint state."); + Hints hints; }; }; // namespace GLPipe DECLARE_REFLECTION_STRUCT(GLPipe::VertexAttribute); -DECLARE_REFLECTION_STRUCT(GLPipe::VB); +DECLARE_REFLECTION_STRUCT(GLPipe::VertexBuffer); DECLARE_REFLECTION_STRUCT(GLPipe::VertexInput); DECLARE_REFLECTION_STRUCT(GLPipe::Shader); DECLARE_REFLECTION_STRUCT(GLPipe::FixedVertexProcessing); @@ -845,17 +693,12 @@ DECLARE_REFLECTION_STRUCT(GLPipe::Sampler); DECLARE_REFLECTION_STRUCT(GLPipe::Buffer); DECLARE_REFLECTION_STRUCT(GLPipe::ImageLoadStore); DECLARE_REFLECTION_STRUCT(GLPipe::Feedback); -DECLARE_REFLECTION_STRUCT(GLPipe::Viewport); -DECLARE_REFLECTION_STRUCT(GLPipe::Scissor); DECLARE_REFLECTION_STRUCT(GLPipe::RasterizerState); DECLARE_REFLECTION_STRUCT(GLPipe::Rasterizer); DECLARE_REFLECTION_STRUCT(GLPipe::DepthState); -DECLARE_REFLECTION_STRUCT(GLPipe::StencilFace); DECLARE_REFLECTION_STRUCT(GLPipe::StencilState); DECLARE_REFLECTION_STRUCT(GLPipe::Attachment); DECLARE_REFLECTION_STRUCT(GLPipe::FBO); -DECLARE_REFLECTION_STRUCT(GLPipe::BlendEquation); -DECLARE_REFLECTION_STRUCT(GLPipe::Blend); DECLARE_REFLECTION_STRUCT(GLPipe::BlendState); DECLARE_REFLECTION_STRUCT(GLPipe::FrameBuffer); DECLARE_REFLECTION_STRUCT(GLPipe::Hints); diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index fc191b3c3..d5cbcedd9 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -444,11 +444,11 @@ Should only be called for texture outputs. :param WindowingSystem system: The type of native window handle data being provided. :param data: The native window data, in a format defined by the system. :type data: opaque void * pointer. -:param ResourceId texID: The texture ID to display in the thumbnail preview. +:param ResourceId textureId: The texture ID to display in the thumbnail preview. :return: A boolean indicating if the thumbnail was successfully created. :rtype: ``bool`` )"); - virtual bool AddThumbnail(WindowingSystem system, void *data, ResourceId texID, + virtual bool AddThumbnail(WindowingSystem system, void *data, ResourceId textureId, CompType typeHint) = 0; DOCUMENT(R"(Render to the window handle specified when the output was created. @@ -533,7 +533,7 @@ Should only be called for texture outputs. Should only be called for texture outputs. -:param ResourceId texID: The texture to pick the pixel from. +:param ResourceId textureId: The texture to pick the pixel from. :param bool customShader: Whether to apply the configured custom shader. :param int x: The x co-ordinate to pick from. :param int y: The y co-ordinate to pick from. @@ -543,7 +543,7 @@ Should only be called for texture outputs. :return: The contents of the pixel. :rtype: PixelValue )"); - virtual PixelValue PickPixel(ResourceId texID, bool customShader, uint32_t x, uint32_t y, + virtual PixelValue PickPixel(ResourceId textureId, bool customShader, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip, uint32_t sample) = 0; DOCUMENT(R"(Retrieves the vertex and instance that is under the cursor location, when viewed @@ -551,14 +551,14 @@ relative to the current window with the current mesh display configuration. Should only be called for mesh outputs. -:param int eventID: The event ID to pick at. +:param int eventId: The event ID to pick at. :param int x: The x co-ordinate to pick from. :param int y: The y co-ordinate to pick from. :return: A tuple with the first value being the vertex index in the mesh, and the second value being the instance index. The values are set to :data:`NoResult` if no vertex was found, :rtype: ``tuple`` of ``int`` and ``int`` )"); - virtual rdcpair PickVertex(uint32_t eventID, uint32_t x, uint32_t y) = 0; + virtual rdcpair PickVertex(uint32_t eventId, uint32_t x, uint32_t y) = 0; static const uint32_t NoResult = ~0U; @@ -572,7 +572,7 @@ well as control the replay and analysis functionality available. .. data:: NoPreference - No preference for a particular value, see :meth:`DebugPixel`. + No preference for a particular value, see :meth:`ReplayController.DebugPixel`. )"); struct IReplayController { @@ -607,7 +607,7 @@ struct IReplayController DOCUMENT(R"(Goes into a blocking loop, repeatedly replaying the open capture as fast as possible, displaying the selected texture in a default unscaled manner to the given output window. -The function won't return until :meth:`CancelLoop` is called. Since this function is blocking, that +The function won't return until :meth:`CancelReplayLoop` is called. Since this function is blocking, that function must be called from another thread. :param WindowingSystem system: The type of native window handle data being provided @@ -624,51 +624,51 @@ function must be called from another thread. virtual void FileChanged() = 0; DOCUMENT(R"(Move the replay to reflect the state immediately *after* the given -:data:`EID `. +:data:`eventId `. -:param int eventID: The :data:`EID ` to move to. -:param bool force: ``True`` if the internal replay should refresh even if the ``eventID`` is +:param int eventId: The :data:`eventId ` to move to. +:param bool force: ``True`` if the internal replay should refresh even if the ``eventId`` is already current. This can be useful if external factors might cause the replay to vary. )"); - virtual void SetFrameEvent(uint32_t eventID, bool force) = 0; + virtual void SetFrameEvent(uint32_t eventId, bool force) = 0; - DOCUMENT(R"(Retrieve the current :class:`D3D11_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`D3D11State` pipeline state. This pipeline state will be filled with default values if the capture is not using the D3D11 API. You should use :meth:`GetAPIProperties` to determine the API of the capture. :return: The current D3D11 pipeline state. -:rtype: D3D11_State +:rtype: D3D11State )"); virtual const D3D11Pipe::State &GetD3D11PipelineState() = 0; - DOCUMENT(R"(Retrieve the current :class:`D3D12_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`D3D12State` pipeline state. This pipeline state will be filled with default values if the capture is not using the D3D12 API. You should use :meth:`GetAPIProperties` to determine the API of the capture. :return: The current D3D12 pipeline state. -:rtype: D3D12_State +:rtype: D3D12State )"); virtual const D3D12Pipe::State &GetD3D12PipelineState() = 0; - DOCUMENT(R"(Retrieve the current :class:`GL_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`GLState` pipeline state. This pipeline state will be filled with default values if the capture is not using the OpenGL API. You should use :meth:`GetAPIProperties` to determine the API of the capture. :return: The current OpenGL pipeline state. -:rtype: GL_State +:rtype: GLState )"); virtual const GLPipe::State &GetGLPipelineState() = 0; - DOCUMENT(R"(Retrieve the current :class:`VK_State` pipeline state. + DOCUMENT(R"(Retrieve the current :class:`VKState` pipeline state. This pipeline state will be filled with default values if the capture is not using the Vulkan API. You should use :meth:`GetAPIProperties` to determine the API of the capture. :return: The current Vulkan pipeline state. -:rtype: VK_State +:rtype: VKState )"); virtual const VKPipe::State &GetVulkanPipelineState() = 0; @@ -698,7 +698,7 @@ or hardware-specific ISA formats. The language used is native to the local renderer - HLSL for D3D based renderers, GLSL otherwise. -See :data:`TextureDisplay.CustomShader`. +See :data:`TextureDisplay.customShaderId`. :param str entry: The entry point to use when compiling. :param str source: The source file. @@ -804,11 +804,11 @@ implementation. DOCUMENT(R"(Get information about what a counter actually represents, in terms of a human-readable understanding as well as the type and unit of the resulting information. -:param GPUCounter counterID: The counter to query about. +:param GPUCounter counter: The counter to query about. :return: The description of the counter. :rtype: CounterDescription )"); - virtual CounterDescription DescribeCounter(GPUCounter counterID) = 0; + virtual CounterDescription DescribeCounter(GPUCounter counter) = 0; DOCUMENT(R"(Retrieve the list of all resources in the capture. @@ -939,7 +939,7 @@ otherwise. :param ResourceId shader: The id of the shader to use for metadata. :param str entryPoint: The entry point of the shader being used. In some APIs, this is ignored. -:param int cbufslot: The index in the :data:`ShaderReflection.ConstantBlocks` list to look up. +:param int cbufslot: The index in the :data:`ShaderReflection.constantBlocks` list to look up. :param ResourceId buffer: The id of the buffer to use for data. If :data:`ConstantBlock.bufferBacked` is ``False`` this is ignored. :param int offs: Retrieve buffer contents starting at this byte offset. @@ -963,12 +963,12 @@ texture to something compatible with the target file format. DOCUMENT(R"(Retrieve the generated data from one of the geometry processing shader stages. -:param int instID: The index of the instance to retrieve data for. +:param int instance: The index of the instance to retrieve data for. :param MeshDataStage stage: The stage of the geometry processing pipeline to retrieve data from. :return: The information describing where the post-transform data is stored. :rtype: MeshFormat )"); - virtual MeshFormat GetPostVSData(uint32_t instID, MeshDataStage stage) = 0; + virtual MeshFormat GetPostVSData(uint32_t instance, MeshDataStage stage) = 0; DOCUMENT(R"(Retrieve the contents of a range of a buffer as a ``bytes``. @@ -1065,16 +1065,16 @@ begin a capture is begun, and it ends when this frame number ends. DOCUMENT(R"(Begin copying a given capture stored on a remote machine to the local machine over the target control connection. -:param int remoteID: The identifier of the remote capture. +:param int captureId: The identifier of the remote capture. :param str localpath: The absolute path on the local system where the file should be saved. )"); - virtual void CopyCapture(uint32_t remoteID, const char *localpath) = 0; + virtual void CopyCapture(uint32_t captureId, const char *localpath) = 0; DOCUMENT(R"(Delete a capture from the remote machine. -:param int remoteID: The identifier of the remote capture. +:param int captureId: The identifier of the remote capture. )"); - virtual void DeleteCapture(uint32_t remoteID) = 0; + virtual void DeleteCapture(uint32_t captureId) = 0; DOCUMENT(R"(Query to see if a message has been received from the remote system. @@ -1134,7 +1134,7 @@ This index should not be cached, as writing sections could re-order the indices. :param int index: The index of the section. :return: The properties of the section, if the index is valid. -:rtype: SectionProperties. +:rtype: SectionProperties )"); virtual SectionProperties GetSectionProperties(int index) = 0; @@ -1199,7 +1199,7 @@ much work as possible happening on the local machine. .. data:: NoPreference - No preference for a particular value, see :meth:`DebugPixel`. + No preference for a particular value, see :meth:`ReplayController.DebugPixel`. )"); struct IRemoteServer : public ICaptureAccess { @@ -1459,8 +1459,8 @@ replay support. This function may only be called if the handle is 'empty' - i.e. no file has been opened with :meth:`OpenFile` or :meth:`OpenBuffer`. -.. note:: The only supported values for :paramref:`SetMetadata.thumbType` are :data:`FileType.JPG`, - :data:`FileType.PNG`, :data:`FileType.TGA`, and :data:`FileType.BMP`. +.. note:: The only supported values for :paramref:`SetMetadata.thumbType` are :attr:`FileType.JPG`, + :attr:`FileType.PNG`, :attr:`FileType.TGA`, and :attr:`FileType.BMP`. :param str driverName: The name of the driver. Must be a recognised driver name (even if replay support for that driver is not compiled in locally. @@ -1518,8 +1518,8 @@ The data is copied internally so it can be destroyed after calling this function DOCUMENT(R"(Retrieves the embedded thumbnail from the capture. -.. note:: The only supported values for :paramref:`GetThumbnail.type` are :data:`FileType.JPG`, - :data:`FileType.PNG`, :data:`FileType.TGA`, and :data:`FileType.BMP`. +.. note:: The only supported values for :paramref:`GetThumbnail.type` are :attr:`FileType.JPG`, + :attr:`FileType.PNG`, :attr:`FileType.TGA`, and :attr:`FileType.BMP`. :param FileType type: The image format to convert the thumbnail to. :param int maxsize: The largest width or height allowed. If the thumbnail is larger, it's resized. @@ -1685,7 +1685,7 @@ This function returns a new handle to a capture file. Once initialised by openin can only be shut-down, it is not re-usable. :return: A handle to the specified path. -:rtype: ICaptureFile +:rtype: CaptureFile )"); extern "C" RENDERDOC_API ICaptureFile *RENDERDOC_CC RENDERDOC_OpenCaptureFile(); diff --git a/renderdoc/api/replay/renderdoc_tostr.inl b/renderdoc/api/replay/renderdoc_tostr.inl index fa6588ae7..86985255c 100644 --- a/renderdoc/api/replay/renderdoc_tostr.inl +++ b/renderdoc/api/replay/renderdoc_tostr.inl @@ -252,9 +252,9 @@ std::string DoStringise(const FilterMode &el) } template <> -std::string DoStringise(const FilterFunc &el) +std::string DoStringise(const FilterFunction &el) { - BEGIN_ENUM_STRINGISE(FilterFunc) + BEGIN_ENUM_STRINGISE(FilterFunction) { STRINGISE_ENUM_CLASS(Normal); STRINGISE_ENUM_CLASS(Comparison); @@ -265,9 +265,9 @@ std::string DoStringise(const FilterFunc &el) } template <> -std::string DoStringise(const CompareFunc &el) +std::string DoStringise(const CompareFunction &el) { - BEGIN_ENUM_STRINGISE(CompareFunc) + BEGIN_ENUM_STRINGISE(CompareFunction) { STRINGISE_ENUM_CLASS_NAMED(Never, "Never"); STRINGISE_ENUM_CLASS_NAMED(AlwaysTrue, "Always"); @@ -310,9 +310,9 @@ std::string DoStringise(const BlendMultiplier &el) } template <> -std::string DoStringise(const BlendOp &el) +std::string DoStringise(const BlendOperation &el) { - BEGIN_ENUM_STRINGISE(BlendOp) + BEGIN_ENUM_STRINGISE(BlendOperation) { STRINGISE_ENUM_CLASS_NAMED(Add, "Add"); STRINGISE_ENUM_CLASS_NAMED(Subtract, "Subtract"); @@ -324,9 +324,9 @@ std::string DoStringise(const BlendOp &el) } template <> -std::string DoStringise(const StencilOp &el) +std::string DoStringise(const StencilOperation &el) { - BEGIN_ENUM_STRINGISE(StencilOp) + BEGIN_ENUM_STRINGISE(StencilOperation) { STRINGISE_ENUM_CLASS_NAMED(Keep, "Keep"); STRINGISE_ENUM_CLASS_NAMED(Zero, "Zero"); @@ -341,9 +341,9 @@ std::string DoStringise(const StencilOp &el) } template <> -std::string DoStringise(const LogicOp &el) +std::string DoStringise(const LogicOperation &el) { - BEGIN_ENUM_STRINGISE(LogicOp) + BEGIN_ENUM_STRINGISE(LogicOperation) { STRINGISE_ENUM_CLASS_NAMED(NoOp, "No-Op"); STRINGISE_ENUM_CLASS_NAMED(Clear, "Clear"); @@ -451,9 +451,9 @@ std::string DoStringise(const ResourceType &el) } template <> -std::string DoStringise(const TextureDim &el) +std::string DoStringise(const TextureType &el) { - BEGIN_ENUM_STRINGISE(TextureDim) + BEGIN_ENUM_STRINGISE(TextureType) { STRINGISE_ENUM_CLASS_NAMED(Unknown, "Unknown"); STRINGISE_ENUM_CLASS_NAMED(Buffer, "Buffer"); diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 314487224..aa1aa7953 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -254,7 +254,7 @@ DOCUMENT(R"(A texture addressing mode in a single direction (U,V or W). .. data:: ClampBorder The texture is clamped such that texture co-ordinates outside the range of ``[0.0, 1.0]`` are set - to the border colour specified in the sampler. + to the border color specified in the sampler. )"); enum class AddressMode : uint32_t { @@ -438,7 +438,7 @@ DOCUMENT(R"(The dimensionality of a texture binding. A Cubemap texture array. )"); -enum class TextureDim : uint32_t +enum class TextureType : uint32_t { Unknown, First = Unknown, @@ -456,8 +456,8 @@ enum class TextureDim : uint32_t Count, }; -ITERABLE_OPERATORS(TextureDim); -DECLARE_REFLECTION_ENUM(TextureDim); +ITERABLE_OPERATORS(TextureType); +DECLARE_REFLECTION_ENUM(TextureType); DOCUMENT(R"(The type of a shader resource bind. @@ -2031,7 +2031,7 @@ DOCUMENT(R"(What kind of solid shading to use when rendering a mesh. .. data:: Solid - The mesh should be rendered in a single flat unshaded colour. + The mesh should be rendered in a single flat unshaded color. .. data:: Lit @@ -2039,7 +2039,7 @@ DOCUMENT(R"(What kind of solid shading to use when rendering a mesh. .. data:: Secondary - The mesh should be rendered using the secondary element as colour. + The mesh should be rendered using the secondary element as color. )"); enum class SolidShade : uint32_t @@ -2164,7 +2164,7 @@ DOCUMENT(R"(The function used to process the returned value after interpolation. Texels that were weight to 0 during interpolation are not included in the max function. )"); -enum class FilterFunc : uint32_t +enum class FilterFunction : uint32_t { Normal, Comparison, @@ -2172,7 +2172,7 @@ enum class FilterFunc : uint32_t Maximum, }; -DECLARE_REFLECTION_ENUM(FilterFunc); +DECLARE_REFLECTION_ENUM(FilterFunction); DOCUMENT(R"(A comparison function to return a ``bool`` result from two inputs ``A`` and ``B``. @@ -2209,7 +2209,7 @@ DOCUMENT(R"(A comparison function to return a ``bool`` result from two inputs `` ``A != B`` )"); -enum class CompareFunc : uint32_t +enum class CompareFunction : uint32_t { Never, AlwaysTrue, @@ -2221,7 +2221,7 @@ enum class CompareFunc : uint32_t NotEqual, }; -DECLARE_REFLECTION_ENUM(CompareFunc); +DECLARE_REFLECTION_ENUM(CompareFunction); DOCUMENT(R"(A stencil operation to apply in stencil processing. @@ -2257,7 +2257,7 @@ DOCUMENT(R"(A stencil operation to apply in stencil processing. Invert the bits in the stencil value (bitwise ``NOT``). )"); -enum class StencilOp : uint32_t +enum class StencilOperation : uint32_t { Keep, Zero, @@ -2269,7 +2269,7 @@ enum class StencilOp : uint32_t Invert, }; -DECLARE_REFLECTION_ENUM(StencilOp); +DECLARE_REFLECTION_ENUM(StencilOperation); DOCUMENT(R"(A multiplier on one component in the blend equation. @@ -2279,7 +2279,7 @@ DOCUMENT(R"(A multiplier on one component in the blend equation. The "destination" value is the value in the target being blended to. - These values are combined using a given blend operation, see :class:`BlendOp`. + These values are combined using a given blend operation, see :class:`BlendOperation`. Where a color is referenced, the value depends on where the multiplier appears in the blend equation. If it is a multiplier on the color component then it refers to the color component. If @@ -2333,11 +2333,11 @@ DOCUMENT(R"(A multiplier on one component in the blend equation. .. data:: FactorRGB - The colour components of the fixed blend factor constant. + The color components of the fixed blend factor constant. .. data:: InvFactorRGB - ``1.0`` minus the colour components of the fixed blend factor constant. + ``1.0`` minus the color components of the fixed blend factor constant. .. data:: FactorAlpha @@ -2388,7 +2388,7 @@ enum class BlendMultiplier : uint32_t DECLARE_REFLECTION_ENUM(BlendMultiplier); -DOCUMENT(R"(A blending operation to apply in colour blending. +DOCUMENT(R"(A blending operation to apply in color blending. .. note:: The "source" value is the value written out by the shader. @@ -2416,7 +2416,7 @@ DOCUMENT(R"(A blending operation to apply in colour blending. The maximum of the source and destination value. )"); -enum class BlendOp : uint32_t +enum class BlendOperation : uint32_t { Add, Subtract, @@ -2425,7 +2425,7 @@ enum class BlendOp : uint32_t Maximum, }; -DECLARE_REFLECTION_ENUM(BlendOp); +DECLARE_REFLECTION_ENUM(BlendOperation); DOCUMENT(R"(A logical operation to apply when writing texture values to an output. @@ -2502,7 +2502,7 @@ DOCUMENT(R"(A logical operation to apply when writing texture values to an outpu The inverted source and destination values are combined with the bitwise ``OR`` operator - i.e. ``(NOT s) OR d``. )"); -enum class LogicOp : uint32_t +enum class LogicOperation : uint32_t { NoOp, Clear, @@ -2522,7 +2522,7 @@ enum class LogicOp : uint32_t OrInverted, }; -DECLARE_REFLECTION_ENUM(LogicOp); +DECLARE_REFLECTION_ENUM(LogicOperation); DOCUMENT(R"(Pre-defined GPU counters that can be supported by a given implementation. @@ -3382,7 +3382,7 @@ DOCUMENT(R"(A set of flags describing the properties of a particular drawcall. .. data:: ClearColor - The drawcall clears a colour target. + The drawcall clears a color target. .. data:: ClearDepthStencil diff --git a/renderdoc/api/replay/shader_types.h b/renderdoc/api/replay/shader_types.h index 712cf1f0a..2584288b0 100644 --- a/renderdoc/api/replay/shader_types.h +++ b/renderdoc/api/replay/shader_types.h @@ -273,9 +273,9 @@ struct ShaderDebugTrace DOCUMENT(R"(Constant variables for this shader as a list of :class:`ShaderValue` lists. Each entry in this list corresponds to a constant block with the same index in the -:data:`ShaderBindpointMapping.ConstantBlocks` list, which can be used to look up the metadata. +:data:`ShaderBindpointMapping.constantBlocks` list, which can be used to look up the metadata. )"); - rdcarray cbuffers; + rdcarray constantBlocks; DOCUMENT(R"(A list of :class:`ShaderDebugState` states representing the state after each instruction was executed @@ -390,9 +390,9 @@ struct ShaderVariableDescriptor DOCUMENT(""); bool operator==(const ShaderVariableDescriptor &o) const { - return type == o.type && rows == o.rows && cols == o.cols && + return type == o.type && rows == o.rows && columns == o.columns && rowMajorStorage == o.rowMajorStorage && elements == o.elements && - arrayStride == o.arrayStride && name == o.name; + arrayByteStride == o.arrayByteStride && name == o.name; } bool operator<(const ShaderVariableDescriptor &o) const { @@ -400,14 +400,14 @@ struct ShaderVariableDescriptor return type < o.type; if(!(rows == o.rows)) return rows < o.rows; - if(!(cols == o.cols)) - return cols < o.cols; + if(!(columns == o.columns)) + return columns < o.columns; if(!(rowMajorStorage == o.rowMajorStorage)) return rowMajorStorage < o.rowMajorStorage; if(!(elements == o.elements)) return elements < o.elements; - if(!(arrayStride == o.arrayStride)) - return arrayStride < o.arrayStride; + if(!(arrayByteStride == o.arrayByteStride)) + return arrayByteStride < o.arrayByteStride; if(!(name == o.name)) return name < o.name; return false; @@ -417,13 +417,13 @@ struct ShaderVariableDescriptor DOCUMENT("The number of rows in this matrix."); uint8_t rows; DOCUMENT("The number of columns in this matrix."); - uint8_t cols; + uint8_t columns; DOCUMENT("``True`` if the matrix is stored as row major instead of column major."); bool rowMajorStorage; DOCUMENT("The number of elements in the array, or 1 if it's not an array."); uint32_t elements; DOCUMENT("The number of bytes between the start of one element in the array and the next."); - uint32_t arrayStride; + uint32_t arrayByteStride; DOCUMENT("The name of the type of this constant, e.g. a ``struct`` name."); rdcstr name; }; @@ -542,7 +542,7 @@ struct ConstantBlock DOCUMENT("The constants contained within this block as a list of :class:`ShaderConstant`."); rdcarray variables; DOCUMENT(R"(The bindpoint for this block. This is an index in the -:data:`ShaderBindpointMapping.ConstantBlocks` list. +:data:`ShaderBindpointMapping.constantBlocks` list. )"); int32_t bindPoint; DOCUMENT("The total number of bytes consumed by all of the constants contained in this block."); @@ -581,7 +581,7 @@ struct ShaderSampler rdcstr name; DOCUMENT(R"(The bindpoint for this block. This is an index in either the -:data:`ShaderBindpointMapping.Samplers` list. +:data:`ShaderBindpointMapping.samplers` list. )"); int32_t bindPoint; }; @@ -600,7 +600,7 @@ struct ShaderResource bool operator==(const ShaderResource &o) const { return resType == o.resType && name == o.name && variableType == o.variableType && - bindPoint == o.bindPoint && IsTexture == o.IsTexture && IsReadOnly == o.IsReadOnly; + bindPoint == o.bindPoint && isTexture == o.isTexture && isReadOnly == o.isReadOnly; } bool operator<(const ShaderResource &o) const { @@ -612,14 +612,14 @@ struct ShaderResource return variableType < o.variableType; if(!(bindPoint == o.bindPoint)) return bindPoint < o.bindPoint; - if(!(IsTexture == o.IsTexture)) - return IsTexture < o.IsTexture; - if(!(IsReadOnly == o.IsReadOnly)) - return IsReadOnly < o.IsReadOnly; + if(!(isTexture == o.isTexture)) + return isTexture < o.isTexture; + if(!(isReadOnly == o.isReadOnly)) + return isReadOnly < o.isReadOnly; return false; } - DOCUMENT("The :class:`TextureDim` that describes the type of this resource."); - TextureDim resType; + DOCUMENT("The :class:`TextureType` that describes the type of this resource."); + TextureType resType; DOCUMENT("The name of this resource."); rdcstr name; @@ -628,19 +628,17 @@ struct ShaderResource ShaderVariableType variableType; DOCUMENT(R"(The bindpoint for this block. This is an index in either the -:data:`ShaderBindpointMapping.ReadOnlyResources` list or -:data:`ShaderBindpointMapping.ReadWriteResources` list as appropriate (see :data:`IsReadOnly`). +:data:`ShaderBindpointMapping.readOnlyResources` list or +:data:`ShaderBindpointMapping.readWriteResources` list as appropriate (see :data:`isReadOnly`). )"); int32_t bindPoint; - DOCUMENT(R"(``True`` if this resource is a texture, otherwise it is a buffer or sampler (see -:data:`IsSampler`). -)"); - bool IsTexture; + DOCUMENT("``True`` if this resource is a texture, otherwise it is a buffer."); + bool isTexture; DOCUMENT(R"(``True`` if this resource is available to the shader for reading only, otherwise it is able to be read from and written to arbitrarily. )"); - bool IsReadOnly; + bool isReadOnly; }; DECLARE_REFLECTION_STRUCT(ShaderResource); @@ -671,20 +669,20 @@ DOCUMENT("Contains a single flag used at compile-time on a shader."); struct ShaderCompileFlag { DOCUMENT(""); - bool operator==(const ShaderCompileFlag &o) const { return Name == o.Name && Value == o.Value; } + bool operator==(const ShaderCompileFlag &o) const { return name == o.name && value == o.value; } bool operator<(const ShaderCompileFlag &o) const { - if(!(Name == o.Name)) - return Name < o.Name; - if(!(Value == o.Value)) - return Value < o.Value; + if(!(name == o.name)) + return name < o.name; + if(!(value == o.value)) + return value < o.value; return false; } DOCUMENT("The name of the compile flag."); - rdcstr Name; + rdcstr name; DOCUMENT("The value of the compile flag."); - rdcstr Value; + rdcstr value; }; DECLARE_REFLECTION_STRUCT(ShaderCompileFlag); @@ -707,21 +705,21 @@ struct ShaderSourceFile DOCUMENT(""); bool operator==(const ShaderSourceFile &o) const { - return Filename == o.Filename && Contents == o.Contents; + return filename == o.filename && contents == o.contents; } bool operator<(const ShaderSourceFile &o) const { - if(!(Filename == o.Filename)) - return Filename < o.Filename; - if(!(Contents == o.Contents)) - return Contents < o.Contents; + if(!(filename == o.filename)) + return filename < o.filename; + if(!(contents == o.contents)) + return contents < o.contents; return false; } DOCUMENT("The filename of this source file."); - rdcstr Filename; + rdcstr filename; DOCUMENT("The actual contents of the file."); - rdcstr Contents; + rdcstr contents; }; DECLARE_REFLECTION_STRUCT(ShaderSourceFile); @@ -731,9 +729,9 @@ information attached to the shader. Primarily this means the embedded original source files. )"); -struct ShaderDebugChunk +struct ShaderDebugInfo { - ShaderDebugChunk() {} + ShaderDebugInfo() {} DOCUMENT("A :class:`ShaderCompileFlags` containing the flags used to compile this shader."); ShaderCompileFlags compileFlags; @@ -744,7 +742,7 @@ The first entry in the list is always the file where the entry point is. rdcarray files; }; -DECLARE_REFLECTION_STRUCT(ShaderDebugChunk); +DECLARE_REFLECTION_STRUCT(ShaderDebugInfo); DOCUMENT(R"(The reflection and metadata fully describing a shader. @@ -755,44 +753,44 @@ and resource binding scheme. struct ShaderReflection { DOCUMENT("The :class:`ResourceId` of this shader."); - ResourceId ID; + ResourceId resourceId; DOCUMENT("The entry point in the shader for this reflection, if multiple entry points exist."); - rdcstr EntryPoint; + rdcstr entryPoint; DOCUMENT( "The :class:`ShaderStage` that this shader corresponds to, if multiple entry points exist."); - ShaderStage Stage; + ShaderStage stage; DOCUMENT( - "A :class:`ShaderDebugChunk` containing any embedded debugging information in this shader."); - ShaderDebugChunk DebugInfo; + "A :class:`ShaderDebugInfo` containing any embedded debugging information in this shader."); + ShaderDebugInfo debugInfo; DOCUMENT("A raw ``bytes`` dump of the original shader, encoded in API specific binary form."); - bytebuf RawBytes; + bytebuf rawBytes; DOCUMENT("The 3D dimensions of a compute workgroup, for compute shaders."); - uint32_t DispatchThreadsDimension[3]; + uint32_t dispatchThreadsDimension[3]; DOCUMENT("A list of :class:`SigParameter` with the shader's input signature."); - rdcarray InputSig; + rdcarray inputSignature; DOCUMENT("A list of :class:`SigParameter` with the shader's output signature."); - rdcarray OutputSig; + rdcarray outputSignature; DOCUMENT("A list of :class:`ConstantBlock` with the shader's constant bindings."); - rdcarray ConstantBlocks; + rdcarray constantBlocks; DOCUMENT("A list of :class:`ShaderSampler` with the shader's samplers."); - rdcarray Samplers; + rdcarray samplers; DOCUMENT("A list of :class:`ShaderResource` with the shader's read-only resources."); - rdcarray ReadOnlyResources; + rdcarray readOnlyResources; DOCUMENT("A list of :class:`ShaderResource` with the shader's read-write resources."); - rdcarray ReadWriteResources; + rdcarray readWriteResources; // TODO expand this to encompass shader subroutines. DOCUMENT("A list of strings with the shader's interfaces. Largely an unused API feature."); - rdcarray Interfaces; + rdcarray interfaces; }; DECLARE_REFLECTION_STRUCT(ShaderReflection); @@ -801,10 +799,10 @@ DOCUMENT(R"(Declares the binding information for a single resource binding. See :class:`ShaderBindpointMapping` for how this mapping works in detail. )"); -struct BindpointMap +struct Bindpoint { DOCUMENT(""); - BindpointMap() + Bindpoint() { bindset = 0; bind = 0; @@ -812,7 +810,7 @@ struct BindpointMap arraySize = 1; } - BindpointMap(int32_t s, int32_t b) + Bindpoint(int32_t s, int32_t b) { bindset = s; bind = b; @@ -820,13 +818,13 @@ struct BindpointMap arraySize = 1; } - bool operator<(const BindpointMap &o) const + bool operator<(const Bindpoint &o) const { if(!(bindset == o.bindset)) return bindset < o.bindset; return bind < o.bind; } - bool operator==(const BindpointMap &o) const { return bindset == o.bindset && bind == o.bind; } + bool operator==(const Bindpoint &o) const { return bindset == o.bindset && bind == o.bind; } DOCUMENT("The binding set."); int32_t bindset; DOCUMENT("The binding index."); @@ -838,7 +836,7 @@ struct BindpointMap bool used; }; -DECLARE_REFLECTION_STRUCT(BindpointMap); +DECLARE_REFLECTION_STRUCT(Bindpoint); DOCUMENT(R"(This structure goes hand in hand with :class:`ShaderReflection` to determine how to map from bindpoint indices in the resource lists there to API-specific binding points. The ``bindPoint`` @@ -848,62 +846,62 @@ API registers, indices, or slots. API specific details: -* Direct3D11 - All :data:`BindpointMap.bindset` values are 0 as D3D11 has no notion of sets, and the +* Direct3D11 - All :data:`Bindpoint.bindset` values are 0 as D3D11 has no notion of sets, and the only namespacing that exists is by shader stage and object type. Mostly this already exists with the constant block, read only and read write resource lists. - :data:`BindpointMap.arraySize` is likewise unused as D3D11 doesn't have arrayed resource bindings. + :data:`Bindpoint.arraySize` is likewise unused as D3D11 doesn't have arrayed resource bindings. - :data:`BindpointMap.bind` refers to the register/slot binding within the appropriate type (SRVs for + :data:`Bindpoint.bind` refers to the register/slot binding within the appropriate type (SRVs for read-only resources, UAV for read-write resources, samplers/constant buffers in each type). -* OpenGL - Similarly to D3D11, :data:`BindpointMap.bindset` and :data:`BindpointMap.arraySize` are +* OpenGL - Similarly to D3D11, :data:`Bindpoint.bindset` and :data:`Bindpoint.arraySize` are unused as OpenGL does not have true binding sets or array resource binds. - For OpenGL there may be many more duplicate :class:`BindpointMap` objects as the - :data:`BindpointMap.bind` refers to the index in the type-specific list, which is much more + For OpenGL there may be many more duplicate :class:`Bindpoint` objects as the + :data:`Bindpoint.bind` refers to the index in the type-specific list, which is much more granular on OpenGL. E.g. ``0`` may refer to images, storage buffers, and atomic buffers all within - the :data:`ReadWriteResources` list. The index is the uniform value of the binding. Since no + the :data:`readWriteResources` list. The index is the uniform value of the binding. Since no objects are namespaced by shader stage, the same value in two shaders refers to the same binding. * Direct3D12 - Since D3D12 doesn't have true resource arrays (they are linearised into sequential - registers) :data:`BindpointMap.arraySize` is not used. + registers) :data:`Bindpoint.arraySize` is not used. - :data:`BindpointMap.bindset` corresponds to register spaces, with :data:`BindpointMap.bind` then + :data:`Bindpoint.bindset` corresponds to register spaces, with :data:`Bindpoint.bind` then mapping to the register within that space. The root signature then maps these registers to descriptors. -* Vulkan - For Vulkan :data:`BindpointMap.bindset` corresponds to the index of the descriptor set, - and :data:`BindpointMap.bind` refers to the index of the descriptor within that set. - :data:`BindpointMap.arraySize` also is used as descriptors in Vulkan can be true arrays, bound all +* Vulkan - For Vulkan :data:`Bindpoint.bindset` corresponds to the index of the descriptor set, + and :data:`Bindpoint.bind` refers to the index of the descriptor within that set. + :data:`Bindpoint.arraySize` also is used as descriptors in Vulkan can be true arrays, bound all at once to a single binding. )"); struct ShaderBindpointMapping { DOCUMENT(R"(This maps input attributes as a simple swizzle on the -:data:`ShaderReflection.InputSig` indices for APIs where this mapping is mutable at runtime. +:data:`ShaderReflection.inputSignature` indices for APIs where this mapping is mutable at runtime. )"); - rdcarray InputAttributes; + rdcarray inputAttributes; - DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the -:data:`ShaderReflection.ConstantBlocks` list. + DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the +:data:`ShaderReflection.constantBlocks` list. )"); - rdcarray ConstantBlocks; + rdcarray constantBlocks; - DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the -:data:`ShaderReflection.Samplers` list. + DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the +:data:`ShaderReflection.samplers` list. )"); - rdcarray Samplers; + rdcarray samplers; - DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the -:data:`ShaderReflection.ReadOnlyResources` list. + DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the +:data:`ShaderReflection.readOnlyResources` list. )"); - rdcarray ReadOnlyResources; + rdcarray readOnlyResources; - DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the -:data:`ShaderReflection.ReadWriteResources` list. + DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the +:data:`ShaderReflection.readWriteResources` list. )"); - rdcarray ReadWriteResources; + rdcarray readWriteResources; }; DECLARE_REFLECTION_STRUCT(ShaderBindpointMapping); diff --git a/renderdoc/api/replay/structured_data.h b/renderdoc/api/replay/structured_data.h index feaade58e..20816eff1 100644 --- a/renderdoc/api/replay/structured_data.h +++ b/renderdoc/api/replay/structured_data.h @@ -341,7 +341,7 @@ struct SDObject SDObjectData data; DOCUMENT("Find a child object by a given name."); - inline SDObject *findChild(const char *childName) const + inline SDObject *FindChild(const char *childName) const { for(size_t i = 0; i < data.children.size(); i++) if(data.children[i]->name == childName) @@ -351,7 +351,7 @@ struct SDObject } DOCUMENT("Add a new child object by duplicating it."); - inline void addChild(SDObject *child) { data.children.push_back(child->Duplicate()); } + inline void AddChild(SDObject *child) { data.children.push_back(child->Duplicate()); } #if defined(RENDERDOC_QT_COMPAT) operator QVariant() const { @@ -646,7 +646,7 @@ struct SDFile DOCUMENT("The version of this structured stream, typically only used internally."); uint64_t version = 0; - inline void swap(SDFile &other) + inline void Swap(SDFile &other) { chunks.swap(other.chunks); buffers.swap(other.buffers); diff --git a/renderdoc/api/replay/vk_pipestate.h b/renderdoc/api/replay/vk_pipestate.h index 67853e9bc..0cc8aacaf 100644 --- a/renderdoc/api/replay/vk_pipestate.h +++ b/renderdoc/api/replay/vk_pipestate.h @@ -24,6 +24,8 @@ #pragma once +#include "common_pipestate.h" + namespace VKPipe { DOCUMENT("The contents of a single binding element within a descriptor set, possibly in an array."); @@ -32,30 +34,31 @@ struct BindingElement DOCUMENT(""); bool operator==(const BindingElement &o) const { - return view == o.view && res == o.res && sampler == o.sampler && - immutableSampler == o.immutableSampler && viewfmt == o.viewfmt && - swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && swizzle[2] == o.swizzle[2] && - swizzle[3] == o.swizzle[3] && baseMip == o.baseMip && baseLayer == o.baseLayer && - numMip == o.numMip && numLayer == o.numLayer && offset == o.offset && size == o.size && - Filter == o.Filter && AddressU == o.AddressU && AddressV == o.AddressV && - AddressW == o.AddressW && mipBias == o.mipBias && maxAniso == o.maxAniso && - comparison == o.comparison && minlod == o.minlod && maxlod == o.maxlod && - BorderColor[0] == o.BorderColor[0] && BorderColor[1] == o.BorderColor[1] && - BorderColor[2] == o.BorderColor[2] && BorderColor[3] == o.BorderColor[3] && + return viewResourceId == o.viewResourceId && resourceResourceId == o.resourceResourceId && + samplerResourceId == o.samplerResourceId && immutableSampler == o.immutableSampler && + viewFormat == o.viewFormat && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && + swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] && firstMip == o.firstMip && + firstSlice == o.firstSlice && numMips == o.numMips && numSlices == o.numSlices && + byteOffset == o.byteOffset && byteSize == o.byteSize && filter == o.filter && + addressU == o.addressU && addressV == o.addressV && addressW == o.addressW && + mipBias == o.mipBias && maxAnisotropy == o.maxAnisotropy && + compareFunction == o.compareFunction && minLOD == o.minLOD && maxLOD == o.maxLOD && + borderColor[0] == o.borderColor[0] && borderColor[1] == o.borderColor[1] && + borderColor[2] == o.borderColor[2] && borderColor[3] == o.borderColor[3] && unnormalized == o.unnormalized; } bool operator<(const BindingElement &o) const { - if(!(view == o.view)) - return view < o.view; - if(!(res == o.res)) - return res < o.res; - if(!(sampler == o.sampler)) - return sampler < o.sampler; + if(!(viewResourceId == o.viewResourceId)) + return viewResourceId < o.viewResourceId; + if(!(resourceResourceId == o.resourceResourceId)) + return resourceResourceId < o.resourceResourceId; + if(!(samplerResourceId == o.samplerResourceId)) + return samplerResourceId < o.samplerResourceId; if(!(immutableSampler == o.immutableSampler)) return immutableSampler < o.immutableSampler; - if(!(viewfmt == o.viewfmt)) - return viewfmt < o.viewfmt; + if(!(viewFormat == o.viewFormat)) + return viewFormat < o.viewFormat; if(!(swizzle[0] == o.swizzle[0])) return swizzle[0] < o.swizzle[0]; if(!(swizzle[1] == o.swizzle[1])) @@ -64,97 +67,99 @@ struct BindingElement return swizzle[2] < o.swizzle[2]; if(!(swizzle[3] == o.swizzle[3])) return swizzle[3] < o.swizzle[3]; - if(!(baseMip == o.baseMip)) - return baseMip < o.baseMip; - if(!(baseLayer == o.baseLayer)) - return baseLayer < o.baseLayer; - if(!(numMip == o.numMip)) - return numMip < o.numMip; - if(!(numLayer == o.numLayer)) - return numLayer < o.numLayer; - if(!(offset == o.offset)) - return offset < o.offset; - if(!(size == o.size)) - return size < o.size; - if(!(Filter == o.Filter)) - return Filter < o.Filter; - if(!(AddressU == o.AddressU)) - return AddressU < o.AddressU; - if(!(AddressV == o.AddressV)) - return AddressV < o.AddressV; - if(!(AddressW == o.AddressW)) - return AddressW < o.AddressW; + if(!(firstMip == o.firstMip)) + return firstMip < o.firstMip; + if(!(firstSlice == o.firstSlice)) + return firstSlice < o.firstSlice; + if(!(numMips == o.numMips)) + return numMips < o.numMips; + if(!(numSlices == o.numSlices)) + return numSlices < o.numSlices; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; + if(!(byteSize == o.byteSize)) + return byteSize < o.byteSize; + if(!(filter == o.filter)) + return filter < o.filter; + if(!(addressU == o.addressU)) + return addressU < o.addressU; + if(!(addressV == o.addressV)) + return addressV < o.addressV; + if(!(addressW == o.addressW)) + return addressW < o.addressW; if(!(mipBias == o.mipBias)) return mipBias < o.mipBias; - if(!(maxAniso == o.maxAniso)) - return maxAniso < o.maxAniso; - if(!(comparison == o.comparison)) - return comparison < o.comparison; - if(!(minlod == o.minlod)) - return minlod < o.minlod; - if(!(maxlod == o.maxlod)) - return maxlod < o.maxlod; - if(!(BorderColor[0] == o.BorderColor[0])) - return BorderColor[0] < o.BorderColor[0]; - if(!(BorderColor[1] == o.BorderColor[1])) - return BorderColor[1] < o.BorderColor[1]; - if(!(BorderColor[2] == o.BorderColor[2])) - return BorderColor[2] < o.BorderColor[2]; - if(!(BorderColor[3] == o.BorderColor[3])) - return BorderColor[3] < o.BorderColor[3]; + if(!(maxAnisotropy == o.maxAnisotropy)) + return maxAnisotropy < o.maxAnisotropy; + if(!(compareFunction == o.compareFunction)) + return compareFunction < o.compareFunction; + if(!(minLOD == o.minLOD)) + return minLOD < o.minLOD; + if(!(maxLOD == o.maxLOD)) + return maxLOD < o.maxLOD; + if(!(borderColor[0] == o.borderColor[0])) + return borderColor[0] < o.borderColor[0]; + if(!(borderColor[1] == o.borderColor[1])) + return borderColor[1] < o.borderColor[1]; + if(!(borderColor[2] == o.borderColor[2])) + return borderColor[2] < o.borderColor[2]; + if(!(borderColor[3] == o.borderColor[3])) + return borderColor[3] < o.borderColor[3]; if(!(unnormalized == o.unnormalized)) return unnormalized < o.unnormalized; return false; } DOCUMENT("The :class:`ResourceId` of the current view object, if one is in use."); - ResourceId view; // bufferview, imageview, attachmentview + ResourceId viewResourceId; // bufferview, imageview, attachmentview DOCUMENT("The :class:`ResourceId` of the current underlying buffer or image object."); - ResourceId res; // buffer, image, attachment + ResourceId resourceResourceId; // buffer, image, attachment DOCUMENT("The :class:`ResourceId` of the current sampler object."); - ResourceId sampler; + ResourceId samplerResourceId; DOCUMENT("``True`` if this is an immutable sampler binding."); bool immutableSampler = false; DOCUMENT("The :class:`ResourceFormat` that the view uses."); - ResourceFormat viewfmt; + ResourceFormat viewFormat; DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture."); TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, TextureSwizzle::Alpha}; + DOCUMENT("For textures - the first mip level used in the view."); - uint32_t baseMip = 0; - DOCUMENT("For 3D textures and texture arrays - the first slice used in the view."); - uint32_t baseLayer = 0; + uint32_t firstMip = 0; DOCUMENT("For textures - the number of mip levels in the view."); - uint32_t numMip = 0; + uint32_t numMips = 0; + + DOCUMENT("For 3D textures and texture arrays - the first slice used in the view."); + uint32_t firstSlice = 0; DOCUMENT("For 3D textures and texture arrays - the number of array slices in the view."); - uint32_t numLayer = 0; + uint32_t numSlices = 0; DOCUMENT("For buffers - the byte offset where the buffer view starts in the underlying buffer."); - uint64_t offset = 0; + uint64_t byteOffset = 0; DOCUMENT("For buffers - how many bytes are in this buffer view."); - uint64_t size = 0; + uint64_t byteSize = 0; DOCUMENT("For samplers - the :class:`TextureFilter` describing the filtering mode."); - TextureFilter Filter; + TextureFilter filter; DOCUMENT("For samplers - the :class:`AddressMode` in the U direction."); - AddressMode AddressU = AddressMode::Wrap; + AddressMode addressU = AddressMode::Wrap; DOCUMENT("For samplers - the :class:`AddressMode` in the V direction."); - AddressMode AddressV = AddressMode::Wrap; + AddressMode addressV = AddressMode::Wrap; DOCUMENT("For samplers - the :class:`AddressMode` in the W direction."); - AddressMode AddressW = AddressMode::Wrap; + AddressMode addressW = AddressMode::Wrap; DOCUMENT("For samplers - a bias to apply to the calculated mip level before sampling."); float mipBias = 0.0f; DOCUMENT("For samplers - the maximum anisotropic filtering level to use."); - float maxAniso = 0.0f; - DOCUMENT("For samplers - the :class:`CompareFunc` for comparison samplers."); - CompareFunc comparison = CompareFunc::AlwaysTrue; + float maxAnisotropy = 0.0f; + DOCUMENT("For samplers - the :class:`CompareFunction` for comparison samplers."); + CompareFunction compareFunction = CompareFunction::AlwaysTrue; DOCUMENT("For samplers - the minimum mip level that can be used."); - float minlod = 0.0f; + float minLOD = 0.0f; DOCUMENT("For samplers - the maximum mip level that can be used."); - float maxlod = 0.0f; + float maxLOD = 0.0f; DOCUMENT("For samplers - the RGBA border color."); - float BorderColor[4]; + float borderColor[4]; DOCUMENT("For samplers - ``True`` if unnormalized co-ordinates are used in this sampler."); bool unnormalized = false; @@ -165,8 +170,8 @@ struct BindingElement )"); bool UseBorder() const { - return AddressU == AddressMode::ClampBorder || AddressV == AddressMode::ClampBorder || - AddressW == AddressMode::ClampBorder; + return addressU == AddressMode::ClampBorder || addressV == AddressMode::ClampBorder || + addressW == AddressMode::ClampBorder; } }; @@ -200,7 +205,7 @@ If this binding is empty/non-existant this value will be ``0``. DOCUMENT("The :class:`ShaderStageMask` where this binding is visible."); ShaderStageMask stageFlags = ShaderStageMask::Unknown; - DOCUMENT(R"(A list of :class:`VK_BindingElement` with the binding elements. + DOCUMENT(R"(A list of :class:`VKBindingElement` with the binding elements. If :data:`descriptorCount` is 1 then this isn't an array, and this list has only one element. )"); rdcarray binds; @@ -212,24 +217,25 @@ struct DescriptorSet DOCUMENT(""); bool operator==(const DescriptorSet &o) const { - return layout == o.layout && descset == o.descset && bindings == o.bindings; + return layoutResourceId == o.layoutResourceId && + descriptorSetResourceId == o.descriptorSetResourceId && bindings == o.bindings; } bool operator<(const DescriptorSet &o) const { - if(!(layout == o.layout)) - return layout < o.layout; - if(!(descset == o.descset)) - return descset < o.descset; + if(!(layoutResourceId == o.layoutResourceId)) + return layoutResourceId < o.layoutResourceId; + if(!(descriptorSetResourceId == o.descriptorSetResourceId)) + return descriptorSetResourceId < o.descriptorSetResourceId; if(!(bindings == o.bindings)) return bindings < o.bindings; return false; } DOCUMENT("The :class:`ResourceId` of the descriptor set layout that matches this set."); - ResourceId layout; + ResourceId layoutResourceId; DOCUMENT("The :class:`ResourceId` of the descriptor set object."); - ResourceId descset; + ResourceId descriptorSetResourceId; - DOCUMENT(R"(A list of :class:`VK_DescriptorBinding` with the bindings within this set. + DOCUMENT(R"(A list of :class:`VKDescriptorBinding` with the bindings within this set. This list is indexed by the binding, so it may be sparse (some entries do not contain any elements). )"); rdcarray bindings; @@ -239,22 +245,24 @@ DOCUMENT("Describes the object and descriptor set bindings of a Vulkan pipeline struct Pipeline { DOCUMENT("The :class:`ResourceId` of the pipeline object."); - ResourceId obj; + ResourceId pipelineResourceId; + DOCUMENT("The :class:`ResourceId` of the pipeline layout object."); + ResourceId pipelineLayoutResourceId; DOCUMENT("The flags used to create the pipeline object."); uint32_t flags = 0; - DOCUMENT("A list of :class:`VK_DescriptorSet` with the bound descriptor sets."); - rdcarray DescSets; + DOCUMENT("A list of :class:`VKDescriptorSet` with the bound descriptor sets."); + rdcarray descriptorSets; }; DOCUMENT("Describes the Vulkan index buffer binding.") -struct IB +struct IndexBuffer { DOCUMENT("The :class:`ResourceId` of the index buffer."); - ResourceId buf; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer to the beginning of the index data."); - uint64_t offs = 0; + uint64_t byteOffset = 0; }; DOCUMENT("Describes the vulkan input assembly configuration."); @@ -263,8 +271,8 @@ struct InputAssembly DOCUMENT("``True`` if primitive restart is enabled for strip primitives."); bool primitiveRestartEnable = false; - DOCUMENT("The :class:`VK_IB` with the index buffer binding."); - IB ibuffer; + DOCUMENT("The :class:`VKIndexBuffer` with the index buffer binding."); + IndexBuffer indexBuffer; }; DOCUMENT("Describes the configuration of a single vertex attribute."); @@ -274,7 +282,7 @@ struct VertexAttribute bool operator==(const VertexAttribute &o) const { return location == o.location && binding == o.binding && format == o.format && - byteoffset == o.byteoffset; + byteOffset == o.byteOffset; } bool operator<(const VertexAttribute &o) const { @@ -284,8 +292,8 @@ struct VertexAttribute return binding < o.binding; if(!(format == o.format)) return format < o.format; - if(!(byteoffset == o.byteoffset)) - return byteoffset < o.byteoffset; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; return false; } DOCUMENT("The location in the shader that is bound to this attribute."); @@ -297,7 +305,7 @@ struct VertexAttribute DOCUMENT( "The byte offset from the start of each vertex data in the :data:`binding` to this " "attribute."); - uint32_t byteoffset = 0; + uint32_t byteOffset = 0; }; DOCUMENT("Describes a vertex binding."); @@ -306,72 +314,78 @@ struct VertexBinding DOCUMENT(""); bool operator==(const VertexBinding &o) const { - return vbufferBinding == o.vbufferBinding && bytestride == o.bytestride && + return vertexBufferBinding == o.vertexBufferBinding && byteStride == o.byteStride && perInstance == o.perInstance; } bool operator<(const VertexBinding &o) const { - if(!(vbufferBinding == o.vbufferBinding)) - return vbufferBinding < o.vbufferBinding; - if(!(bytestride == o.bytestride)) - return bytestride < o.bytestride; + if(!(vertexBufferBinding == o.vertexBufferBinding)) + return vertexBufferBinding < o.vertexBufferBinding; + if(!(byteStride == o.byteStride)) + return byteStride < o.byteStride; if(!(perInstance == o.perInstance)) return perInstance < o.perInstance; return false; } DOCUMENT("The vertex binding where data will be sourced from."); - uint32_t vbufferBinding = 0; + uint32_t vertexBufferBinding = 0; DOCUMENT("The byte stride between the start of one set of vertex data and the next."); - uint32_t bytestride = 0; + uint32_t byteStride = 0; DOCUMENT("``True`` if the vertex data is instance-rate."); bool perInstance = false; }; DOCUMENT("Describes a single Vulkan vertex buffer binding.") -struct VB +struct VertexBuffer { DOCUMENT(""); - bool operator==(const VB &o) const { return buffer == o.buffer && offset == o.offset; } - bool operator<(const VB &o) const + bool operator==(const VertexBuffer &o) const { - if(!(buffer == o.buffer)) - return buffer < o.buffer; - if(!(offset == o.offset)) - return offset < o.offset; + return resourceId == o.resourceId && byteOffset == o.byteOffset; + } + bool operator<(const VertexBuffer &o) const + { + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; + if(!(byteOffset == o.byteOffset)) + return byteOffset < o.byteOffset; return false; } DOCUMENT("The :class:`ResourceId` of the buffer bound to this slot."); - ResourceId buffer; + ResourceId resourceId; DOCUMENT("The byte offset from the start of the buffer to the beginning of the vertex data."); - uint64_t offset = 0; + uint64_t byteOffset = 0; }; DOCUMENT("Describes the fixed-function vertex input fetch setup."); struct VertexInput { - DOCUMENT("A list of :class:`VK_VertexAttribute` with the vertex attributes."); - rdcarray attrs; - DOCUMENT("A list of :class:`VK_VertexBinding` with the vertex bindings."); - rdcarray binds; - DOCUMENT("A list of :class:`VK_VB` with the vertex buffers."); - rdcarray vbuffers; + DOCUMENT("A list of :class:`VKVertexAttribute` with the vertex attributes."); + rdcarray attributes; + DOCUMENT("A list of :class:`VKVertexBinding` with the vertex bindings."); + rdcarray bindings; + DOCUMENT("A list of :class:`VKVertexBuffer` with the vertex buffers."); + rdcarray vertexBuffers; }; DOCUMENT("The provided value for a specialization constant."); -struct SpecInfo +struct SpecializationConstant { DOCUMENT(""); - bool operator==(const SpecInfo &o) const { return specID == o.specID && data == o.data; } - bool operator<(const SpecInfo &o) const + bool operator==(const SpecializationConstant &o) const { - if(!(specID == o.specID)) - return specID < o.specID; + return specializationId == o.specializationId && data == o.data; + } + bool operator<(const SpecializationConstant &o) const + { + if(!(specializationId == o.specializationId)) + return specializationId < o.specializationId; if(!(data == o.data)) return data < o.data; return false; } DOCUMENT("The specialization ID"); - uint32_t specID = 0; + uint32_t specializationId = 0; DOCUMENT("A ``bytes`` with the contents of the constant."); bytebuf data; }; @@ -380,22 +394,23 @@ DOCUMENT("Describes a Vulkan shader stage."); struct Shader { DOCUMENT("The :class:`ResourceId` of the shader module object."); - ResourceId Object; + ResourceId resourceId; DOCUMENT("The name of the entry point in the shader module that is used."); rdcstr entryPoint; DOCUMENT("A :class:`ShaderReflection` describing the reflection data for this shader."); - ShaderReflection *ShaderDetails = NULL; - DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`ShaderDetails` with the bindpoint + ShaderReflection *reflection = NULL; + DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`reflection` with the bindpoint mapping data. )"); - ShaderBindpointMapping BindpointMapping; + ShaderBindpointMapping bindpointMapping; - DOCUMENT("A :class:`VK_ShaderStage` identifying which stage this shader is bound to."); + DOCUMENT("A :class:`ShaderStage` identifying which stage this shader is bound to."); ShaderStage stage = ShaderStage::Vertex; - DOCUMENT("A list of :class:`VK_SpecInfo` with the provided specialization constants."); - rdcarray specialization; + DOCUMENT( + "A list of :class:`VKSpecializationConstant` with the provided specialization constants."); + rdcarray specialization; }; DOCUMENT("Describes the state of the fixed-function tessellator."); @@ -405,96 +420,27 @@ struct Tessellation uint32_t numControlPoints = 0; }; -DOCUMENT("Describes a single Vulkan viewport."); -struct Viewport -{ - DOCUMENT(""); - bool operator==(const Viewport &o) const - { - return x == o.x && y == o.y && width == o.width && height == o.height && - minDepth == o.minDepth && maxDepth == o.maxDepth; - } - bool operator<(const Viewport &o) const - { - if(!(x == o.x)) - return x < o.x; - if(!(y == o.y)) - return y < o.y; - if(!(width == o.width)) - return width < o.width; - if(!(height == o.height)) - return height < o.height; - if(!(minDepth == o.minDepth)) - return minDepth < o.minDepth; - if(!(maxDepth == o.maxDepth)) - return maxDepth < o.maxDepth; - return false; - } - DOCUMENT("The X co-ordinate of the viewport."); - float x = 0.0f; - DOCUMENT("The Y co-ordinate of the viewport."); - float y = 0.0f; - DOCUMENT("The width of the viewport."); - float width = 0.0f; - DOCUMENT("The height of the viewport."); - float height = 0.0f; - DOCUMENT("The minimum depth of the viewport."); - float minDepth = 0.0f; - DOCUMENT("The maximum depth of the viewport."); - float maxDepth = 0.0f; -}; - -DOCUMENT("Describes a single Vulkan scissor region."); -struct Scissor -{ - DOCUMENT(""); - bool operator==(const Scissor &o) const - { - return x == o.x && y == o.y && width == o.width && height == o.height; - } - bool operator<(const Scissor &o) const - { - if(!(x == o.x)) - return x < o.x; - if(!(y == o.y)) - return y < o.y; - if(!(width == o.width)) - return width < o.width; - if(!(height == o.height)) - return height < o.height; - return false; - } - DOCUMENT("The X co-ordinate of the scissor region."); - int32_t x = 0; - DOCUMENT("The Y co-ordinate of the scissor region."); - int32_t y = 0; - DOCUMENT("The width of the scissor region."); - int32_t width = 0; - DOCUMENT("The height of the scissor region."); - int32_t height = 0; -}; - DOCUMENT("Describes a combined viewport and scissor region."); struct ViewportScissor { DOCUMENT(""); bool operator==(const ViewportScissor &o) const { return vp == o.vp && scissor == o.scissor; } bool operator<(const ViewportScissor &o) const { return vp == o.vp && scissor == o.scissor; } - DOCUMENT("The :class:`VK_Viewport`."); + DOCUMENT("The :class:`Viewport`."); Viewport vp; - DOCUMENT("The :class:`VK_Scissor`."); + DOCUMENT("The :class:`Scissor`."); Scissor scissor; }; DOCUMENT("Describes the view state in the pipeline."); struct ViewState { - DOCUMENT("A list of :class:`VK_ViewportScissor`."); + DOCUMENT("A list of :class:`VKViewportScissor`."); rdcarray viewportScissors; }; -DOCUMENT("Describes the raster state in the pipeline."); -struct Raster +DOCUMENT("Describes the rasterizer state in the pipeline."); +struct Rasterizer { DOCUMENT(R"(``True`` if pixels outside of the near and far depth planes should be clamped and to ``0.0`` to ``1.0`` and not clipped. @@ -505,7 +451,7 @@ to ``0.0`` to ``1.0`` and not clipped. DOCUMENT(R"(``True`` if counter-clockwise polygons are front-facing. ``False`` if clockwise polygons are front-facing. )"); - bool FrontCCW = false; + bool frontCCW = false; DOCUMENT("The polygon fill mode."); FillMode fillMode = FillMode::Solid; DOCUMENT("The polygon culling mode."); @@ -536,102 +482,19 @@ struct MultiSample uint32_t sampleMask = 0; }; -DOCUMENT("Describes the details of a Vulkan blend operation."); -struct BlendEquation -{ - DOCUMENT(""); - bool operator==(const BlendEquation &o) const - { - return Source == o.Source && Destination == o.Destination && Operation == o.Operation; - } - bool operator<(const BlendEquation &o) const - { - if(!(Source == o.Source)) - return Source < o.Source; - if(!(Destination == o.Destination)) - return Destination < o.Destination; - if(!(Operation == o.Operation)) - return Operation < o.Operation; - return false; - } - DOCUMENT("The :class:`BlendMultiplier` for the source blend value."); - BlendMultiplier Source = BlendMultiplier::One; - DOCUMENT("The :class:`BlendMultiplier` for the destination blend value."); - BlendMultiplier Destination = BlendMultiplier::One; - DOCUMENT("The :class:`BlendOp` to use in the blend calculation."); - BlendOp Operation = BlendOp::Add; -}; - -DOCUMENT("Describes the blend configuration for a given Vulkan attachment."); -struct Blend -{ - DOCUMENT(""); - bool operator==(const Blend &o) const - { - return blendEnable == o.blendEnable && blend == o.blend && alphaBlend == o.alphaBlend && - writeMask == o.writeMask; - } - bool operator<(const Blend &o) const - { - if(!(blendEnable == o.blendEnable)) - return blendEnable < o.blendEnable; - if(!(blend == o.blend)) - return blend < o.blend; - if(!(alphaBlend == o.alphaBlend)) - return alphaBlend < o.alphaBlend; - if(!(writeMask == o.writeMask)) - return writeMask < o.writeMask; - return false; - } - - DOCUMENT("A :class:`VK_BlendEquation` describing the blending for colour values."); - BlendEquation blend; - DOCUMENT("A :class:`VK_BlendEquation` describing the blending for alpha values."); - BlendEquation alphaBlend; - - DOCUMENT("``True`` if blending is enabled for this attachment."); - bool blendEnable = false; - DOCUMENT("The mask for writes to the attachment."); - uint8_t writeMask = 0; -}; - DOCUMENT("Describes the pipeline blending state."); -struct ColorBlend +struct ColorBlendState { DOCUMENT("``True`` if alpha-to-coverage should be used when blending to an MSAA target."); bool alphaToCoverageEnable = false; DOCUMENT("``True`` if alpha-to-one should be used when blending to an MSAA target."); bool alphaToOneEnable = false; - DOCUMENT("``True`` if the logic operation in :data:`logic` should be used."); - bool logicOpEnable = false; - DOCUMENT( - "The :class:`LogicOp` to use for logic operations, if :data:`logicOpEnable` is ``True``."); - LogicOp logic = LogicOp::NoOp; - DOCUMENT("The list of :class:`VK_Blend` with the blending configuration per-attachment."); - rdcarray attachments; + DOCUMENT("The list of :class:`ColorBlend` with the blending configuration per-attachment."); + rdcarray blends; DOCUMENT("The constant blend factor to use in blend equations."); - float blendConst[4] = {1.0f, 1.0f, 1.0f, 1.0f}; -}; - -DOCUMENT("Describes the details of a Vulkan stencil operation."); -struct StencilFace -{ - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test fails."); - StencilOp FailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the depth-test fails."); - StencilOp DepthFailOp = StencilOp::Keep; - DOCUMENT("The :class:`StencilOp` to apply if the stencil-test passes."); - StencilOp PassOp = StencilOp::Keep; - DOCUMENT("The :class:`CompareFunc` to use for testing stencil values."); - CompareFunc Func = CompareFunc::AlwaysTrue; - DOCUMENT("The current stencil reference value."); - uint32_t ref = 0; - DOCUMENT("The mask for testing stencil values."); - uint32_t compareMask = 0; - DOCUMENT("The mask for writing stencil values."); - uint32_t writeMask = 0; + float blendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; }; DOCUMENT("Describes the pipeline depth-stencil state."); @@ -643,16 +506,16 @@ struct DepthStencil bool depthWriteEnable = false; DOCUMENT("``True`` if depth bounds tests should be applied."); bool depthBoundsEnable = false; - DOCUMENT("The :class:`CompareFunc` to use for testing depth values."); - CompareFunc depthCompareOp = CompareFunc::AlwaysTrue; + DOCUMENT("The :class:`CompareFunction` to use for testing depth values."); + CompareFunction depthFunction = CompareFunction::AlwaysTrue; DOCUMENT("``True`` if stencil operations should be performed."); bool stencilTestEnable = false; - DOCUMENT("A :class:`VK_StencilFace` describing what happens for front-facing polygons."); - StencilFace front; - DOCUMENT("A :class:`VK_StencilFace` describing what happens for back-facing polygons."); - StencilFace back; + DOCUMENT("A :class:`StencilFace` describing what happens for front-facing polygons."); + StencilFace frontFace; + DOCUMENT("A :class:`StencilFace` describing what happens for back-facing polygons."); + StencilFace backFace; DOCUMENT("The near plane bounding value."); float minDepthBounds = 0.0f; @@ -664,7 +527,7 @@ DOCUMENT("Describes the setup of a renderpass and subpasses."); struct RenderPass { DOCUMENT("The :class:`ResourceId` of the render pass."); - ResourceId obj; + ResourceId resourceId; DOCUMENT("The index of the current active subpass."); uint32_t subpass; @@ -690,19 +553,19 @@ struct Attachment DOCUMENT(""); bool operator==(const Attachment &o) const { - return view == o.view && img == o.img && viewfmt == o.viewfmt && swizzle[0] == o.swizzle[0] && - swizzle[1] == o.swizzle[1] && swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] && - baseMip == o.baseMip && baseLayer == o.baseLayer && numMip == o.numMip && - numLayer == o.numLayer; + return viewResourceId == o.viewResourceId && imageResourceId == o.imageResourceId && + viewFormat == o.viewFormat && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && + swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] && firstMip == o.firstMip && + firstSlice == o.firstSlice && numMips == o.numMips && numSlices == o.numSlices; } bool operator<(const Attachment &o) const { - if(!(view == o.view)) - return view < o.view; - if(!(img == o.img)) - return img < o.img; - if(!(viewfmt == o.viewfmt)) - return viewfmt < o.viewfmt; + if(!(viewResourceId == o.viewResourceId)) + return viewResourceId < o.viewResourceId; + if(!(imageResourceId == o.imageResourceId)) + return imageResourceId < o.imageResourceId; + if(!(viewFormat == o.viewFormat)) + return viewFormat < o.viewFormat; if(!(swizzle[0] == o.swizzle[0])) return swizzle[0] < o.swizzle[0]; if(!(swizzle[1] == o.swizzle[1])) @@ -711,43 +574,43 @@ struct Attachment return swizzle[2] < o.swizzle[2]; if(!(swizzle[3] == o.swizzle[3])) return swizzle[3] < o.swizzle[3]; - if(!(baseMip == o.baseMip)) - return baseMip < o.baseMip; - if(!(baseLayer == o.baseLayer)) - return baseLayer < o.baseLayer; - if(!(numMip == o.numMip)) - return numMip < o.numMip; - if(!(numLayer == o.numLayer)) - return numLayer < o.numLayer; + if(!(firstMip == o.firstMip)) + return firstMip < o.firstMip; + if(!(firstSlice == o.firstSlice)) + return firstSlice < o.firstSlice; + if(!(numMips == o.numMips)) + return numMips < o.numMips; + if(!(numSlices == o.numSlices)) + return numSlices < o.numSlices; return false; } DOCUMENT("The :class:`ResourceId` of the image view itself."); - ResourceId view; + ResourceId viewResourceId; DOCUMENT("The :class:`ResourceId` of the underlying image that the view refers to."); - ResourceId img; + ResourceId imageResourceId; DOCUMENT("The :class:`ResourceFormat` that the view uses."); - ResourceFormat viewfmt; + ResourceFormat viewFormat; DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture."); TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue, TextureSwizzle::Alpha}; DOCUMENT("The first mip level used in the attachment."); - uint32_t baseMip = 0; + uint32_t firstMip = 0; DOCUMENT("For 3D textures and texture arrays, the first slice used in the attachment."); - uint32_t baseLayer = 0; + uint32_t firstSlice = 0; DOCUMENT("The number of mip levels in the attachment."); - uint32_t numMip = 1; + uint32_t numMips = 1; DOCUMENT("For 3D textures and texture arrays, the number of array slices in the attachment."); - uint32_t numLayer = 1; + uint32_t numSlices = 1; }; DOCUMENT("Describes a framebuffer object and its attachments."); struct Framebuffer { DOCUMENT("The :class:`ResourceId` of the framebuffer object."); - ResourceId obj; + ResourceId resourceId; - DOCUMENT("A list of :class:`VK_Attachment` with the attachments of this framebuffer."); + DOCUMENT("A list of :class:`VKAttachment` with the attachments of this framebuffer."); rdcarray attachments; DOCUMENT("The width of this framebuffer in pixels."); @@ -774,11 +637,11 @@ struct RenderArea DOCUMENT("Describes the current pass instance at the current time."); struct CurrentPass { - DOCUMENT("The :class:`VK_RenderPass` that is currently active."); + DOCUMENT("The :class:`VKRenderPass` that is currently active."); RenderPass renderpass; - DOCUMENT("The :class:`VK_Framebuffer` that is currently being used."); + DOCUMENT("The :class:`VKFramebuffer` that is currently being used."); Framebuffer framebuffer; - DOCUMENT("The :class:`VK_RenderArea` that is currently being rendered to."); + DOCUMENT("The :class:`VKRenderArea` that is currently being rendered to."); RenderArea renderArea; }; @@ -821,66 +684,65 @@ DOCUMENT("Contains the current layout of all subresources in the image."); struct ImageData { DOCUMENT(""); - bool operator==(const ImageData &o) const { return image == o.image; } + bool operator==(const ImageData &o) const { return resourceId == o.resourceId; } bool operator<(const ImageData &o) const { - if(!(image == o.image)) - return image < o.image; + if(!(resourceId == o.resourceId)) + return resourceId < o.resourceId; return false; } DOCUMENT("The :class:`ResourceId` of the image."); - ResourceId image; + ResourceId resourceId; - DOCUMENT( - "A list of :class:`VK_ImageLayout` with the set of subresources that make up the image."); + DOCUMENT("A list of :class:`VKImageLayout` with the set of subresources that make up the image."); rdcarray layouts; }; DOCUMENT("The full current Vulkan pipeline state."); struct State { - DOCUMENT("A :class:`VK_Pipeline` with the currently bound compute pipeline, if any."); + DOCUMENT("A :class:`VKPipeline` with the currently bound compute pipeline, if any."); Pipeline compute; - DOCUMENT("A :class:`VK_Pipeline` with the currently bound graphics pipeline, if any."); + DOCUMENT("A :class:`VKPipeline` with the currently bound graphics pipeline, if any."); Pipeline graphics; - DOCUMENT("A :class:`VK_InputAssembly` describing the input assembly stage."); - InputAssembly IA; - DOCUMENT("A :class:`VK_VertexInput` describing the vertex input stage."); - VertexInput VI; + DOCUMENT("A :class:`VKInputAssembly` describing the input assembly stage."); + InputAssembly inputAssembly; + DOCUMENT("A :class:`VKVertexInput` describing the vertex input stage."); + VertexInput vertexInput; - DOCUMENT("A :class:`VK_Shader` describing the vertex shader stage."); - Shader m_VS; - DOCUMENT("A :class:`VK_Shader` describing the tessellation control shader stage."); - Shader m_TCS; - DOCUMENT("A :class:`VK_Shader` describing the tessellation evaluation shader stage."); - Shader m_TES; - DOCUMENT("A :class:`VK_Shader` describing the geometry shader stage."); - Shader m_GS; - DOCUMENT("A :class:`VK_Shader` describing the fragment shader stage."); - Shader m_FS; - DOCUMENT("A :class:`VK_Shader` describing the compute shader stage."); - Shader m_CS; + DOCUMENT("A :class:`VKShader` describing the vertex shader stage."); + Shader vertexShader; + DOCUMENT("A :class:`VKShader` describing the tessellation control shader stage."); + Shader tessControlShader; + DOCUMENT("A :class:`VKShader` describing the tessellation evaluation shader stage."); + Shader tessEvalShader; + DOCUMENT("A :class:`VKShader` describing the geometry shader stage."); + Shader geometryShader; + DOCUMENT("A :class:`VKShader` describing the fragment shader stage."); + Shader fragmentShader; + DOCUMENT("A :class:`VKShader` describing the compute shader stage."); + Shader computeShader; - DOCUMENT("A :class:`VK_Tessellation` describing the tessellation stage."); - Tessellation Tess; + DOCUMENT("A :class:`VKTessellation` describing the tessellation stage."); + Tessellation tessellation; - DOCUMENT("A :class:`VK_ViewState` describing the viewport setup."); - ViewState VP; - DOCUMENT("A :class:`VK_Raster` describing rasterization."); - Raster RS; + DOCUMENT("A :class:`VKViewState` describing the viewport setup."); + ViewState viewportScissor; + DOCUMENT("A :class:`VKRasterizer` describing rasterization."); + Rasterizer rasterizer; - DOCUMENT("A :class:`VK_MultiSample` describing the multisample setup."); - MultiSample MSAA; - DOCUMENT("A :class:`VK_ColorBlend` describing color blending."); - ColorBlend CB; - DOCUMENT("A :class:`VK_DepthStencil` describing the depth-stencil stage."); - DepthStencil DS; + DOCUMENT("A :class:`VKMultiSample` describing the multisample setup."); + MultiSample multisample; + DOCUMENT("A :class:`VKColorBlendState` describing color blending."); + ColorBlendState colorBlend; + DOCUMENT("A :class:`VKDepthStencil` describing the depth-stencil stage."); + DepthStencil depthStencil; - DOCUMENT("A :class:`VK_CurrentPass` describing the current renderpass, subpass and framebuffer."); - CurrentPass Pass; + DOCUMENT("A :class:`VKCurrentPass` describing the current renderpass, subpass and framebuffer."); + CurrentPass currentPass; - DOCUMENT("A list of :class:`VK_ImageData` entries, one for each image."); + DOCUMENT("A list of :class:`VKImageData` entries, one for each image."); rdcarray images; }; @@ -890,25 +752,20 @@ DECLARE_REFLECTION_STRUCT(VKPipe::BindingElement); DECLARE_REFLECTION_STRUCT(VKPipe::DescriptorBinding); DECLARE_REFLECTION_STRUCT(VKPipe::DescriptorSet); DECLARE_REFLECTION_STRUCT(VKPipe::Pipeline); -DECLARE_REFLECTION_STRUCT(VKPipe::IB); +DECLARE_REFLECTION_STRUCT(VKPipe::IndexBuffer); DECLARE_REFLECTION_STRUCT(VKPipe::InputAssembly); DECLARE_REFLECTION_STRUCT(VKPipe::VertexAttribute); DECLARE_REFLECTION_STRUCT(VKPipe::VertexBinding); -DECLARE_REFLECTION_STRUCT(VKPipe::VB); +DECLARE_REFLECTION_STRUCT(VKPipe::VertexBuffer); DECLARE_REFLECTION_STRUCT(VKPipe::VertexInput); -DECLARE_REFLECTION_STRUCT(VKPipe::SpecInfo); +DECLARE_REFLECTION_STRUCT(VKPipe::SpecializationConstant); DECLARE_REFLECTION_STRUCT(VKPipe::Shader); DECLARE_REFLECTION_STRUCT(VKPipe::Tessellation); -DECLARE_REFLECTION_STRUCT(VKPipe::Viewport); -DECLARE_REFLECTION_STRUCT(VKPipe::Scissor); DECLARE_REFLECTION_STRUCT(VKPipe::ViewportScissor); DECLARE_REFLECTION_STRUCT(VKPipe::ViewState); -DECLARE_REFLECTION_STRUCT(VKPipe::Raster); +DECLARE_REFLECTION_STRUCT(VKPipe::Rasterizer); DECLARE_REFLECTION_STRUCT(VKPipe::MultiSample); -DECLARE_REFLECTION_STRUCT(VKPipe::BlendEquation); -DECLARE_REFLECTION_STRUCT(VKPipe::Blend); -DECLARE_REFLECTION_STRUCT(VKPipe::ColorBlend); -DECLARE_REFLECTION_STRUCT(VKPipe::StencilFace); +DECLARE_REFLECTION_STRUCT(VKPipe::ColorBlendState); DECLARE_REFLECTION_STRUCT(VKPipe::DepthStencil); DECLARE_REFLECTION_STRUCT(VKPipe::RenderPass); DECLARE_REFLECTION_STRUCT(VKPipe::Attachment); diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp index eda12c565..a2a6ed6e6 100644 --- a/renderdoc/core/core.cpp +++ b/renderdoc/core/core.cpp @@ -1049,7 +1049,7 @@ void RenderDoc::FinishCaptureWriting(RDCFile *rdc, uint32_t frameNumber) if(rdc) { // add the resolve database if we were capturing callstacks. - if(m_Options.CaptureCallstacks) + if(m_Options.captureCallstacks) { SectionProperties props = {}; props.type = SectionType::ResolveDatabase; diff --git a/renderdoc/core/image_viewer.cpp b/renderdoc/core/image_viewer.cpp index c7b6575ed..8a95b6d7c 100644 --- a/renderdoc/core/image_viewer.cpp +++ b/renderdoc/core/image_viewer.cpp @@ -46,19 +46,19 @@ public: m_FrameRecord.drawcallList.resize(1); DrawcallDescription &d = m_FrameRecord.drawcallList[0]; - d.drawcallID = 1; - d.eventID = 1; + d.drawcallId = 1; + d.eventId = 1; d.name = filename; RefreshFile(); m_Resources.push_back(ResourceDescription()); - m_Resources[0].ID = m_TextureID; + m_Resources[0].resourceId = m_TextureID; m_Resources[0].autogeneratedName = false; m_Resources[0].name = m_Filename; - m_PipelineState.m_OM.RenderTargets.resize(1); - m_PipelineState.m_OM.RenderTargets[0].Resource = m_TextureID; + m_PipelineState.outputMerger.renderTargets.resize(1); + m_PipelineState.outputMerger.renderTargets[0].resourceResourceId = m_TextureID; } virtual ~ImageViewer() @@ -114,7 +114,7 @@ public: } bool RenderTexture(TextureDisplay cfg) { - cfg.texid = m_TextureID; + cfg.resourceId = m_TextureID; return m_Proxy->RenderTexture(cfg); } void PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip, @@ -122,9 +122,9 @@ public: { m_Proxy->PickPixel(m_TextureID, x, y, sliceFace, mip, sample, typeHint, pixel); } - uint32_t PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - return m_Proxy->PickVertex(eventID, cfg, x, y); + return m_Proxy->PickVertex(eventId, cfg, x, y); } void BuildCustomShader(string source, string entry, const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id, string *errors) @@ -156,7 +156,7 @@ public: return ReplayStatus::Succeeded; } const SDFile &GetStructuredFile() { return m_File; } - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg) + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { } std::vector GetBuffers() { return vector(); } @@ -172,7 +172,7 @@ public: const GLPipe::State &GetGLPipelineState() { return m_GLState; } const VKPipe::State &GetVulkanPipelineState() { return m_VKState; } void ReplayLog(uint32_t endEventID, ReplayLogType replayType) {} - vector GetPassEvents(uint32_t eventID) { return vector(); } + vector GetPassEvents(uint32_t eventId) { return vector(); } vector GetUsage(ResourceId id) { return vector(); } bool IsRenderOutput(ResourceId id) { return false; } ResourceId GetLiveID(ResourceId id) { return id; } @@ -180,7 +180,7 @@ public: CounterDescription DescribeCounter(GPUCounter counterID) { CounterDescription desc = {}; - desc.counterID = counterID; + desc.counter = counterID; return desc; } vector FetchCounters(const vector &counters) @@ -192,16 +192,16 @@ public: { } void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData) {} - void InitPostVSBuffers(uint32_t eventID) {} - void InitPostVSBuffers(const vector &eventID) {} - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) + void InitPostVSBuffers(uint32_t eventId) {} + void InitPostVSBuffers(const vector &eventId) {} + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { MeshFormat ret; RDCEraseEl(ret); return ret; } ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { return ResourceId(); } @@ -219,21 +219,21 @@ public: { return vector(); } - ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx, + ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { ShaderDebugTrace ret; RDCEraseEl(ret); return ret; } - ShaderDebugTrace DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample, + ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { ShaderDebugTrace ret; RDCEraseEl(ret); return ret; } - ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { ShaderDebugTrace ret; @@ -444,14 +444,14 @@ void ImageViewer::RefreshFile() texDetails.creationFlags = TextureCategory::SwapBuffer | TextureCategory::ColorTarget; texDetails.cubemap = false; - texDetails.ID = m_TextureID; + texDetails.resourceId = m_TextureID; texDetails.byteSize = 0; texDetails.msQual = 0; texDetails.msSamp = 1; texDetails.format = rgba8_unorm; // reasonable defaults - texDetails.resType = TextureDim::Texture2D; + texDetails.type = TextureType::Texture2D; texDetails.dimension = 2; texDetails.arraysize = 1; texDetails.width = 1; @@ -612,25 +612,25 @@ void ImageViewer::RefreshFile() texDetails.format = read_data.format; if(texDetails.depth > 1) { - texDetails.resType = TextureDim::Texture3D; + texDetails.type = TextureType::Texture3D; texDetails.dimension = 3; } else if(texDetails.cubemap) { - texDetails.resType = - texDetails.arraysize > 1 ? TextureDim::TextureCubeArray : TextureDim::TextureCube; + texDetails.type = + texDetails.arraysize > 1 ? TextureType::TextureCubeArray : TextureType::TextureCube; texDetails.dimension = 2; } else if(texDetails.width > 1) { - texDetails.resType = - texDetails.arraysize > 1 ? TextureDim::Texture2DArray : TextureDim::Texture2D; + texDetails.type = + texDetails.arraysize > 1 ? TextureType::Texture2DArray : TextureType::Texture2D; texDetails.dimension = 2; } else { - texDetails.resType = - texDetails.arraysize > 1 ? TextureDim::Texture1DArray : TextureDim::Texture1D; + texDetails.type = + texDetails.arraysize > 1 ? TextureType::Texture1DArray : TextureType::Texture1D; texDetails.dimension = 1; } diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index f4cc50b4d..001f93838 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -313,28 +313,28 @@ BufferDescription ReplayProxy::GetBuffer(ResourceId id) template std::vector ReplayProxy::Proxied_GetPassEvents(ParamSerialiser ¶mser, - ReturnSerialiser &retser, uint32_t eventID) + ReturnSerialiser &retser, uint32_t eventId) { const ReplayProxyPacket packet = eReplayProxy_GetPassEvents; std::vector ret; { BEGIN_PARAMS(); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); END_PARAMS(); } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - ret = m_Remote->GetPassEvents(eventID); + ret = m_Remote->GetPassEvents(eventId); SERIALISE_RETURN(ret); return ret; } -std::vector ReplayProxy::GetPassEvents(uint32_t eventID) +std::vector ReplayProxy::GetPassEvents(uint32_t eventId) { - PROXY_FUNCTION(GetPassEvents, eventID); + PROXY_FUNCTION(GetPassEvents, eventId); } template @@ -679,23 +679,23 @@ void ReplayProxy::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip template void ReplayProxy::Proxied_InitPostVSBuffers(ParamSerialiser ¶mser, ReturnSerialiser &retser, - uint32_t eventID) + uint32_t eventId) { const ReplayProxyPacket packet = eReplayProxy_InitPostVS; { BEGIN_PARAMS(); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); END_PARAMS(); } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - m_Remote->InitPostVSBuffers(eventID); + m_Remote->InitPostVSBuffers(eventId); } -void ReplayProxy::InitPostVSBuffers(uint32_t eventID) +void ReplayProxy::InitPostVSBuffers(uint32_t eventId) { - PROXY_FUNCTION(InitPostVSBuffers, eventID); + PROXY_FUNCTION(InitPostVSBuffers, eventId); } template @@ -721,7 +721,7 @@ void ReplayProxy::InitPostVSBuffers(const std::vector &events) template MeshFormat ReplayProxy::Proxied_GetPostVSBuffers(ParamSerialiser ¶mser, - ReturnSerialiser &retser, uint32_t eventID, + ReturnSerialiser &retser, uint32_t eventId, uint32_t instID, MeshDataStage stage) { const ReplayProxyPacket packet = eReplayProxy_GetPostVS; @@ -729,29 +729,29 @@ MeshFormat ReplayProxy::Proxied_GetPostVSBuffers(ParamSerialiser ¶mser, { BEGIN_PARAMS(); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); SERIALISE_ELEMENT(instID); SERIALISE_ELEMENT(stage); END_PARAMS(); } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - ret = m_Remote->GetPostVSBuffers(eventID, instID, stage); + ret = m_Remote->GetPostVSBuffers(eventId, instID, stage); SERIALISE_RETURN(ret); return ret; } -MeshFormat ReplayProxy::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat ReplayProxy::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { - PROXY_FUNCTION(GetPostVSBuffers, eventID, instID, stage); + PROXY_FUNCTION(GetPostVSBuffers, eventId, instID, stage); } template ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser ¶mser, ReturnSerialiser &retser, ResourceId texid, CompType typeHint, - DebugOverlay overlay, uint32_t eventID, + DebugOverlay overlay, uint32_t eventId, const std::vector &passEvents) { const ReplayProxyPacket packet = eReplayProxy_RenderOverlay; @@ -762,13 +762,13 @@ ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser ¶mser, ReturnS SERIALISE_ELEMENT(texid); SERIALISE_ELEMENT(typeHint); SERIALISE_ELEMENT(overlay); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); SERIALISE_ELEMENT(passEvents); END_PARAMS(); } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - ret = m_Remote->RenderOverlay(texid, typeHint, overlay, eventID, passEvents); + ret = m_Remote->RenderOverlay(texid, typeHint, overlay, eventId, passEvents); SERIALISE_RETURN(ret); @@ -776,9 +776,9 @@ ResourceId ReplayProxy::Proxied_RenderOverlay(ParamSerialiser ¶mser, ReturnS } ResourceId ReplayProxy::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const std::vector &passEvents) + uint32_t eventId, const std::vector &passEvents) { - PROXY_FUNCTION(RenderOverlay, texid, typeHint, overlay, eventID, passEvents); + PROXY_FUNCTION(RenderOverlay, texid, typeHint, overlay, eventId, passEvents); } template @@ -871,8 +871,8 @@ std::string ReplayProxy::Proxied_DisassembleShader(ParamSerialiser ¶mser, if(refl) { - Shader = refl->ID; - EntryPoint = refl->EntryPoint; + Shader = refl->resourceId; + EntryPoint = refl->entryPoint; } { @@ -1073,7 +1073,7 @@ std::vector ReplayProxy::PixelHistory(std::vector template ShaderDebugTrace ReplayProxy::Proxied_DebugVertex(ParamSerialiser ¶mser, - ReturnSerialiser &retser, uint32_t eventID, + ReturnSerialiser &retser, uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { @@ -1082,7 +1082,7 @@ ShaderDebugTrace ReplayProxy::Proxied_DebugVertex(ParamSerialiser ¶mser, { BEGIN_PARAMS(); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); SERIALISE_ELEMENT(vertid); SERIALISE_ELEMENT(instid); SERIALISE_ELEMENT(idx); @@ -1092,22 +1092,22 @@ ShaderDebugTrace ReplayProxy::Proxied_DebugVertex(ParamSerialiser ¶mser, } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - ret = m_Remote->DebugVertex(eventID, vertid, instid, idx, instOffset, vertOffset); + ret = m_Remote->DebugVertex(eventId, vertid, instid, idx, instOffset, vertOffset); SERIALISE_RETURN(ret); return ret; } -ShaderDebugTrace ReplayProxy::DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, +ShaderDebugTrace ReplayProxy::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { - PROXY_FUNCTION(DebugVertex, eventID, vertid, instid, idx, instOffset, vertOffset); + PROXY_FUNCTION(DebugVertex, eventId, vertid, instid, idx, instOffset, vertOffset); } template ShaderDebugTrace ReplayProxy::Proxied_DebugPixel(ParamSerialiser ¶mser, ReturnSerialiser &retser, - uint32_t eventID, uint32_t x, uint32_t y, + uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { const ReplayProxyPacket packet = eReplayProxy_DebugPixel; @@ -1115,7 +1115,7 @@ ShaderDebugTrace ReplayProxy::Proxied_DebugPixel(ParamSerialiser ¶mser, Retu { BEGIN_PARAMS(); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); SERIALISE_ELEMENT(x); SERIALISE_ELEMENT(y); SERIALISE_ELEMENT(sample); @@ -1124,22 +1124,22 @@ ShaderDebugTrace ReplayProxy::Proxied_DebugPixel(ParamSerialiser ¶mser, Retu } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - ret = m_Remote->DebugPixel(eventID, x, y, sample, primitive); + ret = m_Remote->DebugPixel(eventId, x, y, sample, primitive); SERIALISE_RETURN(ret); return ret; } -ShaderDebugTrace ReplayProxy::DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample, +ShaderDebugTrace ReplayProxy::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { - PROXY_FUNCTION(DebugPixel, eventID, x, y, sample, primitive); + PROXY_FUNCTION(DebugPixel, eventId, x, y, sample, primitive); } template ShaderDebugTrace ReplayProxy::Proxied_DebugThread(ParamSerialiser ¶mser, ReturnSerialiser &retser, - uint32_t eventID, const uint32_t groupid[3], + uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { const ReplayProxyPacket packet = eReplayProxy_DebugThread; @@ -1150,24 +1150,24 @@ ShaderDebugTrace ReplayProxy::Proxied_DebugThread(ParamSerialiser ¶mser, Ret { BEGIN_PARAMS(); - SERIALISE_ELEMENT(eventID); + SERIALISE_ELEMENT(eventId); SERIALISE_ELEMENT(GroupID); SERIALISE_ELEMENT(ThreadID); END_PARAMS(); } if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored) - ret = m_Remote->DebugThread(eventID, GroupID, ThreadID); + ret = m_Remote->DebugThread(eventId, GroupID, ThreadID); SERIALISE_RETURN(ret); return ret; } -ShaderDebugTrace ReplayProxy::DebugThread(uint32_t eventID, const uint32_t groupid[3], +ShaderDebugTrace ReplayProxy::DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { - PROXY_FUNCTION(DebugThread, eventID, groupid, threadid); + PROXY_FUNCTION(DebugThread, eventId, groupid, threadid); } template @@ -1220,50 +1220,55 @@ void ReplayProxy::Proxied_SavePipelineState(ParamSerialiser ¶mser, ReturnSer if(m_APIProps.pipelineType == GraphicsAPI::D3D11) { D3D11Pipe::Shader *stages[] = { - &m_D3D11PipelineState.m_VS, &m_D3D11PipelineState.m_HS, &m_D3D11PipelineState.m_DS, - &m_D3D11PipelineState.m_GS, &m_D3D11PipelineState.m_PS, &m_D3D11PipelineState.m_CS, + &m_D3D11PipelineState.vertexShader, &m_D3D11PipelineState.hullShader, + &m_D3D11PipelineState.domainShader, &m_D3D11PipelineState.geometryShader, + &m_D3D11PipelineState.pixelShader, &m_D3D11PipelineState.computeShader, }; for(int i = 0; i < 6; i++) - if(stages[i]->Object != ResourceId()) - stages[i]->ShaderDetails = GetShader(GetLiveID(stages[i]->Object), ""); + if(stages[i]->resourceId != ResourceId()) + stages[i]->reflection = GetShader(GetLiveID(stages[i]->resourceId), ""); - if(m_D3D11PipelineState.m_IA.layout != ResourceId()) - m_D3D11PipelineState.m_IA.Bytecode = - GetShader(GetLiveID(m_D3D11PipelineState.m_IA.layout), ""); + if(m_D3D11PipelineState.inputAssembly.resourceId != ResourceId()) + m_D3D11PipelineState.inputAssembly.bytecode = + GetShader(GetLiveID(m_D3D11PipelineState.inputAssembly.resourceId), ""); } else if(m_APIProps.pipelineType == GraphicsAPI::D3D12) { D3D12Pipe::Shader *stages[] = { - &m_D3D12PipelineState.m_VS, &m_D3D12PipelineState.m_HS, &m_D3D12PipelineState.m_DS, - &m_D3D12PipelineState.m_GS, &m_D3D12PipelineState.m_PS, &m_D3D12PipelineState.m_CS, + &m_D3D12PipelineState.vertexShader, &m_D3D12PipelineState.hullShader, + &m_D3D12PipelineState.domainShader, &m_D3D12PipelineState.geometryShader, + &m_D3D12PipelineState.pixelShader, &m_D3D12PipelineState.computeShader, }; for(int i = 0; i < 6; i++) - if(stages[i]->Object != ResourceId()) - stages[i]->ShaderDetails = GetShader(GetLiveID(stages[i]->Object), ""); + if(stages[i]->resourceId != ResourceId()) + stages[i]->reflection = GetShader(GetLiveID(stages[i]->resourceId), ""); } else if(m_APIProps.pipelineType == GraphicsAPI::OpenGL) { 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, + &m_GLPipelineState.vertexShader, &m_GLPipelineState.tessControlShader, + &m_GLPipelineState.tessEvalShader, &m_GLPipelineState.geometryShader, + &m_GLPipelineState.fragmentShader, &m_GLPipelineState.computeShader, }; for(int i = 0; i < 6; i++) - if(stages[i]->Object != ResourceId()) - stages[i]->ShaderDetails = GetShader(GetLiveID(stages[i]->Object), ""); + if(stages[i]->shaderResourceId != ResourceId()) + stages[i]->reflection = GetShader(GetLiveID(stages[i]->shaderResourceId), ""); } else if(m_APIProps.pipelineType == GraphicsAPI::Vulkan) { VKPipe::Shader *stages[] = { - &m_VulkanPipelineState.m_VS, &m_VulkanPipelineState.m_TCS, &m_VulkanPipelineState.m_TES, - &m_VulkanPipelineState.m_GS, &m_VulkanPipelineState.m_FS, &m_VulkanPipelineState.m_CS, + &m_VulkanPipelineState.vertexShader, &m_VulkanPipelineState.tessControlShader, + &m_VulkanPipelineState.tessEvalShader, &m_VulkanPipelineState.geometryShader, + &m_VulkanPipelineState.fragmentShader, &m_VulkanPipelineState.computeShader, }; for(int i = 0; i < 6; i++) - if(stages[i]->Object != ResourceId()) - stages[i]->ShaderDetails = GetShader(GetLiveID(stages[i]->Object), stages[i]->entryPoint); + if(stages[i]->resourceId != ResourceId()) + stages[i]->reflection = + GetShader(GetLiveID(stages[i]->resourceId), stages[i]->entryPoint); } } } diff --git a/renderdoc/core/replay_proxy.h b/renderdoc/core/replay_proxy.h index 7c8a73397..3b2081238 100644 --- a/renderdoc/core/replay_proxy.h +++ b/renderdoc/core/replay_proxy.h @@ -233,17 +233,17 @@ public: { if(m_Proxy) { - EnsureTexCached(cfg.texid, cfg.sliceFace, cfg.mip); - if(cfg.texid == ResourceId() || m_ProxyTextures[cfg.texid] == ResourceId()) + EnsureTexCached(cfg.resourceId, cfg.sliceFace, cfg.mip); + if(cfg.resourceId == ResourceId() || m_ProxyTextures[cfg.resourceId] == ResourceId()) return false; - cfg.texid = m_ProxyTextures[cfg.texid]; + cfg.resourceId = m_ProxyTextures[cfg.resourceId]; // due to OpenGL having origin bottom-left compared to the rest of the world, // we need to flip going in or out of GL. if((m_APIProps.pipelineType == GraphicsAPI::OpenGL) != (m_APIProps.localRenderer == GraphicsAPI::OpenGL)) { - cfg.FlipY = !cfg.FlipY; + cfg.flipY = !cfg.flipY; } return m_Proxy->RenderTexture(cfg); @@ -279,75 +279,75 @@ public: } } - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg) + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { - if(m_Proxy && cfg.position.buf != ResourceId()) + if(m_Proxy && cfg.position.vertexResourceId != ResourceId()) { MeshDisplay proxiedCfg = cfg; - EnsureBufCached(proxiedCfg.position.buf); - if(proxiedCfg.position.buf == ResourceId() || - m_ProxyBufferIds[proxiedCfg.position.buf] == ResourceId()) + EnsureBufCached(proxiedCfg.position.vertexResourceId); + if(proxiedCfg.position.vertexResourceId == ResourceId() || + m_ProxyBufferIds[proxiedCfg.position.vertexResourceId] == ResourceId()) return; - proxiedCfg.position.buf = m_ProxyBufferIds[proxiedCfg.position.buf]; + proxiedCfg.position.vertexResourceId = m_ProxyBufferIds[proxiedCfg.position.vertexResourceId]; - if(proxiedCfg.second.buf != ResourceId()) + if(proxiedCfg.second.vertexResourceId != ResourceId()) { - EnsureBufCached(proxiedCfg.second.buf); - proxiedCfg.second.buf = m_ProxyBufferIds[proxiedCfg.second.buf]; + EnsureBufCached(proxiedCfg.second.vertexResourceId); + proxiedCfg.second.vertexResourceId = m_ProxyBufferIds[proxiedCfg.second.vertexResourceId]; } - if(proxiedCfg.position.idxbuf != ResourceId()) + if(proxiedCfg.position.indexResourceId != ResourceId()) { - EnsureBufCached(proxiedCfg.position.idxbuf); - proxiedCfg.position.idxbuf = m_ProxyBufferIds[proxiedCfg.position.idxbuf]; + EnsureBufCached(proxiedCfg.position.indexResourceId); + proxiedCfg.position.indexResourceId = m_ProxyBufferIds[proxiedCfg.position.indexResourceId]; } vector secDraws = secondaryDraws; for(size_t i = 0; i < secDraws.size(); i++) { - if(secDraws[i].buf != ResourceId()) + if(secDraws[i].vertexResourceId != ResourceId()) { - EnsureBufCached(secDraws[i].buf); - secDraws[i].buf = m_ProxyBufferIds[secDraws[i].buf]; + EnsureBufCached(secDraws[i].vertexResourceId); + secDraws[i].vertexResourceId = m_ProxyBufferIds[secDraws[i].vertexResourceId]; } - if(secDraws[i].idxbuf != ResourceId()) + if(secDraws[i].indexResourceId != ResourceId()) { - EnsureBufCached(secDraws[i].idxbuf); - secDraws[i].idxbuf = m_ProxyBufferIds[secDraws[i].idxbuf]; + EnsureBufCached(secDraws[i].indexResourceId); + secDraws[i].indexResourceId = m_ProxyBufferIds[secDraws[i].indexResourceId]; } } - m_Proxy->RenderMesh(eventID, secDraws, proxiedCfg); + m_Proxy->RenderMesh(eventId, secDraws, proxiedCfg); } } - uint32_t PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - if(m_Proxy && cfg.position.buf != ResourceId()) + if(m_Proxy && cfg.position.vertexResourceId != ResourceId()) { MeshDisplay proxiedCfg = cfg; - EnsureBufCached(proxiedCfg.position.buf); - if(proxiedCfg.position.buf == ResourceId() || - m_ProxyBufferIds[proxiedCfg.position.buf] == ResourceId()) + EnsureBufCached(proxiedCfg.position.vertexResourceId); + if(proxiedCfg.position.vertexResourceId == ResourceId() || + m_ProxyBufferIds[proxiedCfg.position.vertexResourceId] == ResourceId()) return ~0U; - proxiedCfg.position.buf = m_ProxyBufferIds[proxiedCfg.position.buf]; + proxiedCfg.position.vertexResourceId = m_ProxyBufferIds[proxiedCfg.position.vertexResourceId]; - if(proxiedCfg.second.buf != ResourceId()) + if(proxiedCfg.second.vertexResourceId != ResourceId()) { - EnsureBufCached(proxiedCfg.second.buf); - proxiedCfg.second.buf = m_ProxyBufferIds[proxiedCfg.second.buf]; + EnsureBufCached(proxiedCfg.second.vertexResourceId); + proxiedCfg.second.vertexResourceId = m_ProxyBufferIds[proxiedCfg.second.vertexResourceId]; } - if(proxiedCfg.position.idxbuf != ResourceId()) + if(proxiedCfg.position.indexResourceId != ResourceId()) { - EnsureBufCached(proxiedCfg.position.idxbuf); - proxiedCfg.position.idxbuf = m_ProxyBufferIds[proxiedCfg.position.idxbuf]; + EnsureBufCached(proxiedCfg.position.indexResourceId); + proxiedCfg.position.indexResourceId = m_ProxyBufferIds[proxiedCfg.position.indexResourceId]; } - return m_Proxy->PickVertex(eventID, proxiedCfg, x, y); + return m_Proxy->PickVertex(eventId, proxiedCfg, x, y); } return ~0U; @@ -418,7 +418,7 @@ public: IMPLEMENT_FUNCTION_PROXIED(void, SavePipelineState); IMPLEMENT_FUNCTION_PROXIED(void, ReplayLog, uint32_t endEventID, ReplayLogType replayType); - IMPLEMENT_FUNCTION_PROXIED(std::vector, GetPassEvents, uint32_t eventID); + IMPLEMENT_FUNCTION_PROXIED(std::vector, GetPassEvents, uint32_t eventId); IMPLEMENT_FUNCTION_PROXIED(std::vector, GetUsage, ResourceId id); IMPLEMENT_FUNCTION_PROXIED(FrameRecord, GetFrameRecord); @@ -441,13 +441,13 @@ public: IMPLEMENT_FUNCTION_PROXIED(void, GetTextureData, ResourceId tex, uint32_t arrayIdx, uint32_t mip, const GetTextureDataParams ¶ms, bytebuf &data); - IMPLEMENT_FUNCTION_PROXIED(void, InitPostVSBuffers, uint32_t eventID); + IMPLEMENT_FUNCTION_PROXIED(void, InitPostVSBuffers, uint32_t eventId); IMPLEMENT_FUNCTION_PROXIED(void, InitPostVSBuffers, const std::vector &passEvents); - IMPLEMENT_FUNCTION_PROXIED(MeshFormat, GetPostVSBuffers, uint32_t eventID, uint32_t instID, + IMPLEMENT_FUNCTION_PROXIED(MeshFormat, GetPostVSBuffers, uint32_t eventId, uint32_t instID, MeshDataStage stage); IMPLEMENT_FUNCTION_PROXIED(ResourceId, RenderOverlay, ResourceId texid, CompType typeHint, - DebugOverlay overlay, uint32_t eventID, + DebugOverlay overlay, uint32_t eventId, const std::vector &passEvents); IMPLEMENT_FUNCTION_PROXIED(rdcarray, GetShaderEntryPoints, ResourceId shader); @@ -464,11 +464,11 @@ public: std::vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint); - IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace, DebugVertex, uint32_t eventID, uint32_t vertid, + 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, + IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace, DebugPixel, uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive); - IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace, DebugThread, uint32_t eventID, + IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace, DebugThread, uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]); IMPLEMENT_FUNCTION_PROXIED(void, BuildTargetShader, std::string source, std::string entry, diff --git a/renderdoc/core/resource_manager.h b/renderdoc/core/resource_manager.h index b313d1f37..74db44af7 100644 --- a/renderdoc/core/resource_manager.h +++ b/renderdoc/core/resource_manager.h @@ -863,7 +863,7 @@ void ResourceManagerType::InsertReferencedChunks(WriteSerialiser &ser) RDCDEBUG("%u frame resource records", (uint32_t)m_FrameReferencedResources.size()); - if(RenderDoc::Inst().GetCaptureOptions().RefAllResources) + if(RenderDoc::Inst().GetCaptureOptions().refAllResources) { for(auto it = m_ResourceRecords.begin(); it != m_ResourceRecords.end(); ++it) { @@ -955,7 +955,7 @@ void ResourceManagerType::InsertInitialContentsChunks(WriteSerialiser &ser) ResourceId id = *it; if(m_FrameReferencedResources.find(id) == m_FrameReferencedResources.end() && - !RenderDoc::Inst().GetCaptureOptions().RefAllResources) + !RenderDoc::Inst().GetCaptureOptions().refAllResources) { #if ENABLED(VERBOSE_DIRTY_RESOURCES) RDCDEBUG("Dirty tesource %llu is GPU dirty but not referenced - skipping", id); @@ -1075,7 +1075,7 @@ void ResourceManagerType::ApplyInitialContentsNonChunks(WriteSerialiser &ser) ResourceId id = *it; if(m_FrameReferencedResources.find(id) == m_FrameReferencedResources.end() && - !RenderDoc::Inst().GetCaptureOptions().RefAllResources) + !RenderDoc::Inst().GetCaptureOptions().refAllResources) { continue; } diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp index beae4cb83..8a6f1c3cc 100644 --- a/renderdoc/core/target_control.cpp +++ b/renderdoc/core/target_control.cpp @@ -529,7 +529,7 @@ public: TargetControlMessage msg; if(m_Socket == NULL) { - msg.Type = TargetControlMessageType::Disconnected; + msg.type = TargetControlMessageType::Disconnected; return msg; } @@ -538,12 +538,12 @@ public: if(!m_Socket->Connected()) { SAFE_DELETE(m_Socket); - msg.Type = TargetControlMessageType::Disconnected; + msg.type = TargetControlMessageType::Disconnected; } else { Threading::Sleep(2); - msg.Type = TargetControlMessageType::Noop; + msg.type = TargetControlMessageType::Noop; } return msg; @@ -555,57 +555,57 @@ public: { SAFE_DELETE(m_Socket); - msg.Type = TargetControlMessageType::Disconnected; + msg.type = TargetControlMessageType::Disconnected; return msg; } else if(type == ePacket_Noop) { - msg.Type = TargetControlMessageType::Noop; + msg.type = TargetControlMessageType::Noop; reader.EndChunk(); return msg; } else if(type == ePacket_Busy) { READ_DATA_SCOPE(); - SERIALISE_ELEMENT(msg.Busy.ClientName).Named("Client Name"); + SERIALISE_ELEMENT(msg.busy.clientName).Named("Client Name"); SAFE_DELETE(m_Socket); - RDCLOG("Got busy signal: '%s", msg.Busy.ClientName.c_str()); - msg.Type = TargetControlMessageType::Busy; + RDCLOG("Got busy signal: '%s", msg.busy.clientName.c_str()); + msg.type = TargetControlMessageType::Busy; return msg; } else if(type == ePacket_NewChild) { - msg.Type = TargetControlMessageType::NewChild; + msg.type = TargetControlMessageType::NewChild; READ_DATA_SCOPE(); - SERIALISE_ELEMENT(msg.NewChild.PID).Named("PID"); - SERIALISE_ELEMENT(msg.NewChild.ident).Named("Child ident"); + SERIALISE_ELEMENT(msg.newChild.processId).Named("PID"); + SERIALISE_ELEMENT(msg.newChild.ident).Named("Child ident"); - RDCLOG("Got a new child process: %u %u", msg.NewChild.PID, msg.NewChild.ident); + RDCLOG("Got a new child process: %u %u", msg.newChild.processId, msg.newChild.ident); reader.EndChunk(); return msg; } else if(type == ePacket_NewCapture) { - msg.Type = TargetControlMessageType::NewCapture; + msg.type = TargetControlMessageType::NewCapture; bytebuf thumbnail; { READ_DATA_SCOPE(); - SERIALISE_ELEMENT(msg.NewCapture.ID).Named("Capture ID"); - SERIALISE_ELEMENT(msg.NewCapture.timestamp).Named("timestamp"); - SERIALISE_ELEMENT(msg.NewCapture.path).Named("path"); + SERIALISE_ELEMENT(msg.newCapture.captureId).Named("Capture ID"); + SERIALISE_ELEMENT(msg.newCapture.timestamp).Named("timestamp"); + SERIALISE_ELEMENT(msg.newCapture.path).Named("path"); SERIALISE_ELEMENT(thumbnail); } - msg.NewCapture.local = FileIO::exists(msg.NewCapture.path.c_str()); + msg.newCapture.local = FileIO::exists(msg.newCapture.path.c_str()); - RDCLOG("Got a new capture: %d (time %llu) %d byte thumbnail", msg.NewCapture.ID, - msg.NewCapture.timestamp, thumbnail.count()); + RDCLOG("Got a new capture: %d (time %llu) %d byte thumbnail", msg.newCapture.captureId, + msg.newCapture.timestamp, thumbnail.count()); int w = 0; int h = 0; @@ -615,14 +615,14 @@ public: if(w > 0 && h > 0 && thumbpixels) { - msg.NewCapture.thumbWidth = w; - msg.NewCapture.thumbHeight = h; - msg.NewCapture.thumbnail.assign(thumbpixels, w * h * 3); + msg.newCapture.thumbWidth = w; + msg.newCapture.thumbHeight = h; + msg.newCapture.thumbnail.assign(thumbpixels, w * h * 3); } else { - msg.NewCapture.thumbWidth = 0; - msg.NewCapture.thumbHeight = 0; + msg.newCapture.thumbWidth = 0; + msg.newCapture.thumbHeight = 0; } free(thumbpixels); @@ -632,38 +632,38 @@ public: } else if(type == ePacket_RegisterAPI) { - msg.Type = TargetControlMessageType::RegisterAPI; + msg.type = TargetControlMessageType::RegisterAPI; READ_DATA_SCOPE(); - SERIALISE_ELEMENT(msg.RegisterAPI.APIName).Named("API Name"); + SERIALISE_ELEMENT(msg.apiUse.name).Named("API Name"); - RDCLOG("Used API: %s", msg.RegisterAPI.APIName.c_str()); + RDCLOG("Used API: %s", msg.apiUse.name.c_str()); reader.EndChunk(); return msg; } else if(type == ePacket_CopyCapture) { - msg.Type = TargetControlMessageType::CaptureCopied; + msg.type = TargetControlMessageType::CaptureCopied; READ_DATA_SCOPE(); - SERIALISE_ELEMENT(msg.NewCapture.ID).Named("Capture ID"); + SERIALISE_ELEMENT(msg.newCapture.captureId).Named("Capture ID"); - msg.NewCapture.path = m_CaptureCopies[msg.NewCapture.ID]; + msg.newCapture.path = m_CaptureCopies[msg.newCapture.captureId]; - StreamWriter streamWriter(FileIO::fopen(msg.NewCapture.path.c_str(), "wb"), Ownership::Stream); + StreamWriter streamWriter(FileIO::fopen(msg.newCapture.path.c_str(), "wb"), Ownership::Stream); - ser.SerialiseStream(msg.NewCapture.path.c_str(), streamWriter, NULL); + ser.SerialiseStream(msg.newCapture.path.c_str(), streamWriter, NULL); if(reader.IsErrored()) { SAFE_DELETE(m_Socket); - msg.Type = TargetControlMessageType::Disconnected; + msg.type = TargetControlMessageType::Disconnected; return msg; } - m_CaptureCopies.erase(msg.NewCapture.ID); + m_CaptureCopies.erase(msg.newCapture.captureId); reader.EndChunk(); return msg; @@ -673,7 +673,7 @@ public: RDCERR("Unexpected packed received: %d", type); SAFE_DELETE(m_Socket); - msg.Type = TargetControlMessageType::Disconnected; + msg.type = TargetControlMessageType::Disconnected; return msg; } } diff --git a/renderdoc/driver/d3d11/d3d11_analyse.cpp b/renderdoc/driver/d3d11/d3d11_analyse.cpp index f8fbd7f4c..23d84de1b 100644 --- a/renderdoc/driver/d3d11/d3d11_analyse.cpp +++ b/renderdoc/driver/d3d11/d3d11_analyse.cpp @@ -566,7 +566,7 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t } } - trace.cbuffers.resize(dxbc->m_CBuffers.size()); + trace.constantBlocks.resize(dxbc->m_CBuffers.size()); for(size_t i = 0; i < dxbc->m_CBuffers.size(); i++) { if(dxbc->m_CBuffers[i].descriptor.type != CBuffer::Descriptor::TYPE_CBUFFER) @@ -577,12 +577,12 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t FillCBufferVariables(dxbc->m_CBuffers[i].variables, vars, true, cbufData[dxbc->m_CBuffers[i].reg]); - trace.cbuffers[i].members = vars; + trace.constantBlocks[i].members = vars; - for(size_t c = 0; c < trace.cbuffers[i].members.size(); c++) - trace.cbuffers[i].members[c].name = + for(size_t c = 0; c < trace.constantBlocks[i].members.size(); c++) + trace.constantBlocks[i].members[c].name = StringFormat::Fmt("cb%u[%u] (%s)", dxbc->m_CBuffers[i].reg, (uint32_t)c, - trace.cbuffers[i].members[c].name.c_str()); + trace.constantBlocks[i].members[c].name.c_str()); } initialState.Init(); @@ -958,7 +958,7 @@ struct DebugHit uint32_t rawdata; // arbitrary, depending on shader }; -ShaderDebugTrace D3D11DebugManager::DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, +ShaderDebugTrace D3D11DebugManager::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { @@ -966,11 +966,11 @@ ShaderDebugTrace D3D11DebugManager::DebugVertex(uint32_t eventID, uint32_t verti using namespace ShaderDebug; D3D11MarkerRegion debugpixRegion( - StringFormat::Fmt("DebugVertex @ %u of (%u,%u,%u)", eventID, vertid, instid, idx)); + StringFormat::Fmt("DebugVertex @ %u of (%u,%u,%u)", eventId, vertid, instid, idx)); ShaderDebugTrace empty; - const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(eventID); + const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(eventId); D3D11RenderStateTracker tracker(m_WrappedContext); @@ -1333,14 +1333,14 @@ ShaderDebugTrace D3D11DebugManager::DebugVertex(uint32_t eventID, uint32_t verti return ret; } -ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, +ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { using namespace DXBC; using namespace ShaderDebug; D3D11MarkerRegion debugpixRegion( - StringFormat::Fmt("DebugPixel @ %u of (%u,%u) %u / %u", eventID, x, y, sample, primitive)); + StringFormat::Fmt("DebugPixel @ %u of (%u,%u) %u / %u", eventId, x, y, sample, primitive)); ShaderDebugTrace empty; @@ -1794,7 +1794,7 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin { D3D11MarkerRegion initState("Replaying event for initial states"); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); m_pImmediateContext->CopyResource(stageBuf, initialBuf); } @@ -2285,14 +2285,14 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin return traces[destIdx]; } -ShaderDebugTrace D3D11DebugManager::DebugThread(uint32_t eventID, const uint32_t groupid[3], +ShaderDebugTrace D3D11DebugManager::DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { using namespace DXBC; using namespace ShaderDebug; D3D11MarkerRegion simloop(StringFormat::Fmt("DebugThread @ %u: [%u, %u, %u] (%u, %u, %u)", - eventID, groupid[0], groupid[1], groupid[2], + eventId, groupid[0], groupid[1], groupid[2], threadid[0], threadid[1], threadid[2])); ShaderDebugTrace empty; @@ -2361,10 +2361,10 @@ ShaderDebugTrace D3D11DebugManager::DebugThread(uint32_t eventID, const uint32_t return ret; } -uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, +uint32_t D3D11DebugManager::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - if(cfg.position.numVerts == 0) + if(cfg.position.numIndices == 0) return ~0U; D3D11RenderStateTracker tracker(m_WrappedContext); @@ -2390,8 +2390,8 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, cbuf.PickCoords = Vec2f((float)x, (float)y); cbuf.PickViewport = Vec2f((float)GetWidth(), (float)GetHeight()); - cbuf.PickIdx = cfg.position.idxByteWidth ? 1 : 0; - cbuf.PickNumVerts = cfg.position.numVerts; + cbuf.PickIdx = cfg.position.indexByteStride ? 1 : 0; + cbuf.PickNumVerts = cfg.position.numIndices; cbuf.PickUnproject = cfg.position.unproject ? 1 : 0; Matrix4f projMat = @@ -2472,7 +2472,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, cbuf.PickMVP = cfg.position.unproject ? pickMVPProj : pickMVP; bool isTriangleMesh = true; - switch(cfg.position.topo) + switch(cfg.position.topology) { case Topology::TriangleList: { @@ -2502,15 +2502,15 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, } ID3D11Buffer *vb = NULL, *ib = NULL; - DXGI_FORMAT ifmt = cfg.position.idxByteWidth == 4 ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT; + DXGI_FORMAT ifmt = cfg.position.indexByteStride == 4 ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT; { - auto it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.buf); + auto it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.vertexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) vb = it->second.m_Buffer; - it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.idxbuf); + it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.indexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) ib = it->second.m_Buffer; @@ -2522,23 +2522,23 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, // In the case of VB we also tightly pack and unpack the data. IB can just be // read as R16 or R32 via the SRV so it is just a straight copy - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) { // resize up on demand if(m_DebugRender.PickIBBuf == NULL || - m_DebugRender.PickIBSize < cfg.position.numVerts * cfg.position.idxByteWidth) + m_DebugRender.PickIBSize < cfg.position.numIndices * cfg.position.indexByteStride) { SAFE_RELEASE(m_DebugRender.PickIBBuf); SAFE_RELEASE(m_DebugRender.PickIBSRV); - D3D11_BUFFER_DESC desc = {cfg.position.numVerts * cfg.position.idxByteWidth, + D3D11_BUFFER_DESC desc = {cfg.position.numIndices * cfg.position.indexByteStride, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, 0}; - m_DebugRender.PickIBSize = cfg.position.numVerts * cfg.position.idxByteWidth; + m_DebugRender.PickIBSize = cfg.position.numIndices * cfg.position.indexByteStride; hr = m_pDevice->CreateBuffer(&desc, NULL, &m_DebugRender.PickIBBuf); @@ -2552,7 +2552,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, sdesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; sdesc.Format = ifmt; sdesc.Buffer.FirstElement = 0; - sdesc.Buffer.NumElements = cfg.position.numVerts; + sdesc.Buffer.NumElements = cfg.position.numIndices; hr = m_pDevice->CreateShaderResourceView(m_DebugRender.PickIBBuf, &sdesc, &m_DebugRender.PickIBSRV); @@ -2567,7 +2567,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, // copy index data as-is, the view format will take care of the rest - RDCASSERT(cfg.position.idxoffs < 0xffffffff); + RDCASSERT(cfg.position.indexByteOffset < 0xffffffff); if(ib) { @@ -2577,31 +2577,32 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, D3D11_BOX box; box.front = 0; box.back = 1; - box.left = (uint32_t)cfg.position.idxoffs; - box.right = (uint32_t)cfg.position.idxoffs + cfg.position.numVerts * cfg.position.idxByteWidth; + box.left = (uint32_t)cfg.position.indexByteOffset; + box.right = (uint32_t)cfg.position.indexByteOffset + + cfg.position.numIndices * cfg.position.indexByteStride; box.top = 0; box.bottom = 1; - box.right = RDCMIN(box.right, ibdesc.ByteWidth - (uint32_t)cfg.position.idxoffs); + box.right = RDCMIN(box.right, ibdesc.ByteWidth - (uint32_t)cfg.position.indexByteOffset); m_pImmediateContext->CopySubresourceRegion(m_DebugRender.PickIBBuf, 0, 0, 0, 0, ib, 0, &box); } } if(m_DebugRender.PickVBBuf == NULL || - m_DebugRender.PickVBSize < cfg.position.numVerts * sizeof(Vec4f)) + m_DebugRender.PickVBSize < cfg.position.numIndices * sizeof(Vec4f)) { SAFE_RELEASE(m_DebugRender.PickVBBuf); SAFE_RELEASE(m_DebugRender.PickVBSRV); - D3D11_BUFFER_DESC desc = {cfg.position.numVerts * sizeof(Vec4f), + D3D11_BUFFER_DESC desc = {cfg.position.numIndices * sizeof(Vec4f), D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, 0}; - m_DebugRender.PickVBSize = cfg.position.numVerts * sizeof(Vec4f); + m_DebugRender.PickVBSize = cfg.position.numIndices * sizeof(Vec4f); hr = m_pDevice->CreateBuffer(&desc, NULL, &m_DebugRender.PickVBBuf); @@ -2615,7 +2616,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, sdesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; sdesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; sdesc.Buffer.FirstElement = 0; - sdesc.Buffer.NumElements = cfg.position.numVerts; + sdesc.Buffer.NumElements = cfg.position.numIndices; hr = m_pDevice->CreateShaderResourceView(m_DebugRender.PickVBBuf, &sdesc, &m_DebugRender.PickVBSRV); @@ -2631,10 +2632,10 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, // unpack and linearise the data if(vb) { - FloatVector *vbData = new FloatVector[cfg.position.numVerts]; + FloatVector *vbData = new FloatVector[cfg.position.numIndices]; bytebuf oldData; - GetBufferData(vb, cfg.position.offset, 0, oldData); + GetBufferData(vb, cfg.position.vertexByteOffset, 0, oldData); byte *data = &oldData[0]; byte *dataEnd = data + oldData.size(); @@ -2645,7 +2646,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, if(cfg.position.baseVertex < 0) idxclamp = uint32_t(-cfg.position.baseVertex); - for(uint32_t i = 0; i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < cfg.position.numIndices; i++) { uint32_t idx = i; @@ -2666,7 +2667,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, box.front = 0; box.back = 1; box.left = 0; - box.right = cfg.position.numVerts * sizeof(Vec4f); + box.right = cfg.position.numIndices * sizeof(Vec4f); m_pImmediateContext->UpdateSubresource(m_DebugRender.PickVBBuf, 0, &box, vbData, sizeof(Vec4f), sizeof(Vec4f)); @@ -2687,7 +2688,7 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, m_pImmediateContext->CSSetShader(m_DebugRender.MeshPickCS, NULL, 0); - m_pImmediateContext->Dispatch(cfg.position.numVerts / 1024 + 1, 1, 1); + m_pImmediateContext->Dispatch(cfg.position.numIndices / 1024 + 1, 1, 1); m_pImmediateContext->CopyStructureCount(m_DebugRender.histogramBuff, 0, m_DebugRender.PickResultUAV); @@ -2798,22 +2799,22 @@ void D3D11DebugManager::PickPixel(ResourceId texture, uint32_t x, uint32_t y, ui { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = true; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = sample; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = sliceFace; - texDisplay.rangemin = 0.0f; - texDisplay.rangemax = 1.0f; + texDisplay.rangeMin = 0.0f; + texDisplay.rangeMax = 1.0f; texDisplay.scale = 1.0f; - texDisplay.texid = texture; + texDisplay.resourceId = texture; texDisplay.typeHint = typeHint; - texDisplay.rawoutput = true; - texDisplay.offx = -float(x); - texDisplay.offy = -float(y); + texDisplay.rawOutput = true; + texDisplay.xOffset = -float(x); + texDisplay.yOffset = -float(y); RenderTexture(texDisplay, false); } @@ -2969,23 +2970,23 @@ void D3D11DebugManager::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32 { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = 0; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = arrayIdx; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = params.typeHint; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; RenderTexture(texDisplay, false); } @@ -3110,23 +3111,23 @@ void D3D11DebugManager::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32 { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = params.resolve ? ~0U : arrayIdx; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = arrayIdx; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = params.typeHint; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; RenderTexture(texDisplay, false); } @@ -3269,23 +3270,23 @@ void D3D11DebugManager::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32 TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = 0; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = i << mip; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = params.typeHint; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; RenderTexture(texDisplay, false); @@ -3387,22 +3388,22 @@ ResourceId D3D11DebugManager::ApplyCustomShader(ResourceId shader, ResourceId te m_pImmediateContext->RSSetViewports(1, &viewport); TextureDisplay disp; - disp.Red = disp.Green = disp.Blue = disp.Alpha = true; - disp.FlipY = false; - disp.offx = 0.0f; - disp.offy = 0.0f; - disp.CustomShader = shader; - disp.texid = texid; + disp.red = disp.green = disp.blue = disp.alpha = true; + disp.flipY = false; + disp.xOffset = 0.0f; + disp.yOffset = 0.0f; + disp.customShaderId = shader; + disp.resourceId = texid; disp.typeHint = typeHint; disp.backgroundColor = FloatVector(0, 0, 0, 1.0); - disp.HDRMul = -1.0f; + disp.hdrMultiplier = -1.0f; disp.linearDisplayAsGamma = false; disp.mip = mip; disp.sampleIdx = sampleIdx; disp.overlay = DebugOverlay::NoOverlay; - disp.rangemin = 0.0f; - disp.rangemax = 1.0f; - disp.rawoutput = false; + disp.rangeMin = 0.0f; + disp.rangeMax = 1.0f; + disp.rawOutput = false; disp.scale = 1.0f; disp.sliceFace = arrayIdx; @@ -3454,7 +3455,7 @@ void D3D11DebugManager::CreateCustomShaderTex(uint32_t w, uint32_t h) } ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { TextureShaderDetails details = GetShaderDetails(texid, typeHint, false); @@ -3662,7 +3663,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->RSSetState(rs); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); SAFE_RELEASE(os); SAFE_RELEASE(rs); @@ -3742,7 +3743,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->RSSetState(rs); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); overlayConsts[0] = 0.0f; overlayConsts[1] = 1.0f; @@ -3753,7 +3754,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->RSSetState(rsCull); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); SAFE_RELEASE(os); SAFE_RELEASE(rs); @@ -3963,7 +3964,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->RSSetState(rs); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); SAFE_RELEASE(os); SAFE_RELEASE(rs); @@ -3975,7 +3976,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, if(overlay == DebugOverlay::ClearBeforeDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty()) { @@ -4049,12 +4050,12 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, if(overlay == DebugOverlay::TriangleSizeDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(overlay == DebugOverlay::TriangleSizePass) m_WrappedDevice->ReplayLog(0, events[0], eReplay_WithoutDraw); - events.push_back(eventID); + events.push_back(eventId); for(size_t i = 0; i < events.size(); i++) { @@ -4091,33 +4092,33 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) { MeshFormat fmt = GetPostVSBuffers(events[i], inst, MeshDataStage::GSOut); - if(fmt.buf == ResourceId()) + if(fmt.vertexResourceId == ResourceId()) fmt = GetPostVSBuffers(events[i], inst, MeshDataStage::VSOut); - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { - D3D11_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(fmt.topo); + D3D11_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(fmt.topology); ID3D11Buffer *ibuf = NULL; DXGI_FORMAT ifmt = DXGI_FORMAT_R16_UINT; - UINT ioffs = (UINT)fmt.idxoffs; + UINT ioffs = (UINT)fmt.indexByteOffset; ID3D11Buffer *vbs[2] = {NULL, NULL}; - UINT str[2] = {fmt.stride, 4}; - UINT offs[2] = {(UINT)fmt.offset, 0}; + UINT str[2] = {fmt.vertexByteStride, 4}; + UINT offs[2] = {(UINT)fmt.vertexByteOffset, 0}; { - auto it = WrappedID3D11Buffer::m_BufferList.find(fmt.buf); + auto it = WrappedID3D11Buffer::m_BufferList.find(fmt.vertexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) vbs[0] = it->second.m_Buffer; - it = WrappedID3D11Buffer::m_BufferList.find(fmt.idxbuf); + it = WrappedID3D11Buffer::m_BufferList.find(fmt.indexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) ibuf = it->second.m_Buffer; - if(fmt.idxByteWidth == 4) + if(fmt.indexByteStride == 4) ifmt = DXGI_FORMAT_R32_UINT; } @@ -4142,9 +4143,9 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->OMSetRenderTargets(1, &rtv, oldstate.OM.DepthView); if(ibuf) - m_pImmediateContext->DrawIndexed(fmt.numVerts, 0, fmt.baseVertex); + m_pImmediateContext->DrawIndexed(fmt.numIndices, 0, fmt.baseVertex); else - m_pImmediateContext->Draw(fmt.numVerts, 0); + m_pImmediateContext->Draw(fmt.numIndices, 0); } } @@ -4160,7 +4161,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, } if(overlay == DebugOverlay::TriangleSizePass) - m_WrappedDevice->ReplayLog(0, eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_WithoutDraw); } else if(overlay == DebugOverlay::QuadOverdrawPass || overlay == DebugOverlay::QuadOverdrawDraw) { @@ -4171,7 +4172,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, if(overlay == DebugOverlay::QuadOverdrawDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty()) { @@ -4370,7 +4371,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, SAFE_RELEASE(overdrawUAV); if(overlay == DebugOverlay::QuadOverdrawPass) - m_WrappedDevice->ReplayLog(0, eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_WithoutDraw); } } else if(preDrawDepth) @@ -4517,7 +4518,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); SAFE_RELEASE(os); @@ -4552,7 +4553,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); SAFE_RELEASE(os); } @@ -4612,7 +4613,7 @@ ResourceId D3D11DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, m_pImmediateContext->RSSetState(rs); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); SAFE_RELEASE(os); SAFE_RELEASE(rs); @@ -5298,7 +5299,7 @@ vector D3D11DebugManager::PixelHistory(vector eve return history; } - m_WrappedDevice->ReplayLog(0, events[0].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[0].eventId, eReplay_WithoutDraw); ID3D11RasterizerState *curRS = NULL; ID3D11RasterizerState *newRS = NULL; @@ -5717,7 +5718,7 @@ vector D3D11DebugManager::PixelHistory(vector eve // For UAV output we only want to replay once in pristine conditions (only fetching before/after // values) if(!uavOutput) - m_WrappedDevice->ReplayLog(0, events[ev].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[ev].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(occl[ev]); @@ -5770,7 +5771,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->OMSetRenderTargets(0, NULL, shaddepthOutputDSV); // replay first with overlay shader. This is guaranteed to count all fragments - m_WrappedDevice->ReplayLog(0, events[ev].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[ev].eventId, eReplay_OnlyDraw); PixelHistoryCopyPixel(params, storex * pixstoreStride + 2, storey); m_pImmediateContext->PSSetShader(curPS, curInst, curNumInst); @@ -5778,7 +5779,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->ClearDepthStencilView(shaddepthOutputDSV, D3D11_CLEAR_STENCIL, 1.0f, 0); // now replay with original shader. Some fragments may discard and not be counted - m_WrappedDevice->ReplayLog(0, events[ev].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[ev].eventId, eReplay_OnlyDraw); PixelHistoryCopyPixel(params, storex * pixstoreStride + 3, storey); UINT initCounts[D3D11_1_UAV_SLOT_COUNT]; @@ -5813,7 +5814,7 @@ vector D3D11DebugManager::PixelHistory(vector eve SAFE_RELEASE(curDS); // replay only draw to get immediately post-modification values - m_WrappedDevice->ReplayLog(events[ev].eventID, events[ev].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(events[ev].eventId, events[ev].eventId, eReplay_OnlyDraw); PixelHistoryCopyPixel(colourCopyParams, storex * pixstoreStride + 1, storey); PixelHistoryCopyPixel(depthCopyParams, storex * pixstoreStride + 1, storey); @@ -5822,7 +5823,7 @@ vector D3D11DebugManager::PixelHistory(vector eve SAFE_RELEASE(releaseStencilSRV); if(ev < events.size() - 1) - m_WrappedDevice->ReplayLog(events[ev].eventID + 1, events[ev + 1].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(events[ev].eventId + 1, events[ev + 1].eventId, eReplay_WithoutDraw); SAFE_RELEASE(depthRes); } @@ -5841,7 +5842,7 @@ vector D3D11DebugManager::PixelHistory(vector eve ResourceRange resourceRange(targetres, mip, slice); - const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(events[i].eventID); + const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(events[i].eventId); bool clear = bool(draw->flags & DrawFlags::Clear); @@ -5896,7 +5897,7 @@ vector D3D11DebugManager::PixelHistory(vector eve if(!used) { RDCDEBUG("Usage %d at %u didn't refer to the matching mip/slice (%u/%u)", events[i].usage, - events[i].eventID, mip, slice); + events[i].eventId, mip, slice); occlData = 0; clear = uavWrite = false; } @@ -5907,12 +5908,12 @@ vector D3D11DebugManager::PixelHistory(vector eve PixelModification mod; RDCEraseEl(mod); - mod.eventID = events[i].eventID; + mod.eventId = events[i].eventId; mod.directShaderWrite = uavWrite; mod.unboundPS = false; - mod.preMod.col.value_u[0] = (uint32_t)i; + mod.preMod.col.uintValue[0] = (uint32_t)i; if(!(draw->flags & DrawFlags::Clear) && !uavWrite) { @@ -5927,7 +5928,7 @@ vector D3D11DebugManager::PixelHistory(vector eve if(flags[i] & Predication_Failed) mod.predicationSkipped = true; - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); { ID3D11RenderTargetView *tmpViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {0}; @@ -6049,7 +6050,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pDevice->CreateRasterizerState(&rd, &newRS); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); m_pImmediateContext->OMSetBlendState(m_DebugRender.NopBlendState, blendFactor, sampleMask); m_pImmediateContext->OMSetDepthStencilState(m_DebugRender.AllPassDepthState, stencilRef); @@ -6058,7 +6059,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->Begin(testQueries[3]); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(testQueries[3]); @@ -6075,7 +6076,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pDevice->CreateRasterizerState(&rd, &newRS); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); m_pImmediateContext->OMSetBlendState(m_DebugRender.NopBlendState, blendFactor, sampleMask); @@ -6085,7 +6086,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->Begin(testQueries[0]); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(testQueries[0]); @@ -6102,7 +6103,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pDevice->CreateRasterizerState(&rd, &newRS); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); m_pImmediateContext->OMSetBlendState(m_DebugRender.NopBlendState, blendFactor, sampleMask); @@ -6112,7 +6113,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->Begin(testQueries[1]); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(testQueries[1]); @@ -6162,7 +6163,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pDevice->CreateRasterizerState(&rd, &newRS); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); m_pImmediateContext->OMSetBlendState(m_DebugRender.NopBlendState, blendFactor, sampleMask); @@ -6172,7 +6173,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->Begin(testQueries[2]); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(testQueries[2]); @@ -6204,7 +6205,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pDevice->CreateDepthStencilState(&dsd, &newDS); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); m_pImmediateContext->OMSetBlendState(m_DebugRender.NopBlendState, blendFactor, sampleMask); @@ -6214,7 +6215,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->Begin(testQueries[4]); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(testQueries[4]); @@ -6236,7 +6237,7 @@ vector D3D11DebugManager::PixelHistory(vector eve // stencil isn't run m_pDevice->CreateDepthStencilState(&dsdesc, &newDS); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_WithoutDraw); m_pImmediateContext->PSSetShader(m_DebugRender.OverlayPS, NULL, 0); m_pImmediateContext->OMSetBlendState(m_DebugRender.NopBlendState, blendFactor, sampleMask); @@ -6246,7 +6247,7 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->Begin(testQueries[5]); - m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, events[i].eventId, eReplay_OnlyDraw); m_pImmediateContext->End(testQueries[5]); @@ -6348,7 +6349,7 @@ vector D3D11DebugManager::PixelHistory(vector eve history.push_back(mod); - RDCDEBUG("Event %u is visible, %llu samples visible", events[i].eventID, (UINT64)occlData); + RDCDEBUG("Event %u is visible, %llu samples visible", events[i].eventId, (UINT64)occlData); } SAFE_RELEASE(occl[i]); @@ -6376,9 +6377,9 @@ vector D3D11DebugManager::PixelHistory(vector eve { PixelModification &mod = history[h]; - uint32_t pre = mod.preMod.col.value_u[0]; + uint32_t pre = mod.preMod.col.uintValue[0]; - mod.preMod.col.value_u[0] = 0; + mod.preMod.col.uintValue[0] = 0; // figure out where this event lies in the pixstore texture uint32_t storex = uint32_t(pre % (2048 / pixstoreStride)); @@ -6402,25 +6403,25 @@ vector D3D11DebugManager::PixelHistory(vector eve { int8_t *d = (int8_t *)data; for(uint32_t c = 0; c < fmt.compCount; c++) - val->col.value_i[c] = d[c]; + val->col.intValue[c] = d[c]; } else if(fmt.compByteWidth == 2) { int16_t *d = (int16_t *)data; for(uint32_t c = 0; c < fmt.compCount; c++) - val->col.value_i[c] = d[c]; + val->col.intValue[c] = d[c]; } else if(fmt.compByteWidth == 4) { int32_t *d = (int32_t *)data; for(uint32_t c = 0; c < fmt.compCount; c++) - val->col.value_i[c] = d[c]; + val->col.intValue[c] = d[c]; } } else { for(uint32_t c = 0; c < fmt.compCount; c++) - memcpy(&val->col.value_u[c], data + fmt.compByteWidth * c, fmt.compByteWidth); + memcpy(&val->col.uintValue[c], data + fmt.compByteWidth * c, fmt.compByteWidth); } } } @@ -6447,7 +6448,7 @@ vector D3D11DebugManager::PixelHistory(vector eve v = Vec4f(v3.x, v3.y, v3.z); } - memcpy(&val->col.value_f[0], &v, sizeof(float) * 4); + memcpy(&val->col.floatValue[0], &v, sizeof(float) * 4); } } else @@ -6467,11 +6468,11 @@ vector D3D11DebugManager::PixelHistory(vector eve mod.postMod.stencil = int32_t(data[3]); // data[4] unused - mod.shaderOut.col.value_i[0] = + mod.shaderOut.col.intValue[0] = int32_t(data[5]); // fragments writing to the pixel in this event with overlay shader // data[6] unused - mod.shaderOut.col.value_i[1] = + mod.shaderOut.col.intValue[1] = int32_t(data[7]); // fragments writing to the pixel in this event with original shader } } @@ -6485,8 +6486,8 @@ vector D3D11DebugManager::PixelHistory(vector eve for(size_t h = 0; h < history.size();) { - int32_t frags = RDCMAX(1, history[h].shaderOut.col.value_i[0]); - int32_t fragsClipped = RDCCLAMP(history[h].shaderOut.col.value_i[1], 1, frags); + int32_t frags = RDCMAX(1, history[h].shaderOut.col.intValue[0]); + int32_t fragsClipped = RDCCLAMP(history[h].shaderOut.col.intValue[1], 1, frags); // if we have fewer fragments with the original shader, some discarded // so we need to do a thorough check to see which fragments discarded @@ -6533,20 +6534,20 @@ vector D3D11DebugManager::PixelHistory(vector eve for(size_t h = 0; h < history.size(); h++) { - const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(history[h].eventID); + const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(history[h].eventId); if(draw->flags & DrawFlags::Clear) continue; D3D11MarkerRegion historyData( - StringFormat::Fmt("Fetching history data for %u: %s", draw->eventID, draw->name.c_str())); + StringFormat::Fmt("Fetching history data for %u: %s", draw->eventId, draw->name.c_str())); - if(prev != history[h].eventID) + if(prev != history[h].eventId) { D3D11MarkerRegion predraw("fetching pre-draw"); - m_WrappedDevice->ReplayLog(0, history[h].eventID, eReplay_WithoutDraw); - prev = history[h].eventID; + m_WrappedDevice->ReplayLog(0, history[h].eventId, eReplay_WithoutDraw); + prev = history[h].eventId; curNumScissors = curNumViews = 16; m_pImmediateContext->RSGetViewports(&curNumViews, curViewports); @@ -6675,13 +6676,13 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->OMSetDepthStencilState(ds, history[h].fragIndex); // if we're not the last modification in our event, need to fetch post fragment value - if(h + 1 < history.size() && history[h].eventID == history[h + 1].eventID) + if(h + 1 < history.size() && history[h].eventId == history[h + 1].eventId) { D3D11MarkerRegion middraw("fetching mid-draw"); m_pImmediateContext->OMSetRenderTargets(rtIndex + 1, RTVs, shaddepthOutputDSV); - m_WrappedDevice->ReplayLog(0, history[h].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, history[h].eventId, eReplay_OnlyDraw); PixelHistoryCopyPixel(colourCopyParams, postColSlot % 2048, postColSlot / 2048); postColSlot++; @@ -6707,7 +6708,7 @@ vector D3D11DebugManager::PixelHistory(vector eve sparseRTVs[rtIndex] = shadOutputRTV; m_pImmediateContext->OMSetRenderTargets(rtIndex + 1, sparseRTVs, shaddepthOutputDSV); - m_WrappedDevice->ReplayLog(0, history[h].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, history[h].eventId, eReplay_OnlyDraw); PixelHistoryCopyPixel(shadoutCopyParams, shadColSlot % 2048, shadColSlot / 2048); shadColSlot++; @@ -6733,7 +6734,7 @@ vector D3D11DebugManager::PixelHistory(vector eve if(curPS == NULL) history[h].unboundPS = true; - m_WrappedDevice->ReplayLog(0, history[h].eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, history[h].eventId, eReplay_OnlyDraw); m_pImmediateContext->PSSetShader(curPS, curInst, curNumInst); @@ -6786,13 +6787,13 @@ vector D3D11DebugManager::PixelHistory(vector eve for(size_t h = 0; h < history.size(); h++) { - const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(history[h].eventID); + const DrawcallDescription *draw = m_WrappedDevice->GetDrawcall(history[h].eventId); if(draw->flags & DrawFlags::Clear) continue; // if we're not the last modification in our event, need to fetch post fragment value - if(h + 1 < history.size() && history[h].eventID == history[h + 1].eventID) + if(h + 1 < history.size() && history[h].eventId == history[h + 1].eventId) { // colour { @@ -6809,25 +6810,25 @@ vector D3D11DebugManager::PixelHistory(vector eve { int8_t *d = (int8_t *)data; for(uint32_t c = 0; c < fmt.compCount; c++) - history[h].postMod.col.value_i[c] = d[c]; + history[h].postMod.col.intValue[c] = d[c]; } else if(fmt.compByteWidth == 2) { int16_t *d = (int16_t *)data; for(uint32_t c = 0; c < fmt.compCount; c++) - history[h].postMod.col.value_i[c] = d[c]; + history[h].postMod.col.intValue[c] = d[c]; } else if(fmt.compByteWidth == 4) { int32_t *d = (int32_t *)data; for(uint32_t c = 0; c < fmt.compCount; c++) - history[h].postMod.col.value_i[c] = d[c]; + history[h].postMod.col.intValue[c] = d[c]; } } else { for(uint32_t c = 0; c < fmt.compCount; c++) - memcpy(&history[h].postMod.col.value_u[c], data + fmt.compByteWidth * c, + memcpy(&history[h].postMod.col.uintValue[c], data + fmt.compByteWidth * c, fmt.compByteWidth); } } @@ -6849,7 +6850,7 @@ vector D3D11DebugManager::PixelHistory(vector eve v = Vec4f(v3.x, v3.y, v3.z); } - memcpy(&history[h].postMod.col.value_f[0], &v, sizeof(float) * 4); + memcpy(&history[h].postMod.col.floatValue[0], &v, sizeof(float) * 4); } else { @@ -6884,13 +6885,13 @@ vector D3D11DebugManager::PixelHistory(vector eve } // if we're not the first modification in our event, set our preMod to the previous postMod - if(h > 0 && history[h].eventID == history[h - 1].eventID) + if(h > 0 && history[h].eventId == history[h - 1].eventId) { history[h].preMod = history[h - 1].postMod; } // reset discarded offset every event - if(h > 0 && history[h].eventID != history[h - 1].eventID) + if(h > 0 && history[h].eventId != history[h - 1].eventId) { discardedOffset = 0; } @@ -6909,7 +6910,7 @@ vector D3D11DebugManager::PixelHistory(vector eve byte *rowdata = shadoutStoreData + mappedShadout.RowPitch * (offsettedSlot / 2048); byte *data = rowdata + 4 * sizeof(float) * (offsettedSlot % 2048); - memcpy(&history[h].shaderOut.col.value_u[0], data, 4 * sizeof(float)); + memcpy(&history[h].shaderOut.col.uintValue[0], data, 4 * sizeof(float)); } // depth @@ -6952,9 +6953,9 @@ vector D3D11DebugManager::PixelHistory(vector eve { // don't need to worry about trashing state, since at this point we don't need to restore it // anymore - if(prev != history[h].eventID) + if(prev != history[h].eventId) { - m_WrappedDevice->ReplayLog(0, history[h].eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, history[h].eventId, eReplay_WithoutDraw); ////////////////////////////////////////////////////////////// // Set up an identical raster state, but with scissor enabled. @@ -7001,7 +7002,7 @@ vector D3D11DebugManager::PixelHistory(vector eve SAFE_RELEASE(newRS); } - prev = history[h].eventID; + prev = history[h].eventId; m_pImmediateContext->ClearDepthStencilView( shaddepthOutputDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 0.0f, 0); @@ -7061,8 +7062,8 @@ vector D3D11DebugManager::PixelHistory(vector eve { for(uint32_t c = 0; c < fmt.compCount; c++) { - mod.preMod.col.value_f[c] = ConvertFromHalf(uint16_t(mod.preMod.col.value_u[c])); - mod.postMod.col.value_f[c] = ConvertFromHalf(uint16_t(mod.postMod.col.value_u[c])); + mod.preMod.col.floatValue[c] = ConvertFromHalf(uint16_t(mod.preMod.col.uintValue[c])); + mod.postMod.col.floatValue[c] = ConvertFromHalf(uint16_t(mod.postMod.col.uintValue[c])); } } else if(fmt.compType == CompType::UNorm && fmt.compByteWidth == 1 && fmt.srgbCorrected) @@ -7071,15 +7072,15 @@ vector D3D11DebugManager::PixelHistory(vector eve for(uint32_t c = 0; c < RDCMIN(fmt.compCount, uint8_t(3)); c++) { - mod.preMod.col.value_f[c] = ConvertFromSRGB8(mod.preMod.col.value_u[c] & 0xff); - mod.postMod.col.value_f[c] = ConvertFromSRGB8(mod.postMod.col.value_u[c] & 0xff); + mod.preMod.col.floatValue[c] = ConvertFromSRGB8(mod.preMod.col.uintValue[c] & 0xff); + mod.postMod.col.floatValue[c] = ConvertFromSRGB8(mod.postMod.col.uintValue[c] & 0xff); } // alpha is not SRGB'd if(fmt.compCount == 4) { - mod.preMod.col.value_f[3] = float(mod.preMod.col.value_u[3] & 0xff) / 255.0f; - mod.postMod.col.value_f[3] = float(mod.postMod.col.value_u[3] & 0xff) / 255.0f; + mod.preMod.col.floatValue[3] = float(mod.preMod.col.uintValue[3] & 0xff) / 255.0f; + mod.postMod.col.floatValue[3] = float(mod.postMod.col.uintValue[3] & 0xff) / 255.0f; } } else if(fmt.compType == CompType::UNorm) @@ -7091,54 +7092,54 @@ vector D3D11DebugManager::PixelHistory(vector eve for(uint32_t c = 0; c < fmt.compCount; c++) { - mod.preMod.col.value_f[c] = float(mod.preMod.col.value_u[c]) / maxVal; - mod.postMod.col.value_f[c] = float(mod.postMod.col.value_u[c]) / maxVal; + mod.preMod.col.floatValue[c] = float(mod.preMod.col.uintValue[c]) / maxVal; + mod.postMod.col.floatValue[c] = float(mod.postMod.col.uintValue[c]) / maxVal; } } else if(fmt.compType == CompType::SNorm && fmt.compByteWidth == 2) { for(uint32_t c = 0; c < fmt.compCount; c++) { - mod.preMod.col.value_f[c] = float(mod.preMod.col.value_u[c]); - mod.postMod.col.value_f[c] = float(mod.postMod.col.value_u[c]); + mod.preMod.col.floatValue[c] = float(mod.preMod.col.uintValue[c]); + mod.postMod.col.floatValue[c] = float(mod.postMod.col.uintValue[c]); } } else if(fmt.compType == CompType::SNorm && fmt.compByteWidth == 1) { for(uint32_t c = 0; c < fmt.compCount; c++) { - int8_t *d = (int8_t *)&mod.preMod.col.value_u[c]; + int8_t *d = (int8_t *)&mod.preMod.col.uintValue[c]; if(*d == -128) - mod.preMod.col.value_f[c] = -1.0f; + mod.preMod.col.floatValue[c] = -1.0f; else - mod.preMod.col.value_f[c] = float(*d) / 127.0f; + mod.preMod.col.floatValue[c] = float(*d) / 127.0f; - d = (int8_t *)&mod.postMod.col.value_u[c]; + d = (int8_t *)&mod.postMod.col.uintValue[c]; if(*d == -128) - mod.postMod.col.value_f[c] = -1.0f; + mod.postMod.col.floatValue[c] = -1.0f; else - mod.postMod.col.value_f[c] = float(*d) / 127.0f; + mod.postMod.col.floatValue[c] = float(*d) / 127.0f; } } else if(fmt.compType == CompType::SNorm && fmt.compByteWidth == 2) { for(uint32_t c = 0; c < fmt.compCount; c++) { - int16_t *d = (int16_t *)&mod.preMod.col.value_u[c]; + int16_t *d = (int16_t *)&mod.preMod.col.uintValue[c]; if(*d == -32768) - mod.preMod.col.value_f[c] = -1.0f; + mod.preMod.col.floatValue[c] = -1.0f; else - mod.preMod.col.value_f[c] = float(*d) / 32767.0f; + mod.preMod.col.floatValue[c] = float(*d) / 32767.0f; - d = (int16_t *)&mod.postMod.col.value_u[c]; + d = (int16_t *)&mod.postMod.col.uintValue[c]; if(*d == -32768) - mod.postMod.col.value_f[c] = -1.0f; + mod.postMod.col.floatValue[c] = -1.0f; else - mod.postMod.col.value_f[c] = float(*d) / 32767.0f; + mod.postMod.col.floatValue[c] = float(*d) / 32767.0f; } } } @@ -7153,16 +7154,17 @@ vector D3D11DebugManager::PixelHistory(vector eve "pre {%f,%f,%f,%f} {%f,%d}\n" "+ shad {%f,%f,%f,%f} {%f,%d}\n" "-> post {%f,%f,%f,%f} {%f,%d}", - uint32_t(h), hs.fragIndex, hs.primitiveID, hs.eventID, hs.depthTestFailed, + uint32_t(h), hs.fragIndex, hs.primitiveID, hs.eventId, hs.depthTestFailed, - hs.preMod.col.value_f[0], hs.preMod.col.value_f[1], hs.preMod.col.value_f[2], - hs.preMod.col.value_f[3], hs.preMod.depth, hs.preMod.stencil, + hs.preMod.col.floatValue[0], hs.preMod.col.floatValue[1], hs.preMod.col.floatValue[2], + hs.preMod.col.floatValue[3], hs.preMod.depth, hs.preMod.stencil, - hs.shaderOut.col.value_f[0], hs.shaderOut.col.value_f[1], hs.shaderOut.col.value_f[2], - hs.shaderOut.col.value_f[3], hs.shaderOut.depth, hs.shaderOut.stencil, + hs.shaderOut.col.floatValue[0], hs.shaderOut.col.floatValue[1], + hs.shaderOut.col.floatValue[2], hs.shaderOut.col.floatValue[3], hs.shaderOut.depth, + hs.shaderOut.stencil, - hs.postMod.col.value_f[0], hs.postMod.col.value_f[1], hs.postMod.col.value_f[2], - hs.postMod.col.value_f[3], hs.postMod.depth, hs.postMod.stencil); + hs.postMod.col.floatValue[0], hs.postMod.col.floatValue[1], hs.postMod.col.floatValue[2], + hs.postMod.col.floatValue[3], hs.postMod.depth, hs.postMod.stencil); } #endif diff --git a/renderdoc/driver/d3d11/d3d11_common.cpp b/renderdoc/driver/d3d11/d3d11_common.cpp index 8da8f9ce1..c8ad244b8 100644 --- a/renderdoc/driver/d3d11/d3d11_common.cpp +++ b/renderdoc/driver/d3d11/d3d11_common.cpp @@ -484,75 +484,75 @@ void DoSerialise(SerialiserType &ser, D3D11InitParams &el) INSTANTIATE_SERIALISE_TYPE(D3D11InitParams); -TextureDim MakeTextureDim(D3D11_SRV_DIMENSION dim) +TextureType MakeTextureDim(D3D11_SRV_DIMENSION dim) { switch(dim) { - case D3D11_SRV_DIMENSION_UNKNOWN: return TextureDim::Unknown; + case D3D11_SRV_DIMENSION_UNKNOWN: return TextureType::Unknown; case D3D11_SRV_DIMENSION_BUFFER: - case D3D11_SRV_DIMENSION_BUFFEREX: return TextureDim::Buffer; - case D3D11_SRV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D11_SRV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D11_SRV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D11_SRV_DIMENSION_TEXTURE2DMS: return TextureDim::Texture2DMS; - case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: return TextureDim::Texture2DMSArray; - case D3D11_SRV_DIMENSION_TEXTURE3D: return TextureDim::Texture3D; - case D3D11_SRV_DIMENSION_TEXTURECUBE: return TextureDim::TextureCube; - case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: return TextureDim::TextureCubeArray; + case D3D11_SRV_DIMENSION_BUFFEREX: return TextureType::Buffer; + case D3D11_SRV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D11_SRV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D11_SRV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D11_SRV_DIMENSION_TEXTURE2DMS: return TextureType::Texture2DMS; + case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: return TextureType::Texture2DMSArray; + case D3D11_SRV_DIMENSION_TEXTURE3D: return TextureType::Texture3D; + case D3D11_SRV_DIMENSION_TEXTURECUBE: return TextureType::TextureCube; + case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: return TextureType::TextureCubeArray; } - return TextureDim::Unknown; + return TextureType::Unknown; } -TextureDim MakeTextureDim(D3D11_RTV_DIMENSION dim) +TextureType MakeTextureDim(D3D11_RTV_DIMENSION dim) { switch(dim) { - case D3D11_RTV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D11_RTV_DIMENSION_BUFFER: return TextureDim::Buffer; - case D3D11_RTV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D11_RTV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D11_RTV_DIMENSION_TEXTURE2DMS: return TextureDim::Texture2DMS; - case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: return TextureDim::Texture2DMSArray; - case D3D11_RTV_DIMENSION_TEXTURE3D: return TextureDim::Texture3D; + case D3D11_RTV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D11_RTV_DIMENSION_BUFFER: return TextureType::Buffer; + case D3D11_RTV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D11_RTV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: return TextureType::Texture2DMS; + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: return TextureType::Texture2DMSArray; + case D3D11_RTV_DIMENSION_TEXTURE3D: return TextureType::Texture3D; } - return TextureDim::Unknown; + return TextureType::Unknown; } -TextureDim MakeTextureDim(D3D11_DSV_DIMENSION dim) +TextureType MakeTextureDim(D3D11_DSV_DIMENSION dim) { switch(dim) { - case D3D11_DSV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D11_DSV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D11_DSV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D11_DSV_DIMENSION_TEXTURE2DMS: return TextureDim::Texture2DMS; - case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: return TextureDim::Texture2DMSArray; + case D3D11_DSV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D11_DSV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D11_DSV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D11_DSV_DIMENSION_TEXTURE2DMS: return TextureType::Texture2DMS; + case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: return TextureType::Texture2DMSArray; } - return TextureDim::Unknown; + return TextureType::Unknown; } -TextureDim MakeTextureDim(D3D11_UAV_DIMENSION dim) +TextureType MakeTextureDim(D3D11_UAV_DIMENSION dim) { switch(dim) { - case D3D11_UAV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D11_UAV_DIMENSION_BUFFER: return TextureDim::Buffer; - case D3D11_UAV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D11_UAV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D11_UAV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D11_UAV_DIMENSION_TEXTURE3D: return TextureDim::Texture3D; + case D3D11_UAV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D11_UAV_DIMENSION_BUFFER: return TextureType::Buffer; + case D3D11_UAV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D11_UAV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D11_UAV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D11_UAV_DIMENSION_TEXTURE3D: return TextureType::Texture3D; } - return TextureDim::Unknown; + return TextureType::Unknown; } AddressMode MakeAddressMode(D3D11_TEXTURE_ADDRESS_MODE addr) @@ -570,48 +570,48 @@ AddressMode MakeAddressMode(D3D11_TEXTURE_ADDRESS_MODE addr) return AddressMode::Wrap; } -CompareFunc MakeCompareFunc(D3D11_COMPARISON_FUNC func) +CompareFunction MakeCompareFunc(D3D11_COMPARISON_FUNC func) { switch(func) { - case D3D11_COMPARISON_NEVER: return CompareFunc::Never; - case D3D11_COMPARISON_LESS: return CompareFunc::Less; - case D3D11_COMPARISON_EQUAL: return CompareFunc::Equal; - case D3D11_COMPARISON_LESS_EQUAL: return CompareFunc::LessEqual; - case D3D11_COMPARISON_GREATER: return CompareFunc::Greater; - case D3D11_COMPARISON_NOT_EQUAL: return CompareFunc::NotEqual; - case D3D11_COMPARISON_GREATER_EQUAL: return CompareFunc::GreaterEqual; - case D3D11_COMPARISON_ALWAYS: return CompareFunc::AlwaysTrue; + case D3D11_COMPARISON_NEVER: return CompareFunction::Never; + case D3D11_COMPARISON_LESS: return CompareFunction::Less; + case D3D11_COMPARISON_EQUAL: return CompareFunction::Equal; + case D3D11_COMPARISON_LESS_EQUAL: return CompareFunction::LessEqual; + case D3D11_COMPARISON_GREATER: return CompareFunction::Greater; + case D3D11_COMPARISON_NOT_EQUAL: return CompareFunction::NotEqual; + case D3D11_COMPARISON_GREATER_EQUAL: return CompareFunction::GreaterEqual; + case D3D11_COMPARISON_ALWAYS: return CompareFunction::AlwaysTrue; default: break; } - return CompareFunc::AlwaysTrue; + return CompareFunction::AlwaysTrue; } TextureFilter MakeFilter(D3D11_FILTER filter) { TextureFilter ret; - ret.func = FilterFunc::Normal; + ret.filter = FilterFunction::Normal; if(filter >= D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT && filter < D3D11_FILTER_COMPARISON_ANISOTROPIC) { - ret.func = FilterFunc::Comparison; + ret.filter = FilterFunction::Comparison; // the first 0x7f is the min/mag/mip filtering filter = D3D11_FILTER(filter & 0x7f); } else if(filter >= D3D11_FILTER_MINIMUM_MIN_MAG_MIP_POINT && filter < D3D11_FILTER_MINIMUM_ANISOTROPIC) { - ret.func = FilterFunc::Minimum; + ret.filter = FilterFunction::Minimum; // the first 0x7f is the min/mag/mip filtering filter = D3D11_FILTER(filter & 0x7f); } else if(filter >= D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_POINT && filter < D3D11_FILTER_MAXIMUM_ANISOTROPIC) { - ret.func = FilterFunc::Maximum; + ret.filter = FilterFunction::Maximum; // the first 0x7f is the min/mag/mip filtering filter = D3D11_FILTER(filter & 0x7f); } @@ -662,30 +662,30 @@ TextureFilter MakeFilter(D3D11_FILTER filter) return ret; } -LogicOp MakeLogicOp(D3D11_LOGIC_OP op) +LogicOperation MakeLogicOp(D3D11_LOGIC_OP op) { switch(op) { - case D3D11_LOGIC_OP_CLEAR: return LogicOp::Clear; - case D3D11_LOGIC_OP_AND: return LogicOp::And; - case D3D11_LOGIC_OP_AND_REVERSE: return LogicOp::AndReverse; - case D3D11_LOGIC_OP_COPY: return LogicOp::Copy; - case D3D11_LOGIC_OP_AND_INVERTED: return LogicOp::AndInverted; - case D3D11_LOGIC_OP_NOOP: return LogicOp::NoOp; - case D3D11_LOGIC_OP_XOR: return LogicOp::Xor; - case D3D11_LOGIC_OP_OR: return LogicOp::Or; - case D3D11_LOGIC_OP_NOR: return LogicOp::Nor; - case D3D11_LOGIC_OP_EQUIV: return LogicOp::Equivalent; - case D3D11_LOGIC_OP_INVERT: return LogicOp::Invert; - case D3D11_LOGIC_OP_OR_REVERSE: return LogicOp::OrReverse; - case D3D11_LOGIC_OP_COPY_INVERTED: return LogicOp::CopyInverted; - case D3D11_LOGIC_OP_OR_INVERTED: return LogicOp::OrInverted; - case D3D11_LOGIC_OP_NAND: return LogicOp::Nand; - case D3D11_LOGIC_OP_SET: return LogicOp::Set; + case D3D11_LOGIC_OP_CLEAR: return LogicOperation::Clear; + case D3D11_LOGIC_OP_AND: return LogicOperation::And; + case D3D11_LOGIC_OP_AND_REVERSE: return LogicOperation::AndReverse; + case D3D11_LOGIC_OP_COPY: return LogicOperation::Copy; + case D3D11_LOGIC_OP_AND_INVERTED: return LogicOperation::AndInverted; + case D3D11_LOGIC_OP_NOOP: return LogicOperation::NoOp; + case D3D11_LOGIC_OP_XOR: return LogicOperation::Xor; + case D3D11_LOGIC_OP_OR: return LogicOperation::Or; + case D3D11_LOGIC_OP_NOR: return LogicOperation::Nor; + case D3D11_LOGIC_OP_EQUIV: return LogicOperation::Equivalent; + case D3D11_LOGIC_OP_INVERT: return LogicOperation::Invert; + case D3D11_LOGIC_OP_OR_REVERSE: return LogicOperation::OrReverse; + case D3D11_LOGIC_OP_COPY_INVERTED: return LogicOperation::CopyInverted; + case D3D11_LOGIC_OP_OR_INVERTED: return LogicOperation::OrInverted; + case D3D11_LOGIC_OP_NAND: return LogicOperation::Nand; + case D3D11_LOGIC_OP_SET: return LogicOperation::Set; default: break; } - return LogicOp::NoOp; + return LogicOperation::NoOp; } BlendMultiplier MakeBlendMultiplier(D3D11_BLEND blend, bool alpha) @@ -717,35 +717,35 @@ BlendMultiplier MakeBlendMultiplier(D3D11_BLEND blend, bool alpha) return BlendMultiplier::One; } -BlendOp MakeBlendOp(D3D11_BLEND_OP op) +BlendOperation MakeBlendOp(D3D11_BLEND_OP op) { switch(op) { - case D3D11_BLEND_OP_ADD: return BlendOp::Add; - case D3D11_BLEND_OP_SUBTRACT: return BlendOp::Subtract; - case D3D11_BLEND_OP_REV_SUBTRACT: return BlendOp::ReversedSubtract; - case D3D11_BLEND_OP_MIN: return BlendOp::Minimum; - case D3D11_BLEND_OP_MAX: return BlendOp::Maximum; + case D3D11_BLEND_OP_ADD: return BlendOperation::Add; + case D3D11_BLEND_OP_SUBTRACT: return BlendOperation::Subtract; + case D3D11_BLEND_OP_REV_SUBTRACT: return BlendOperation::ReversedSubtract; + case D3D11_BLEND_OP_MIN: return BlendOperation::Minimum; + case D3D11_BLEND_OP_MAX: return BlendOperation::Maximum; default: break; } - return BlendOp::Add; + return BlendOperation::Add; } -StencilOp MakeStencilOp(D3D11_STENCIL_OP op) +StencilOperation MakeStencilOp(D3D11_STENCIL_OP op) { switch(op) { - case D3D11_STENCIL_OP_KEEP: return StencilOp::Keep; - case D3D11_STENCIL_OP_ZERO: return StencilOp::Zero; - case D3D11_STENCIL_OP_REPLACE: return StencilOp::Replace; - case D3D11_STENCIL_OP_INCR_SAT: return StencilOp::IncSat; - case D3D11_STENCIL_OP_DECR_SAT: return StencilOp::DecSat; - case D3D11_STENCIL_OP_INVERT: return StencilOp::Invert; - case D3D11_STENCIL_OP_INCR: return StencilOp::IncWrap; - case D3D11_STENCIL_OP_DECR: return StencilOp::DecWrap; + case D3D11_STENCIL_OP_KEEP: return StencilOperation::Keep; + case D3D11_STENCIL_OP_ZERO: return StencilOperation::Zero; + case D3D11_STENCIL_OP_REPLACE: return StencilOperation::Replace; + case D3D11_STENCIL_OP_INCR_SAT: return StencilOperation::IncSat; + case D3D11_STENCIL_OP_DECR_SAT: return StencilOperation::DecSat; + case D3D11_STENCIL_OP_INVERT: return StencilOperation::Invert; + case D3D11_STENCIL_OP_INCR: return StencilOperation::IncWrap; + case D3D11_STENCIL_OP_DECR: return StencilOperation::DecWrap; default: break; } - return StencilOp::Keep; + return StencilOperation::Keep; } diff --git a/renderdoc/driver/d3d11/d3d11_common.h b/renderdoc/driver/d3d11/d3d11_common.h index 9d63d9d49..d9a9222f6 100644 --- a/renderdoc/driver/d3d11/d3d11_common.h +++ b/renderdoc/driver/d3d11/d3d11_common.h @@ -150,17 +150,17 @@ private: template inline const ResourceRange &GetResourceRange(T *); -TextureDim MakeTextureDim(D3D11_SRV_DIMENSION dim); -TextureDim MakeTextureDim(D3D11_RTV_DIMENSION dim); -TextureDim MakeTextureDim(D3D11_DSV_DIMENSION dim); -TextureDim MakeTextureDim(D3D11_UAV_DIMENSION dim); +TextureType MakeTextureDim(D3D11_SRV_DIMENSION dim); +TextureType MakeTextureDim(D3D11_RTV_DIMENSION dim); +TextureType MakeTextureDim(D3D11_DSV_DIMENSION dim); +TextureType MakeTextureDim(D3D11_UAV_DIMENSION dim); AddressMode MakeAddressMode(D3D11_TEXTURE_ADDRESS_MODE addr); -CompareFunc MakeCompareFunc(D3D11_COMPARISON_FUNC func); +CompareFunction MakeCompareFunc(D3D11_COMPARISON_FUNC func); TextureFilter MakeFilter(D3D11_FILTER filter); -LogicOp MakeLogicOp(D3D11_LOGIC_OP op); +LogicOperation MakeLogicOp(D3D11_LOGIC_OP op); BlendMultiplier MakeBlendMultiplier(D3D11_BLEND blend, bool alpha); -BlendOp MakeBlendOp(D3D11_BLEND_OP op); -StencilOp MakeStencilOp(D3D11_STENCIL_OP op); +BlendOperation MakeBlendOp(D3D11_BLEND_OP op); +StencilOperation MakeStencilOp(D3D11_STENCIL_OP op); template inline void SetDebugName(T *pObj, const char *name) diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp index 3a4d09ba5..af1b3118d 100644 --- a/renderdoc/driver/d3d11/d3d11_context.cpp +++ b/renderdoc/driver/d3d11/d3d11_context.cpp @@ -173,7 +173,7 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device *real m_CurrentPipelineState->SetDevice(m_pDevice); m_pDevice->SoftRef(); - if(IsCaptureMode(m_State) && RenderDoc::Inst().GetCaptureOptions().CaptureAllCmdLists) + if(IsCaptureMode(m_State) && RenderDoc::Inst().GetCaptureOptions().captureAllCmdLists) m_State = CaptureState::ActiveCapturing; } @@ -490,7 +490,7 @@ void WrappedID3D11DeviceContext::AttemptCapture() void WrappedID3D11DeviceContext::FinishCapture() { if(GetType() != D3D11_DEVICE_CONTEXT_DEFERRED || - !RenderDoc::Inst().GetCaptureOptions().CaptureAllCmdLists) + !RenderDoc::Inst().GetCaptureOptions().captureAllCmdLists) { m_State = CaptureState::BackgroundCapturing; @@ -568,7 +568,7 @@ void WrappedID3D11DeviceContext::CleanupCapture() record->FreeContextID(it->second); } - if(RenderDoc::Inst().GetCaptureOptions().CaptureAllCmdLists) + if(RenderDoc::Inst().GetCaptureOptions().captureAllCmdLists) return; } else @@ -898,7 +898,7 @@ bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk ch void WrappedID3D11DeviceContext::AddUsage(const DrawcallDescription &d) { const D3D11RenderState *pipe = m_CurrentPipelineState; - uint32_t e = d.eventID; + uint32_t e = d.eventId; DrawFlags DrawMask = DrawFlags::Drawcall | DrawFlags::Dispatch | DrawFlags::CmdList; if(!(d.flags & DrawMask)) @@ -1004,8 +1004,8 @@ void WrappedID3D11DeviceContext::AddDrawcall(const DrawcallDescription &d, bool m_AddedDrawcall = true; - draw.eventID = m_CurEventID; - draw.drawcallID = m_CurDrawcallID; + draw.eventId = m_CurEventID; + draw.drawcallId = m_CurDrawcallID; draw.indexByteWidth = 0; if(m_CurrentPipelineState->IA.IndexFormat == DXGI_FORMAT_R16_UINT) @@ -1060,7 +1060,7 @@ void WrappedID3D11DeviceContext::AddEvent() APIEvent apievent; apievent.fileOffset = m_CurChunkOffset; - apievent.eventID = m_CurEventID; + apievent.eventId = m_CurEventID; apievent.chunkIndex = uint32_t(m_StructuredFile->chunks.size() - 1); @@ -1072,11 +1072,11 @@ void WrappedID3D11DeviceContext::AddEvent() m_Events.push_back(apievent); } -const APIEvent &WrappedID3D11DeviceContext::GetEvent(uint32_t eventID) +const APIEvent &WrappedID3D11DeviceContext::GetEvent(uint32_t eventId) { for(const APIEvent &e : m_Events) { - if(e.eventID >= eventID) + if(e.eventId >= eventId) return e; } @@ -1110,7 +1110,7 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32 { ser.ConfigureStructuredExport(&GetChunkName, IsStructuredExporting(m_State)); - ser.GetStructuredFile().swap(m_pDevice->GetStructuredFile()); + ser.GetStructuredFile().Swap(m_pDevice->GetStructuredFile()); m_StructuredFile = &ser.GetStructuredFile(); } @@ -1133,7 +1133,7 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32 if(IsActiveReplaying(m_State)) { APIEvent ev = GetEvent(startEventID); - m_CurEventID = ev.eventID; + m_CurEventID = ev.eventId; ser.GetReader()->SetOffset(ev.fileOffset); ClearMaps(); @@ -1274,7 +1274,7 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32 // swap the structure back now that we've accumulated the frame as well. if(IsLoading(m_State) || IsStructuredExporting(m_State)) - ser.GetStructuredFile().swap(m_pDevice->GetStructuredFile()); + ser.GetStructuredFile().Swap(m_pDevice->GetStructuredFile()); m_StructuredFile = NULL; @@ -1464,11 +1464,11 @@ void WrappedID3D11DeviceContext::RecordResourceStats(ShaderStage stage, UINT Num RDCASSERT(NumResources < resources.bindslots.size()); resources.bindslots[NumResources] += 1; - const TextureDim mapping[] = { - TextureDim::Unknown, TextureDim::Buffer, TextureDim::Texture1D, - TextureDim::Texture1DArray, TextureDim::Texture2D, TextureDim::Texture2DArray, - TextureDim::Texture2DMS, TextureDim::Texture2DMSArray, TextureDim::Texture3D, - TextureDim::TextureCube, TextureDim::TextureCubeArray, TextureDim::Buffer, + const TextureType mapping[] = { + TextureType::Unknown, TextureType::Buffer, TextureType::Texture1D, + TextureType::Texture1DArray, TextureType::Texture2D, TextureType::Texture2DArray, + TextureType::Texture2DMS, TextureType::Texture2DMSArray, TextureType::Texture3D, + TextureType::TextureCube, TextureType::TextureCubeArray, TextureType::Buffer, }; RDCCOMPILE_ASSERT(ARRAY_COUNT(mapping) == D3D_SRV_DIMENSION_BUFFEREX + 1, "Update mapping table."); @@ -1482,7 +1482,7 @@ void WrappedID3D11DeviceContext::RecordResourceStats(ShaderStage stage, UINT Num D3D11_SHADER_RESOURCE_VIEW_DESC desc; Resources[i]->GetDesc(&desc); RDCASSERT(desc.ViewDimension < ARRAY_COUNT(mapping)); - TextureDim type = mapping[desc.ViewDimension]; + TextureType type = mapping[desc.ViewDimension]; // #mivance surprisingly this is not asserted in operator[] for // rdcarray so I'm being paranoid RDCASSERT((int)type < (int)resources.types.size()); @@ -1526,18 +1526,18 @@ void WrappedID3D11DeviceContext::RecordUpdateStats(ID3D11Resource *res, uint32_t updates.clients += (Server == false); updates.servers += (Server == true); - const TextureDim mapping[] = { - TextureDim::Unknown, // D3D11_RESOURCE_DIMENSION_UNKNOWN = 0, - TextureDim::Buffer, // D3D11_RESOURCE_DIMENSION_BUFFER = 1, - TextureDim::Texture1D, // D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2, - TextureDim::Texture2D, // D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3, - TextureDim::Texture3D, // D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4 + const TextureType mapping[] = { + TextureType::Unknown, // D3D11_RESOURCE_DIMENSION_UNKNOWN = 0, + TextureType::Buffer, // D3D11_RESOURCE_DIMENSION_BUFFER = 1, + TextureType::Texture1D, // D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2, + TextureType::Texture2D, // D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3, + TextureType::Texture3D, // D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4 }; D3D11_RESOURCE_DIMENSION dim; res->GetType(&dim); RDCASSERT(dim < ARRAY_COUNT(mapping)); - TextureDim type = mapping[dim]; + TextureType type = mapping[dim]; RDCASSERT((int)type < (int)updates.types.size()); updates.types[(int)type] += 1; diff --git a/renderdoc/driver/d3d11/d3d11_context.h b/renderdoc/driver/d3d11/d3d11_context.h index d7915dfad..88232751f 100644 --- a/renderdoc/driver/d3d11/d3d11_context.h +++ b/renderdoc/driver/d3d11/d3d11_context.h @@ -309,7 +309,7 @@ public: void ClearMaps(); uint32_t GetEventID() { return m_CurEventID; } - const APIEvent &GetEvent(uint32_t eventID); + const APIEvent &GetEvent(uint32_t eventId); const DrawcallDescription &GetRootDraw() { return m_ParentDrawcall; } void ThreadSafe_SetMarker(uint32_t col, const wchar_t *name); diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 320e888a7..f17a6e841 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -3510,7 +3510,7 @@ void WrappedID3D11DeviceContext::Serialise_DebugMessages(SerialiserType &ser) { for(DebugMessage &msg : DebugMessages) { - msg.eventID = m_CurEventID; + msg.eventId = m_CurEventID; m_pDevice->AddDebugMessage(msg); } } @@ -7006,7 +7006,7 @@ bool WrappedID3D11DeviceContext::Serialise_Map(SerialiserType &ser, ID3D11Resour } intercept = MapIntercept(); - intercept.verifyWrite = (RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites != 0); + intercept.verifyWrite = (RenderDoc::Inst().GetCaptureOptions().verifyMapWrites != 0); intercept.SetD3D(mappedResource); intercept.InitWrappedResource(resMap, Subresource, appMem); intercept.MapType = MapType; @@ -7024,7 +7024,7 @@ bool WrappedID3D11DeviceContext::Serialise_Map(SerialiserType &ser, ID3D11Resour mapLength = (size_t)record->Length; intercept = MapIntercept(); - intercept.verifyWrite = (RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites != 0); + intercept.verifyWrite = (RenderDoc::Inst().GetCaptureOptions().verifyMapWrites != 0); intercept.SetD3D(mappedResource); intercept.MapType = MapType; intercept.MapFlags = MapFlags; @@ -7175,7 +7175,7 @@ HRESULT WrappedID3D11DeviceContext::Map(ID3D11Resource *pResource, UINT Subresou record->UpdateCount++; - if(record->UpdateCount > 60 && RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites == 0) + if(record->UpdateCount > 60 && RenderDoc::Inst().GetCaptureOptions().verifyMapWrites == 0) { m_HighTrafficResources.insert(Id); MarkDirtyResource(Id); diff --git a/renderdoc/driver/d3d11/d3d11_counters.cpp b/renderdoc/driver/d3d11/d3d11_counters.cpp index dd2bd7e1b..f3e37994f 100644 --- a/renderdoc/driver/d3d11/d3d11_counters.cpp +++ b/renderdoc/driver/d3d11/d3d11_counters.cpp @@ -78,7 +78,7 @@ vector D3D11DebugManager::EnumerateCounters() CounterDescription D3D11DebugManager::DescribeCounter(GPUCounter counterID) { CounterDescription desc = {}; - desc.counterID = counterID; + desc.counter = counterID; /////AMD////// if(counterID >= GPUCounter::FirstAMD && counterID < GPUCounter::FirstIntel) @@ -211,7 +211,7 @@ struct GPUTimer ID3D11Query *after; ID3D11Query *stats; ID3D11Query *occlusion; - uint32_t eventID; + uint32_t eventId; }; struct D3D11CounterContext @@ -245,7 +245,7 @@ void D3D11DebugManager::FillTimers(D3D11CounterContext &ctx, const DrawcallDescr ctx.timers.push_back(GPUTimer()); timer = &ctx.timers.back(); - timer->eventID = d.eventID; + timer->eventId = d.eventId; timer->before = timer->after = timer->stats = timer->occlusion = NULL; hr = m_pDevice->CreateQuery(&qtimedesc, &timer->before); @@ -258,7 +258,7 @@ void D3D11DebugManager::FillTimers(D3D11CounterContext &ctx, const DrawcallDescr RDCASSERTEQUAL(hr, S_OK); } - m_WrappedDevice->ReplayLog(ctx.eventStart, d.eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(ctx.eventStart, d.eventId, eReplay_WithoutDraw); m_pImmediateContext->Flush(); @@ -268,7 +268,7 @@ void D3D11DebugManager::FillTimers(D3D11CounterContext &ctx, const DrawcallDescr m_pImmediateContext->Begin(timer->occlusion); if(timer->before && timer->after) m_pImmediateContext->End(timer->before); - m_WrappedDevice->ReplayLog(ctx.eventStart, d.eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(ctx.eventStart, d.eventId, eReplay_OnlyDraw); if(timer->before && timer->after) m_pImmediateContext->End(timer->after); if(timer->occlusion) @@ -276,7 +276,7 @@ void D3D11DebugManager::FillTimers(D3D11CounterContext &ctx, const DrawcallDescr if(timer->stats) m_pImmediateContext->End(timer->stats); - ctx.eventStart = d.eventID + 1; + ctx.eventStart = d.eventId + 1; } } @@ -295,19 +295,19 @@ void D3D11DebugManager::FillTimersAMD(uint32_t &eventStartID, uint32_t &sampleIn if(d.events.empty()) continue; - eventIDs.push_back(d.eventID); + eventIDs.push_back(d.eventId); - m_WrappedDevice->ReplayLog(eventStartID, d.eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(eventStartID, d.eventId, eReplay_WithoutDraw); m_pImmediateContext->Flush(); m_pAMDCounters->BeginSample(sampleIndex); - m_WrappedDevice->ReplayLog(eventStartID, d.eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(eventStartID, d.eventId, eReplay_OnlyDraw); m_pAMDCounters->EndSample(); - eventStartID = d.eventID + 1; + eventStartID = d.eventId + 1; sampleIndex++; } } @@ -550,55 +550,55 @@ vector D3D11DebugManager::FetchCounters(const vector { case GPUCounter::EventGPUDuration: ret.push_back( - CounterResult(ctx.timers[i].eventID, GPUCounter::EventGPUDuration, duration)); + CounterResult(ctx.timers[i].eventId, GPUCounter::EventGPUDuration, duration)); break; case GPUCounter::InputVerticesRead: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::InputVerticesRead, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::InputVerticesRead, pipelineStats.IAVertices)); break; case GPUCounter::IAPrimitives: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::IAPrimitives, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::IAPrimitives, pipelineStats.IAPrimitives)); break; case GPUCounter::VSInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::VSInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::VSInvocations, pipelineStats.VSInvocations)); break; case GPUCounter::GSInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::GSInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::GSInvocations, pipelineStats.GSInvocations)); break; case GPUCounter::GSPrimitives: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::GSPrimitives, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::GSPrimitives, pipelineStats.GSPrimitives)); break; case GPUCounter::RasterizerInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::RasterizerInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::RasterizerInvocations, pipelineStats.CInvocations)); break; case GPUCounter::RasterizedPrimitives: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::RasterizedPrimitives, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::RasterizedPrimitives, pipelineStats.CPrimitives)); break; case GPUCounter::PSInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::PSInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::PSInvocations, pipelineStats.PSInvocations)); break; case GPUCounter::HSInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::HSInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::HSInvocations, pipelineStats.HSInvocations)); break; case GPUCounter::DSInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::DSInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::DSInvocations, pipelineStats.DSInvocations)); break; case GPUCounter::CSInvocations: - ret.push_back(CounterResult(ctx.timers[i].eventID, GPUCounter::CSInvocations, + ret.push_back(CounterResult(ctx.timers[i].eventId, GPUCounter::CSInvocations, pipelineStats.CSInvocations)); break; case GPUCounter::SamplesWritten: ret.push_back( - CounterResult(ctx.timers[i].eventID, GPUCounter::SamplesWritten, occlusion)); + CounterResult(ctx.timers[i].eventId, GPUCounter::SamplesWritten, occlusion)); break; } } @@ -611,7 +611,7 @@ vector D3D11DebugManager::FetchCounters(const vector { case GPUCounter::EventGPUDuration: ret.push_back( - CounterResult(ctx.timers[i].eventID, GPUCounter::EventGPUDuration, -1.0)); + CounterResult(ctx.timers[i].eventId, GPUCounter::EventGPUDuration, -1.0)); break; case GPUCounter::InputVerticesRead: case GPUCounter::IAPrimitives: @@ -626,7 +626,7 @@ vector D3D11DebugManager::FetchCounters(const vector case GPUCounter::CSInvocations: case GPUCounter::SamplesWritten: ret.push_back( - CounterResult(ctx.timers[i].eventID, d3dCounters[c], 0xFFFFFFFFFFFFFFFF)); + CounterResult(ctx.timers[i].eventId, d3dCounters[c], 0xFFFFFFFFFFFFFFFF)); break; } } diff --git a/renderdoc/driver/d3d11/d3d11_debug.cpp b/renderdoc/driver/d3d11/d3d11_debug.cpp index 49871877c..8f4079f89 100644 --- a/renderdoc/driver/d3d11/d3d11_debug.cpp +++ b/renderdoc/driver/d3d11/d3d11_debug.cpp @@ -3350,8 +3350,8 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg, bool blendAlpha) pixelData.AlwaysZero = 0.0f; - float x = cfg.offx; - float y = cfg.offy; + float x = cfg.xOffset; + float y = cfg.yOffset; vertexData.Position.x = x * (2.0f / float(GetWidth())); vertexData.Position.y = -y * (2.0f / float(GetHeight())); @@ -3365,30 +3365,30 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg, bool blendAlpha) vertexData.LineStrip = 0; - if(cfg.rangemax <= cfg.rangemin) - cfg.rangemax += 0.00001f; + if(cfg.rangeMax <= cfg.rangeMin) + cfg.rangeMax += 0.00001f; - pixelData.Channels.x = cfg.Red ? 1.0f : 0.0f; - pixelData.Channels.y = cfg.Green ? 1.0f : 0.0f; - pixelData.Channels.z = cfg.Blue ? 1.0f : 0.0f; - pixelData.Channels.w = cfg.Alpha ? 1.0f : 0.0f; + pixelData.Channels.x = cfg.red ? 1.0f : 0.0f; + pixelData.Channels.y = cfg.green ? 1.0f : 0.0f; + pixelData.Channels.z = cfg.blue ? 1.0f : 0.0f; + pixelData.Channels.w = cfg.alpha ? 1.0f : 0.0f; - pixelData.RangeMinimum = cfg.rangemin; - pixelData.InverseRangeSize = 1.0f / (cfg.rangemax - cfg.rangemin); + pixelData.RangeMinimum = cfg.rangeMin; + pixelData.InverseRangeSize = 1.0f / (cfg.rangeMax - cfg.rangeMin); if(_isnan(pixelData.InverseRangeSize) || !_finite(pixelData.InverseRangeSize)) { pixelData.InverseRangeSize = FLT_MAX; } - pixelData.WireframeColour.x = cfg.HDRMul; + pixelData.WireframeColour.x = cfg.hdrMultiplier; - pixelData.RawOutput = cfg.rawoutput ? 1 : 0; + pixelData.RawOutput = cfg.rawOutput ? 1 : 0; - pixelData.FlipY = cfg.FlipY ? 1 : 0; + pixelData.FlipY = cfg.flipY ? 1 : 0; TextureShaderDetails details = - GetShaderDetails(cfg.texid, cfg.typeHint, cfg.rawoutput ? true : false); + GetShaderDetails(cfg.resourceId, cfg.typeHint, cfg.rawOutput ? true : false); int sampleIdx = (int)RDCCLAMP(cfg.sampleIdx, 0U, details.sampleCount - 1); @@ -3447,9 +3447,9 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg, bool blendAlpha) ID3D11PixelShader *customPS = NULL; ID3D11Buffer *customBuff = NULL; - if(cfg.CustomShader != ResourceId()) + if(cfg.customShaderId != ResourceId()) { - auto it = WrappedShader::m_ShaderList.find(cfg.CustomShader); + auto it = WrappedShader::m_ShaderList.find(cfg.customShaderId); if(it != WrappedShader::m_ShaderList.end()) { @@ -3458,11 +3458,11 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg, bool blendAlpha) RDCASSERT(dxbc); RDCASSERT(dxbc->m_Type == D3D11_ShaderType_Pixel); - if(m_WrappedDevice->GetResourceManager()->HasLiveResource(cfg.CustomShader)) + if(m_WrappedDevice->GetResourceManager()->HasLiveResource(cfg.customShaderId)) { WrappedID3D11Shader *wrapped = (WrappedID3D11Shader *)m_WrappedDevice->GetResourceManager() - ->GetLiveResource(cfg.CustomShader); + ->GetLiveResource(cfg.customShaderId); customPS = wrapped; @@ -3678,7 +3678,7 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg, bool blendAlpha) m_pImmediateContext->PSSetSamplers(0, 2, samps); float factor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - if(cfg.rawoutput || !blendAlpha || cfg.CustomShader != ResourceId()) + if(cfg.rawOutput || !blendAlpha || cfg.customShaderId != ResourceId()) m_pImmediateContext->OMSetBlendState(NULL, factor, 0xffffffff); else m_pImmediateContext->OMSetBlendState(m_DebugRender.BlendState, factor, 0xffffffff); @@ -3831,44 +3831,44 @@ void D3D11DebugManager::RenderForPredicate() m_WrappedContext->Draw(3, 0); } -MeshFormat D3D11DebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat D3D11DebugManager::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { D3D11PostVSData postvs; RDCEraseEl(postvs); - if(m_PostVSData.find(eventID) != m_PostVSData.end()) - postvs = m_PostVSData[eventID]; + if(m_PostVSData.find(eventId) != m_PostVSData.end()) + postvs = m_PostVSData[eventId]; const D3D11PostVSData::StageData &s = postvs.GetStage(stage); MeshFormat ret; if(s.useIndices && s.idxBuf) - ret.idxbuf = ((WrappedID3D11Buffer *)s.idxBuf)->GetResourceID(); + ret.indexResourceId = ((WrappedID3D11Buffer *)s.idxBuf)->GetResourceID(); else - ret.idxbuf = ResourceId(); - ret.idxoffs = 0; - ret.idxByteWidth = s.idxFmt == DXGI_FORMAT_R16_UINT ? 2 : 4; + ret.indexResourceId = ResourceId(); + ret.indexByteOffset = 0; + ret.indexByteStride = s.idxFmt == DXGI_FORMAT_R16_UINT ? 2 : 4; ret.baseVertex = 0; if(s.buf) - ret.buf = ((WrappedID3D11Buffer *)s.buf)->GetResourceID(); + ret.vertexResourceId = ((WrappedID3D11Buffer *)s.buf)->GetResourceID(); else - ret.buf = ResourceId(); + ret.vertexResourceId = ResourceId(); - ret.offset = s.instStride * instID; - ret.stride = s.vertStride; + ret.vertexByteOffset = s.instStride * instID; + ret.vertexByteStride = s.vertStride; - ret.fmt.compCount = 4; - ret.fmt.compByteWidth = 4; - ret.fmt.compType = CompType::Float; - ret.fmt.type = ResourceFormatType::Regular; - ret.fmt.bgraOrder = false; + ret.format.compCount = 4; + ret.format.compByteWidth = 4; + ret.format.compType = CompType::Float; + ret.format.type = ResourceFormatType::Regular; + ret.format.bgraOrder = false; ret.showAlpha = false; - ret.topo = MakePrimitiveTopology(s.topo); - ret.numVerts = s.numVerts; + ret.topology = MakePrimitiveTopology(s.topo); + ret.numIndices = s.numVerts; ret.unproject = s.hasPosOut; ret.nearPlane = s.nearPlane; @@ -3878,16 +3878,16 @@ MeshFormat D3D11DebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instID { D3D11PostVSData::InstData inst = s.instData[instID]; - ret.offset = inst.bufOffset; - ret.numVerts = inst.numVerts; + ret.vertexByteOffset = inst.bufOffset; + ret.numIndices = inst.numVerts; } return ret; } -void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID) +void D3D11DebugManager::InitPostVSBuffers(uint32_t eventId) { - if(m_PostVSData.find(eventID) != m_PostVSData.end()) + if(m_PostVSData.find(eventId) != m_PostVSData.end()) return; D3D11RenderStateTracker tracker(m_WrappedContext); @@ -3927,7 +3927,7 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID) return; } - const DrawcallDescription *drawcall = m_WrappedDevice->GetDrawcall(eventID); + const DrawcallDescription *drawcall = m_WrappedDevice->GetDrawcall(eventId); if(drawcall->numIndices == 0) return; @@ -4235,7 +4235,7 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID) if(numPrims.NumPrimitivesWritten == 0) { - m_PostVSData[eventID] = D3D11PostVSData(); + m_PostVSData[eventId] = D3D11PostVSData(); SAFE_RELEASE(idxBuf); return; } @@ -4339,45 +4339,45 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID) m_pImmediateContext->Unmap(m_SOStagingBuffer, 0); - m_PostVSData[eventID].vsin.topo = topo; - m_PostVSData[eventID].vsout.buf = vsoutBuffer; - m_PostVSData[eventID].vsout.vertStride = stride; - m_PostVSData[eventID].vsout.nearPlane = nearp; - m_PostVSData[eventID].vsout.farPlane = farp; + m_PostVSData[eventId].vsin.topo = topo; + m_PostVSData[eventId].vsout.buf = vsoutBuffer; + m_PostVSData[eventId].vsout.vertStride = stride; + m_PostVSData[eventId].vsout.nearPlane = nearp; + m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventID].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); - m_PostVSData[eventID].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); + m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; - m_PostVSData[eventID].vsout.instStride = 0; + m_PostVSData[eventId].vsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].vsout.instStride = + m_PostVSData[eventId].vsout.instStride = bufferDesc.ByteWidth / RDCMAX(1U, drawcall->numInstances); - m_PostVSData[eventID].vsout.idxBuf = NULL; - if(m_PostVSData[eventID].vsout.useIndices && idxBuf) + m_PostVSData[eventId].vsout.idxBuf = NULL; + if(m_PostVSData[eventId].vsout.useIndices && idxBuf) { - m_PostVSData[eventID].vsout.idxBuf = idxBuf; - m_PostVSData[eventID].vsout.idxFmt = idxFmt; + m_PostVSData[eventId].vsout.idxBuf = idxBuf; + m_PostVSData[eventId].vsout.idxFmt = idxFmt; } - m_PostVSData[eventID].vsout.hasPosOut = posidx >= 0; + m_PostVSData[eventId].vsout.hasPosOut = posidx >= 0; - m_PostVSData[eventID].vsout.topo = topo; + m_PostVSData[eventId].vsout.topo = topo; } else { // empty vertex output signature - m_PostVSData[eventID].vsin.topo = topo; - m_PostVSData[eventID].vsout.buf = NULL; - m_PostVSData[eventID].vsout.instStride = 0; - m_PostVSData[eventID].vsout.vertStride = 0; - m_PostVSData[eventID].vsout.nearPlane = 0.0f; - m_PostVSData[eventID].vsout.farPlane = 0.0f; - m_PostVSData[eventID].vsout.useIndices = false; - m_PostVSData[eventID].vsout.hasPosOut = false; - m_PostVSData[eventID].vsout.idxBuf = NULL; + m_PostVSData[eventId].vsin.topo = topo; + m_PostVSData[eventId].vsout.buf = NULL; + m_PostVSData[eventId].vsout.instStride = 0; + m_PostVSData[eventId].vsout.vertStride = 0; + m_PostVSData[eventId].vsout.nearPlane = 0.0f; + m_PostVSData[eventId].vsout.farPlane = 0.0f; + m_PostVSData[eventId].vsout.useIndices = false; + m_PostVSData[eventId].vsout.hasPosOut = false; + m_PostVSData[eventId].vsout.idxBuf = NULL; - m_PostVSData[eventID].vsout.topo = topo; + m_PostVSData[eventId].vsout.topo = topo; } if(dxbcGS || dxbcDS) @@ -4706,17 +4706,17 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID) m_pImmediateContext->Unmap(m_SOStagingBuffer, 0); - m_PostVSData[eventID].gsout.buf = gsoutBuffer; - m_PostVSData[eventID].gsout.instStride = 0; + m_PostVSData[eventId].gsout.buf = gsoutBuffer; + m_PostVSData[eventId].gsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].gsout.instStride = + m_PostVSData[eventId].gsout.instStride = bufferDesc.ByteWidth / RDCMAX(1U, drawcall->numInstances); - m_PostVSData[eventID].gsout.vertStride = stride; - m_PostVSData[eventID].gsout.nearPlane = nearp; - m_PostVSData[eventID].gsout.farPlane = farp; - m_PostVSData[eventID].gsout.useIndices = false; - m_PostVSData[eventID].gsout.hasPosOut = posidx >= 0; - m_PostVSData[eventID].gsout.idxBuf = NULL; + m_PostVSData[eventId].gsout.vertStride = stride; + m_PostVSData[eventId].gsout.nearPlane = nearp; + m_PostVSData[eventId].gsout.farPlane = farp; + m_PostVSData[eventId].gsout.useIndices = false; + m_PostVSData[eventId].gsout.hasPosOut = posidx >= 0; + m_PostVSData[eventId].gsout.idxBuf = NULL; topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; @@ -4750,45 +4750,45 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID) } } - m_PostVSData[eventID].gsout.topo = topo; + m_PostVSData[eventId].gsout.topo = topo; // streamout expands strips unfortunately if(topo == D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; else if(topo == D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST; else if(topo == D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; else if(topo == D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; - switch(m_PostVSData[eventID].gsout.topo) + switch(m_PostVSData[eventId].gsout.topo) { case D3D11_PRIMITIVE_TOPOLOGY_POINTLIST: - m_PostVSData[eventID].gsout.numVerts = (uint32_t)numPrims.NumPrimitivesWritten; + m_PostVSData[eventId].gsout.numVerts = (uint32_t)numPrims.NumPrimitivesWritten; break; case D3D11_PRIMITIVE_TOPOLOGY_LINELIST: case D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ: - m_PostVSData[eventID].gsout.numVerts = (uint32_t)numPrims.NumPrimitivesWritten * 2; + m_PostVSData[eventId].gsout.numVerts = (uint32_t)numPrims.NumPrimitivesWritten * 2; break; default: case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST: case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ: - m_PostVSData[eventID].gsout.numVerts = (uint32_t)numPrims.NumPrimitivesWritten * 3; + m_PostVSData[eventId].gsout.numVerts = (uint32_t)numPrims.NumPrimitivesWritten * 3; break; } if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); + m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); - m_PostVSData[eventID].gsout.instData = instData; + m_PostVSData[eventId].gsout.instData = instData; } } -void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &secondaryDraws, +void D3D11DebugManager::RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { - if(cfg.position.buf == ResourceId() || cfg.position.numVerts == 0) + if(cfg.position.vertexResourceId == ResourceId() || cfg.position.numIndices == 0) return; DebugVertexCBuffer vertexData; @@ -4827,8 +4827,8 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s // don't cull in wireframe mesh display m_pImmediateContext->RSSetState(m_WireframeHelpersRS); - const ResourceFormat &resFmt = cfg.position.fmt; - const ResourceFormat &resFmt2 = cfg.second.fmt; + const ResourceFormat &resFmt = cfg.position.format; + const ResourceFormat &resFmt2 = cfg.second.format; if(m_PrevMeshFmt != resFmt || m_PrevMeshFmt2 != resFmt2) { @@ -4839,7 +4839,7 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s layoutdesc[0].SemanticName = "pos"; layoutdesc[0].SemanticIndex = 0; layoutdesc[0].Format = DXGI_FORMAT_R8G8B8A8_UNORM; - if(cfg.position.buf != ResourceId() && (resFmt.Special() || resFmt.compCount > 0)) + if(cfg.position.vertexResourceId != ResourceId() && (resFmt.Special() || resFmt.compCount > 0)) layoutdesc[0].Format = MakeDXGIFormat(resFmt); layoutdesc[0].AlignedByteOffset = 0; // offset will be handled by vertex buffer offset layoutdesc[0].InputSlot = 0; @@ -4849,7 +4849,7 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s layoutdesc[1].SemanticName = "sec"; layoutdesc[1].SemanticIndex = 0; layoutdesc[1].Format = DXGI_FORMAT_R8G8B8A8_UNORM; - if(cfg.second.buf != ResourceId() && (resFmt2.Special() || resFmt2.compCount > 0)) + if(cfg.second.vertexResourceId != ResourceId() && (resFmt2.Special() || resFmt2.compCount > 0)) layoutdesc[1].Format = MakeDXGIFormat(resFmt2); layoutdesc[1].AlignedByteOffset = 0; layoutdesc[1].InputSlot = 1; @@ -4869,13 +4869,13 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s m_PrevMeshFmt = resFmt; m_PrevMeshFmt2 = resFmt2; - RDCASSERT(cfg.position.idxoffs < 0xffffffff); + RDCASSERT(cfg.position.indexByteOffset < 0xffffffff); ID3D11Buffer *ibuf = NULL; DXGI_FORMAT ifmt = DXGI_FORMAT_R16_UINT; - UINT ioffs = (UINT)cfg.position.idxoffs; + UINT ioffs = (UINT)cfg.position.indexByteOffset; - D3D11_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(cfg.position.topo); + D3D11_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(cfg.position.topology); // render the mesh itself (solid, then wireframe) { @@ -4924,34 +4924,34 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s { const MeshFormat &fmt = secondaryDraws[i]; - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { meshColour = Vec4f(fmt.meshColor.x, fmt.meshColor.y, fmt.meshColor.z, 1.0f); FillCBuffer(meshColourBuf, &meshColour, sizeof(meshColour)); m_pImmediateContext->PSSetConstantBuffers(2, 1, &meshColourBuf); - m_pImmediateContext->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(fmt.topo)); + m_pImmediateContext->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(fmt.topology)); - auto it = WrappedID3D11Buffer::m_BufferList.find(fmt.buf); + auto it = WrappedID3D11Buffer::m_BufferList.find(fmt.vertexResourceId); ID3D11Buffer *buf = it->second.m_Buffer; - m_pImmediateContext->IASetVertexBuffers(0, 1, &buf, (UINT *)&fmt.stride, - (UINT *)&fmt.offset); - if(fmt.idxbuf != ResourceId()) + m_pImmediateContext->IASetVertexBuffers(0, 1, &buf, (UINT *)&fmt.vertexByteStride, + (UINT *)&fmt.vertexByteOffset); + if(fmt.indexResourceId != ResourceId()) { - RDCASSERT(fmt.idxoffs < 0xffffffff); + RDCASSERT(fmt.indexByteOffset < 0xffffffff); - it = WrappedID3D11Buffer::m_BufferList.find(fmt.idxbuf); + it = WrappedID3D11Buffer::m_BufferList.find(fmt.indexResourceId); buf = it->second.m_Buffer; m_pImmediateContext->IASetIndexBuffer( - buf, fmt.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT, - (UINT)fmt.idxoffs); + buf, fmt.indexByteStride == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT, + (UINT)fmt.indexByteOffset); - m_pImmediateContext->DrawIndexed(fmt.numVerts, 0, fmt.baseVertex); + m_pImmediateContext->DrawIndexed(fmt.numIndices, 0, fmt.baseVertex); } else { - m_pImmediateContext->Draw(fmt.numVerts, 0); + m_pImmediateContext->Draw(fmt.numIndices, 0); } } } @@ -4967,40 +4967,40 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s m_pImmediateContext->IASetInputLayout(layout); - RDCASSERT(cfg.position.offset < 0xffffffff && cfg.second.offset < 0xffffffff); + RDCASSERT(cfg.position.vertexByteOffset < 0xffffffff && cfg.second.vertexByteOffset < 0xffffffff); ID3D11Buffer *vbs[2] = {NULL, NULL}; - UINT str[] = {cfg.position.stride, cfg.second.stride}; - UINT offs[] = {(UINT)cfg.position.offset, (UINT)cfg.second.offset}; + UINT str[] = {cfg.position.vertexByteStride, cfg.second.vertexByteStride}; + UINT offs[] = {(UINT)cfg.position.vertexByteOffset, (UINT)cfg.second.vertexByteOffset}; { - auto it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.buf); + auto it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.vertexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) vbs[0] = it->second.m_Buffer; - it = WrappedID3D11Buffer::m_BufferList.find(cfg.second.buf); + it = WrappedID3D11Buffer::m_BufferList.find(cfg.second.vertexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) vbs[1] = it->second.m_Buffer; - it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.idxbuf); + it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.indexResourceId); if(it != WrappedID3D11Buffer::m_BufferList.end()) ibuf = it->second.m_Buffer; - if(cfg.position.idxByteWidth == 4) + if(cfg.position.indexByteStride == 4) ifmt = DXGI_FORMAT_R32_UINT; } m_pImmediateContext->IASetVertexBuffers(0, 2, vbs, str, offs); - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) m_pImmediateContext->IASetIndexBuffer(ibuf, ifmt, ioffs); else m_pImmediateContext->IASetIndexBuffer(NULL, DXGI_FORMAT_UNKNOWN, NULL); // draw solid shaded mode - if(cfg.solidShadeMode != SolidShade::NoSolid && cfg.position.topo < Topology::PatchList_1CPs) + if(cfg.solidShadeMode != SolidShade::NoSolid && cfg.position.topology < Topology::PatchList_1CPs) { m_pImmediateContext->RSSetState(m_DebugRender.RastState); @@ -5029,10 +5029,10 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s m_pImmediateContext->GSSetShader(m_DebugRender.MeshGS, NULL, 0); } - if(cfg.position.idxByteWidth) - m_pImmediateContext->DrawIndexed(cfg.position.numVerts, 0, cfg.position.baseVertex); + if(cfg.position.indexByteStride) + m_pImmediateContext->DrawIndexed(cfg.position.numIndices, 0, cfg.position.baseVertex); else - m_pImmediateContext->Draw(cfg.position.numVerts, 0); + m_pImmediateContext->Draw(cfg.position.numIndices, 0); if(cfg.solidShadeMode == SolidShade::Lit) m_pImmediateContext->GSSetShader(NULL, NULL, 0); @@ -5040,7 +5040,7 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s // draw wireframe mode if(cfg.solidShadeMode == SolidShade::NoSolid || cfg.wireframeDraw || - cfg.position.topo >= Topology::PatchList_1CPs) + cfg.position.topology >= Topology::PatchList_1CPs) { m_pImmediateContext->RSSetState(m_WireframeHelpersRS); @@ -5056,15 +5056,15 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s m_pImmediateContext->PSSetConstantBuffers(0, 1, &m_DebugRender.GenericPSCBuffer); - if(cfg.position.topo >= Topology::PatchList_1CPs) + if(cfg.position.topology >= Topology::PatchList_1CPs) m_pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); else m_pImmediateContext->IASetPrimitiveTopology(topo); - if(cfg.position.idxByteWidth) - m_pImmediateContext->DrawIndexed(cfg.position.numVerts, 0, cfg.position.baseVertex); + if(cfg.position.indexByteStride) + m_pImmediateContext->DrawIndexed(cfg.position.numIndices, 0, cfg.position.baseVertex); else - m_pImmediateContext->Draw(cfg.position.numVerts, 0); + m_pImmediateContext->Draw(cfg.position.numIndices, 0); } } @@ -5112,7 +5112,7 @@ void D3D11DebugManager::RenderMesh(uint32_t eventID, const vector &s if(cfg.highlightVert != ~0U) { - m_HighlightCache.CacheHighlightingData(eventID, cfg); + m_HighlightCache.CacheHighlightingData(eventId, cfg); D3D11_PRIMITIVE_TOPOLOGY meshtopo = topo; diff --git a/renderdoc/driver/d3d11/d3d11_debug.h b/renderdoc/driver/d3d11/d3d11_debug.h index cad07c2cc..5fa0eb391 100644 --- a/renderdoc/driver/d3d11/d3d11_debug.h +++ b/renderdoc/driver/d3d11/d3d11_debug.h @@ -126,8 +126,8 @@ public: void SetOutputWindow(HWND w); int GetWidth() { return m_width; } int GetHeight() { return m_height; } - void InitPostVSBuffers(uint32_t eventID); - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + void InitPostVSBuffers(uint32_t eventId); + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void ClearPostVSCache(); void RenderForPredicate(); @@ -163,7 +163,7 @@ public: vector FetchCountersAMD(const vector &counters); void RenderText(float x, float y, const char *textfmt, ...); - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg); + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg); ID3D11Buffer *MakeCBuffer(const void *data, size_t size); @@ -190,18 +190,18 @@ public: vector PixelHistory(vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint); - ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx, + 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, + ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive); - ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + 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 PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y); + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y); ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents); + uint32_t eventId, const vector &passEvents); ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint); diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index 41beb31e3..e3d76f775 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -64,7 +64,7 @@ WrappedID3D11Device::WrappedID3D11Device(ID3D11Device *realDevice, D3D11InitPara uint32_t flags = WriteSerialiser::ChunkDuration | WriteSerialiser::ChunkTimestamp | WriteSerialiser::ChunkThreadID; - if(RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks) + if(RenderDoc::Inst().GetCaptureOptions().captureCallstacks) flags |= WriteSerialiser::ChunkCallstack; m_ScratchSerialiser.SetChunkMetadataRecording(flags); @@ -167,7 +167,7 @@ WrappedID3D11Device::WrappedID3D11Device(ID3D11Device *realDevice, D3D11InitPara if(m_pInfoQueue) { - if(RenderDoc::Inst().GetCaptureOptions().DebugOutputMute) + if(RenderDoc::Inst().GetCaptureOptions().debugOutputMute) m_pInfoQueue->SetMuteDebugOutput(true); UINT size = m_pInfoQueue->GetStorageFilterStackSize(); @@ -570,7 +570,7 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject) } else { - if(!RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!RenderDoc::Inst().GetCaptureOptions().apiValidation) { RDCWARN("API Validation is not enabled, RenderDoc disabled the debug layer."); RDCWARN( @@ -635,7 +635,7 @@ void WrappedID3D11Device::AddDebugMessage(MessageCategory c, MessageSeverity sv, if(!IsActiveReplaying(m_State) || src == MessageSource::RuntimeWarning) { DebugMessage msg; - msg.eventID = IsCaptureMode(m_State) ? 0 : m_pImmediateContext->GetEventID(); + msg.eventId = IsCaptureMode(m_State) ? 0 : m_pImmediateContext->GetEventID(); msg.messageID = 0; msg.source = src; msg.category = c; @@ -680,7 +680,7 @@ std::vector WrappedID3D11Device::GetDebugMessages() m_pInfoQueue->GetMessage(i, message, &len); DebugMessage msg; - msg.eventID = 0; + msg.eventId = 0; msg.source = MessageSource::API; msg.category = MessageCategory::Miscellaneous; msg.severity = MessageSeverity::Medium; @@ -922,11 +922,11 @@ bool WrappedID3D11Device::Serialise_CaptureScope(SerialiserType &ser) stats.samplers[stage].bindslots.resize(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 1); - stats.resources[stage].types.resize(uint32_t(TextureDim::Count)); + stats.resources[stage].types.resize(uint32_t(TextureType::Count)); stats.resources[stage].bindslots.resize(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 1); } - stats.updates.types.resize(uint32_t(TextureDim::Count)); + stats.updates.types.resize(uint32_t(TextureType::Count)); stats.updates.sizes.resize(ResourceUpdateStats::BucketCount); stats.draws.counts.resize(DrawcallStats::BucketCount); @@ -1041,7 +1041,7 @@ ReplayStatus WrappedID3D11Device::ReadLogInitialisation(RDCFile *rdc, bool store } // steal the structured data for ourselves - m_StructuredFile->swap(m_StoredStructuredData); + m_StructuredFile->Swap(m_StoredStructuredData); // and in future use this file. m_StructuredFile = &m_StoredStructuredData; @@ -2302,10 +2302,10 @@ WrappedID3D11DeviceContext *WrappedID3D11Device::GetDeferredContext(size_t idx) return *it; } -const DrawcallDescription *WrappedID3D11Device::GetDrawcall(uint32_t eventID) +const DrawcallDescription *WrappedID3D11Device::GetDrawcall(uint32_t eventId) { - if(eventID >= m_Drawcalls.size()) + if(eventId >= m_Drawcalls.size()) return NULL; - return m_Drawcalls[eventID]; + return m_Drawcalls[eventId]; } diff --git a/renderdoc/driver/d3d11/d3d11_device.h b/renderdoc/driver/d3d11/d3d11_device.h index 0d3da04a3..ca89f0abf 100644 --- a/renderdoc/driver/d3d11/d3d11_device.h +++ b/renderdoc/driver/d3d11/d3d11_device.h @@ -445,7 +445,7 @@ public: ResourceId GetResourceID() { return m_ResourceID; } FrameRecord &GetFrameRecord() { return m_FrameRecord; } FrameStatistics &GetFrameStats() { return m_FrameRecord.frameInfo.stats; } - const DrawcallDescription *GetDrawcall(uint32_t eventID); + const DrawcallDescription *GetDrawcall(uint32_t eventId); void ReplayPushEvent() { m_ReplayEventCount++; } void ReplayPopEvent() { m_ReplayEventCount = RDCMAX(0, m_ReplayEventCount - 1); } diff --git a/renderdoc/driver/d3d11/d3d11_hooks.cpp b/renderdoc/driver/d3d11/d3d11_hooks.cpp index a8a9424b2..e37ac1984 100644 --- a/renderdoc/driver/d3d11/d3d11_hooks.cpp +++ b/renderdoc/driver/d3d11/d3d11_hooks.cpp @@ -196,7 +196,7 @@ private: if(m_EnabledHooks) { - if(!reading && RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!reading && RenderDoc::Inst().GetCaptureOptions().apiValidation) { Flags |= D3D11_CREATE_DEVICE_DEBUG; } @@ -215,7 +215,7 @@ private: pUsedSwapDesc = &swapDesc; } - if(pUsedSwapDesc && m_EnabledHooks && !RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if(pUsedSwapDesc && m_EnabledHooks && !RenderDoc::Inst().GetCaptureOptions().allowFullscreen) { pUsedSwapDesc->Windowed = TRUE; } @@ -373,7 +373,7 @@ private: if(d3d11hooks.m_EnabledHooks) { - if(!reading && RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!reading && RenderDoc::Inst().GetCaptureOptions().apiValidation) { Flags |= D3D11_CREATE_DEVICE_DEBUG; } @@ -434,7 +434,7 @@ private: if(d3d11hooks.m_EnabledHooks) { - if(!reading && RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!reading && RenderDoc::Inst().GetCaptureOptions().apiValidation) { Flags |= D3D11_CREATE_DEVICE_DEBUG; } @@ -454,7 +454,7 @@ private: } if(pUsedSwapDesc && d3d11hooks.m_EnabledHooks && - !RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + !RenderDoc::Inst().GetCaptureOptions().allowFullscreen) { pUsedSwapDesc->Windowed = TRUE; } diff --git a/renderdoc/driver/d3d11/d3d11_initstate.cpp b/renderdoc/driver/d3d11/d3d11_initstate.cpp index 8ac2faa31..e9d510f30 100644 --- a/renderdoc/driver/d3d11/d3d11_initstate.cpp +++ b/renderdoc/driver/d3d11/d3d11_initstate.cpp @@ -337,7 +337,7 @@ uint32_t WrappedID3D11Device::GetSize_InitialState(ResourceId id, ID3D11DeviceCh NumSubresources *= desc.SampleDesc.Count; bool OmittedContents = ShouldOmitInitState(desc, tex->GetResourceID()) && - !RenderDoc::Inst().GetCaptureOptions().SaveAllInitials; + !RenderDoc::Inst().GetCaptureOptions().saveAllInitials; if(!OmittedContents) { @@ -692,7 +692,7 @@ bool WrappedID3D11Device::Serialise_InitialState(SerialiserType &ser, ResourceId SERIALISE_ELEMENT_LOCAL( OmittedContents, - ShouldOmitInitState(desc, Id) && !RenderDoc::Inst().GetCaptureOptions().SaveAllInitials); + ShouldOmitInitState(desc, Id) && !RenderDoc::Inst().GetCaptureOptions().saveAllInitials); if(OmittedContents) { diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 4e8eaebeb..77dd12bd9 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -56,7 +56,7 @@ void D3D11Replay::Shutdown() TextureDescription D3D11Replay::GetTexture(ResourceId id) { TextureDescription tex = {}; - tex.ID = ResourceId(); + tex.resourceId = ResourceId(); auto it1D = WrappedID3D11Texture1D::m_TextureList.find(id); if(it1D != WrappedID3D11Texture1D::m_TextureList.end()) @@ -68,7 +68,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) D3D11_TEXTURE1D_DESC desc; d3dtex->GetDesc(&desc); - tex.ID = m_pDevice->GetResourceManager()->GetOriginalID(it1D->first); + tex.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(it1D->first); tex.dimension = 1; tex.width = desc.Width; tex.height = 1; @@ -93,7 +93,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) tex.arraysize = desc.ArraySize; - tex.resType = tex.arraysize > 1 ? TextureDim::Texture1DArray : TextureDim::Texture1D; + tex.type = tex.arraysize > 1 ? TextureType::Texture1DArray : TextureType::Texture1D; tex.msQual = 0; tex.msSamp = 1; @@ -118,7 +118,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) if(d3dtex->m_RealDescriptor) desc.Format = d3dtex->m_RealDescriptor->Format; - tex.ID = m_pDevice->GetResourceManager()->GetOriginalID(it2D->first); + tex.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(it2D->first); tex.dimension = 2; tex.width = desc.Width; tex.height = desc.Height; @@ -151,11 +151,11 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) tex.msQual = desc.SampleDesc.Quality; tex.msSamp = RDCMAX(1U, desc.SampleDesc.Count); - tex.resType = tex.arraysize > 1 ? TextureDim::Texture2DArray : TextureDim::Texture2D; + tex.type = tex.arraysize > 1 ? TextureType::Texture2DArray : TextureType::Texture2D; if(tex.cubemap) - tex.resType = tex.arraysize > 1 ? TextureDim::TextureCubeArray : TextureDim::TextureCube; + tex.type = tex.arraysize > 1 ? TextureType::TextureCubeArray : TextureType::TextureCube; if(tex.msSamp > 1) - tex.resType = tex.arraysize > 1 ? TextureDim::Texture2DMSArray : TextureDim::Texture2DMS; + tex.type = tex.arraysize > 1 ? TextureType::Texture2DMSArray : TextureType::Texture2DMS; tex.byteSize = 0; for(uint32_t s = 0; s < tex.arraysize * tex.mips; s++) @@ -174,7 +174,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) D3D11_TEXTURE3D_DESC desc; d3dtex->GetDesc(&desc); - tex.ID = m_pDevice->GetResourceManager()->GetOriginalID(it3D->first); + tex.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(it3D->first); tex.dimension = 3; tex.width = desc.Width; tex.height = desc.Height; @@ -182,7 +182,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) tex.cubemap = false; tex.format = MakeResourceFormat(desc.Format); - tex.resType = TextureDim::Texture3D; + tex.type = TextureType::Texture3D; tex.creationFlags = TextureCategory::NoFlags; if(desc.BindFlags & D3D11_BIND_SHADER_RESOURCE) @@ -215,7 +215,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id) tex.byteSize = 0; tex.dimension = 2; - tex.resType = TextureDim::Texture2D; + tex.type = TextureType::Texture2D; tex.width = 1; tex.height = 1; tex.depth = 1; @@ -237,7 +237,7 @@ rdcarray D3D11Replay::GetShaderEntryPoints(ResourceId shader) ShaderReflection &ret = it->second->GetDetails(); - return {{"main", ret.Stage}}; + return {{"main", ret.stage}}; } ShaderReflection *D3D11Replay::GetShader(ResourceId shader, string entryPoint) @@ -267,7 +267,8 @@ vector D3D11Replay::GetDisassemblyTargets() string D3D11Replay::DisassembleShader(ResourceId pipeline, const ShaderReflection *refl, const string &target) { - auto it = WrappedShader::m_ShaderList.find(m_pDevice->GetResourceManager()->GetLiveID(refl->ID)); + auto it = + WrappedShader::m_ShaderList.find(m_pDevice->GetResourceManager()->GetLiveID(refl->resourceId)); if(it == WrappedShader::m_ShaderList.end()) return "Invalid Shader Specified"; @@ -334,7 +335,7 @@ ResourceDescription &D3D11Replay::GetResourceDesc(ResourceId id) { m_ResourceIdx[id] = m_Resources.size(); m_Resources.push_back(ResourceDescription()); - m_Resources.back().ID = id; + m_Resources.back().resourceId = id; return m_Resources.back(); } @@ -368,7 +369,7 @@ std::vector D3D11Replay::GetBuffers() BufferDescription D3D11Replay::GetBuffer(ResourceId id) { BufferDescription ret = {}; - ret.ID = ResourceId(); + ret.resourceId = ResourceId(); auto it = WrappedID3D11Buffer::m_BufferList.find(id); @@ -379,7 +380,7 @@ BufferDescription D3D11Replay::GetBuffer(ResourceId id) string str = GetDebugName(d3dbuf); - ret.ID = m_pDevice->GetResourceManager()->GetOriginalID(it->first); + ret.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(it->first); D3D11_BUFFER_DESC desc; it->second.m_Buffer->GetDesc(&desc); @@ -452,7 +453,7 @@ void D3D11Replay::SavePipelineState() D3D11ResourceManager *rm = m_pDevice->GetResourceManager(); - ret.m_IA.Bytecode = NULL; + ret.inputAssembly.bytecode = NULL; if(rs->IA.Layout) { @@ -460,44 +461,44 @@ void D3D11Replay::SavePipelineState() ResourceId layoutId = GetIDForResource(rs->IA.Layout); - ret.m_IA.layout = rm->GetOriginalID(layoutId); - ret.m_IA.Bytecode = GetShader(layoutId, ""); + ret.inputAssembly.resourceId = rm->GetOriginalID(layoutId); + ret.inputAssembly.bytecode = GetShader(layoutId, ""); - ret.m_IA.layouts.resize(vec.size()); + ret.inputAssembly.layouts.resize(vec.size()); for(size_t i = 0; i < vec.size(); i++) { - D3D11Pipe::Layout &l = ret.m_IA.layouts[i]; + D3D11Pipe::Layout &l = ret.inputAssembly.layouts[i]; - l.ByteOffset = vec[i].AlignedByteOffset; - l.Format = MakeResourceFormat(vec[i].Format); - l.InputSlot = vec[i].InputSlot; - l.PerInstance = vec[i].InputSlotClass == D3D11_INPUT_PER_INSTANCE_DATA; - l.InstanceDataStepRate = vec[i].InstanceDataStepRate; - l.SemanticIndex = vec[i].SemanticIndex; - l.SemanticName = vec[i].SemanticName; + l.byteOffset = vec[i].AlignedByteOffset; + l.format = MakeResourceFormat(vec[i].Format); + l.inputSlot = vec[i].InputSlot; + l.perInstance = vec[i].InputSlotClass == D3D11_INPUT_PER_INSTANCE_DATA; + l.instanceDataStepRate = vec[i].InstanceDataStepRate; + l.semanticIndex = vec[i].SemanticIndex; + l.semanticName = vec[i].SemanticName; } } - ret.m_IA.vbuffers.resize(ARRAY_COUNT(rs->IA.VBs)); + ret.inputAssembly.vertexBuffers.resize(ARRAY_COUNT(rs->IA.VBs)); for(size_t i = 0; i < ARRAY_COUNT(rs->IA.VBs); i++) { - D3D11Pipe::VB &vb = ret.m_IA.vbuffers[i]; + D3D11Pipe::VertexBuffer &vb = ret.inputAssembly.vertexBuffers[i]; - vb.Buffer = rm->GetOriginalID(GetIDForResource(rs->IA.VBs[i])); - vb.Offset = rs->IA.Offsets[i]; - vb.Stride = rs->IA.Strides[i]; + vb.resourceId = rm->GetOriginalID(GetIDForResource(rs->IA.VBs[i])); + vb.byteOffset = rs->IA.Offsets[i]; + vb.byteStride = rs->IA.Strides[i]; } - ret.m_IA.ibuffer.Buffer = rm->GetOriginalID(GetIDForResource(rs->IA.IndexBuffer)); - ret.m_IA.ibuffer.Offset = rs->IA.IndexOffset; + ret.inputAssembly.indexBuffer.resourceId = rm->GetOriginalID(GetIDForResource(rs->IA.IndexBuffer)); + ret.inputAssembly.indexBuffer.byteOffset = rs->IA.IndexOffset; ///////////////////////////////////////////////// // Shaders ///////////////////////////////////////////////// { - D3D11Pipe::Shader *dstArr[] = {&ret.m_VS, &ret.m_HS, &ret.m_DS, - &ret.m_GS, &ret.m_PS, &ret.m_CS}; + D3D11Pipe::Shader *dstArr[] = {&ret.vertexShader, &ret.hullShader, &ret.domainShader, + &ret.geometryShader, &ret.pixelShader, &ret.computeShader}; const D3D11RenderState::Shader *srcArr[] = {&rs->VS, &rs->HS, &rs->DS, &rs->GS, &rs->PS, &rs->CS}; @@ -519,162 +520,163 @@ void D3D11Replay::SavePipelineState() if(shad != NULL) { refl = &shad->GetDetails(); - dst.BindpointMapping = shad->GetMapping(); + dst.bindpointMapping = shad->GetMapping(); } - dst.Object = rm->GetOriginalID(id); - dst.ShaderDetails = refl; + dst.resourceId = rm->GetOriginalID(id); + dst.reflection = refl; - dst.ConstantBuffers.resize(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT); + dst.constantBuffers.resize(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT); for(size_t s = 0; s < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; s++) { - dst.ConstantBuffers[s].Buffer = rm->GetOriginalID(GetIDForResource(src.ConstantBuffers[s])); - dst.ConstantBuffers[s].VecOffset = src.CBOffsets[s]; - dst.ConstantBuffers[s].VecCount = src.CBCounts[s]; + dst.constantBuffers[s].resourceId = + rm->GetOriginalID(GetIDForResource(src.ConstantBuffers[s])); + dst.constantBuffers[s].vecOffset = src.CBOffsets[s]; + dst.constantBuffers[s].vecCount = src.CBCounts[s]; } - dst.Samplers.resize(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT); + dst.samplers.resize(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT); for(size_t s = 0; s < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT; s++) { - D3D11Pipe::Sampler &samp = dst.Samplers[s]; + D3D11Pipe::Sampler &samp = dst.samplers[s]; - samp.Samp = rm->GetOriginalID(GetIDForResource(src.Samplers[s])); + samp.resourceId = rm->GetOriginalID(GetIDForResource(src.Samplers[s])); - if(samp.Samp != ResourceId()) + if(samp.resourceId != ResourceId()) { D3D11_SAMPLER_DESC desc; src.Samplers[s]->GetDesc(&desc); - samp.AddressU = MakeAddressMode(desc.AddressU); - samp.AddressV = MakeAddressMode(desc.AddressV); - samp.AddressW = MakeAddressMode(desc.AddressW); + samp.addressU = MakeAddressMode(desc.AddressU); + samp.addressV = MakeAddressMode(desc.AddressV); + samp.addressW = MakeAddressMode(desc.AddressW); - memcpy(samp.BorderColor, desc.BorderColor, sizeof(FLOAT) * 4); + memcpy(samp.borderColor, desc.BorderColor, sizeof(FLOAT) * 4); - samp.Comparison = MakeCompareFunc(desc.ComparisonFunc); - samp.Filter = MakeFilter(desc.Filter); - samp.MaxAniso = 0; - if(samp.Filter.mip == FilterMode::Anisotropic) - samp.MaxAniso = desc.MaxAnisotropy; - samp.MaxLOD = desc.MaxLOD; - samp.MinLOD = desc.MinLOD; - samp.MipLODBias = desc.MipLODBias; + samp.compareFunction = MakeCompareFunc(desc.ComparisonFunc); + samp.filter = MakeFilter(desc.Filter); + samp.maxAnisotropy = 0; + if(samp.filter.mip == FilterMode::Anisotropic) + samp.maxAnisotropy = desc.MaxAnisotropy; + samp.maxLOD = desc.MaxLOD; + samp.minLOD = desc.MinLOD; + samp.mipLODBias = desc.MipLODBias; } } - dst.SRVs.resize(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT); + dst.srvs.resize(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT); for(size_t s = 0; s < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; s++) { - D3D11Pipe::View &view = dst.SRVs[s]; + D3D11Pipe::View &view = dst.srvs[s]; - view.Object = rm->GetOriginalID(GetIDForResource(src.SRVs[s])); + view.viewResourceId = rm->GetOriginalID(GetIDForResource(src.SRVs[s])); - if(view.Object != ResourceId()) + if(view.viewResourceId != ResourceId()) { D3D11_SHADER_RESOURCE_VIEW_DESC desc; src.SRVs[s]->GetDesc(&desc); - view.Format = MakeResourceFormat(desc.Format); + view.viewFormat = MakeResourceFormat(desc.Format); ID3D11Resource *res = NULL; src.SRVs[s]->GetResource(&res); - view.Structured = false; - view.BufferStructCount = 0; + view.structured = false; + view.bufferStructCount = 0; - view.ElementSize = + view.elementByteSize = desc.Format == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, desc.Format, 0); - view.Resource = rm->GetOriginalID(GetIDForResource(res)); + view.resourceResourceId = rm->GetOriginalID(GetIDForResource(res)); - view.Type = MakeTextureDim(desc.ViewDimension); + view.type = MakeTextureDim(desc.ViewDimension); if(desc.ViewDimension == D3D11_SRV_DIMENSION_BUFFER) { - view.FirstElement = desc.Buffer.FirstElement; - view.NumElements = desc.Buffer.NumElements; + view.firstElement = desc.Buffer.FirstElement; + view.numElements = desc.Buffer.NumElements; D3D11_BUFFER_DESC bufdesc; ((ID3D11Buffer *)res)->GetDesc(&bufdesc); - view.Structured = bufdesc.StructureByteStride > 0 && desc.Format == DXGI_FORMAT_UNKNOWN; + view.structured = bufdesc.StructureByteStride > 0 && desc.Format == DXGI_FORMAT_UNKNOWN; - if(view.Structured) - view.ElementSize = bufdesc.StructureByteStride; + if(view.structured) + view.elementByteSize = bufdesc.StructureByteStride; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_BUFFEREX) { - view.FirstElement = desc.BufferEx.FirstElement; - view.NumElements = desc.BufferEx.NumElements; - view.Flags = D3DBufferViewFlags(desc.BufferEx.Flags); + view.firstElement = desc.BufferEx.FirstElement; + view.numElements = desc.BufferEx.NumElements; + view.bufferFlags = D3DBufferViewFlags(desc.BufferEx.Flags); } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc.Texture1D.MostDetailedMip; - view.NumMipLevels = desc.Texture1D.MipLevels; + view.firstMip = desc.Texture1D.MostDetailedMip; + view.numMips = desc.Texture1D.MipLevels; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc.Texture1DArray.ArraySize; - view.FirstArraySlice = desc.Texture1DArray.FirstArraySlice; - view.HighestMip = desc.Texture1DArray.MostDetailedMip; - view.NumMipLevels = desc.Texture1DArray.MipLevels; + view.numSlices = desc.Texture1DArray.ArraySize; + view.firstSlice = desc.Texture1DArray.FirstArraySlice; + view.firstMip = desc.Texture1DArray.MostDetailedMip; + view.numMips = desc.Texture1DArray.MipLevels; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc.Texture2D.MostDetailedMip; - view.NumMipLevels = desc.Texture2D.MipLevels; + view.firstMip = desc.Texture2D.MostDetailedMip; + view.numMips = desc.Texture2D.MipLevels; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc.Texture2DArray.ArraySize; - view.FirstArraySlice = desc.Texture2DArray.FirstArraySlice; - view.HighestMip = desc.Texture2DArray.MostDetailedMip; - view.NumMipLevels = desc.Texture2DArray.MipLevels; + view.numSlices = desc.Texture2DArray.ArraySize; + view.firstSlice = desc.Texture2DArray.FirstArraySlice; + view.firstMip = desc.Texture2DArray.MostDetailedMip; + view.numMips = desc.Texture2DArray.MipLevels; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2DMS) { } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY) { - view.ArraySize = desc.Texture2DArray.ArraySize; - view.FirstArraySlice = desc.Texture2DArray.FirstArraySlice; + view.numSlices = desc.Texture2DArray.ArraySize; + view.firstSlice = desc.Texture2DArray.FirstArraySlice; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE3D) { - view.HighestMip = desc.Texture3D.MostDetailedMip; - view.NumMipLevels = desc.Texture3D.MipLevels; + view.firstMip = desc.Texture3D.MostDetailedMip; + view.numMips = desc.Texture3D.MipLevels; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURECUBE) { - view.ArraySize = 6; - view.HighestMip = desc.TextureCube.MostDetailedMip; - view.NumMipLevels = desc.TextureCube.MipLevels; + view.numSlices = 6; + view.firstMip = desc.TextureCube.MostDetailedMip; + view.numMips = desc.TextureCube.MipLevels; } else if(desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURECUBEARRAY) { - view.ArraySize = desc.TextureCubeArray.NumCubes * 6; - view.FirstArraySlice = desc.TextureCubeArray.First2DArrayFace; - view.HighestMip = desc.TextureCubeArray.MostDetailedMip; - view.NumMipLevels = desc.TextureCubeArray.MipLevels; + view.numSlices = desc.TextureCubeArray.NumCubes * 6; + view.firstSlice = desc.TextureCubeArray.First2DArrayFace; + view.firstMip = desc.TextureCubeArray.MostDetailedMip; + view.numMips = desc.TextureCubeArray.MipLevels; } SAFE_RELEASE(res); } else { - view.Resource = ResourceId(); + view.resourceResourceId = ResourceId(); } } - dst.UAVs.resize(D3D11_1_UAV_SLOT_COUNT); + dst.uavs.resize(D3D11_1_UAV_SLOT_COUNT); for(size_t s = 0; dst.stage == ShaderStage::Compute && s < D3D11_1_UAV_SLOT_COUNT; s++) { - D3D11Pipe::View &view = dst.UAVs[s]; + D3D11Pipe::View &view = dst.uavs[s]; - view.Object = rm->GetOriginalID(GetIDForResource(rs->CSUAVs[s])); + view.viewResourceId = rm->GetOriginalID(GetIDForResource(rs->CSUAVs[s])); - if(view.Object != ResourceId()) + if(view.viewResourceId != ResourceId()) { D3D11_UNORDERED_ACCESS_VIEW_DESC desc; rs->CSUAVs[s]->GetDesc(&desc); @@ -682,78 +684,78 @@ void D3D11Replay::SavePipelineState() ID3D11Resource *res = NULL; rs->CSUAVs[s]->GetResource(&res); - view.Structured = false; - view.BufferStructCount = 0; + view.structured = false; + view.bufferStructCount = 0; - view.ElementSize = + view.elementByteSize = desc.Format == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, desc.Format, 0); if(desc.ViewDimension == D3D11_UAV_DIMENSION_BUFFER && (desc.Buffer.Flags & (D3D11_BUFFER_UAV_FLAG_APPEND | D3D11_BUFFER_UAV_FLAG_COUNTER))) { - view.BufferStructCount = m_pDevice->GetDebugManager()->GetStructCount(rs->CSUAVs[s]); + view.bufferStructCount = m_pDevice->GetDebugManager()->GetStructCount(rs->CSUAVs[s]); } - view.Resource = rm->GetOriginalID(GetIDForResource(res)); + view.resourceResourceId = rm->GetOriginalID(GetIDForResource(res)); - view.Format = MakeResourceFormat(desc.Format); - view.Type = MakeTextureDim(desc.ViewDimension); + view.viewFormat = MakeResourceFormat(desc.Format); + view.type = MakeTextureDim(desc.ViewDimension); if(desc.ViewDimension == D3D11_UAV_DIMENSION_BUFFER) { - view.FirstElement = desc.Buffer.FirstElement; - view.NumElements = desc.Buffer.NumElements; - view.Flags = D3DBufferViewFlags(desc.Buffer.Flags); + view.firstElement = desc.Buffer.FirstElement; + view.numElements = desc.Buffer.NumElements; + view.bufferFlags = D3DBufferViewFlags(desc.Buffer.Flags); D3D11_BUFFER_DESC bufdesc; ((ID3D11Buffer *)res)->GetDesc(&bufdesc); - view.Structured = bufdesc.StructureByteStride > 0 && desc.Format == DXGI_FORMAT_UNKNOWN; + view.structured = bufdesc.StructureByteStride > 0 && desc.Format == DXGI_FORMAT_UNKNOWN; - if(view.Structured) - view.ElementSize = bufdesc.StructureByteStride; + if(view.structured) + view.elementByteSize = bufdesc.StructureByteStride; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc.Texture1D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture1D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc.Texture1DArray.ArraySize; - view.FirstArraySlice = desc.Texture1DArray.FirstArraySlice; - view.HighestMip = desc.Texture1DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture1DArray.ArraySize; + view.firstSlice = desc.Texture1DArray.FirstArraySlice; + view.firstMip = desc.Texture1DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc.Texture2D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture2D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc.Texture2DArray.ArraySize; - view.FirstArraySlice = desc.Texture2DArray.FirstArraySlice; - view.HighestMip = desc.Texture2DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture2DArray.ArraySize; + view.firstSlice = desc.Texture2DArray.FirstArraySlice; + view.firstMip = desc.Texture2DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE3D) { - view.ArraySize = desc.Texture3D.WSize; - view.FirstArraySlice = desc.Texture3D.FirstWSlice; - view.HighestMip = desc.Texture3D.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture3D.WSize; + view.firstSlice = desc.Texture3D.FirstWSlice; + view.firstMip = desc.Texture3D.MipSlice; + view.numMips = 1; } SAFE_RELEASE(res); } else { - view.Resource = ResourceId(); + view.resourceResourceId = ResourceId(); } } - dst.ClassInstances.reserve(src.NumInstances); + dst.classInstances.reserve(src.NumInstances); for(UINT s = 0; s < src.NumInstances; s++) { D3D11_CLASS_INSTANCE_DESC desc; @@ -767,7 +769,7 @@ void D3D11Replay::SavePipelineState() count = 255; src.Instances[s]->GetInstanceName(instName, &count); - dst.ClassInstances.push_back(instName); + dst.classInstances.push_back(instName); } } } @@ -777,11 +779,11 @@ void D3D11Replay::SavePipelineState() ///////////////////////////////////////////////// { - ret.m_SO.Outputs.resize(D3D11_SO_BUFFER_SLOT_COUNT); + ret.streamOut.outputs.resize(D3D11_SO_BUFFER_SLOT_COUNT); for(size_t s = 0; s < D3D11_SO_BUFFER_SLOT_COUNT; s++) { - ret.m_SO.Outputs[s].Buffer = rm->GetOriginalID(GetIDForResource(rs->SO.Buffers[s])); - ret.m_SO.Outputs[s].Offset = rs->SO.Offsets[s]; + ret.streamOut.outputs[s].resourceId = rm->GetOriginalID(GetIDForResource(rs->SO.Buffers[s])); + ret.streamOut.outputs[s].byteOffset = rs->SO.Offsets[s]; } } @@ -796,26 +798,26 @@ void D3D11Replay::SavePipelineState() { rs->RS.State->GetDesc(&desc); - ret.m_RS.m_State.AntialiasedLineEnable = desc.AntialiasedLineEnable == TRUE; + ret.rasterizer.state.antialiasedLines = desc.AntialiasedLineEnable == TRUE; - ret.m_RS.m_State.cullMode = CullMode::NoCull; + ret.rasterizer.state.cullMode = CullMode::NoCull; if(desc.CullMode == D3D11_CULL_FRONT) - ret.m_RS.m_State.cullMode = CullMode::Front; + ret.rasterizer.state.cullMode = CullMode::Front; if(desc.CullMode == D3D11_CULL_BACK) - ret.m_RS.m_State.cullMode = CullMode::Back; + ret.rasterizer.state.cullMode = CullMode::Back; - ret.m_RS.m_State.fillMode = FillMode::Solid; + ret.rasterizer.state.fillMode = FillMode::Solid; if(desc.FillMode == D3D11_FILL_WIREFRAME) - ret.m_RS.m_State.fillMode = FillMode::Wireframe; + ret.rasterizer.state.fillMode = FillMode::Wireframe; - ret.m_RS.m_State.DepthBias = desc.DepthBias; - ret.m_RS.m_State.DepthBiasClamp = desc.DepthBiasClamp; - ret.m_RS.m_State.DepthClip = desc.DepthClipEnable == TRUE; - ret.m_RS.m_State.FrontCCW = desc.FrontCounterClockwise == TRUE; - ret.m_RS.m_State.MultisampleEnable = desc.MultisampleEnable == TRUE; - ret.m_RS.m_State.ScissorEnable = desc.ScissorEnable == TRUE; - ret.m_RS.m_State.SlopeScaledDepthBias = desc.SlopeScaledDepthBias; - ret.m_RS.m_State.ForcedSampleCount = 0; + ret.rasterizer.state.depthBias = desc.DepthBias; + ret.rasterizer.state.depthBiasClamp = desc.DepthBiasClamp; + ret.rasterizer.state.depthClip = desc.DepthClipEnable == TRUE; + ret.rasterizer.state.frontCCW = desc.FrontCounterClockwise == TRUE; + ret.rasterizer.state.multisampleEnable = desc.MultisampleEnable == TRUE; + ret.rasterizer.state.scissorEnable = desc.ScissorEnable == TRUE; + ret.rasterizer.state.slopeScaledDepthBias = desc.SlopeScaledDepthBias; + ret.rasterizer.state.forcedSampleCount = 0; D3D11_RASTERIZER_DESC1 desc1; RDCEraseEl(desc1); @@ -823,7 +825,7 @@ void D3D11Replay::SavePipelineState() if(CanQuery(rs->RS.State)) { ((ID3D11RasterizerState1 *)rs->RS.State)->GetDesc1(&desc1); - ret.m_RS.m_State.ForcedSampleCount = desc1.ForcedSampleCount; + ret.rasterizer.state.forcedSampleCount = desc1.ForcedSampleCount; } D3D11_RASTERIZER_DESC2 desc2; @@ -832,47 +834,47 @@ void D3D11Replay::SavePipelineState() if(CanQuery(rs->RS.State)) { ((ID3D11RasterizerState2 *)rs->RS.State)->GetDesc2(&desc2); - ret.m_RS.m_State.ConservativeRasterization = + ret.rasterizer.state.conservativeRasterization = desc2.ConservativeRaster == D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON; } - ret.m_RS.m_State.State = rm->GetOriginalID(GetIDForResource(rs->RS.State)); + ret.rasterizer.state.resourceId = rm->GetOriginalID(GetIDForResource(rs->RS.State)); } else { - ret.m_RS.m_State.AntialiasedLineEnable = FALSE; - ret.m_RS.m_State.cullMode = CullMode::Back; - ret.m_RS.m_State.DepthBias = 0; - ret.m_RS.m_State.DepthBiasClamp = 0.0f; - ret.m_RS.m_State.DepthClip = TRUE; - ret.m_RS.m_State.fillMode = FillMode::Solid; - ret.m_RS.m_State.FrontCCW = FALSE; - ret.m_RS.m_State.MultisampleEnable = FALSE; - ret.m_RS.m_State.ScissorEnable = FALSE; - ret.m_RS.m_State.SlopeScaledDepthBias = 0.0f; - ret.m_RS.m_State.ForcedSampleCount = 0; - ret.m_RS.m_State.State = ResourceId(); + ret.rasterizer.state.antialiasedLines = FALSE; + ret.rasterizer.state.cullMode = CullMode::Back; + ret.rasterizer.state.depthBias = 0; + ret.rasterizer.state.depthBiasClamp = 0.0f; + ret.rasterizer.state.depthClip = TRUE; + ret.rasterizer.state.fillMode = FillMode::Solid; + ret.rasterizer.state.frontCCW = FALSE; + ret.rasterizer.state.multisampleEnable = FALSE; + ret.rasterizer.state.scissorEnable = FALSE; + ret.rasterizer.state.slopeScaledDepthBias = 0.0f; + ret.rasterizer.state.forcedSampleCount = 0; + ret.rasterizer.state.resourceId = ResourceId(); } size_t i = 0; - ret.m_RS.Scissors.resize(D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE); + ret.rasterizer.scissors.resize(D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE); for(i = 0; i < rs->RS.NumScissors; i++) - ret.m_RS.Scissors[i] = - D3D11Pipe::Scissor(rs->RS.Scissors[i].left, rs->RS.Scissors[i].top, - rs->RS.Scissors[i].right, rs->RS.Scissors[i].bottom, true); + ret.rasterizer.scissors[i] = Scissor(rs->RS.Scissors[i].left, rs->RS.Scissors[i].top, + rs->RS.Scissors[i].right - rs->RS.Scissors[i].left, + rs->RS.Scissors[i].bottom - rs->RS.Scissors[i].top, true); for(; i < D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; i++) - ret.m_RS.Scissors[i] = D3D11Pipe::Scissor(0, 0, 0, 0, false); + ret.rasterizer.scissors[i] = Scissor(0, 0, 0, 0, false); - ret.m_RS.Viewports.resize(D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE); + ret.rasterizer.viewports.resize(D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE); for(i = 0; i < rs->RS.NumViews; i++) - ret.m_RS.Viewports[i] = - D3D11Pipe::Viewport(rs->RS.Viewports[i].TopLeftX, rs->RS.Viewports[i].TopLeftY, - rs->RS.Viewports[i].Width, rs->RS.Viewports[i].Height, - rs->RS.Viewports[i].MinDepth, rs->RS.Viewports[i].MaxDepth, true); + ret.rasterizer.viewports[i] = + Viewport(rs->RS.Viewports[i].TopLeftX, rs->RS.Viewports[i].TopLeftY, + rs->RS.Viewports[i].Width, rs->RS.Viewports[i].Height, + rs->RS.Viewports[i].MinDepth, rs->RS.Viewports[i].MaxDepth, true); for(; i < D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; i++) - ret.m_RS.Viewports[i] = D3D11Pipe::Viewport(0, 0, 0, 0, 0, 0, false); + ret.rasterizer.viewports[i] = Viewport(0, 0, 0, 0, 0, 0, false); } ///////////////////////////////////////////////// @@ -880,14 +882,14 @@ void D3D11Replay::SavePipelineState() ///////////////////////////////////////////////// { - ret.m_OM.RenderTargets.resize(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT); + ret.outputMerger.renderTargets.resize(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT); for(size_t i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++) { - D3D11Pipe::View &view = ret.m_OM.RenderTargets[i]; + D3D11Pipe::View &view = ret.outputMerger.renderTargets[i]; - view.Object = rm->GetOriginalID(GetIDForResource(rs->OM.RenderTargets[i])); + view.viewResourceId = rm->GetOriginalID(GetIDForResource(rs->OM.RenderTargets[i])); - if(view.Object != ResourceId()) + if(view.viewResourceId != ResourceId()) { D3D11_RENDER_TARGET_VIEW_DESC desc; rs->OM.RenderTargets[i]->GetDesc(&desc); @@ -895,71 +897,71 @@ void D3D11Replay::SavePipelineState() ID3D11Resource *res = NULL; rs->OM.RenderTargets[i]->GetResource(&res); - view.Structured = false; - view.BufferStructCount = 0; - view.ElementSize = + view.structured = false; + view.bufferStructCount = 0; + view.elementByteSize = desc.Format == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, desc.Format, 0); - view.Resource = rm->GetOriginalID(GetIDForResource(res)); + view.resourceResourceId = rm->GetOriginalID(GetIDForResource(res)); - view.Format = MakeResourceFormat(desc.Format); - view.Type = MakeTextureDim(desc.ViewDimension); + view.viewFormat = MakeResourceFormat(desc.Format); + view.type = MakeTextureDim(desc.ViewDimension); if(desc.ViewDimension == D3D11_RTV_DIMENSION_BUFFER) { - view.FirstElement = desc.Buffer.FirstElement; - view.NumElements = desc.Buffer.NumElements; + view.firstElement = desc.Buffer.FirstElement; + view.numElements = desc.Buffer.NumElements; } else if(desc.ViewDimension == D3D11_RTV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc.Texture1D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture1D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_RTV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc.Texture1DArray.ArraySize; - view.FirstArraySlice = desc.Texture1DArray.FirstArraySlice; - view.HighestMip = desc.Texture1DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture1DArray.ArraySize; + view.firstSlice = desc.Texture1DArray.FirstArraySlice; + view.firstMip = desc.Texture1DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_RTV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc.Texture2D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture2D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_RTV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc.Texture2DArray.ArraySize; - view.FirstArraySlice = desc.Texture2DArray.FirstArraySlice; - view.HighestMip = desc.Texture2DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture2DArray.ArraySize; + view.firstSlice = desc.Texture2DArray.FirstArraySlice; + view.firstMip = desc.Texture2DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_RTV_DIMENSION_TEXTURE3D) { - view.ArraySize = desc.Texture3D.WSize; - view.FirstArraySlice = desc.Texture3D.FirstWSlice; - view.HighestMip = desc.Texture3D.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture3D.WSize; + view.firstSlice = desc.Texture3D.FirstWSlice; + view.firstMip = desc.Texture3D.MipSlice; + view.numMips = 1; } SAFE_RELEASE(res); } else { - view.Resource = ResourceId(); + view.resourceResourceId = ResourceId(); } } - ret.m_OM.UAVStartSlot = rs->OM.UAVStartSlot; + ret.outputMerger.uavStartSlot = rs->OM.UAVStartSlot; - ret.m_OM.UAVs.resize(D3D11_1_UAV_SLOT_COUNT); + ret.outputMerger.uavs.resize(D3D11_1_UAV_SLOT_COUNT); for(size_t s = 0; s < D3D11_1_UAV_SLOT_COUNT; s++) { D3D11Pipe::View view; - view.Object = rm->GetOriginalID(GetIDForResource(rs->OM.UAVs[s])); + view.viewResourceId = rm->GetOriginalID(GetIDForResource(rs->OM.UAVs[s])); - if(view.Object != ResourceId()) + if(view.viewResourceId != ResourceId()) { D3D11_UNORDERED_ACCESS_VIEW_DESC desc; rs->OM.UAVs[s]->GetDesc(&desc); @@ -967,79 +969,79 @@ void D3D11Replay::SavePipelineState() ID3D11Resource *res = NULL; rs->OM.UAVs[s]->GetResource(&res); - view.Structured = false; - view.BufferStructCount = 0; - view.ElementSize = + view.structured = false; + view.bufferStructCount = 0; + view.elementByteSize = desc.Format == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, desc.Format, 0); if(desc.Buffer.Flags & (D3D11_BUFFER_UAV_FLAG_APPEND | D3D11_BUFFER_UAV_FLAG_COUNTER)) { - view.BufferStructCount = m_pDevice->GetDebugManager()->GetStructCount(rs->OM.UAVs[s]); + view.bufferStructCount = m_pDevice->GetDebugManager()->GetStructCount(rs->OM.UAVs[s]); } - view.Resource = rm->GetOriginalID(GetIDForResource(res)); + view.resourceResourceId = rm->GetOriginalID(GetIDForResource(res)); - view.Format = MakeResourceFormat(desc.Format); - view.Type = MakeTextureDim(desc.ViewDimension); + view.viewFormat = MakeResourceFormat(desc.Format); + view.type = MakeTextureDim(desc.ViewDimension); if(desc.ViewDimension == D3D11_UAV_DIMENSION_BUFFER) { - view.FirstElement = desc.Buffer.FirstElement; - view.NumElements = desc.Buffer.NumElements; - view.Flags = D3DBufferViewFlags(desc.Buffer.Flags); + view.firstElement = desc.Buffer.FirstElement; + view.numElements = desc.Buffer.NumElements; + view.bufferFlags = D3DBufferViewFlags(desc.Buffer.Flags); D3D11_BUFFER_DESC bufdesc; ((ID3D11Buffer *)res)->GetDesc(&bufdesc); - view.Structured = bufdesc.StructureByteStride > 0 && desc.Format == DXGI_FORMAT_UNKNOWN; + view.structured = bufdesc.StructureByteStride > 0 && desc.Format == DXGI_FORMAT_UNKNOWN; - if(view.Structured) - view.ElementSize = bufdesc.StructureByteStride; + if(view.structured) + view.elementByteSize = bufdesc.StructureByteStride; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc.Texture1D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture1D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc.Texture1DArray.ArraySize; - view.FirstArraySlice = desc.Texture1DArray.FirstArraySlice; - view.HighestMip = desc.Texture1DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture1DArray.ArraySize; + view.firstSlice = desc.Texture1DArray.FirstArraySlice; + view.firstMip = desc.Texture1DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc.Texture2D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture2D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc.Texture2DArray.ArraySize; - view.FirstArraySlice = desc.Texture2DArray.FirstArraySlice; - view.HighestMip = desc.Texture2DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture2DArray.ArraySize; + view.firstSlice = desc.Texture2DArray.FirstArraySlice; + view.firstMip = desc.Texture2DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_UAV_DIMENSION_TEXTURE3D) { - view.ArraySize = desc.Texture3D.WSize; - view.FirstArraySlice = desc.Texture3D.FirstWSlice; - view.HighestMip = desc.Texture3D.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture3D.WSize; + view.firstSlice = desc.Texture3D.FirstWSlice; + view.firstMip = desc.Texture3D.MipSlice; + view.numMips = 1; } SAFE_RELEASE(res); } - ret.m_OM.UAVs[s] = view; + ret.outputMerger.uavs[s] = view; } { - D3D11Pipe::View &view = ret.m_OM.DepthTarget; + D3D11Pipe::View &view = ret.outputMerger.depthTarget; - view.Object = rm->GetOriginalID(GetIDForResource(rs->OM.DepthView)); + view.viewResourceId = rm->GetOriginalID(GetIDForResource(rs->OM.DepthView)); - if(view.Object != ResourceId()) + if(view.viewResourceId != ResourceId()) { D3D11_DEPTH_STENCIL_VIEW_DESC desc; rs->OM.DepthView->GetDesc(&desc); @@ -1047,66 +1049,66 @@ void D3D11Replay::SavePipelineState() ID3D11Resource *res = NULL; rs->OM.DepthView->GetResource(&res); - view.Structured = false; - view.BufferStructCount = 0; - view.ElementSize = + view.structured = false; + view.bufferStructCount = 0; + view.elementByteSize = desc.Format == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, desc.Format, 0); - ret.m_OM.DepthReadOnly = false; - ret.m_OM.StencilReadOnly = false; + ret.outputMerger.depthReadOnly = false; + ret.outputMerger.stencilReadOnly = false; if(desc.Flags & D3D11_DSV_READ_ONLY_DEPTH) - ret.m_OM.DepthReadOnly = true; + ret.outputMerger.depthReadOnly = true; if(desc.Flags & D3D11_DSV_READ_ONLY_STENCIL) - ret.m_OM.StencilReadOnly = true; + ret.outputMerger.stencilReadOnly = true; - view.Resource = rm->GetOriginalID(GetIDForResource(res)); + view.resourceResourceId = rm->GetOriginalID(GetIDForResource(res)); - view.Format = MakeResourceFormat(desc.Format); - view.Type = MakeTextureDim(desc.ViewDimension); + view.viewFormat = MakeResourceFormat(desc.Format); + view.type = MakeTextureDim(desc.ViewDimension); if(desc.ViewDimension == D3D11_DSV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc.Texture1D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture1D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_DSV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc.Texture1DArray.ArraySize; - view.FirstArraySlice = desc.Texture1DArray.FirstArraySlice; - view.HighestMip = desc.Texture1DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture1DArray.ArraySize; + view.firstSlice = desc.Texture1DArray.FirstArraySlice; + view.firstMip = desc.Texture1DArray.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_DSV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc.Texture2D.MipSlice; - view.NumMipLevels = 1; + view.firstMip = desc.Texture2D.MipSlice; + view.numMips = 1; } else if(desc.ViewDimension == D3D11_DSV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc.Texture2DArray.ArraySize; - view.FirstArraySlice = desc.Texture2DArray.FirstArraySlice; - view.HighestMip = desc.Texture2DArray.MipSlice; - view.NumMipLevels = 1; + view.numSlices = desc.Texture2DArray.ArraySize; + view.firstSlice = desc.Texture2DArray.FirstArraySlice; + view.firstMip = desc.Texture2DArray.MipSlice; + view.numMips = 1; } SAFE_RELEASE(res); } } - ret.m_OM.m_BlendState.SampleMask = rs->OM.SampleMask; + ret.outputMerger.blendState.sampleMask = rs->OM.SampleMask; - memcpy(ret.m_OM.m_BlendState.BlendFactor, rs->OM.BlendFactor, sizeof(FLOAT) * 4); + memcpy(ret.outputMerger.blendState.blendFactor, rs->OM.BlendFactor, sizeof(FLOAT) * 4); if(rs->OM.BlendState) { D3D11_BLEND_DESC desc; rs->OM.BlendState->GetDesc(&desc); - ret.m_OM.m_BlendState.State = rm->GetOriginalID(GetIDForResource(rs->OM.BlendState)); + ret.outputMerger.blendState.resourceId = rm->GetOriginalID(GetIDForResource(rs->OM.BlendState)); - ret.m_OM.m_BlendState.AlphaToCoverage = desc.AlphaToCoverageEnable == TRUE; - ret.m_OM.m_BlendState.IndependentBlend = desc.IndependentBlendEnable == TRUE; + ret.outputMerger.blendState.alphaToCoverage = desc.AlphaToCoverageEnable == TRUE; + ret.outputMerger.blendState.independentBlend = desc.IndependentBlendEnable == TRUE; bool state1 = false; D3D11_BLEND_DESC1 desc1; @@ -1119,55 +1121,55 @@ void D3D11Replay::SavePipelineState() state1 = true; } - ret.m_OM.m_BlendState.Blends.resize(8); + ret.outputMerger.blendState.blends.resize(8); for(size_t i = 0; i < 8; i++) { - D3D11Pipe::Blend &blend = ret.m_OM.m_BlendState.Blends[i]; + ColorBlend &blend = ret.outputMerger.blendState.blends[i]; - blend.Enabled = desc.RenderTarget[i].BlendEnable == TRUE; + blend.enabled = desc.RenderTarget[i].BlendEnable == TRUE; - blend.LogicEnabled = state1 && desc1.RenderTarget[i].LogicOpEnable == TRUE; - blend.Logic = state1 ? MakeLogicOp(desc1.RenderTarget[i].LogicOp) : LogicOp::NoOp; + blend.logicOperationEnabled = state1 && desc1.RenderTarget[i].LogicOpEnable == TRUE; + blend.logicOperation = + state1 ? MakeLogicOp(desc1.RenderTarget[i].LogicOp) : LogicOperation::NoOp; - blend.m_AlphaBlend.Source = MakeBlendMultiplier(desc.RenderTarget[i].SrcBlendAlpha, true); - blend.m_AlphaBlend.Destination = - MakeBlendMultiplier(desc.RenderTarget[i].DestBlendAlpha, true); - blend.m_AlphaBlend.Operation = MakeBlendOp(desc.RenderTarget[i].BlendOpAlpha); + blend.alphaBlend.source = MakeBlendMultiplier(desc.RenderTarget[i].SrcBlendAlpha, true); + blend.alphaBlend.destination = MakeBlendMultiplier(desc.RenderTarget[i].DestBlendAlpha, true); + blend.alphaBlend.operation = MakeBlendOp(desc.RenderTarget[i].BlendOpAlpha); - blend.m_Blend.Source = MakeBlendMultiplier(desc.RenderTarget[i].SrcBlend, false); - blend.m_Blend.Destination = MakeBlendMultiplier(desc.RenderTarget[i].DestBlend, false); - blend.m_Blend.Operation = MakeBlendOp(desc.RenderTarget[i].BlendOp); + blend.colorBlend.source = MakeBlendMultiplier(desc.RenderTarget[i].SrcBlend, false); + blend.colorBlend.destination = MakeBlendMultiplier(desc.RenderTarget[i].DestBlend, false); + blend.colorBlend.operation = MakeBlendOp(desc.RenderTarget[i].BlendOp); - blend.WriteMask = desc.RenderTarget[i].RenderTargetWriteMask; + blend.writeMask = desc.RenderTarget[i].RenderTargetWriteMask; } } else { - ret.m_OM.m_BlendState.State = ResourceId(); + ret.outputMerger.blendState.resourceId = ResourceId(); - ret.m_OM.m_BlendState.AlphaToCoverage = false; - ret.m_OM.m_BlendState.IndependentBlend = false; + ret.outputMerger.blendState.alphaToCoverage = false; + ret.outputMerger.blendState.independentBlend = false; - D3D11Pipe::Blend blend; + ColorBlend blend; - blend.Enabled = false; + blend.enabled = false; - blend.m_AlphaBlend.Source = BlendMultiplier::One; - blend.m_AlphaBlend.Destination = BlendMultiplier::Zero; - blend.m_AlphaBlend.Operation = BlendOp::Add; + blend.alphaBlend.source = BlendMultiplier::One; + blend.alphaBlend.destination = BlendMultiplier::Zero; + blend.alphaBlend.operation = BlendOperation::Add; - blend.m_Blend.Source = BlendMultiplier::One; - blend.m_Blend.Destination = BlendMultiplier::Zero; - blend.m_Blend.Operation = BlendOp::Add; + blend.colorBlend.source = BlendMultiplier::One; + blend.colorBlend.destination = BlendMultiplier::Zero; + blend.colorBlend.operation = BlendOperation::Add; - blend.LogicEnabled = false; - blend.Logic = LogicOp::NoOp; + blend.logicOperationEnabled = false; + blend.logicOperation = LogicOperation::NoOp; - blend.WriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; + blend.writeMask = D3D11_COLOR_WRITE_ENABLE_ALL; - ret.m_OM.m_BlendState.Blends.resize(8); + ret.outputMerger.blendState.blends.resize(8); for(size_t i = 0; i < 8; i++) - ret.m_OM.m_BlendState.Blends[i] = blend; + ret.outputMerger.blendState.blends[i] = blend; } if(rs->OM.DepthStencilState) @@ -1175,45 +1177,67 @@ void D3D11Replay::SavePipelineState() D3D11_DEPTH_STENCIL_DESC desc; rs->OM.DepthStencilState->GetDesc(&desc); - ret.m_OM.m_State.DepthEnable = desc.DepthEnable == TRUE; - ret.m_OM.m_State.DepthFunc = MakeCompareFunc(desc.DepthFunc); - ret.m_OM.m_State.DepthWrites = desc.DepthWriteMask == D3D11_DEPTH_WRITE_MASK_ALL; - ret.m_OM.m_State.StencilEnable = desc.StencilEnable == TRUE; - ret.m_OM.m_State.StencilRef = rs->OM.StencRef; - ret.m_OM.m_State.StencilReadMask = desc.StencilReadMask; - ret.m_OM.m_State.StencilWriteMask = desc.StencilWriteMask; - ret.m_OM.m_State.State = rm->GetOriginalID(GetIDForResource(rs->OM.DepthStencilState)); + ret.outputMerger.depthStencilState.depthEnable = desc.DepthEnable == TRUE; + ret.outputMerger.depthStencilState.depthFunction = MakeCompareFunc(desc.DepthFunc); + ret.outputMerger.depthStencilState.depthWrites = + desc.DepthWriteMask == D3D11_DEPTH_WRITE_MASK_ALL; + ret.outputMerger.depthStencilState.stencilEnable = desc.StencilEnable == TRUE; + ret.outputMerger.depthStencilState.resourceId = + rm->GetOriginalID(GetIDForResource(rs->OM.DepthStencilState)); - ret.m_OM.m_State.m_FrontFace.Func = MakeCompareFunc(desc.FrontFace.StencilFunc); - ret.m_OM.m_State.m_FrontFace.DepthFailOp = MakeStencilOp(desc.FrontFace.StencilDepthFailOp); - ret.m_OM.m_State.m_FrontFace.PassOp = MakeStencilOp(desc.FrontFace.StencilPassOp); - ret.m_OM.m_State.m_FrontFace.FailOp = MakeStencilOp(desc.FrontFace.StencilFailOp); + ret.outputMerger.depthStencilState.frontFace.function = + MakeCompareFunc(desc.FrontFace.StencilFunc); + ret.outputMerger.depthStencilState.frontFace.depthFailOperation = + MakeStencilOp(desc.FrontFace.StencilDepthFailOp); + ret.outputMerger.depthStencilState.frontFace.passOperation = + MakeStencilOp(desc.FrontFace.StencilPassOp); + ret.outputMerger.depthStencilState.frontFace.failOperation = + MakeStencilOp(desc.FrontFace.StencilFailOp); - ret.m_OM.m_State.m_BackFace.Func = MakeCompareFunc(desc.BackFace.StencilFunc); - ret.m_OM.m_State.m_BackFace.DepthFailOp = MakeStencilOp(desc.BackFace.StencilDepthFailOp); - ret.m_OM.m_State.m_BackFace.PassOp = MakeStencilOp(desc.BackFace.StencilPassOp); - ret.m_OM.m_State.m_BackFace.FailOp = MakeStencilOp(desc.BackFace.StencilFailOp); + ret.outputMerger.depthStencilState.backFace.function = + MakeCompareFunc(desc.BackFace.StencilFunc); + ret.outputMerger.depthStencilState.backFace.depthFailOperation = + MakeStencilOp(desc.BackFace.StencilDepthFailOp); + ret.outputMerger.depthStencilState.backFace.passOperation = + MakeStencilOp(desc.BackFace.StencilPassOp); + ret.outputMerger.depthStencilState.backFace.failOperation = + MakeStencilOp(desc.BackFace.StencilFailOp); + + // due to shared structs, this is slightly duplicated - D3D doesn't have separate states for + // front/back. + ret.outputMerger.depthStencilState.frontFace.reference = rs->OM.StencRef; + ret.outputMerger.depthStencilState.frontFace.compareMask = desc.StencilReadMask; + ret.outputMerger.depthStencilState.frontFace.writeMask = desc.StencilWriteMask; + ret.outputMerger.depthStencilState.backFace.reference = rs->OM.StencRef; + ret.outputMerger.depthStencilState.backFace.compareMask = desc.StencilReadMask; + ret.outputMerger.depthStencilState.backFace.writeMask = desc.StencilWriteMask; } else { - ret.m_OM.m_State.DepthEnable = true; - ret.m_OM.m_State.DepthFunc = CompareFunc::Less; - ret.m_OM.m_State.DepthWrites = true; - ret.m_OM.m_State.StencilEnable = false; - ret.m_OM.m_State.StencilRef = rs->OM.StencRef; - ret.m_OM.m_State.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; - ret.m_OM.m_State.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; - ret.m_OM.m_State.State = ResourceId(); + ret.outputMerger.depthStencilState.depthEnable = true; + ret.outputMerger.depthStencilState.depthFunction = CompareFunction::Less; + ret.outputMerger.depthStencilState.depthWrites = true; + ret.outputMerger.depthStencilState.stencilEnable = false; + ret.outputMerger.depthStencilState.resourceId = ResourceId(); - ret.m_OM.m_State.m_FrontFace.Func = CompareFunc::AlwaysTrue; - ret.m_OM.m_State.m_FrontFace.DepthFailOp = StencilOp::Keep; - ret.m_OM.m_State.m_FrontFace.PassOp = StencilOp::Keep; - ret.m_OM.m_State.m_FrontFace.FailOp = StencilOp::Keep; + ret.outputMerger.depthStencilState.frontFace.function = CompareFunction::AlwaysTrue; + ret.outputMerger.depthStencilState.frontFace.depthFailOperation = StencilOperation::Keep; + ret.outputMerger.depthStencilState.frontFace.passOperation = StencilOperation::Keep; + ret.outputMerger.depthStencilState.frontFace.failOperation = StencilOperation::Keep; - ret.m_OM.m_State.m_BackFace.Func = CompareFunc::AlwaysTrue; - ret.m_OM.m_State.m_BackFace.DepthFailOp = StencilOp::Keep; - ret.m_OM.m_State.m_BackFace.PassOp = StencilOp::Keep; - ret.m_OM.m_State.m_BackFace.FailOp = StencilOp::Keep; + ret.outputMerger.depthStencilState.backFace.function = CompareFunction::AlwaysTrue; + ret.outputMerger.depthStencilState.backFace.depthFailOperation = StencilOperation::Keep; + ret.outputMerger.depthStencilState.backFace.passOperation = StencilOperation::Keep; + ret.outputMerger.depthStencilState.backFace.failOperation = StencilOperation::Keep; + + // due to shared structs, this is slightly duplicated - D3D doesn't have separate states for + // front/back. + ret.outputMerger.depthStencilState.frontFace.reference = rs->OM.StencRef; + ret.outputMerger.depthStencilState.frontFace.compareMask = D3D11_DEFAULT_STENCIL_READ_MASK; + ret.outputMerger.depthStencilState.frontFace.writeMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + ret.outputMerger.depthStencilState.backFace.reference = rs->OM.StencRef; + ret.outputMerger.depthStencilState.backFace.compareMask = D3D11_DEFAULT_STENCIL_READ_MASK; + ret.outputMerger.depthStencilState.backFace.writeMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; } } @@ -1221,9 +1245,9 @@ void D3D11Replay::SavePipelineState() // Predication ///////////////////////////////////////////////// - ret.m_Predicate.Obj = rm->GetOriginalID(GetIDForResource(rs->Predicate)); - ret.m_Predicate.Value = rs->PredicateValue == TRUE ? true : false; - ret.m_Predicate.Passing = rs->PredicationWouldPass(); + ret.predication.resourceId = rm->GetOriginalID(GetIDForResource(rs->Predicate)); + ret.predication.value = rs->PredicateValue == TRUE ? true : false; + ret.predication.isPassing = rs->PredicationWouldPass(); } ReplayStatus D3D11Replay::ReadLogInitialisation(RDCFile *rdc, bool storeStructuredBuffers) @@ -1241,11 +1265,11 @@ const SDFile &D3D11Replay::GetStructuredFile() return m_pDevice->GetStructuredFile(); } -vector D3D11Replay::GetPassEvents(uint32_t eventID) +vector D3D11Replay::GetPassEvents(uint32_t eventId) { vector passEvents; - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventID); + const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); const DrawcallDescription *start = draw; while(start && start->previous != 0 && @@ -1266,7 +1290,7 @@ vector D3D11Replay::GetPassEvents(uint32_t eventID) break; if(start->flags & DrawFlags::Drawcall) - passEvents.push_back(start->eventID); + passEvents.push_back(start->eventId); start = m_pDevice->GetDrawcall((uint32_t)start->next); } @@ -1319,9 +1343,9 @@ void D3D11Replay::FlipOutputWindow(uint64_t id) m_pDevice->GetDebugManager()->FlipOutputWindow(id); } -void D3D11Replay::InitPostVSBuffers(uint32_t eventID) +void D3D11Replay::InitPostVSBuffers(uint32_t eventId) { - m_pDevice->GetDebugManager()->InitPostVSBuffers(eventID); + m_pDevice->GetDebugManager()->InitPostVSBuffers(eventId); } void D3D11Replay::InitPostVSBuffers(const vector &passEvents) @@ -1368,9 +1392,9 @@ bool D3D11Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mi maxval, channels, histogram); } -MeshFormat D3D11Replay::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat D3D11Replay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { - return m_pDevice->GetDebugManager()->GetPostVSBuffers(eventID, instID, stage); + return m_pDevice->GetDebugManager()->GetPostVSBuffers(eventId, instID, stage); } void D3D11Replay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData) @@ -1411,10 +1435,10 @@ vector D3D11Replay::FetchCounters(const vector &count return m_pDevice->GetDebugManager()->FetchCounters(counters); } -void D3D11Replay::RenderMesh(uint32_t eventID, const vector &secondaryDraws, +void D3D11Replay::RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { - return m_pDevice->GetDebugManager()->RenderMesh(eventID, secondaryDraws, cfg); + return m_pDevice->GetDebugManager()->RenderMesh(eventId, secondaryDraws, cfg); } void D3D11Replay::BuildTargetShader(string source, string entry, @@ -1476,28 +1500,28 @@ vector D3D11Replay::PixelHistory(vector events, R typeHint); } -ShaderDebugTrace D3D11Replay::DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, +ShaderDebugTrace D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { - return m_pDevice->GetDebugManager()->DebugVertex(eventID, vertid, instid, idx, instOffset, + return m_pDevice->GetDebugManager()->DebugVertex(eventId, vertid, instid, idx, instOffset, vertOffset); } -ShaderDebugTrace D3D11Replay::DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample, +ShaderDebugTrace D3D11Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { - return m_pDevice->GetDebugManager()->DebugPixel(eventID, x, y, sample, primitive); + return m_pDevice->GetDebugManager()->DebugPixel(eventId, x, y, sample, primitive); } -ShaderDebugTrace D3D11Replay::DebugThread(uint32_t eventID, const uint32_t groupid[3], +ShaderDebugTrace D3D11Replay::DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { - return m_pDevice->GetDebugManager()->DebugThread(eventID, groupid, threadid); + return m_pDevice->GetDebugManager()->DebugThread(eventId, groupid, threadid); } -uint32_t D3D11Replay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) +uint32_t D3D11Replay::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - return m_pDevice->GetDebugManager()->PickVertex(eventID, cfg, x, y); + return m_pDevice->GetDebugManager()->PickVertex(eventId, cfg, x, y); } void D3D11Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, @@ -1507,9 +1531,9 @@ void D3D11Replay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t } ResourceId D3D11Replay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { - return m_pDevice->GetDebugManager()->RenderOverlay(texid, typeHint, overlay, eventID, passEvents); + return m_pDevice->GetDebugManager()->RenderOverlay(texid, typeHint, overlay, eventId, passEvents); } ResourceId D3D11Replay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, @@ -1523,13 +1547,13 @@ bool D3D11Replay::IsRenderOutput(ResourceId id) { for(size_t i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++) { - if(m_CurPipelineState.m_OM.RenderTargets[i].Object == id || - m_CurPipelineState.m_OM.RenderTargets[i].Resource == id) + if(m_CurPipelineState.outputMerger.renderTargets[i].viewResourceId == id || + m_CurPipelineState.outputMerger.renderTargets[i].resourceResourceId == id) return true; } - if(m_CurPipelineState.m_OM.DepthTarget.Object == id || - m_CurPipelineState.m_OM.DepthTarget.Resource == id) + if(m_CurPipelineState.outputMerger.depthTarget.viewResourceId == id || + m_CurPipelineState.outputMerger.depthTarget.resourceResourceId == id) return true; return false; @@ -2063,7 +2087,7 @@ void D3D11_ProcessStructured(RDCFile *rdc, SDFile &output) ReplayStatus status = device.ReadLogInitialisation(rdc, true); if(status == ReplayStatus::Succeeded) - device.GetStructuredFile().swap(output); + device.GetStructuredFile().Swap(output); } static StructuredProcessRegistration D3D11ProcessRegistration(RDC_D3D11, &D3D11_ProcessStructured); \ No newline at end of file diff --git a/renderdoc/driver/d3d11/d3d11_replay.h b/renderdoc/driver/d3d11/d3d11_replay.h index 0c13001a0..e0d0081ae 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.h +++ b/renderdoc/driver/d3d11/d3d11_replay.h @@ -81,7 +81,7 @@ public: void ReplayLog(uint32_t endEventID, ReplayLogType replayType); const SDFile &GetStructuredFile(); - vector GetPassEvents(uint32_t eventID); + vector GetPassEvents(uint32_t eventId); vector GetSupportedWindowSystems() { @@ -100,7 +100,7 @@ public: bool IsOutputWindowVisible(uint64_t id); void FlipOutputWindow(uint64_t id); - void InitPostVSBuffers(uint32_t eventID); + void InitPostVSBuffers(uint32_t eventId); void InitPostVSBuffers(const vector &passEvents); ResourceId GetLiveID(ResourceId id); @@ -111,7 +111,7 @@ public: CompType typeHint, float minval, float maxval, bool channels[4], vector &histogram); - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData); void GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, @@ -135,7 +135,7 @@ public: ResourceId CreateProxyBuffer(const BufferDescription &templateBuf); void SetProxyBufferData(ResourceId bufid, byte *data, size_t dataSize); - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg); + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg); bool RenderTexture(TextureDisplay cfg); @@ -149,18 +149,18 @@ public: vector PixelHistory(vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint); - ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx, + 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, + ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive); - ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + 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 PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y); + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y); ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents); + uint32_t eventId, const vector &passEvents); void BuildCustomShader(string source, string entry, const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id, string *errors); diff --git a/renderdoc/driver/d3d11/d3d11_resources.cpp b/renderdoc/driver/d3d11/d3d11_resources.cpp index 2e4be57ea..bb836400e 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.cpp +++ b/renderdoc/driver/d3d11/d3d11_resources.cpp @@ -184,7 +184,7 @@ void WrappedShader::ShaderEntry::BuildReflection() "Mismatched vertex input count"); MakeShaderReflection(m_DXBCFile, &m_Details, &m_Mapping); - m_Details.ID = m_ID; + m_Details.resourceId = m_ID; } UINT GetMipForSubresource(ID3D11Resource *res, int Subresource) diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index 49ebb31d0..96dcfd670 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -1473,7 +1473,7 @@ void WrappedID3D12GraphicsCommandList::SetComputeRootDescriptorTable( num = base->samp.heap->GetNumDescriptors() - offset; } - if(!RenderDoc::Inst().GetCaptureOptions().RefAllResources) + if(!RenderDoc::Inst().GetCaptureOptions().refAllResources) { std::vector &descs = m_ListRecord->cmdInfo->boundDescs; @@ -2035,7 +2035,7 @@ void WrappedID3D12GraphicsCommandList::SetGraphicsRootDescriptorTable( num = base->samp.heap->GetNumDescriptors() - offset; } - if(!RenderDoc::Inst().GetCaptureOptions().RefAllResources) + if(!RenderDoc::Inst().GetCaptureOptions().refAllResources) { std::vector &descs = m_ListRecord->cmdInfo->boundDescs; @@ -3060,16 +3060,16 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DrawInstanced(SerialiserType &s { ID3D12GraphicsCommandList *list = m_Cmd->RerecordCmdList(m_Cmd->m_LastCmdListID); - uint32_t eventID = m_Cmd->HandlePreCallback(list); + uint32_t eventId = m_Cmd->HandlePreCallback(list); Unwrap(list)->DrawInstanced(VertexCountPerInstance, InstanceCount, StartVertexLocation, StartInstanceLocation); - if(eventID && m_Cmd->m_DrawcallCallback->PostDraw(eventID, list)) + if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) { Unwrap(list)->DrawInstanced(VertexCountPerInstance, InstanceCount, StartVertexLocation, StartInstanceLocation); - m_Cmd->m_DrawcallCallback->PostRedraw(eventID, list); + m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); } } } @@ -3144,16 +3144,16 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DrawIndexedInstanced( { ID3D12GraphicsCommandList *list = m_Cmd->RerecordCmdList(m_Cmd->m_LastCmdListID); - uint32_t eventID = m_Cmd->HandlePreCallback(list); + uint32_t eventId = m_Cmd->HandlePreCallback(list); Unwrap(list)->DrawIndexedInstanced(IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartInstanceLocation); - if(eventID && m_Cmd->m_DrawcallCallback->PostDraw(eventID, list)) + if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) { Unwrap(list)->DrawIndexedInstanced(IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartInstanceLocation); - m_Cmd->m_DrawcallCallback->PostRedraw(eventID, list); + m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); } } } @@ -3230,14 +3230,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Dispatch(SerialiserType &ser, U { ID3D12GraphicsCommandList *list = m_Cmd->RerecordCmdList(m_Cmd->m_LastCmdListID); - uint32_t eventID = m_Cmd->HandlePreCallback(list, true); + uint32_t eventId = m_Cmd->HandlePreCallback(list, true); Unwrap(list)->Dispatch(ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ); - if(eventID && m_Cmd->m_DrawcallCallback->PostDraw(eventID, list)) + if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) { Unwrap(list)->Dispatch(ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ); - m_Cmd->m_DrawcallCallback->PostRedraw(eventID, list); + m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); } } } @@ -3302,14 +3302,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteBundle(SerialiserType &s { ID3D12GraphicsCommandList *list = m_Cmd->RerecordCmdList(m_Cmd->m_LastCmdListID); - uint32_t eventID = m_Cmd->HandlePreCallback(list, true); + uint32_t eventId = m_Cmd->HandlePreCallback(list, true); Unwrap(list)->ExecuteBundle(Unwrap(pBundle)); - if(eventID && m_Cmd->m_DrawcallCallback->PostDraw(eventID, list)) + if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) { Unwrap(list)->ExecuteBundle(Unwrap(pBundle)); - m_Cmd->m_DrawcallCallback->PostRedraw(eventID, list); + m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); } } } @@ -3466,7 +3466,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in // find the draw where our execute begins for(; idx < draws.size(); idx++) - if(draws[idx].draw.eventID == eid) + if(draws[idx].draw.eventId == eid) break; RDCASSERTMSG("Couldn't find base event draw!", idx < draws.size(), idx, draws.size()); @@ -3510,7 +3510,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in // if this is the first draw of the indirect, we could have picked up previous // non-indirect events in this drawcall, so the EID will be higher than we expect. Just // assign the draw's EID - eid = draw.eventID; + eid = draw.eventId; m_Cmd->AddUsage(draws[idx]); @@ -3539,7 +3539,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in // if this is the first draw of the indirect, we could have picked up previous // non-indirect events in this drawcall, so the EID will be higher than we expect. Just // assign the draw's EID - eid = draw.eventID; + eid = draw.eventId; m_Cmd->AddUsage(draws[idx]); @@ -3566,7 +3566,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in // if this is the first draw of the indirect, we could have picked up previous // non-indirect events in this drawcall, so the EID will be higher than we expect. Just // assign the draw's EID - eid = draw.eventID; + eid = draw.eventId; m_Cmd->AddUsage(draws[idx]); @@ -3660,7 +3660,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in uint32_t shiftDrawID = 0; - while(idx < draws.size() && draws[idx].draw.eventID < lastEID) + while(idx < draws.size() && draws[idx].draw.eventId < lastEID) { draws.erase(draws.begin() + idx); shiftDrawID++; @@ -3770,7 +3770,7 @@ void WrappedID3D12GraphicsCommandList::ReplayExecuteIndirect(ID3D12GraphicsComma } else { - uint32_t baseEventID = it->eventID; + uint32_t baseEventID = it->eventId; // TODO when using a drawcall callback, we should submit every drawcall individually if(m_Cmd->m_DrawcallCallback) @@ -4109,9 +4109,9 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteIndirect( D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pArgumentBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(pArgumentBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pCountBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(pCountBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); ID3D12GraphicsCommandList *cracked = GetCrackedList(); @@ -4267,7 +4267,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearDepthStencilView( drawNode.resourceUsage.push_back( std::make_pair(GetResID(descriptor->nonsamp.resource), - EventUsage(drawNode.draw.eventID, ResourceUsage::Clear))); + EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); } } } @@ -4348,7 +4348,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearRenderTargetView( drawNode.resourceUsage.push_back( std::make_pair(GetResID(descriptor->nonsamp.resource), - EventUsage(drawNode.draw.eventID, ResourceUsage::Clear))); + EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); } } } @@ -4432,7 +4432,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearUnorderedAccessViewUint( D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pResource), EventUsage(drawNode.draw.eventID, ResourceUsage::Clear))); + GetResID(pResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); } } } @@ -4524,7 +4524,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearUnorderedAccessViewFloat( D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pResource), EventUsage(drawNode.draw.eventID, ResourceUsage::Clear))); + GetResID(pResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); } } } @@ -4673,14 +4673,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyBufferRegion(SerialiserType if(pSrcBuffer == pDstBuffer) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Copy))); + GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pDstBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + GetResID(pDstBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -4771,14 +4771,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyTextureRegion( if(origSrc == origDst) { drawNode.resourceUsage.push_back( - std::make_pair(liveSrc, EventUsage(drawNode.draw.eventID, ResourceUsage::Copy))); + std::make_pair(liveSrc, EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); } else { drawNode.resourceUsage.push_back( - std::make_pair(liveSrc, EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + std::make_pair(liveSrc, EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back( - std::make_pair(liveDst, EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + std::make_pair(liveDst, EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -4860,14 +4860,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyResource(SerialiserType &se if(pSrcResource == pDstResource) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventID, ResourceUsage::Copy))); + GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pDstResource), EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + GetResID(pDstResource), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -4949,14 +4949,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ResolveSubresource( if(pSrcResource == pDstResource) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventID, ResourceUsage::Resolve))); + GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventID, ResourceUsage::ResolveSrc))); + GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(pDstResource), EventUsage(drawNode.draw.eventID, ResourceUsage::ResolveDst))); + GetResID(pDstResource), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); } } } diff --git a/renderdoc/driver/d3d12/d3d12_command_queue.h b/renderdoc/driver/d3d12/d3d12_command_queue.h index 2c9c0f6b7..b13a7c7be 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue.h +++ b/renderdoc/driver/d3d12/d3d12_command_queue.h @@ -126,8 +126,8 @@ public: WrappedID3D12Device *GetWrappedDevice() { return m_pDevice; } const vector &GetCmdLists() { return m_CmdListRecords; } D3D12DrawcallTreeNode &GetParentDrawcall() { return m_Cmd.m_ParentDrawcall; } - const APIEvent &GetEvent(uint32_t eventID); - uint32_t GetMaxEID() { return m_Cmd.m_Events.back().eventID; } + const APIEvent &GetEvent(uint32_t eventId); + uint32_t GetMaxEID() { return m_Cmd.m_Events.back().eventId; } ResourceId GetBackbufferResourceID() { return m_BackbufferID; } void ClearAfterCapture(); diff --git a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp index ab7bc562f..e1ed02573 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp @@ -198,7 +198,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se for(size_t i = 0; i < cmdBufInfo.debugMessages.size(); i++) { DebugMessage msg = cmdBufInfo.debugMessages[i]; - msg.eventID += m_Cmd.m_RootEventID; + msg.eventId += m_Cmd.m_RootEventID; m_pDevice->AddDebugMessage(msg); } diff --git a/renderdoc/driver/d3d12/d3d12_commands.cpp b/renderdoc/driver/d3d12/d3d12_commands.cpp index 90a4eeef8..096d87583 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.cpp +++ b/renderdoc/driver/d3d12/d3d12_commands.cpp @@ -251,11 +251,11 @@ std::string WrappedID3D12CommandQueue::GetChunkName(uint32_t idx) return ToStr((D3D12Chunk)idx); } -const APIEvent &WrappedID3D12CommandQueue::GetEvent(uint32_t eventID) +const APIEvent &WrappedID3D12CommandQueue::GetEvent(uint32_t eventId) { for(const APIEvent &e : m_Cmd.m_Events) { - if(e.eventID >= eventID) + if(e.eventId >= eventId) return e; } @@ -535,7 +535,7 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_ { ser.ConfigureStructuredExport(&GetChunkName, IsStructuredExporting(m_State)); - ser.GetStructuredFile().swap(m_pDevice->GetStructuredFile()); + ser.GetStructuredFile().Swap(m_pDevice->GetStructuredFile()); m_StructuredFile = &ser.GetStructuredFile(); } @@ -566,7 +566,7 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_ if(IsActiveReplaying(m_State)) { APIEvent ev = GetEvent(startEventID); - m_Cmd.m_RootEventID = ev.eventID; + m_Cmd.m_RootEventID = ev.eventId; // if not partial, we need to be sure to replay // past the command list records, so can't @@ -660,18 +660,13 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_ // swap the structure back now that we've accumulated the frame as well. if(IsLoading(m_State) || IsStructuredExporting(m_State)) - ser.GetStructuredFile().swap(m_pDevice->GetStructuredFile()); + ser.GetStructuredFile().Swap(m_pDevice->GetStructuredFile()); m_StructuredFile = NULL; if(IsLoading(m_State)) { - struct SortEID - { - bool operator()(const APIEvent &a, const APIEvent &b) { return a.eventID < b.eventID; } - }; - - std::sort(m_Cmd.m_Events.begin(), m_Cmd.m_Events.end(), SortEID()); + std::sort(m_Cmd.m_Events.begin(), m_Cmd.m_Events.end()); } for(size_t i = 0; i < m_Cmd.m_RerecordCmdList.size(); i++) @@ -862,20 +857,20 @@ void BakedCmdListInfo::ShiftForRemoved(uint32_t shiftDrawID, uint32_t shiftEID, // can cross command list boundaries. RDCASSERT(draws[i].children.empty()); - draws[i].draw.eventID -= shiftEID; - draws[i].draw.drawcallID -= shiftDrawID; + draws[i].draw.eventId -= shiftEID; + draws[i].draw.drawcallId -= shiftDrawID; for(APIEvent &ev : draws[i].draw.events) - ev.eventID -= shiftEID; + ev.eventId -= shiftEID; } - uint32_t lastEID = draws[idx].draw.eventID; + uint32_t lastEID = draws[idx].draw.eventId; // shift any resource usage for drawcalls after the removed section for(size_t i = 0; i < draw->resourceUsage.size(); i++) { - if(draw->resourceUsage[i].second.eventID >= lastEID) - draw->resourceUsage[i].second.eventID -= shiftEID; + if(draw->resourceUsage[i].second.eventId >= lastEID) + draw->resourceUsage[i].second.eventId -= shiftEID; } // patch any subsequent executes @@ -978,31 +973,31 @@ uint32_t D3D12CommandData::HandlePreCallback(ID3D12GraphicsCommandList *list, bo return 0; } - uint32_t eventID = it->eventID; + uint32_t eventId = it->eventId; - RDCASSERT(eventID != 0); + RDCASSERT(eventId != 0); // handle all aliases of this drawcall as long as it's not a multidraw - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventID); + const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); if(draw == NULL || !(draw->flags & DrawFlags::MultiDraw)) { ++it; while(it != m_DrawcallUses.end() && it->fileOffset == m_CurChunkOffset) { - m_DrawcallCallback->AliasEvent(eventID, it->eventID); + m_DrawcallCallback->AliasEvent(eventId, it->eventId); ++it; } } - eventID += multiDrawOffset; + eventId += multiDrawOffset; if(dispatch) - m_DrawcallCallback->PreDispatch(eventID, list); + m_DrawcallCallback->PreDispatch(eventId, list); else - m_DrawcallCallback->PreDraw(eventID, list); + m_DrawcallCallback->PreDraw(eventId, list); - return eventID; + return eventId; } bool D3D12CommandData::InRerecordRange(ResourceId cmdid) @@ -1070,7 +1065,7 @@ void D3D12CommandData::AddEvent() APIEvent apievent; apievent.fileOffset = m_CurChunkOffset; - apievent.eventID = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEventID + apievent.eventId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEventID : m_RootEventID; apievent.chunkIndex = uint32_t(m_StructuredFile->chunks.size() - 1); @@ -1078,7 +1073,7 @@ void D3D12CommandData::AddEvent() apievent.callstack = m_ChunkMetadata.callstack; for(size_t i = 0; i < m_EventMessages.size(); i++) - m_EventMessages[i].eventID = apievent.eventID; + m_EventMessages[i].eventId = apievent.eventId; if(m_LastCmdListID != ResourceId()) { @@ -1114,7 +1109,7 @@ void D3D12CommandData::AddUsage(D3D12DrawcallTreeNode &drawNode) DrawcallDescription &d = drawNode.draw; const D3D12RenderState &state = m_BakedCmdListInfo[m_LastCmdListID].state; - uint32_t e = d.eventID; + uint32_t e = d.eventId; DrawFlags DrawMask = DrawFlags::Drawcall | DrawFlags::Dispatch; if(!(d.flags & DrawMask)) @@ -1281,9 +1276,9 @@ void D3D12CommandData::AddDrawcall(const DrawcallDescription &d, bool hasEvents, m_AddedDrawcall = true; DrawcallDescription draw = d; - draw.eventID = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEventID + draw.eventId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEventID : m_RootEventID; - draw.drawcallID = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].drawCount + draw.drawcallId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].drawCount : m_RootDrawcallID; for(int i = 0; i < 8; i++) @@ -1363,16 +1358,16 @@ void D3D12CommandData::InsertDrawsAndRefreshIDs(ResourceId cmd, } D3D12DrawcallTreeNode n = cmdBufNodes[i]; - n.draw.eventID += m_RootEventID; - n.draw.drawcallID += m_RootDrawcallID; + n.draw.eventId += m_RootEventID; + n.draw.drawcallId += m_RootDrawcallID; for(APIEvent &ev : n.draw.events) { - ev.eventID += m_RootEventID; + ev.eventId += m_RootEventID; m_Events.push_back(ev); } - DrawcallUse use(m_Events.back().fileOffset, n.draw.eventID, cmd, cmdBufNodes[i].draw.eventID); + DrawcallUse use(m_Events.back().fileOffset, n.draw.eventId, cmd, cmdBufNodes[i].draw.eventId); // insert in sorted location auto drawit = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); @@ -1383,7 +1378,7 @@ void D3D12CommandData::InsertDrawsAndRefreshIDs(ResourceId cmd, for(auto it = n.resourceUsage.begin(); it != n.resourceUsage.end(); ++it) { EventUsage u = it->second; - u.eventID += m_RootEventID; + u.eventId += m_RootEventID; m_ResourceUses[it->first].push_back(u); } diff --git a/renderdoc/driver/d3d12/d3d12_commands.h b/renderdoc/driver/d3d12/d3d12_commands.h index 39e655e9d..249f0b5e2 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.h +++ b/renderdoc/driver/d3d12/d3d12_commands.h @@ -52,17 +52,17 @@ struct D3D12DrawcallTreeNode for(size_t i = 0; i < child.resourceUsage.size(); i++) { resourceUsage.push_back(child.resourceUsage[i]); - resourceUsage.back().second.eventID += baseEventID; + resourceUsage.back().second.eventId += baseEventID; } for(size_t i = 0; i < child.children.size(); i++) { children.push_back(child.children[i]); - children.back().draw.eventID += baseEventID; - children.back().draw.drawcallID += baseDrawID; + children.back().draw.eventId += baseEventID; + children.back().draw.drawcallId += baseDrawID; for(APIEvent &ev : children.back().draw.events) - ev.eventID += baseEventID; + ev.eventId += baseEventID; } } @@ -249,18 +249,18 @@ struct D3D12CommandData struct DrawcallUse { DrawcallUse(uint64_t offs, uint32_t eid, ResourceId cmd = ResourceId(), uint32_t rel = 0) - : fileOffset(offs), cmdList(cmd), eventID(eid), relativeEID(rel) + : fileOffset(offs), cmdList(cmd), eventId(eid), relativeEID(rel) { } uint64_t fileOffset; ResourceId cmdList; - uint32_t eventID; + uint32_t eventId; uint32_t relativeEID; bool operator<(const DrawcallUse &o) const { if(fileOffset != o.fileOffset) return fileOffset < o.fileOffset; - return eventID < o.eventID; + return eventId < o.eventId; } }; vector m_DrawcallUses; @@ -297,7 +297,7 @@ struct D3D12CommandData void GetIndirectBuffer(size_t size, ID3D12Resource **buf, uint64_t *offs); - // util function to handle fetching the right eventID, calling any + // util function to handle fetching the right eventId, calling any // aliases then calling PreDraw/PreDispatch. uint32_t HandlePreCallback(ID3D12GraphicsCommandList *list, bool dispatch = false, uint32_t multiDrawOffset = 0); diff --git a/renderdoc/driver/d3d12/d3d12_common.cpp b/renderdoc/driver/d3d12/d3d12_common.cpp index 30ca8867d..edc9b09fb 100644 --- a/renderdoc/driver/d3d12/d3d12_common.cpp +++ b/renderdoc/driver/d3d12/d3d12_common.cpp @@ -121,74 +121,74 @@ void DoSerialise(SerialiserType &ser, D3D12InitParams &el) INSTANTIATE_SERIALISE_TYPE(D3D12InitParams); -TextureDim MakeTextureDim(D3D12_SRV_DIMENSION dim) +TextureType MakeTextureDim(D3D12_SRV_DIMENSION dim) { switch(dim) { - case D3D12_SRV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D12_SRV_DIMENSION_BUFFER: return TextureDim::Buffer; - case D3D12_SRV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D12_SRV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D12_SRV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D12_SRV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D12_SRV_DIMENSION_TEXTURE2DMS: return TextureDim::Texture2DMS; - case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY: return TextureDim::Texture2DMSArray; - case D3D12_SRV_DIMENSION_TEXTURE3D: return TextureDim::Texture3D; - case D3D12_SRV_DIMENSION_TEXTURECUBE: return TextureDim::TextureCube; - case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY: return TextureDim::TextureCubeArray; + case D3D12_SRV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D12_SRV_DIMENSION_BUFFER: return TextureType::Buffer; + case D3D12_SRV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D12_SRV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D12_SRV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D12_SRV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D12_SRV_DIMENSION_TEXTURE2DMS: return TextureType::Texture2DMS; + case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY: return TextureType::Texture2DMSArray; + case D3D12_SRV_DIMENSION_TEXTURE3D: return TextureType::Texture3D; + case D3D12_SRV_DIMENSION_TEXTURECUBE: return TextureType::TextureCube; + case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY: return TextureType::TextureCubeArray; } - return TextureDim::Unknown; + return TextureType::Unknown; } -TextureDim MakeTextureDim(D3D12_RTV_DIMENSION dim) +TextureType MakeTextureDim(D3D12_RTV_DIMENSION dim) { switch(dim) { - case D3D12_RTV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D12_RTV_DIMENSION_BUFFER: return TextureDim::Buffer; - case D3D12_RTV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D12_RTV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D12_RTV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D12_RTV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D12_RTV_DIMENSION_TEXTURE2DMS: return TextureDim::Texture2DMS; - case D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY: return TextureDim::Texture2DMSArray; - case D3D12_RTV_DIMENSION_TEXTURE3D: return TextureDim::Texture3D; + case D3D12_RTV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D12_RTV_DIMENSION_BUFFER: return TextureType::Buffer; + case D3D12_RTV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D12_RTV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D12_RTV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D12_RTV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D12_RTV_DIMENSION_TEXTURE2DMS: return TextureType::Texture2DMS; + case D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY: return TextureType::Texture2DMSArray; + case D3D12_RTV_DIMENSION_TEXTURE3D: return TextureType::Texture3D; } - return TextureDim::Unknown; + return TextureType::Unknown; } -TextureDim MakeTextureDim(D3D12_DSV_DIMENSION dim) +TextureType MakeTextureDim(D3D12_DSV_DIMENSION dim) { switch(dim) { - case D3D12_DSV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D12_DSV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D12_DSV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D12_DSV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D12_DSV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D12_DSV_DIMENSION_TEXTURE2DMS: return TextureDim::Texture2DMS; - case D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY: return TextureDim::Texture2DMSArray; + case D3D12_DSV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D12_DSV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D12_DSV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D12_DSV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D12_DSV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D12_DSV_DIMENSION_TEXTURE2DMS: return TextureType::Texture2DMS; + case D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY: return TextureType::Texture2DMSArray; } - return TextureDim::Unknown; + return TextureType::Unknown; } -TextureDim MakeTextureDim(D3D12_UAV_DIMENSION dim) +TextureType MakeTextureDim(D3D12_UAV_DIMENSION dim) { switch(dim) { - case D3D12_UAV_DIMENSION_UNKNOWN: return TextureDim::Unknown; - case D3D12_UAV_DIMENSION_BUFFER: return TextureDim::Buffer; - case D3D12_UAV_DIMENSION_TEXTURE1D: return TextureDim::Texture1D; - case D3D12_UAV_DIMENSION_TEXTURE1DARRAY: return TextureDim::Texture1DArray; - case D3D12_UAV_DIMENSION_TEXTURE2D: return TextureDim::Texture2D; - case D3D12_UAV_DIMENSION_TEXTURE2DARRAY: return TextureDim::Texture2DArray; - case D3D12_UAV_DIMENSION_TEXTURE3D: return TextureDim::Texture3D; + case D3D12_UAV_DIMENSION_UNKNOWN: return TextureType::Unknown; + case D3D12_UAV_DIMENSION_BUFFER: return TextureType::Buffer; + case D3D12_UAV_DIMENSION_TEXTURE1D: return TextureType::Texture1D; + case D3D12_UAV_DIMENSION_TEXTURE1DARRAY: return TextureType::Texture1DArray; + case D3D12_UAV_DIMENSION_TEXTURE2D: return TextureType::Texture2D; + case D3D12_UAV_DIMENSION_TEXTURE2DARRAY: return TextureType::Texture2DArray; + case D3D12_UAV_DIMENSION_TEXTURE3D: return TextureType::Texture3D; } - return TextureDim::Unknown; + return TextureType::Unknown; } AddressMode MakeAddressMode(D3D12_TEXTURE_ADDRESS_MODE addr) @@ -206,48 +206,48 @@ AddressMode MakeAddressMode(D3D12_TEXTURE_ADDRESS_MODE addr) return AddressMode::Wrap; } -CompareFunc MakeCompareFunc(D3D12_COMPARISON_FUNC func) +CompareFunction MakeCompareFunc(D3D12_COMPARISON_FUNC func) { switch(func) { - case D3D12_COMPARISON_FUNC_NEVER: return CompareFunc::Never; - case D3D12_COMPARISON_FUNC_LESS: return CompareFunc::Less; - case D3D12_COMPARISON_FUNC_EQUAL: return CompareFunc::Equal; - case D3D12_COMPARISON_FUNC_LESS_EQUAL: return CompareFunc::LessEqual; - case D3D12_COMPARISON_FUNC_GREATER: return CompareFunc::Greater; - case D3D12_COMPARISON_FUNC_NOT_EQUAL: return CompareFunc::NotEqual; - case D3D12_COMPARISON_FUNC_GREATER_EQUAL: return CompareFunc::GreaterEqual; - case D3D12_COMPARISON_FUNC_ALWAYS: return CompareFunc::AlwaysTrue; + case D3D12_COMPARISON_FUNC_NEVER: return CompareFunction::Never; + case D3D12_COMPARISON_FUNC_LESS: return CompareFunction::Less; + case D3D12_COMPARISON_FUNC_EQUAL: return CompareFunction::Equal; + case D3D12_COMPARISON_FUNC_LESS_EQUAL: return CompareFunction::LessEqual; + case D3D12_COMPARISON_FUNC_GREATER: return CompareFunction::Greater; + case D3D12_COMPARISON_FUNC_NOT_EQUAL: return CompareFunction::NotEqual; + case D3D12_COMPARISON_FUNC_GREATER_EQUAL: return CompareFunction::GreaterEqual; + case D3D12_COMPARISON_FUNC_ALWAYS: return CompareFunction::AlwaysTrue; default: break; } - return CompareFunc::AlwaysTrue; + return CompareFunction::AlwaysTrue; } TextureFilter MakeFilter(D3D12_FILTER filter) { TextureFilter ret; - ret.func = FilterFunc::Normal; + ret.filter = FilterFunction::Normal; if(filter >= D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT && filter < D3D12_FILTER_COMPARISON_ANISOTROPIC) { - ret.func = FilterFunc::Comparison; + ret.filter = FilterFunction::Comparison; // the first 0x7f is the min/mag/mip filtering filter = D3D12_FILTER(filter & 0x7f); } else if(filter >= D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT && filter < D3D12_FILTER_MINIMUM_ANISOTROPIC) { - ret.func = FilterFunc::Minimum; + ret.filter = FilterFunction::Minimum; // the first 0x7f is the min/mag/mip filtering filter = D3D12_FILTER(filter & 0x7f); } else if(filter >= D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT && filter < D3D12_FILTER_MAXIMUM_ANISOTROPIC) { - ret.func = FilterFunc::Maximum; + ret.filter = FilterFunction::Maximum; // the first 0x7f is the min/mag/mip filtering filter = D3D12_FILTER(filter & 0x7f); } @@ -318,30 +318,30 @@ D3DBufferViewFlags MakeBufferFlags(D3D12_BUFFER_UAV_FLAGS flags) return ret; } -LogicOp MakeLogicOp(D3D12_LOGIC_OP op) +LogicOperation MakeLogicOp(D3D12_LOGIC_OP op) { switch(op) { - case D3D12_LOGIC_OP_CLEAR: return LogicOp::Clear; - case D3D12_LOGIC_OP_AND: return LogicOp::And; - case D3D12_LOGIC_OP_AND_REVERSE: return LogicOp::AndReverse; - case D3D12_LOGIC_OP_COPY: return LogicOp::Copy; - case D3D12_LOGIC_OP_AND_INVERTED: return LogicOp::AndInverted; - case D3D12_LOGIC_OP_NOOP: return LogicOp::NoOp; - case D3D12_LOGIC_OP_XOR: return LogicOp::Xor; - case D3D12_LOGIC_OP_OR: return LogicOp::Or; - case D3D12_LOGIC_OP_NOR: return LogicOp::Nor; - case D3D12_LOGIC_OP_EQUIV: return LogicOp::Equivalent; - case D3D12_LOGIC_OP_INVERT: return LogicOp::Invert; - case D3D12_LOGIC_OP_OR_REVERSE: return LogicOp::OrReverse; - case D3D12_LOGIC_OP_COPY_INVERTED: return LogicOp::CopyInverted; - case D3D12_LOGIC_OP_OR_INVERTED: return LogicOp::OrInverted; - case D3D12_LOGIC_OP_NAND: return LogicOp::Nand; - case D3D12_LOGIC_OP_SET: return LogicOp::Set; + case D3D12_LOGIC_OP_CLEAR: return LogicOperation::Clear; + case D3D12_LOGIC_OP_AND: return LogicOperation::And; + case D3D12_LOGIC_OP_AND_REVERSE: return LogicOperation::AndReverse; + case D3D12_LOGIC_OP_COPY: return LogicOperation::Copy; + case D3D12_LOGIC_OP_AND_INVERTED: return LogicOperation::AndInverted; + case D3D12_LOGIC_OP_NOOP: return LogicOperation::NoOp; + case D3D12_LOGIC_OP_XOR: return LogicOperation::Xor; + case D3D12_LOGIC_OP_OR: return LogicOperation::Or; + case D3D12_LOGIC_OP_NOR: return LogicOperation::Nor; + case D3D12_LOGIC_OP_EQUIV: return LogicOperation::Equivalent; + case D3D12_LOGIC_OP_INVERT: return LogicOperation::Invert; + case D3D12_LOGIC_OP_OR_REVERSE: return LogicOperation::OrReverse; + case D3D12_LOGIC_OP_COPY_INVERTED: return LogicOperation::CopyInverted; + case D3D12_LOGIC_OP_OR_INVERTED: return LogicOperation::OrInverted; + case D3D12_LOGIC_OP_NAND: return LogicOperation::Nand; + case D3D12_LOGIC_OP_SET: return LogicOperation::Set; default: break; } - return LogicOp::NoOp; + return LogicOperation::NoOp; } BlendMultiplier MakeBlendMultiplier(D3D12_BLEND blend, bool alpha) @@ -373,37 +373,37 @@ BlendMultiplier MakeBlendMultiplier(D3D12_BLEND blend, bool alpha) return BlendMultiplier::One; } -BlendOp MakeBlendOp(D3D12_BLEND_OP op) +BlendOperation MakeBlendOp(D3D12_BLEND_OP op) { switch(op) { - case D3D12_BLEND_OP_ADD: return BlendOp::Add; - case D3D12_BLEND_OP_SUBTRACT: return BlendOp::Subtract; - case D3D12_BLEND_OP_REV_SUBTRACT: return BlendOp::ReversedSubtract; - case D3D12_BLEND_OP_MIN: return BlendOp::Minimum; - case D3D12_BLEND_OP_MAX: return BlendOp::Maximum; + case D3D12_BLEND_OP_ADD: return BlendOperation::Add; + case D3D12_BLEND_OP_SUBTRACT: return BlendOperation::Subtract; + case D3D12_BLEND_OP_REV_SUBTRACT: return BlendOperation::ReversedSubtract; + case D3D12_BLEND_OP_MIN: return BlendOperation::Minimum; + case D3D12_BLEND_OP_MAX: return BlendOperation::Maximum; default: break; } - return BlendOp::Add; + return BlendOperation::Add; } -StencilOp MakeStencilOp(D3D12_STENCIL_OP op) +StencilOperation MakeStencilOp(D3D12_STENCIL_OP op) { switch(op) { - case D3D12_STENCIL_OP_KEEP: return StencilOp::Keep; - case D3D12_STENCIL_OP_ZERO: return StencilOp::Zero; - case D3D12_STENCIL_OP_REPLACE: return StencilOp::Replace; - case D3D12_STENCIL_OP_INCR_SAT: return StencilOp::IncSat; - case D3D12_STENCIL_OP_DECR_SAT: return StencilOp::DecSat; - case D3D12_STENCIL_OP_INVERT: return StencilOp::Invert; - case D3D12_STENCIL_OP_INCR: return StencilOp::IncWrap; - case D3D12_STENCIL_OP_DECR: return StencilOp::DecWrap; + case D3D12_STENCIL_OP_KEEP: return StencilOperation::Keep; + case D3D12_STENCIL_OP_ZERO: return StencilOperation::Zero; + case D3D12_STENCIL_OP_REPLACE: return StencilOperation::Replace; + case D3D12_STENCIL_OP_INCR_SAT: return StencilOperation::IncSat; + case D3D12_STENCIL_OP_DECR_SAT: return StencilOperation::DecSat; + case D3D12_STENCIL_OP_INVERT: return StencilOperation::Invert; + case D3D12_STENCIL_OP_INCR: return StencilOperation::IncWrap; + case D3D12_STENCIL_OP_DECR: return StencilOperation::DecWrap; default: break; } - return StencilOp::Keep; + return StencilOperation::Keep; } UINT GetResourceNumMipLevels(const D3D12_RESOURCE_DESC *desc) diff --git a/renderdoc/driver/d3d12/d3d12_common.h b/renderdoc/driver/d3d12/d3d12_common.h index f9740de06..d574fec83 100644 --- a/renderdoc/driver/d3d12/d3d12_common.h +++ b/renderdoc/driver/d3d12/d3d12_common.h @@ -57,19 +57,19 @@ inline void SetObjName(ID3D12Object *obj, const std::string &utf8name) obj->SetName(StringFormat::UTF82Wide(utf8name).c_str()); } -TextureDim MakeTextureDim(D3D12_SRV_DIMENSION dim); -TextureDim MakeTextureDim(D3D12_RTV_DIMENSION dim); -TextureDim MakeTextureDim(D3D12_DSV_DIMENSION dim); -TextureDim MakeTextureDim(D3D12_UAV_DIMENSION dim); +TextureType MakeTextureDim(D3D12_SRV_DIMENSION dim); +TextureType MakeTextureDim(D3D12_RTV_DIMENSION dim); +TextureType MakeTextureDim(D3D12_DSV_DIMENSION dim); +TextureType MakeTextureDim(D3D12_UAV_DIMENSION dim); AddressMode MakeAddressMode(D3D12_TEXTURE_ADDRESS_MODE addr); -CompareFunc MakeCompareFunc(D3D12_COMPARISON_FUNC func); +CompareFunction MakeCompareFunc(D3D12_COMPARISON_FUNC func); TextureFilter MakeFilter(D3D12_FILTER filter); D3DBufferViewFlags MakeBufferFlags(D3D12_BUFFER_SRV_FLAGS flags); D3DBufferViewFlags MakeBufferFlags(D3D12_BUFFER_UAV_FLAGS flags); -LogicOp MakeLogicOp(D3D12_LOGIC_OP op); +LogicOperation MakeLogicOp(D3D12_LOGIC_OP op); BlendMultiplier MakeBlendMultiplier(D3D12_BLEND blend, bool alpha); -BlendOp MakeBlendOp(D3D12_BLEND_OP op); -StencilOp MakeStencilOp(D3D12_STENCIL_OP op); +BlendOperation MakeBlendOp(D3D12_BLEND_OP op); +StencilOperation MakeStencilOp(D3D12_STENCIL_OP op); // similar to RDCUNIMPLEMENTED but for things that are hit often so we don't want to fire the // debugbreak. diff --git a/renderdoc/driver/d3d12/d3d12_counters.cpp b/renderdoc/driver/d3d12/d3d12_counters.cpp index c81ab3186..fa0dc07d3 100644 --- a/renderdoc/driver/d3d12/d3d12_counters.cpp +++ b/renderdoc/driver/d3d12/d3d12_counters.cpp @@ -66,7 +66,7 @@ vector D3D12Replay::EnumerateCounters() CounterDescription D3D12Replay::DescribeCounter(GPUCounter counterID) { CounterDescription desc; - desc.counterID = counterID; + desc.counter = counterID; // 0808CC9B-79DF-4549-81F7-85494E648F22 desc.uuid.words[0] = 0x0808CC9B; desc.uuid.words[1] = 0x79DF4549; @@ -414,8 +414,8 @@ vector D3D12Replay::FetchCounters(const vector &count { CounterResult result; - result.eventID = cb.m_Results[i].first; - result.counterID = counters[c]; + result.eventId = cb.m_Results[i].first; + result.counter = counters[c]; switch(counters[c]) { @@ -447,8 +447,8 @@ vector D3D12Replay::FetchCounters(const vector &count for(size_t c = 0; c < counters.size(); c++) { CounterResult search; - search.counterID = counters[c]; - search.eventID = cb.m_AliasEvents[i].first; + search.counter = counters[c]; + search.eventId = cb.m_AliasEvents[i].first; // find the result we're aliasing auto it = std::find(ret.begin(), ret.end(), search); @@ -456,13 +456,13 @@ vector D3D12Replay::FetchCounters(const vector &count { // duplicate the result and append CounterResult aliased = *it; - aliased.eventID = cb.m_AliasEvents[i].second; + aliased.eventId = cb.m_AliasEvents[i].second; ret.push_back(aliased); } else { RDCERR("Expected to find alias-target result for EID %u counter %u, but didn't", - search.eventID, search.counterID); + search.eventId, search.counter); } } } diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index 330eb0d10..b73f4f83b 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -2356,22 +2356,22 @@ void D3D12DebugManager::PickPixel(ResourceId texture, uint32_t x, uint32_t y, ui { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = true; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = sample; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = sliceFace; - texDisplay.rangemin = 0.0f; - texDisplay.rangemax = 1.0f; + texDisplay.rangeMin = 0.0f; + texDisplay.rangeMax = 1.0f; texDisplay.scale = 1.0f; - texDisplay.texid = texture; + texDisplay.resourceId = texture; texDisplay.typeHint = typeHint; - texDisplay.rawoutput = true; - texDisplay.offx = -float(x); - texDisplay.offy = -float(y); + texDisplay.rawOutput = true; + texDisplay.xOffset = -float(x); + texDisplay.yOffset = -float(y); RenderTextureInternal(m_PickPixelRTV, texDisplay, false); } @@ -2442,10 +2442,10 @@ void D3D12DebugManager::PickPixel(ResourceId texture, uint32_t x, uint32_t y, ui m_ReadbackBuffer->Unmap(0, &range); } -uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, +uint32_t D3D12DebugManager::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - if(cfg.position.numVerts == 0) + if(cfg.position.numIndices == 0) return ~0U; struct MeshPickData @@ -2469,8 +2469,8 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, cbuf.PickCoords = Vec2f((float)x, (float)y); cbuf.PickViewport = Vec2f((float)GetWidth(), (float)GetHeight()); - cbuf.PickIdx = cfg.position.idxByteWidth ? 1 : 0; - cbuf.PickNumVerts = cfg.position.numVerts; + cbuf.PickIdx = cfg.position.indexByteStride ? 1 : 0; + cbuf.PickNumVerts = cfg.position.numIndices; cbuf.PickUnproject = cfg.position.unproject ? 1 : 0; Matrix4f projMat = @@ -2551,7 +2551,7 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, cbuf.PickMVP = cfg.position.unproject ? pickMVPProj : pickMVP; bool isTriangleMesh = true; - switch(cfg.position.topo) + switch(cfg.position.topology) { case Topology::TriangleList: { @@ -2581,13 +2581,15 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, } ID3D12Resource *vb = NULL, *ib = NULL; - DXGI_FORMAT ifmt = cfg.position.idxByteWidth == 4 ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT; + DXGI_FORMAT ifmt = cfg.position.indexByteStride == 4 ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT; - if(cfg.position.buf != ResourceId()) - vb = m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.position.buf); + if(cfg.position.vertexResourceId != ResourceId()) + vb = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + cfg.position.vertexResourceId); - if(cfg.position.idxbuf != ResourceId()) - ib = m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.position.idxbuf); + if(cfg.position.indexResourceId != ResourceId()) + ib = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + cfg.position.indexResourceId); HRESULT hr = S_OK; @@ -2600,10 +2602,10 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, sdesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; sdesc.Format = ifmt; - if(cfg.position.idxByteWidth && ib) + if(cfg.position.indexByteStride && ib) { - sdesc.Buffer.FirstElement = cfg.position.idxoffs / (cfg.position.idxByteWidth); - sdesc.Buffer.NumElements = cfg.position.numVerts; + sdesc.Buffer.FirstElement = cfg.position.indexByteOffset / (cfg.position.indexByteStride); + sdesc.Buffer.NumElements = cfg.position.numIndices; m_WrappedDevice->CreateShaderResourceView(ib, &sdesc, GetCPUHandle(PICK_IB_SRV)); } else @@ -2617,11 +2619,11 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, if(vb) { - if(m_PickVB == NULL || m_PickSize < cfg.position.numVerts) + if(m_PickVB == NULL || m_PickSize < cfg.position.numIndices) { SAFE_RELEASE(m_PickVB); - m_PickSize = cfg.position.numVerts; + m_PickSize = cfg.position.numIndices; D3D12_HEAP_PROPERTIES heapProps; heapProps.Type = D3D12_HEAP_TYPE_UPLOAD; @@ -2641,7 +2643,7 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, vbDesc.MipLevels = 1; vbDesc.SampleDesc.Count = 1; vbDesc.SampleDesc.Quality = 0; - vbDesc.Width = sizeof(Vec4f) * cfg.position.numVerts; + vbDesc.Width = sizeof(Vec4f) * cfg.position.numIndices; hr = m_WrappedDevice->CreateCommittedResource(&heapProps, D3D12_HEAP_FLAG_NONE, &vbDesc, D3D12_RESOURCE_STATE_GENERIC_READ, NULL, @@ -2655,7 +2657,7 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, m_PickVB->SetName(L"m_PickVB"); - sdesc.Buffer.NumElements = cfg.position.numVerts; + sdesc.Buffer.NumElements = cfg.position.numIndices; m_WrappedDevice->CreateShaderResourceView(m_PickVB, &sdesc, GetCPUHandle(PICK_VB_SRV)); } } @@ -2667,10 +2669,10 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, // unpack and linearise the data { - FloatVector *vbData = new FloatVector[cfg.position.numVerts]; + FloatVector *vbData = new FloatVector[cfg.position.numIndices]; bytebuf oldData; - GetBufferData(vb, cfg.position.offset, 0, oldData); + GetBufferData(vb, cfg.position.vertexByteOffset, 0, oldData); byte *data = &oldData[0]; byte *dataEnd = data + oldData.size(); @@ -2681,7 +2683,7 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, if(cfg.position.baseVertex < 0) idxclamp = uint32_t(-cfg.position.baseVertex); - for(uint32_t i = 0; i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < cfg.position.numIndices; i++) { uint32_t idx = i; @@ -2696,7 +2698,7 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, vbData[i] = HighlightCache::InterpretVertex(data, idx, cfg, dataEnd, valid); } - FillBuffer(m_PickVB, 0, vbData, sizeof(Vec4f) * cfg.position.numVerts); + FillBuffer(m_PickVB, 0, vbData, sizeof(Vec4f) * cfg.position.numIndices); delete[] vbData; } @@ -2713,7 +2715,7 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, list->SetComputeRootDescriptorTable(1, GetGPUHandle(PICK_IB_SRV)); list->SetComputeRootDescriptorTable(2, GetGPUHandle(PICK_RESULT_UAV)); - list->Dispatch(cfg.position.numVerts / 1024 + 1, 1, 1); + list->Dispatch(cfg.position.numIndices / 1024 + 1, 1, 1); list->Close(); m_WrappedDevice->ExecuteLists(); @@ -3438,23 +3440,23 @@ void D3D12DebugManager::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32 { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = params.resolve ? ~0U : arrayIdx; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = arrayIdx; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = CompType::Typeless; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; RenderTextureInternal(GetCPUHandle(GET_TEX_RTV), texDisplay, false); } @@ -3800,13 +3802,13 @@ void D3D12DebugManager::ClearPostVSCache() m_PostVSData.clear(); } -void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) +void D3D12DebugManager::InitPostVSBuffers(uint32_t eventId) { // go through any aliasing - if(m_PostVSAlias.find(eventID) != m_PostVSAlias.end()) - eventID = m_PostVSAlias[eventID]; + if(m_PostVSAlias.find(eventId) != m_PostVSAlias.end()) + eventId = m_PostVSAlias[eventId]; - if(m_PostVSData.find(eventID) != m_PostVSData.end()) + if(m_PostVSData.find(eventId) != m_PostVSData.end()) return; D3D12CommandData *cmd = m_WrappedDevice->GetQueue()->GetCommandData(); @@ -3830,7 +3832,7 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) D3D_PRIMITIVE_TOPOLOGY topo = rs.topo; - const DrawcallDescription *drawcall = m_WrappedDevice->GetDrawcall(eventID); + const DrawcallDescription *drawcall = m_WrappedDevice->GetDrawcall(eventId); if(drawcall->numIndices == 0) return; @@ -4198,7 +4200,7 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) __uuidof(ID3D12Resource), (void **)&idxBuf); RDCASSERTEQUAL(hr, S_OK); - SetObjName(idxBuf, StringFormat::Fmt("PostVS idxBuf for %u", eventID)); + SetObjName(idxBuf, StringFormat::Fmt("PostVS idxBuf for %u", eventId)); FillBuffer(idxBuf, 0, &idxdata[0], idxdata.size()); } @@ -4250,7 +4252,7 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) if(numBytesWritten == 0) { - m_PostVSData[eventID] = D3D12PostVSData(); + m_PostVSData[eventId] = D3D12PostVSData(); SAFE_RELEASE(idxBuf); SAFE_RELEASE(soSig); return; @@ -4291,7 +4293,7 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) if(vsoutBuffer) { - SetObjName(vsoutBuffer, StringFormat::Fmt("PostVS vsoutBuffer for %u", eventID)); + SetObjName(vsoutBuffer, StringFormat::Fmt("PostVS vsoutBuffer for %u", eventId)); FillBuffer(vsoutBuffer, 0, byteData, (size_t)numBytesWritten); } } @@ -4356,46 +4358,46 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) m_SOStagingBuffer->Unmap(0, &range); - m_PostVSData[eventID].vsin.topo = topo; - m_PostVSData[eventID].vsout.buf = vsoutBuffer; - m_PostVSData[eventID].vsout.vertStride = stride; - m_PostVSData[eventID].vsout.nearPlane = nearp; - m_PostVSData[eventID].vsout.farPlane = farp; + m_PostVSData[eventId].vsin.topo = topo; + m_PostVSData[eventId].vsout.buf = vsoutBuffer; + m_PostVSData[eventId].vsout.vertStride = stride; + m_PostVSData[eventId].vsout.nearPlane = nearp; + m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventID].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); - m_PostVSData[eventID].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); + m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; - m_PostVSData[eventID].vsout.instStride = 0; + m_PostVSData[eventId].vsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].vsout.instStride = + m_PostVSData[eventId].vsout.instStride = uint32_t(numBytesWritten / RDCMAX(1U, drawcall->numInstances)); - m_PostVSData[eventID].vsout.idxBuf = NULL; - if(m_PostVSData[eventID].vsout.useIndices && idxBuf) + m_PostVSData[eventId].vsout.idxBuf = NULL; + if(m_PostVSData[eventId].vsout.useIndices && idxBuf) { - m_PostVSData[eventID].vsout.idxBuf = idxBuf; - m_PostVSData[eventID].vsout.idxFmt = + m_PostVSData[eventId].vsout.idxBuf = idxBuf; + m_PostVSData[eventId].vsout.idxFmt = rs.ibuffer.bytewidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; } - m_PostVSData[eventID].vsout.hasPosOut = posidx >= 0; + m_PostVSData[eventId].vsout.hasPosOut = posidx >= 0; - m_PostVSData[eventID].vsout.topo = topo; + m_PostVSData[eventId].vsout.topo = topo; } else { // empty vertex output signature - m_PostVSData[eventID].vsin.topo = topo; - m_PostVSData[eventID].vsout.buf = NULL; - m_PostVSData[eventID].vsout.instStride = 0; - m_PostVSData[eventID].vsout.vertStride = 0; - m_PostVSData[eventID].vsout.nearPlane = 0.0f; - m_PostVSData[eventID].vsout.farPlane = 0.0f; - m_PostVSData[eventID].vsout.useIndices = false; - m_PostVSData[eventID].vsout.hasPosOut = false; - m_PostVSData[eventID].vsout.idxBuf = NULL; + m_PostVSData[eventId].vsin.topo = topo; + m_PostVSData[eventId].vsout.buf = NULL; + m_PostVSData[eventId].vsout.instStride = 0; + m_PostVSData[eventId].vsout.vertStride = 0; + m_PostVSData[eventId].vsout.nearPlane = 0.0f; + m_PostVSData[eventId].vsout.farPlane = 0.0f; + m_PostVSData[eventId].vsout.useIndices = false; + m_PostVSData[eventId].vsout.hasPosOut = false; + m_PostVSData[eventId].vsout.idxBuf = NULL; - m_PostVSData[eventID].vsout.topo = topo; + m_PostVSData[eventId].vsout.topo = topo; } if(dxbcGS || dxbcDS) @@ -4821,7 +4823,7 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) if(gsoutBuffer) { - SetObjName(gsoutBuffer, StringFormat::Fmt("PostVS gsoutBuffer for %u", eventID)); + SetObjName(gsoutBuffer, StringFormat::Fmt("PostVS gsoutBuffer for %u", eventId)); FillBuffer(gsoutBuffer, 0, byteData, (size_t)numBytesWritten); } } @@ -4886,17 +4888,17 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) m_SOStagingBuffer->Unmap(0, &range); - m_PostVSData[eventID].gsout.buf = gsoutBuffer; - m_PostVSData[eventID].gsout.instStride = 0; + m_PostVSData[eventId].gsout.buf = gsoutBuffer; + m_PostVSData[eventId].gsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].gsout.instStride = + m_PostVSData[eventId].gsout.instStride = uint32_t(numBytesWritten / RDCMAX(1U, drawcall->numInstances)); - m_PostVSData[eventID].gsout.vertStride = stride; - m_PostVSData[eventID].gsout.nearPlane = nearp; - m_PostVSData[eventID].gsout.farPlane = farp; - m_PostVSData[eventID].gsout.useIndices = false; - m_PostVSData[eventID].gsout.hasPosOut = posidx >= 0; - m_PostVSData[eventID].gsout.idxBuf = NULL; + m_PostVSData[eventId].gsout.vertStride = stride; + m_PostVSData[eventId].gsout.nearPlane = nearp; + m_PostVSData[eventId].gsout.farPlane = farp; + m_PostVSData[eventId].gsout.useIndices = false; + m_PostVSData[eventId].gsout.hasPosOut = posidx >= 0; + m_PostVSData[eventId].gsout.idxBuf = NULL; topo = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; @@ -4930,40 +4932,40 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID) } } - m_PostVSData[eventID].gsout.topo = topo; + m_PostVSData[eventId].gsout.topo = topo; // streamout expands strips unfortunately if(topo == D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; else if(topo == D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST; else if(topo == D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; else if(topo == D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ) - m_PostVSData[eventID].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; + m_PostVSData[eventId].gsout.topo = D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; - m_PostVSData[eventID].gsout.numVerts = (uint32_t)numVerts; + m_PostVSData[eventId].gsout.numVerts = (uint32_t)numVerts; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); + m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); - m_PostVSData[eventID].gsout.instData = instData; + m_PostVSData[eventId].gsout.instData = instData; } SAFE_RELEASE(soSig); } -MeshFormat D3D12DebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat D3D12DebugManager::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { // go through any aliasing - if(m_PostVSAlias.find(eventID) != m_PostVSAlias.end()) - eventID = m_PostVSAlias[eventID]; + if(m_PostVSAlias.find(eventId) != m_PostVSAlias.end()) + eventId = m_PostVSAlias[eventId]; D3D12PostVSData postvs; RDCEraseEl(postvs); - if(m_PostVSData.find(eventID) != m_PostVSData.end()) - postvs = m_PostVSData[eventID]; + if(m_PostVSData.find(eventId) != m_PostVSData.end()) + postvs = m_PostVSData[eventId]; const D3D12PostVSData::StageData &s = postvs.GetStage(stage); @@ -4971,35 +4973,35 @@ MeshFormat D3D12DebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instID if(s.useIndices && s.idxBuf != NULL) { - ret.idxbuf = GetResID(s.idxBuf); - ret.idxByteWidth = s.idxFmt == DXGI_FORMAT_R16_UINT ? 2 : 4; + ret.indexResourceId = GetResID(s.idxBuf); + ret.indexByteStride = s.idxFmt == DXGI_FORMAT_R16_UINT ? 2 : 4; } else { - ret.idxbuf = ResourceId(); - ret.idxByteWidth = 0; + ret.indexResourceId = ResourceId(); + ret.indexByteStride = 0; } - ret.idxoffs = 0; + ret.indexByteOffset = 0; ret.baseVertex = 0; if(s.buf != NULL) - ret.buf = GetResID(s.buf); + ret.vertexResourceId = GetResID(s.buf); else - ret.buf = ResourceId(); + ret.vertexResourceId = ResourceId(); - ret.offset = s.instStride * instID; - ret.stride = s.vertStride; + ret.vertexByteOffset = s.instStride * instID; + ret.vertexByteStride = s.vertStride; - ret.fmt.compCount = 4; - ret.fmt.compByteWidth = 4; - ret.fmt.compType = CompType::Float; - ret.fmt.type = ResourceFormatType::Regular; - ret.fmt.bgraOrder = false; + ret.format.compCount = 4; + ret.format.compByteWidth = 4; + ret.format.compType = CompType::Float; + ret.format.type = ResourceFormatType::Regular; + ret.format.bgraOrder = false; ret.showAlpha = false; - ret.topo = MakePrimitiveTopology(s.topo); - ret.numVerts = s.numVerts; + ret.topology = MakePrimitiveTopology(s.topo); + ret.numIndices = s.numVerts; ret.unproject = s.hasPosOut; ret.nearPlane = s.nearPlane; @@ -5009,8 +5011,8 @@ MeshFormat D3D12DebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instID { D3D12PostVSData::InstData inst = s.instData[instID]; - ret.offset = inst.bufOffset; - ret.numVerts = inst.numVerts; + ret.vertexByteOffset = inst.bufOffset; + ret.numIndices = inst.numVerts; } return ret; @@ -5269,17 +5271,18 @@ D3D12DebugManager::MeshDisplayPipelines D3D12DebugManager::CacheMeshDisplayPipel uint64_t bit = 0; - if(primary.idxByteWidth == 4) + if(primary.indexByteStride == 4) key |= 1ULL << bit; bit++; - RDCASSERT((uint32_t)primary.topo < 64); - key |= uint64_t((uint32_t)primary.topo & 0x3f) << bit; + RDCASSERT((uint32_t)primary.topology < 64); + key |= uint64_t((uint32_t)primary.topology & 0x3f) << bit; bit += 6; - DXGI_FORMAT primaryFmt = MakeDXGIFormat(primary.fmt); - DXGI_FORMAT secondaryFmt = - secondary.buf == ResourceId() ? DXGI_FORMAT_UNKNOWN : MakeDXGIFormat(secondary.fmt); + DXGI_FORMAT primaryFmt = MakeDXGIFormat(primary.format); + DXGI_FORMAT secondaryFmt = secondary.vertexResourceId == ResourceId() + ? DXGI_FORMAT_UNKNOWN + : MakeDXGIFormat(secondary.format); key |= uint64_t((uint32_t)primaryFmt & 0xff) << bit; bit += 8; @@ -5287,14 +5290,14 @@ D3D12DebugManager::MeshDisplayPipelines D3D12DebugManager::CacheMeshDisplayPipel key |= uint64_t((uint32_t)secondaryFmt & 0xff) << bit; bit += 8; - RDCASSERT(primary.stride <= 0xffff); - key |= uint64_t((uint32_t)primary.stride & 0xffff) << bit; + RDCASSERT(primary.vertexByteStride <= 0xffff); + key |= uint64_t((uint32_t)primary.vertexByteStride & 0xffff) << bit; bit += 16; - if(secondary.buf != ResourceId()) + if(secondary.vertexResourceId != ResourceId()) { - RDCASSERT(secondary.stride <= 0xffff); - key |= uint64_t((uint32_t)secondary.stride & 0xffff) << bit; + RDCASSERT(secondary.vertexByteStride <= 0xffff); + key |= uint64_t((uint32_t)secondary.vertexByteStride & 0xffff) << bit; } bit += 16; @@ -5313,7 +5316,7 @@ D3D12DebugManager::MeshDisplayPipelines D3D12DebugManager::CacheMeshDisplayPipel pipeDesc.SampleMask = 0xFFFFFFFF; pipeDesc.SampleDesc.Count = D3D12_MSAA_SAMPLECOUNT; pipeDesc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED; - D3D_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(primary.topo); + D3D_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(primary.topology); if(topo == D3D_PRIMITIVE_TOPOLOGY_POINTLIST || topo >= D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST) @@ -5394,7 +5397,7 @@ D3D12DebugManager::MeshDisplayPipelines D3D12DebugManager::CacheMeshDisplayPipel (void **)&cache.pipes[MeshDisplayPipelines::ePipe_SolidDepth]); RDCASSERTEQUAL(hr, S_OK); - if(secondary.buf != ResourceId()) + if(secondary.vertexResourceId != ResourceId()) { // pull secondary information from second vertex buffer ia[1].InputSlotClass = D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA; @@ -5423,10 +5426,10 @@ D3D12DebugManager::MeshDisplayPipelines D3D12DebugManager::CacheMeshDisplayPipel return cache; } -void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &secondaryDraws, +void D3D12DebugManager::RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { - if(cfg.position.buf == ResourceId() || cfg.position.numVerts == 0) + if(cfg.position.vertexResourceId == ResourceId() || cfg.position.numIndices == 0) return; auto it = m_OutputWindows.find(m_CurrentOutputWindow); @@ -5501,7 +5504,7 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s DebugVertexCBuffer vdata; - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { list->SetGraphicsRoot32BitConstants(3, 4, &fmt.meshColor.x, 0); @@ -5511,42 +5514,42 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s list->SetPipelineState(secondaryCache.pipes[MeshDisplayPipelines::ePipe_WireDepth]); ID3D12Resource *vb = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(fmt.buf); + m_WrappedDevice->GetResourceManager()->GetCurrentAs(fmt.vertexResourceId); - UINT64 offs = fmt.offset; + UINT64 offs = fmt.vertexByteOffset; D3D12_VERTEX_BUFFER_VIEW view; view.BufferLocation = vb->GetGPUVirtualAddress() + offs; - view.StrideInBytes = fmt.stride; + view.StrideInBytes = fmt.vertexByteStride; view.SizeInBytes = UINT(vb->GetDesc().Width - offs); list->IASetVertexBuffers(0, 1, &view); // set it to the secondary buffer too just as dummy info list->IASetVertexBuffers(1, 1, &view); - list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(fmt.topo)); + list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(fmt.topology)); - if(PatchList_Count(fmt.topo) > 0) + if(PatchList_Count(fmt.topology) > 0) list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_POINTLIST); - if(fmt.idxByteWidth) + if(fmt.indexByteStride) { - if(fmt.idxbuf != ResourceId()) + if(fmt.indexResourceId != ResourceId()) { - ID3D12Resource *ib = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(fmt.idxbuf); + ID3D12Resource *ib = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + fmt.indexResourceId); D3D12_INDEX_BUFFER_VIEW iview; - iview.BufferLocation = ib->GetGPUVirtualAddress() + fmt.idxoffs; - iview.SizeInBytes = UINT(ib->GetDesc().Width - fmt.idxoffs); - iview.Format = fmt.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; + iview.BufferLocation = ib->GetGPUVirtualAddress() + fmt.indexByteOffset; + iview.SizeInBytes = UINT(ib->GetDesc().Width - fmt.indexByteOffset); + iview.Format = fmt.indexByteStride == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; list->IASetIndexBuffer(&iview); - list->DrawIndexedInstanced(fmt.numVerts, 1, 0, fmt.baseVertex, 0); + list->DrawIndexedInstanced(fmt.numIndices, 1, 0, fmt.baseVertex, 0); } } else { - list->DrawInstanced(fmt.numVerts, 1, 0, 0); + list->DrawInstanced(fmt.numIndices, 1, 0, 0); } } } @@ -5554,48 +5557,48 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s MeshDisplayPipelines cache = CacheMeshDisplayPipelines(cfg.position, cfg.second); - if(cfg.position.buf != ResourceId()) + if(cfg.position.vertexResourceId != ResourceId()) { - ID3D12Resource *vb = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.position.buf); + ID3D12Resource *vb = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + cfg.position.vertexResourceId); - UINT64 offs = cfg.position.offset; + UINT64 offs = cfg.position.vertexByteOffset; D3D12_VERTEX_BUFFER_VIEW view; view.BufferLocation = vb->GetGPUVirtualAddress() + offs; - view.StrideInBytes = cfg.position.stride; + view.StrideInBytes = cfg.position.vertexByteStride; view.SizeInBytes = UINT(vb->GetDesc().Width - offs); list->IASetVertexBuffers(0, 1, &view); // set it to the secondary buffer too just as dummy info list->IASetVertexBuffers(1, 1, &view); - list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(cfg.position.topo)); + list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(cfg.position.topology)); - if(PatchList_Count(cfg.position.topo) > 0) + if(PatchList_Count(cfg.position.topology) > 0) list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_POINTLIST); } SolidShade solidShadeMode = cfg.solidShadeMode; // can't support secondary shading without a buffer - no pipeline will have been created - if(solidShadeMode == SolidShade::Secondary && cfg.second.buf == ResourceId()) + if(solidShadeMode == SolidShade::Secondary && cfg.second.vertexResourceId == ResourceId()) solidShadeMode = SolidShade::NoSolid; if(solidShadeMode == SolidShade::Secondary) { - ID3D12Resource *vb = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.position.buf); + ID3D12Resource *vb = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + cfg.position.vertexResourceId); - UINT64 offs = cfg.second.offset; + UINT64 offs = cfg.second.vertexByteOffset; D3D12_VERTEX_BUFFER_VIEW view; view.BufferLocation = vb->GetGPUVirtualAddress() + offs; - view.StrideInBytes = cfg.second.stride; + view.StrideInBytes = cfg.second.vertexByteStride; view.SizeInBytes = UINT(vb->GetDesc().Width - offs); list->IASetVertexBuffers(1, 1, &view); } // solid render - if(solidShadeMode != SolidShade::NoSolid && cfg.position.topo < Topology::PatchList) + if(solidShadeMode != SolidShade::NoSolid && cfg.position.topology < Topology::PatchList) { ID3D12PipelineState *pipe = NULL; switch(solidShadeMode) @@ -5632,31 +5635,31 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s Vec4f colour(0.8f, 0.8f, 0.0f, 1.0f); list->SetGraphicsRoot32BitConstants(3, 4, &colour.x, 0); - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) { - if(cfg.position.idxbuf != ResourceId()) + if(cfg.position.indexResourceId != ResourceId()) { - ID3D12Resource *ib = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.position.idxbuf); + ID3D12Resource *ib = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + cfg.position.indexResourceId); D3D12_INDEX_BUFFER_VIEW view; - view.BufferLocation = ib->GetGPUVirtualAddress() + cfg.position.idxoffs; - view.SizeInBytes = UINT(ib->GetDesc().Width - cfg.position.idxoffs); - view.Format = cfg.position.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; + view.BufferLocation = ib->GetGPUVirtualAddress() + cfg.position.indexByteOffset; + view.SizeInBytes = UINT(ib->GetDesc().Width - cfg.position.indexByteOffset); + view.Format = cfg.position.indexByteStride == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; list->IASetIndexBuffer(&view); - list->DrawIndexedInstanced(cfg.position.numVerts, 1, 0, cfg.position.baseVertex, 0); + list->DrawIndexedInstanced(cfg.position.numIndices, 1, 0, cfg.position.baseVertex, 0); } } else { - list->DrawInstanced(cfg.position.numVerts, 1, 0, 0); + list->DrawInstanced(cfg.position.numIndices, 1, 0, 0); } } // wireframe render if(solidShadeMode == SolidShade::NoSolid || cfg.wireframeDraw || - cfg.position.topo >= Topology::PatchList) + cfg.position.topology >= Topology::PatchList) { Vec4f wireCol = Vec4f(cfg.position.meshColor.x, cfg.position.meshColor.y, cfg.position.meshColor.z, 1.0f); @@ -5672,35 +5675,35 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s list->SetGraphicsRoot32BitConstants(3, 4, &cfg.position.meshColor.x, 0); - if(cfg.position.idxByteWidth && cfg.position.idxbuf != ResourceId()) + if(cfg.position.indexByteStride && cfg.position.indexResourceId != ResourceId()) { - ID3D12Resource *ib = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.position.idxbuf); + ID3D12Resource *ib = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + cfg.position.indexResourceId); D3D12_INDEX_BUFFER_VIEW view; - view.BufferLocation = ib->GetGPUVirtualAddress() + cfg.position.idxoffs; - view.SizeInBytes = UINT(ib->GetDesc().Width - cfg.position.idxoffs); - view.Format = cfg.position.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; + view.BufferLocation = ib->GetGPUVirtualAddress() + cfg.position.indexByteOffset; + view.SizeInBytes = UINT(ib->GetDesc().Width - cfg.position.indexByteOffset); + view.Format = cfg.position.indexByteStride == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; list->IASetIndexBuffer(&view); - list->DrawIndexedInstanced(cfg.position.numVerts, 1, 0, cfg.position.baseVertex, 0); + list->DrawIndexedInstanced(cfg.position.numIndices, 1, 0, cfg.position.baseVertex, 0); } else { - list->DrawInstanced(cfg.position.numVerts, 1, 0, 0); + list->DrawInstanced(cfg.position.numIndices, 1, 0, 0); } } MeshFormat helper; - helper.idxByteWidth = 2; - helper.topo = Topology::LineList; + helper.indexByteStride = 2; + helper.topology = Topology::LineList; - helper.fmt.type = ResourceFormatType::Regular; - helper.fmt.compByteWidth = 4; - helper.fmt.compCount = 4; - helper.fmt.compType = CompType::Float; + helper.format.type = ResourceFormatType::Regular; + helper.format.compByteWidth = 4; + helper.format.compCount = 4; + helper.format.compType = CompType::Float; - helper.stride = sizeof(Vec4f); + helper.vertexByteStride = sizeof(Vec4f); pixelData.OutputDisplayFormat = MESHDISPLAY_SOLID; @@ -5824,9 +5827,9 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s // show highlighted vertex if(cfg.highlightVert != ~0U) { - m_HighlightCache.CacheHighlightingData(eventID, cfg); + m_HighlightCache.CacheHighlightingData(eventId, cfg); - Topology meshtopo = cfg.position.topo; + Topology meshtopo = cfg.position.topology; /////////////////////////////////////////////////////////////// // vectors to be set from buffers, depending on topology @@ -5846,19 +5849,19 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s // will be N*M long, N adjacent prims of M verts each. M = primSize below vector adjacentPrimVertices; - helper.topo = Topology::TriangleList; + helper.topology = Topology::TriangleList; uint32_t primSize = 3; // number of verts per primitive if(meshtopo == Topology::LineList || meshtopo == Topology::LineStrip || meshtopo == Topology::LineList_Adj || meshtopo == Topology::LineStrip_Adj) { primSize = 2; - helper.topo = Topology::LineList; + helper.topology = Topology::LineList; } else { // update the cache, as it's currently linelist - helper.topo = Topology::TriangleList; + helper.topology = Topology::TriangleList; cache = CacheMeshDisplayPipelines(helper, helper); } @@ -5876,9 +5879,9 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s else vertexData.ModelViewProj = projMat.Mul(camMat); - list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(helper.topo)); + list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(helper.topology)); - if(PatchList_Count(helper.topo) > 0) + if(PatchList_Count(helper.topology) > 0) list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_POINTLIST); list->SetGraphicsRootConstantBufferView(0, UploadConstants(&vertexData, sizeof(vertexData))); @@ -5935,16 +5938,16 @@ void D3D12DebugManager::RenderMesh(uint32_t eventID, const vector &s list->SetGraphicsRoot32BitConstants(3, 4, &colour.x, 0); // vertices are drawn with tri strips - helper.topo = Topology::TriangleStrip; + helper.topology = Topology::TriangleStrip; cache = CacheMeshDisplayPipelines(helper, helper); FloatVector vertSprite[4] = { activeVertex, activeVertex, activeVertex, activeVertex, }; - list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(helper.topo)); + list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(helper.topology)); - if(PatchList_Count(helper.topo) > 0) + if(PatchList_Count(helper.topology) > 0) list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_POINTLIST); list->SetPipelineState(cache.pipes[MeshDisplayPipelines::ePipe_Solid]); @@ -6878,21 +6881,21 @@ ResourceId D3D12DebugManager::ApplyCustomShader(ResourceId shader, ResourceId te list->Close(); TextureDisplay disp; - disp.Red = disp.Green = disp.Blue = disp.Alpha = true; - disp.FlipY = false; - disp.offx = 0.0f; - disp.offy = 0.0f; - disp.CustomShader = shader; - disp.texid = texid; + disp.red = disp.green = disp.blue = disp.alpha = true; + disp.flipY = false; + disp.xOffset = 0.0f; + disp.yOffset = 0.0f; + disp.customShaderId = shader; + disp.resourceId = texid; disp.typeHint = typeHint; - disp.HDRMul = -1.0f; + disp.hdrMultiplier = -1.0f; disp.linearDisplayAsGamma = false; disp.mip = mip; disp.sampleIdx = sampleIdx; disp.overlay = DebugOverlay::NoOverlay; - disp.rangemin = 0.0f; - disp.rangemax = 1.0f; - disp.rawoutput = false; + disp.rangeMin = 0.0f; + disp.rangeMax = 1.0f; + disp.rawOutput = false; disp.scale = 1.0f; disp.sliceFace = arrayIdx; @@ -6905,7 +6908,7 @@ ResourceId D3D12DebugManager::ApplyCustomShader(ResourceId shader, ResourceId te } ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { ID3D12Resource *resource = WrappedID3D12Resource::GetList()[texid]; @@ -7163,7 +7166,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, rs.rts[0] = rtv; rs.dsv = D3D12_CPU_DESCRIPTOR_HANDLE(); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); rs = prev; @@ -7255,11 +7258,11 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, rs.rts[0] = rtv; rs.dsv = D3D12_CPU_DESCRIPTOR_HANDLE(); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); rs.pipe = GetResID(greenPSO); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); rs = prev; @@ -7334,7 +7337,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, rs.rts[0] = rtv; rs.dsv = dsv; - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); rs = prev; @@ -7352,7 +7355,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, if(overlay == DebugOverlay::ClearBeforeDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty()) { @@ -7475,7 +7478,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, break; } - events.push_back(eventID); + events.push_back(eventId); D3D12_GRAPHICS_PIPELINE_STATE_DESC pipeDesc = pipe->GetGraphicsDesc(); pipeDesc.pRootSignature = m_CBOnlyRootSig; @@ -7559,12 +7562,12 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) { MeshFormat fmt = GetPostVSBuffers(events[i], inst, MeshDataStage::GSOut); - if(fmt.buf == ResourceId()) + if(fmt.vertexResourceId == ResourceId()) fmt = GetPostVSBuffers(events[i], inst, MeshDataStage::VSOut); - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { - D3D_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(fmt.topo); + D3D_PRIMITIVE_TOPOLOGY topo = MakeD3DPrimitiveTopology(fmt.topology); if(topo == D3D_PRIMITIVE_TOPOLOGY_POINTLIST || topo >= D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST) @@ -7587,13 +7590,13 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, RDCASSERTEQUAL(hr, S_OK); } - ID3D12Resource *vb = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(fmt.buf); + ID3D12Resource *vb = m_WrappedDevice->GetResourceManager()->GetCurrentAs( + fmt.vertexResourceId); D3D12_VERTEX_BUFFER_VIEW vbView = {}; - vbView.BufferLocation = vb->GetGPUVirtualAddress() + fmt.offset; - vbView.StrideInBytes = fmt.stride; - vbView.SizeInBytes = UINT(vb->GetDesc().Width - fmt.offset); + vbView.BufferLocation = vb->GetGPUVirtualAddress() + fmt.vertexByteOffset; + vbView.StrideInBytes = fmt.vertexByteStride; + vbView.SizeInBytes = UINT(vb->GetDesc().Width - fmt.vertexByteOffset); // second bind is just a dummy, so we don't have to make a shader // that doesn't accept the secondary stream @@ -7602,22 +7605,23 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, list->SetPipelineState(pipes[pipeDesc.PrimitiveTopologyType]); - if(fmt.idxByteWidth && fmt.idxbuf != ResourceId()) + if(fmt.indexByteStride && fmt.indexResourceId != ResourceId()) { ID3D12Resource *ib = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(fmt.idxbuf); + m_WrappedDevice->GetResourceManager()->GetCurrentAs( + fmt.indexResourceId); D3D12_INDEX_BUFFER_VIEW view; - view.BufferLocation = ib->GetGPUVirtualAddress() + fmt.idxoffs; - view.SizeInBytes = UINT(ib->GetDesc().Width - fmt.idxoffs); - view.Format = fmt.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; + view.BufferLocation = ib->GetGPUVirtualAddress() + fmt.indexByteOffset; + view.SizeInBytes = UINT(ib->GetDesc().Width - fmt.indexByteOffset); + view.Format = fmt.indexByteStride == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; list->IASetIndexBuffer(&view); - list->DrawIndexedInstanced(fmt.numVerts, 1, 0, fmt.baseVertex, 0); + list->DrawIndexedInstanced(fmt.numIndices, 1, 0, fmt.baseVertex, 0); } else { - list->DrawInstanced(fmt.numVerts, 1, 0, 0); + list->DrawInstanced(fmt.numIndices, 1, 0, 0); } } } @@ -7634,7 +7638,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, } // restore back to normal - m_WrappedDevice->ReplayLog(0, eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_WithoutDraw); } else if(overlay == DebugOverlay::QuadOverdrawPass || overlay == DebugOverlay::QuadOverdrawDraw) { @@ -7645,7 +7649,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, if(overlay == DebugOverlay::QuadOverdrawDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty()) { @@ -7766,7 +7770,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, } if(overlay == DebugOverlay::QuadOverdrawPass) - m_WrappedDevice->ReplayLog(0, eventID, eReplay_WithoutDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_WithoutDraw); } else if(overlay == DebugOverlay::Depth || overlay == DebugOverlay::Stencil) { @@ -7868,11 +7872,11 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, rs.rts[0] = rtv; rs.dsv = dsv; - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); rs.pipe = GetResID(greenPSO); - m_WrappedDevice->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_WrappedDevice->ReplayLog(0, eventId, eReplay_OnlyDraw); rs = prev; @@ -7904,7 +7908,7 @@ ResourceId D3D12DebugManager::RenderOverlay(ResourceId texid, CompType typeHint, bool D3D12DebugManager::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, TextureDisplay cfg, bool blendAlpha) { - ID3D12Resource *resource = WrappedID3D12Resource::GetList()[cfg.texid]; + ID3D12Resource *resource = WrappedID3D12Resource::GetList()[cfg.resourceId]; if(resource == NULL) return false; @@ -7914,8 +7918,8 @@ bool D3D12DebugManager::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, T pixelData.AlwaysZero = 0.0f; - float x = cfg.offx; - float y = cfg.offy; + float x = cfg.xOffset; + float y = cfg.yOffset; vertexData.Position.x = x * (2.0f / float(GetWidth())); vertexData.Position.y = -y * (2.0f / float(GetHeight())); @@ -7928,27 +7932,27 @@ bool D3D12DebugManager::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, T vertexData.LineStrip = 0; - if(cfg.rangemax <= cfg.rangemin) - cfg.rangemax += 0.00001f; + if(cfg.rangeMax <= cfg.rangeMin) + cfg.rangeMax += 0.00001f; - pixelData.Channels.x = cfg.Red ? 1.0f : 0.0f; - pixelData.Channels.y = cfg.Green ? 1.0f : 0.0f; - pixelData.Channels.z = cfg.Blue ? 1.0f : 0.0f; - pixelData.Channels.w = cfg.Alpha ? 1.0f : 0.0f; + pixelData.Channels.x = cfg.red ? 1.0f : 0.0f; + pixelData.Channels.y = cfg.green ? 1.0f : 0.0f; + pixelData.Channels.z = cfg.blue ? 1.0f : 0.0f; + pixelData.Channels.w = cfg.alpha ? 1.0f : 0.0f; - pixelData.RangeMinimum = cfg.rangemin; - pixelData.InverseRangeSize = 1.0f / (cfg.rangemax - cfg.rangemin); + pixelData.RangeMinimum = cfg.rangeMin; + pixelData.InverseRangeSize = 1.0f / (cfg.rangeMax - cfg.rangeMin); if(_isnan(pixelData.InverseRangeSize) || !_finite(pixelData.InverseRangeSize)) { pixelData.InverseRangeSize = FLT_MAX; } - pixelData.WireframeColour.x = cfg.HDRMul; + pixelData.WireframeColour.x = cfg.hdrMultiplier; - pixelData.RawOutput = cfg.rawoutput ? 1 : 0; + pixelData.RawOutput = cfg.rawOutput ? 1 : 0; - pixelData.FlipY = cfg.FlipY ? 1 : 0; + pixelData.FlipY = cfg.flipY ? 1 : 0; D3D12_RESOURCE_DESC resourceDesc = resource->GetDesc(); @@ -8037,10 +8041,10 @@ bool D3D12DebugManager::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, T D3D12_GPU_VIRTUAL_ADDRESS psCBuf = 0; - if(cfg.CustomShader != ResourceId()) + if(cfg.customShaderId != ResourceId()) { WrappedID3D12Shader *shader = - m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.CustomShader); + m_WrappedDevice->GetResourceManager()->GetCurrentAs(cfg.customShaderId); if(shader == NULL) return false; @@ -8209,7 +8213,7 @@ bool D3D12DebugManager::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, T { list->SetPipelineState(customPSO); } - else if(cfg.rawoutput || !blendAlpha || cfg.CustomShader != ResourceId()) + else if(cfg.rawOutput || !blendAlpha || cfg.customShaderId != ResourceId()) { if(m_BBFmtIdx == RGBA32_BACKBUFFER) list->SetPipelineState(m_TexDisplayF32Pipe); diff --git a/renderdoc/driver/d3d12/d3d12_debug.h b/renderdoc/driver/d3d12/d3d12_debug.h index 756252c83..274e21fe8 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.h +++ b/renderdoc/driver/d3d12/d3d12_debug.h @@ -73,7 +73,7 @@ public: void RenderCheckerboard(); bool RenderTexture(TextureDisplay cfg, bool blendAlpha); - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg); + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg); bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample, CompType typeHint, float *minval, float *maxval); @@ -83,22 +83,22 @@ public: vector &histogram); ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents); + uint32_t eventId, const vector &passEvents); ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint); 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 PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y); + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y); void FillCBufferVariables(const vector &invars, vector &outvars, bool flattenVec4s, const bytebuf &data); - void InitPostVSBuffers(uint32_t eventID); + void InitPostVSBuffers(uint32_t eventId); - // indicates that EID alias is the same as eventID - void AliasPostVSBuffers(uint32_t eventID, uint32_t alias) { m_PostVSAlias[alias] = eventID; } - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + // indicates that EID alias is the same as eventId + void AliasPostVSBuffers(uint32_t eventId, uint32_t alias) { m_PostVSAlias[alias] = eventId; } + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void ClearPostVSCache(); void GetBufferData(ResourceId buff, uint64_t offset, uint64_t length, bytebuf &retData); diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index 3e2daa268..e71d3fcdd 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -225,7 +225,7 @@ WrappedID3D12Device::WrappedID3D12Device(ID3D12Device *realDevice, D3D12InitPara if(m_pInfoQueue) { - if(RenderDoc::Inst().GetCaptureOptions().DebugOutputMute) + if(RenderDoc::Inst().GetCaptureOptions().debugOutputMute) m_pInfoQueue->SetMuteDebugOutput(true); UINT size = m_pInfoQueue->GetStorageFilterStackSize(); @@ -1709,7 +1709,7 @@ void WrappedID3D12Device::AddDebugMessage(MessageCategory c, MessageSeverity sv, D3D12CommandData &cmd = *m_Queue->GetCommandData(); DebugMessage msg; - msg.eventID = 0; + msg.eventId = 0; msg.messageID = 0; msg.source = src; msg.category = c; @@ -1723,7 +1723,7 @@ void WrappedID3D12Device::AddDebugMessage(MessageCategory c, MessageSeverity sv, RDCASSERT(it != cmd.m_DrawcallUses.end()); if(it != cmd.m_DrawcallUses.end()) - msg.eventID = it->eventID; + msg.eventId = it->eventId; else RDCERR("Couldn't locate drawcall use for current chunk offset %llu", cmd.m_CurChunkOffset); } @@ -1769,7 +1769,7 @@ std::vector WrappedID3D12Device::GetDebugMessages() m_pInfoQueue->GetMessage(i, message, &len); DebugMessage msg; - msg.eventID = 0; + msg.eventId = 0; msg.source = MessageSource::API; msg.category = MessageCategory::Miscellaneous; msg.severity = MessageSeverity::Medium; @@ -2013,7 +2013,7 @@ WriteSerialiser &WrappedID3D12Device::GetThreadSerialiser() uint32_t flags = WriteSerialiser::ChunkDuration | WriteSerialiser::ChunkTimestamp | WriteSerialiser::ChunkThreadID; - if(RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks) + if(RenderDoc::Inst().GetCaptureOptions().captureCallstacks) flags |= WriteSerialiser::ChunkCallstack; ser->SetChunkMetadataRecording(flags); @@ -2244,12 +2244,12 @@ void WrappedID3D12Device::FlushLists(bool forceSync, ID3D12CommandQueue *queue) } } -const DrawcallDescription *WrappedID3D12Device::GetDrawcall(uint32_t eventID) +const DrawcallDescription *WrappedID3D12Device::GetDrawcall(uint32_t eventId) { - if(eventID >= m_Drawcalls.size()) + if(eventId >= m_Drawcalls.size()) return NULL; - return m_Drawcalls[eventID]; + return m_Drawcalls[eventId]; } bool WrappedID3D12Device::ProcessChunk(ReadSerialiser &ser, D3D12Chunk context) @@ -2486,7 +2486,7 @@ ReplayStatus WrappedID3D12Device::ReadLogInitialisation(RDCFile *rdc, bool store } // steal the structured data for ourselves - m_StructuredFile->swap(m_StoredStructuredData); + m_StructuredFile->Swap(m_StoredStructuredData); // and in future use this file. m_StructuredFile = &m_StoredStructuredData; diff --git a/renderdoc/driver/d3d12/d3d12_device.h b/renderdoc/driver/d3d12/d3d12_device.h index 4cfd25410..198e5553b 100644 --- a/renderdoc/driver/d3d12/d3d12_device.h +++ b/renderdoc/driver/d3d12/d3d12_device.h @@ -378,7 +378,7 @@ public: void ReleaseSwapchainResources(IDXGISwapChain *swap, IUnknown **backbuffers, int numBackbuffers); void FirstFrame(WrappedIDXGISwapChain4 *swap); FrameRecord &GetFrameRecord() { return m_FrameRecord; } - const DrawcallDescription *GetDrawcall(uint32_t eventID); + const DrawcallDescription *GetDrawcall(uint32_t eventId); ResourceId GetFrameCaptureResourceId() { return m_FrameCaptureRecord->GetResourceID(); } void AddDebugMessage(MessageCategory c, MessageSeverity sv, MessageSource src, std::string d); diff --git a/renderdoc/driver/d3d12/d3d12_hooks.cpp b/renderdoc/driver/d3d12/d3d12_hooks.cpp index 83c669906..81fac63dd 100644 --- a/renderdoc/driver/d3d12/d3d12_hooks.cpp +++ b/renderdoc/driver/d3d12/d3d12_hooks.cpp @@ -193,7 +193,7 @@ private: #if ENABLED(RDOC_DEVEL) RenderDoc::Inst().IsReplayApp() || #endif - (m_EnabledHooks && !reading && RenderDoc::Inst().GetCaptureOptions().APIValidation); + (m_EnabledHooks && !reading && RenderDoc::Inst().GetCaptureOptions().apiValidation); if(EnableDebugLayer) { diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 6574ede06..11f9b2909 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -93,7 +93,7 @@ ResourceDescription &D3D12Replay::GetResourceDesc(ResourceId id) { m_ResourceIdx[id] = m_Resources.size(); m_Resources.push_back(ResourceDescription()); - m_Resources.back().ID = id; + m_Resources.back().resourceId = id; return m_Resources.back(); } @@ -135,7 +135,7 @@ std::vector D3D12Replay::GetTextures() BufferDescription D3D12Replay::GetBuffer(ResourceId id) { BufferDescription ret = {}; - ret.ID = m_pDevice->GetResourceManager()->GetOriginalID(id); + ret.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(id); auto it = WrappedID3D12Resource::GetList().find(id); @@ -176,7 +176,7 @@ BufferDescription D3D12Replay::GetBuffer(ResourceId id) TextureDescription D3D12Replay::GetTexture(ResourceId id) { TextureDescription ret = {}; - ret.ID = m_pDevice->GetResourceManager()->GetOriginalID(id); + ret.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(id); auto it = WrappedID3D12Resource::GetList().find(id); @@ -203,15 +203,15 @@ TextureDescription D3D12Replay::GetTexture(ResourceId id) switch(ret.dimension) { case 1: - ret.resType = ret.arraysize > 1 ? TextureDim::Texture1DArray : TextureDim::Texture1D; + ret.type = ret.arraysize > 1 ? TextureType::Texture1DArray : TextureType::Texture1D; break; case 2: if(ret.msSamp > 1) - ret.resType = ret.arraysize > 1 ? TextureDim::Texture2DMSArray : TextureDim::Texture2DMS; + ret.type = ret.arraysize > 1 ? TextureType::Texture2DMSArray : TextureType::Texture2DMS; else - ret.resType = ret.arraysize > 1 ? TextureDim::Texture2DArray : TextureDim::Texture2D; + ret.type = ret.arraysize > 1 ? TextureType::Texture2DArray : TextureType::Texture2D; break; - case 3: ret.resType = TextureDim::Texture3D; break; + case 3: ret.type = TextureType::Texture3D; break; } ret.cubemap = m_pDevice->IsCubemap(id); @@ -225,7 +225,7 @@ TextureDescription D3D12Replay::GetTexture(ResourceId id) if(desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS) ret.creationFlags |= TextureCategory::ShaderReadWrite; - if(ret.ID == m_pDevice->GetQueue()->GetBackbufferResourceID()) + if(ret.resourceId == m_pDevice->GetQueue()->GetBackbufferResourceID()) { ret.format = MakeResourceFormat(GetTypedFormat(desc.Format, CompType::UNorm)); ret.creationFlags |= TextureCategory::SwapBuffer; @@ -244,7 +244,7 @@ rdcarray D3D12Replay::GetShaderEntryPoints(ResourceId shader) ShaderReflection &ret = sh->GetDetails(); - return {{"main", ret.Stage}}; + return {{"main", ret.stage}}; } ShaderReflection *D3D12Replay::GetShader(ResourceId shader, string entryPoint) @@ -273,7 +273,8 @@ vector D3D12Replay::GetDisassemblyTargets() string D3D12Replay::DisassembleShader(ResourceId pipeline, const ShaderReflection *refl, const string &target) { - WrappedID3D12Shader *sh = m_pDevice->GetResourceManager()->GetLiveAs(refl->ID); + WrappedID3D12Shader *sh = + m_pDevice->GetResourceManager()->GetLiveAs(refl->resourceId); if(!sh) return "Invalid Shader Specified"; @@ -332,9 +333,9 @@ void D3D12Replay::FillResourceView(D3D12Pipe::View &view, D3D12Descriptor *desc) return; } - view.Resource = rm->GetOriginalID(GetResID(desc->nonsamp.resource)); + view.resourceId = rm->GetOriginalID(GetResID(desc->nonsamp.resource)); - if(view.Resource == ResourceId()) + if(view.resourceId == ResourceId()) return; D3D12_RESOURCE_DESC res = desc->nonsamp.resource->GetDesc(); @@ -352,90 +353,90 @@ void D3D12Replay::FillResourceView(D3D12Pipe::View &view, D3D12Descriptor *desc) if(fmt == DXGI_FORMAT_UNKNOWN) fmt = res.Format; - view.ElementSize = fmt == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, fmt, 0); + view.elementByteSize = fmt == DXGI_FORMAT_UNKNOWN ? 1 : GetByteSize(1, 1, 1, fmt, 0); - view.Format = MakeResourceFormat(fmt); + view.viewFormat = MakeResourceFormat(fmt); if(desc->GetType() == D3D12DescriptorType::RTV) { - view.Type = MakeTextureDim(desc->nonsamp.rtv.ViewDimension); + view.type = MakeTextureDim(desc->nonsamp.rtv.ViewDimension); if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_BUFFER) { - view.FirstElement = desc->nonsamp.rtv.Buffer.FirstElement; - view.NumElements = desc->nonsamp.rtv.Buffer.NumElements; + view.firstElement = desc->nonsamp.rtv.Buffer.FirstElement; + view.numElements = desc->nonsamp.rtv.Buffer.NumElements; } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc->nonsamp.rtv.Texture1D.MipSlice; + view.firstMip = desc->nonsamp.rtv.Texture1D.MipSlice; } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc->nonsamp.rtv.Texture1DArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.rtv.Texture1DArray.FirstArraySlice; - view.HighestMip = desc->nonsamp.rtv.Texture1DArray.MipSlice; + view.numSlices = desc->nonsamp.rtv.Texture1DArray.ArraySize; + view.firstSlice = desc->nonsamp.rtv.Texture1DArray.FirstArraySlice; + view.firstMip = desc->nonsamp.rtv.Texture1DArray.MipSlice; } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc->nonsamp.rtv.Texture2D.MipSlice; + view.firstMip = desc->nonsamp.rtv.Texture2D.MipSlice; } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc->nonsamp.rtv.Texture2DArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.rtv.Texture2DArray.FirstArraySlice; - view.HighestMip = desc->nonsamp.rtv.Texture2DArray.MipSlice; + view.numSlices = desc->nonsamp.rtv.Texture2DArray.ArraySize; + view.firstSlice = desc->nonsamp.rtv.Texture2DArray.FirstArraySlice; + view.firstMip = desc->nonsamp.rtv.Texture2DArray.MipSlice; } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMS) { } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY) { - view.ArraySize = desc->nonsamp.rtv.Texture2DMSArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.rtv.Texture2DArray.FirstArraySlice; + view.numSlices = desc->nonsamp.rtv.Texture2DMSArray.ArraySize; + view.firstSlice = desc->nonsamp.rtv.Texture2DArray.FirstArraySlice; } else if(desc->nonsamp.rtv.ViewDimension == D3D12_RTV_DIMENSION_TEXTURE3D) { - view.ArraySize = desc->nonsamp.rtv.Texture3D.WSize; - view.FirstArraySlice = desc->nonsamp.rtv.Texture3D.FirstWSlice; - view.HighestMip = desc->nonsamp.rtv.Texture3D.MipSlice; + view.numSlices = desc->nonsamp.rtv.Texture3D.WSize; + view.firstSlice = desc->nonsamp.rtv.Texture3D.FirstWSlice; + view.firstMip = desc->nonsamp.rtv.Texture3D.MipSlice; } } else if(desc->GetType() == D3D12DescriptorType::DSV) { - view.Type = MakeTextureDim(desc->nonsamp.dsv.ViewDimension); + view.type = MakeTextureDim(desc->nonsamp.dsv.ViewDimension); if(desc->nonsamp.dsv.ViewDimension == D3D12_DSV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc->nonsamp.dsv.Texture1D.MipSlice; + view.firstMip = desc->nonsamp.dsv.Texture1D.MipSlice; } else if(desc->nonsamp.dsv.ViewDimension == D3D12_DSV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc->nonsamp.dsv.Texture1DArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.dsv.Texture1DArray.FirstArraySlice; - view.HighestMip = desc->nonsamp.dsv.Texture1DArray.MipSlice; + view.numSlices = desc->nonsamp.dsv.Texture1DArray.ArraySize; + view.firstSlice = desc->nonsamp.dsv.Texture1DArray.FirstArraySlice; + view.firstMip = desc->nonsamp.dsv.Texture1DArray.MipSlice; } else if(desc->nonsamp.dsv.ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc->nonsamp.dsv.Texture2D.MipSlice; + view.firstMip = desc->nonsamp.dsv.Texture2D.MipSlice; } else if(desc->nonsamp.dsv.ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc->nonsamp.dsv.Texture2DArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.dsv.Texture2DArray.FirstArraySlice; - view.HighestMip = desc->nonsamp.dsv.Texture2DArray.MipSlice; + view.numSlices = desc->nonsamp.dsv.Texture2DArray.ArraySize; + view.firstSlice = desc->nonsamp.dsv.Texture2DArray.FirstArraySlice; + view.firstMip = desc->nonsamp.dsv.Texture2DArray.MipSlice; } else if(desc->nonsamp.dsv.ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2DMS) { } else if(desc->nonsamp.dsv.ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY) { - view.ArraySize = desc->nonsamp.dsv.Texture2DMSArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.dsv.Texture2DArray.FirstArraySlice; + view.numSlices = desc->nonsamp.dsv.Texture2DMSArray.ArraySize; + view.firstSlice = desc->nonsamp.dsv.Texture2DArray.FirstArraySlice; } } else if(desc->GetType() == D3D12DescriptorType::SRV) { - view.Type = MakeTextureDim(desc->nonsamp.srv.ViewDimension); + view.type = MakeTextureDim(desc->nonsamp.srv.ViewDimension); view.swizzle[0] = (TextureSwizzle)D3D12_DECODE_SHADER_4_COMPONENT_MAPPING( 0, desc->nonsamp.srv.Shader4ComponentMapping); @@ -448,109 +449,109 @@ void D3D12Replay::FillResourceView(D3D12Pipe::View &view, D3D12Descriptor *desc) if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_BUFFER) { - view.FirstElement = desc->nonsamp.srv.Buffer.FirstElement; - view.NumElements = desc->nonsamp.srv.Buffer.NumElements; + view.firstElement = desc->nonsamp.srv.Buffer.FirstElement; + view.numElements = desc->nonsamp.srv.Buffer.NumElements; - view.BufferFlags = MakeBufferFlags(desc->nonsamp.srv.Buffer.Flags); + view.bufferFlags = MakeBufferFlags(desc->nonsamp.srv.Buffer.Flags); if(desc->nonsamp.srv.Buffer.StructureByteStride > 0) - view.ElementSize = desc->nonsamp.srv.Buffer.StructureByteStride; + view.elementByteSize = desc->nonsamp.srv.Buffer.StructureByteStride; } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE1D) { - view.HighestMip = desc->nonsamp.srv.Texture1D.MostDetailedMip; - view.NumMipLevels = desc->nonsamp.srv.Texture1D.MipLevels; - view.MinLODClamp = desc->nonsamp.srv.Texture1D.ResourceMinLODClamp; + view.firstMip = desc->nonsamp.srv.Texture1D.MostDetailedMip; + view.numMips = desc->nonsamp.srv.Texture1D.MipLevels; + view.minLODClamp = desc->nonsamp.srv.Texture1D.ResourceMinLODClamp; } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = desc->nonsamp.srv.Texture1DArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.srv.Texture1DArray.FirstArraySlice; - view.HighestMip = desc->nonsamp.srv.Texture1DArray.MostDetailedMip; - view.NumMipLevels = desc->nonsamp.srv.Texture1DArray.MipLevels; - view.MinLODClamp = desc->nonsamp.srv.Texture1DArray.ResourceMinLODClamp; + view.numSlices = desc->nonsamp.srv.Texture1DArray.ArraySize; + view.firstSlice = desc->nonsamp.srv.Texture1DArray.FirstArraySlice; + view.firstMip = desc->nonsamp.srv.Texture1DArray.MostDetailedMip; + view.numMips = desc->nonsamp.srv.Texture1DArray.MipLevels; + view.minLODClamp = desc->nonsamp.srv.Texture1DArray.ResourceMinLODClamp; } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2D) { - view.HighestMip = desc->nonsamp.srv.Texture2D.MostDetailedMip; - view.NumMipLevels = desc->nonsamp.srv.Texture2D.MipLevels; - view.MinLODClamp = desc->nonsamp.srv.Texture2D.ResourceMinLODClamp; + view.firstMip = desc->nonsamp.srv.Texture2D.MostDetailedMip; + view.numMips = desc->nonsamp.srv.Texture2D.MipLevels; + view.minLODClamp = desc->nonsamp.srv.Texture2D.ResourceMinLODClamp; } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = desc->nonsamp.srv.Texture2DArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.srv.Texture2DArray.FirstArraySlice; - view.HighestMip = desc->nonsamp.srv.Texture2DArray.MostDetailedMip; - view.NumMipLevels = desc->nonsamp.srv.Texture2DArray.MipLevels; - view.MinLODClamp = desc->nonsamp.srv.Texture2DArray.ResourceMinLODClamp; + view.numSlices = desc->nonsamp.srv.Texture2DArray.ArraySize; + view.firstSlice = desc->nonsamp.srv.Texture2DArray.FirstArraySlice; + view.firstMip = desc->nonsamp.srv.Texture2DArray.MostDetailedMip; + view.numMips = desc->nonsamp.srv.Texture2DArray.MipLevels; + view.minLODClamp = desc->nonsamp.srv.Texture2DArray.ResourceMinLODClamp; } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DMS) { } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY) { - view.ArraySize = desc->nonsamp.srv.Texture2DMSArray.ArraySize; - view.FirstArraySlice = desc->nonsamp.srv.Texture2DMSArray.FirstArraySlice; + view.numSlices = desc->nonsamp.srv.Texture2DMSArray.ArraySize; + view.firstSlice = desc->nonsamp.srv.Texture2DMSArray.FirstArraySlice; } else if(desc->nonsamp.srv.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE3D) { - view.HighestMip = desc->nonsamp.srv.Texture3D.MostDetailedMip; - view.NumMipLevels = desc->nonsamp.srv.Texture3D.MipLevels; - view.MinLODClamp = desc->nonsamp.srv.Texture3D.ResourceMinLODClamp; + view.firstMip = desc->nonsamp.srv.Texture3D.MostDetailedMip; + view.numMips = desc->nonsamp.srv.Texture3D.MipLevels; + view.minLODClamp = desc->nonsamp.srv.Texture3D.ResourceMinLODClamp; } } else if(desc->GetType() == D3D12DescriptorType::UAV) { D3D12_UNORDERED_ACCESS_VIEW_DESC uav = desc->nonsamp.uav.desc.AsDesc(); - view.CounterResource = rm->GetOriginalID(GetResID(desc->nonsamp.uav.counterResource)); + view.counterResourceId = rm->GetOriginalID(GetResID(desc->nonsamp.uav.counterResource)); - view.Type = MakeTextureDim(uav.ViewDimension); + view.type = MakeTextureDim(uav.ViewDimension); if(uav.ViewDimension == D3D12_UAV_DIMENSION_BUFFER) { - view.FirstElement = uav.Buffer.FirstElement; - view.NumElements = uav.Buffer.NumElements; + view.firstElement = uav.Buffer.FirstElement; + view.numElements = uav.Buffer.NumElements; - view.BufferFlags = MakeBufferFlags(uav.Buffer.Flags); + view.bufferFlags = MakeBufferFlags(uav.Buffer.Flags); if(uav.Buffer.StructureByteStride > 0) - view.ElementSize = uav.Buffer.StructureByteStride; + view.elementByteSize = uav.Buffer.StructureByteStride; - view.CounterByteOffset = uav.Buffer.CounterOffsetInBytes; + view.counterByteOffset = uav.Buffer.CounterOffsetInBytes; - if(view.CounterResource != ResourceId()) + if(view.counterResourceId != ResourceId()) { bytebuf counterVal; m_pDevice->GetDebugManager()->GetBufferData(desc->nonsamp.uav.counterResource, - view.CounterByteOffset, 4, counterVal); + view.counterByteOffset, 4, counterVal); uint32_t *val = (uint32_t *)&counterVal[0]; - view.BufferStructCount = *val; + view.bufferStructCount = *val; } } else if(uav.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE1D) { - view.HighestMip = uav.Texture1D.MipSlice; + view.firstMip = uav.Texture1D.MipSlice; } else if(uav.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE1DARRAY) { - view.ArraySize = uav.Texture1DArray.ArraySize; - view.FirstArraySlice = uav.Texture1DArray.FirstArraySlice; - view.HighestMip = uav.Texture1DArray.MipSlice; + view.numSlices = uav.Texture1DArray.ArraySize; + view.firstSlice = uav.Texture1DArray.FirstArraySlice; + view.firstMip = uav.Texture1DArray.MipSlice; } else if(uav.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE2D) { - view.HighestMip = uav.Texture2D.MipSlice; + view.firstMip = uav.Texture2D.MipSlice; } else if(uav.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE2DARRAY) { - view.ArraySize = uav.Texture2DArray.ArraySize; - view.FirstArraySlice = uav.Texture2DArray.FirstArraySlice; - view.HighestMip = uav.Texture2DArray.MipSlice; + view.numSlices = uav.Texture2DArray.ArraySize; + view.firstSlice = uav.Texture2DArray.FirstArraySlice; + view.firstMip = uav.Texture2DArray.MipSlice; } else if(uav.ViewDimension == D3D12_UAV_DIMENSION_TEXTURE3D) { - view.ArraySize = uav.Texture3D.WSize; - view.FirstArraySlice = uav.Texture3D.FirstWSlice; - view.HighestMip = uav.Texture3D.MipSlice; + view.numSlices = uav.Texture3D.WSize; + view.firstSlice = uav.Texture3D.FirstWSlice; + view.firstMip = uav.Texture3D.MipSlice; } } } @@ -577,29 +578,29 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS) { - D3D12Pipe::CBuffer &cb = resize_and_add(spaces[p.Constants.RegisterSpace].ConstantBuffers, - p.Constants.ShaderRegister); - cb.Immediate = true; - cb.RootElement = (uint32_t)rootEl; - cb.ByteSize = uint32_t(sizeof(uint32_t) * p.Constants.Num32BitValues); + D3D12Pipe::ConstantBuffer &cb = resize_and_add( + spaces[p.Constants.RegisterSpace].constantBuffers, p.Constants.ShaderRegister); + cb.immediate = true; + cb.rootElement = (uint32_t)rootEl; + cb.byteSize = uint32_t(sizeof(uint32_t) * p.Constants.Num32BitValues); if(rootEl < rootSig.sigelems.size()) { const D3D12RenderState::SignatureElement &e = rootSig.sigelems[rootEl]; if(e.type == eRootConst) - cb.RootValues.assign(e.constants.data(), + cb.rootValues.assign(e.constants.data(), RDCMIN(e.constants.size(), (size_t)p.Constants.Num32BitValues)); } - if(cb.RootValues.empty()) - cb.RootValues.resize(p.Constants.Num32BitValues); + if(cb.rootValues.empty()) + cb.rootValues.resize(p.Constants.Num32BitValues); } else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_CBV) { - D3D12Pipe::CBuffer &cb = resize_and_add(spaces[p.Descriptor.RegisterSpace].ConstantBuffers, - p.Descriptor.ShaderRegister); - cb.Immediate = true; - cb.RootElement = (uint32_t)rootEl; + D3D12Pipe::ConstantBuffer &cb = resize_and_add( + spaces[p.Descriptor.RegisterSpace].constantBuffers, p.Descriptor.ShaderRegister); + cb.immediate = true; + cb.rootElement = (uint32_t)rootEl; if(rootEl < rootSig.sigelems.size()) { @@ -608,18 +609,18 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root { ID3D12Resource *res = rm->GetCurrentAs(e.id); - cb.Buffer = rm->GetOriginalID(e.id); - cb.Offset = e.offset; - cb.ByteSize = uint32_t(res->GetDesc().Width - cb.Offset); + cb.resourceId = rm->GetOriginalID(e.id); + cb.byteOffset = e.offset; + cb.byteSize = uint32_t(res->GetDesc().Width - cb.byteOffset); } } } else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_SRV) { D3D12Pipe::View &view = - resize_and_add(spaces[p.Descriptor.RegisterSpace].SRVs, p.Descriptor.ShaderRegister); - view.Immediate = true; - view.RootElement = (uint32_t)rootEl; + resize_and_add(spaces[p.Descriptor.RegisterSpace].srvs, p.Descriptor.ShaderRegister); + view.immediate = true; + view.rootElement = (uint32_t)rootEl; if(rootEl < rootSig.sigelems.size()) { @@ -629,22 +630,22 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root ID3D12Resource *res = rm->GetCurrentAs(e.id); // parameters from resource/view - view.Resource = rm->GetOriginalID(e.id); - view.Type = TextureDim::Buffer; - view.Format = MakeResourceFormat(DXGI_FORMAT_R32_UINT); + view.resourceId = rm->GetOriginalID(e.id); + view.type = TextureType::Buffer; + view.viewFormat = MakeResourceFormat(DXGI_FORMAT_R32_UINT); - view.ElementSize = sizeof(uint32_t); - view.FirstElement = e.offset / sizeof(uint32_t); - view.NumElements = uint32_t((res->GetDesc().Width - e.offset) / sizeof(uint32_t)); + view.elementByteSize = sizeof(uint32_t); + view.firstElement = e.offset / sizeof(uint32_t); + view.numElements = uint32_t((res->GetDesc().Width - e.offset) / sizeof(uint32_t)); } } } else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_UAV) { D3D12Pipe::View &view = - resize_and_add(spaces[p.Descriptor.RegisterSpace].UAVs, p.Descriptor.ShaderRegister); - view.Immediate = true; - view.RootElement = (uint32_t)rootEl; + resize_and_add(spaces[p.Descriptor.RegisterSpace].uavs, p.Descriptor.ShaderRegister); + view.immediate = true; + view.rootElement = (uint32_t)rootEl; if(rootEl < rootSig.sigelems.size()) { @@ -654,13 +655,13 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root ID3D12Resource *res = rm->GetCurrentAs(e.id); // parameters from resource/view - view.Resource = rm->GetOriginalID(e.id); - view.Type = TextureDim::Buffer; - view.Format = MakeResourceFormat(DXGI_FORMAT_R32_UINT); + view.resourceId = rm->GetOriginalID(e.id); + view.type = TextureType::Buffer; + view.viewFormat = MakeResourceFormat(DXGI_FORMAT_R32_UINT); - view.ElementSize = sizeof(uint32_t); - view.FirstElement = e.offset / sizeof(uint32_t); - view.NumElements = uint32_t((res->GetDesc().Width - e.offset) / sizeof(uint32_t)); + view.elementByteSize = sizeof(uint32_t); + view.firstElement = e.offset / sizeof(uint32_t); + view.numElements = uint32_t((res->GetDesc().Width - e.offset) / sizeof(uint32_t)); } } } @@ -719,34 +720,34 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root if(range.RangeType == D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER) { UINT maxReg = shaderReg + num - 1; - if(maxReg >= spaces[regSpace].Samplers.size()) - spaces[regSpace].Samplers.resize(maxReg + 1); + if(maxReg >= spaces[regSpace].samplers.size()) + spaces[regSpace].samplers.resize(maxReg + 1); for(UINT i = 0; i < num; i++, shaderReg++) { - D3D12Pipe::Sampler &samp = spaces[regSpace].Samplers[shaderReg]; - samp.Immediate = false; - samp.RootElement = (uint32_t)rootEl; - samp.TableIndex = offset + i; + D3D12Pipe::Sampler &samp = spaces[regSpace].samplers[shaderReg]; + samp.immediate = false; + samp.rootElement = (uint32_t)rootEl; + samp.tableIndex = offset + i; if(desc) { D3D12_SAMPLER_DESC &sampDesc = desc->samp.desc; - samp.AddressU = MakeAddressMode(sampDesc.AddressU); - samp.AddressV = MakeAddressMode(sampDesc.AddressV); - samp.AddressW = MakeAddressMode(sampDesc.AddressW); + samp.addressU = MakeAddressMode(sampDesc.AddressU); + samp.addressV = MakeAddressMode(sampDesc.AddressV); + samp.addressW = MakeAddressMode(sampDesc.AddressW); - memcpy(samp.BorderColor, sampDesc.BorderColor, sizeof(FLOAT) * 4); + memcpy(samp.borderColor, sampDesc.BorderColor, sizeof(FLOAT) * 4); - samp.Comparison = MakeCompareFunc(sampDesc.ComparisonFunc); - samp.Filter = MakeFilter(sampDesc.Filter); - samp.MaxAniso = 0; - if(samp.Filter.minify == FilterMode::Anisotropic) - samp.MaxAniso = sampDesc.MaxAnisotropy; - samp.MaxLOD = sampDesc.MaxLOD; - samp.MinLOD = sampDesc.MinLOD; - samp.MipLODBias = sampDesc.MipLODBias; + samp.compareFunction = MakeCompareFunc(sampDesc.ComparisonFunc); + samp.filter = MakeFilter(sampDesc.Filter); + samp.maxAnisotropy = 0; + if(samp.filter.minify == FilterMode::Anisotropic) + samp.maxAnisotropy = sampDesc.MaxAnisotropy; + samp.maxLOD = sampDesc.MaxLOD; + samp.minLOD = sampDesc.MinLOD; + samp.mipLODBias = sampDesc.MipLODBias; desc++; } @@ -755,22 +756,22 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root else if(range.RangeType == D3D12_DESCRIPTOR_RANGE_TYPE_CBV) { UINT maxReg = shaderReg + num - 1; - if(maxReg >= spaces[regSpace].ConstantBuffers.size()) - spaces[regSpace].ConstantBuffers.resize(maxReg + 1); + if(maxReg >= spaces[regSpace].constantBuffers.size()) + spaces[regSpace].constantBuffers.resize(maxReg + 1); for(UINT i = 0; i < num; i++, shaderReg++) { - D3D12Pipe::CBuffer &cb = spaces[regSpace].ConstantBuffers[shaderReg]; - cb.Immediate = false; - cb.RootElement = (uint32_t)rootEl; - cb.TableIndex = offset + i; + D3D12Pipe::ConstantBuffer &cb = spaces[regSpace].constantBuffers[shaderReg]; + cb.immediate = false; + cb.rootElement = (uint32_t)rootEl; + cb.tableIndex = offset + i; if(desc) { - WrappedID3D12Resource::GetResIDFromAddr(desc->nonsamp.cbv.BufferLocation, cb.Buffer, - cb.Offset); - cb.Buffer = rm->GetOriginalID(cb.Buffer); - cb.ByteSize = desc->nonsamp.cbv.SizeInBytes; + WrappedID3D12Resource::GetResIDFromAddr(desc->nonsamp.cbv.BufferLocation, + cb.resourceId, cb.byteOffset); + cb.resourceId = rm->GetOriginalID(cb.resourceId); + cb.byteSize = desc->nonsamp.cbv.SizeInBytes; desc++; } @@ -779,15 +780,15 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root else if(range.RangeType == D3D12_DESCRIPTOR_RANGE_TYPE_SRV) { UINT maxReg = shaderReg + num - 1; - if(maxReg >= spaces[regSpace].SRVs.size()) - spaces[regSpace].SRVs.resize(maxReg + 1); + if(maxReg >= spaces[regSpace].srvs.size()) + spaces[regSpace].srvs.resize(maxReg + 1); for(UINT i = 0; i < num; i++, shaderReg++) { - D3D12Pipe::View &view = spaces[regSpace].SRVs[shaderReg]; - view.Immediate = false; - view.RootElement = (uint32_t)rootEl; - view.TableIndex = offset + i; + D3D12Pipe::View &view = spaces[regSpace].srvs[shaderReg]; + view.immediate = false; + view.rootElement = (uint32_t)rootEl; + view.tableIndex = offset + i; if(desc) { @@ -800,15 +801,15 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root else if(range.RangeType == D3D12_DESCRIPTOR_RANGE_TYPE_UAV) { UINT maxReg = shaderReg + num - 1; - if(maxReg >= spaces[regSpace].UAVs.size()) - spaces[regSpace].UAVs.resize(maxReg + 1); + if(maxReg >= spaces[regSpace].uavs.size()) + spaces[regSpace].uavs.resize(maxReg + 1); for(UINT i = 0; i < num; i++, shaderReg++) { - D3D12Pipe::View &view = spaces[regSpace].UAVs[shaderReg]; - view.Immediate = false; - view.RootElement = (uint32_t)rootEl; - view.TableIndex = offset + i; + D3D12Pipe::View &view = spaces[regSpace].uavs[shaderReg]; + view.immediate = false; + view.rootElement = (uint32_t)rootEl; + view.tableIndex = offset + i; if(desc) { @@ -831,48 +832,48 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root continue; D3D12Pipe::Sampler &samp = - resize_and_add(spaces[sampDesc.RegisterSpace].Samplers, sampDesc.ShaderRegister); - samp.Immediate = true; - samp.RootElement = (uint32_t)i; + resize_and_add(spaces[sampDesc.RegisterSpace].samplers, sampDesc.ShaderRegister); + samp.immediate = true; + samp.rootElement = (uint32_t)i; - samp.AddressU = MakeAddressMode(sampDesc.AddressU); - samp.AddressV = MakeAddressMode(sampDesc.AddressV); - samp.AddressW = MakeAddressMode(sampDesc.AddressW); + samp.addressU = MakeAddressMode(sampDesc.AddressU); + samp.addressV = MakeAddressMode(sampDesc.AddressV); + samp.addressW = MakeAddressMode(sampDesc.AddressW); if(sampDesc.BorderColor == D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK) { - samp.BorderColor[0] = 0.0f; - samp.BorderColor[1] = 0.0f; - samp.BorderColor[2] = 0.0f; - samp.BorderColor[3] = 0.0f; + samp.borderColor[0] = 0.0f; + samp.borderColor[1] = 0.0f; + samp.borderColor[2] = 0.0f; + samp.borderColor[3] = 0.0f; } else if(sampDesc.BorderColor == D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK) { - samp.BorderColor[0] = 0.0f; - samp.BorderColor[1] = 0.0f; - samp.BorderColor[2] = 0.0f; - samp.BorderColor[3] = 1.0f; + samp.borderColor[0] = 0.0f; + samp.borderColor[1] = 0.0f; + samp.borderColor[2] = 0.0f; + samp.borderColor[3] = 1.0f; } else if(sampDesc.BorderColor == D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE) { - samp.BorderColor[0] = 1.0f; - samp.BorderColor[1] = 1.0f; - samp.BorderColor[2] = 1.0f; - samp.BorderColor[3] = 1.0f; + samp.borderColor[0] = 1.0f; + samp.borderColor[1] = 1.0f; + samp.borderColor[2] = 1.0f; + samp.borderColor[3] = 1.0f; } else { RDCERR("Unexpected static border colour: %u", sampDesc.BorderColor); } - samp.Comparison = MakeCompareFunc(sampDesc.ComparisonFunc); - samp.Filter = MakeFilter(sampDesc.Filter); - samp.MaxAniso = 0; - if(samp.Filter.minify == FilterMode::Anisotropic) - samp.MaxAniso = sampDesc.MaxAnisotropy; - samp.MaxLOD = sampDesc.MaxLOD; - samp.MinLOD = sampDesc.MinLOD; - samp.MipLODBias = sampDesc.MipLODBias; + samp.compareFunction = MakeCompareFunc(sampDesc.ComparisonFunc); + samp.filter = MakeFilter(sampDesc.Filter); + samp.maxAnisotropy = 0; + if(samp.filter.minify == FilterMode::Anisotropic) + samp.maxAnisotropy = sampDesc.MaxAnisotropy; + samp.maxLOD = sampDesc.MaxLOD; + samp.minLOD = sampDesc.MinLOD; + samp.mipLODBias = sampDesc.MipLODBias; } } @@ -888,7 +889,7 @@ void D3D12Replay::SavePipelineState() D3D12ResourceManager *rm = m_pDevice->GetResourceManager(); - state.pipeline = rm->GetOriginalID(rs.pipe); + state.pipelineResourceId = rm->GetOriginalID(rs.pipe); WrappedID3D12PipelineState *pipe = NULL; @@ -900,44 +901,46 @@ void D3D12Replay::SavePipelineState() const D3D12_INPUT_ELEMENT_DESC *inputEl = pipe->graphics->InputLayout.pInputElementDescs; UINT numInput = pipe->graphics->InputLayout.NumElements; - state.m_IA.layouts.resize(numInput); + state.inputAssembly.layouts.resize(numInput); for(UINT i = 0; i < numInput; i++) { - D3D12Pipe::Layout &l = state.m_IA.layouts[i]; + D3D12Pipe::Layout &l = state.inputAssembly.layouts[i]; - l.ByteOffset = inputEl[i].AlignedByteOffset; - l.Format = MakeResourceFormat(inputEl[i].Format); - l.InputSlot = inputEl[i].InputSlot; - l.PerInstance = inputEl[i].InputSlotClass == D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA; - l.InstanceDataStepRate = inputEl[i].InstanceDataStepRate; - l.SemanticIndex = inputEl[i].SemanticIndex; - l.SemanticName = inputEl[i].SemanticName; + l.byteOffset = inputEl[i].AlignedByteOffset; + l.format = MakeResourceFormat(inputEl[i].Format); + l.inputSlot = inputEl[i].InputSlot; + l.perInstance = inputEl[i].InputSlotClass == D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA; + l.instanceDataStepRate = inputEl[i].InstanceDataStepRate; + l.semanticIndex = inputEl[i].SemanticIndex; + l.semanticName = inputEl[i].SemanticName; } - state.m_IA.indexStripCutValue = 0; + state.inputAssembly.indexStripCutValue = 0; switch(pipe->graphics->IBStripCutValue) { - case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF: state.m_IA.indexStripCutValue = 0xFFFF; break; + case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF: + state.inputAssembly.indexStripCutValue = 0xFFFF; + break; case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF: - state.m_IA.indexStripCutValue = 0xFFFFFFFF; + state.inputAssembly.indexStripCutValue = 0xFFFFFFFF; break; default: break; } - state.m_IA.vbuffers.resize(rs.vbuffers.size()); + state.inputAssembly.vertexBuffers.resize(rs.vbuffers.size()); for(size_t i = 0; i < rs.vbuffers.size(); i++) { - D3D12Pipe::VB &vb = state.m_IA.vbuffers[i]; + D3D12Pipe::VertexBuffer &vb = state.inputAssembly.vertexBuffers[i]; - vb.Buffer = rm->GetOriginalID(rs.vbuffers[i].buf); - vb.Offset = rs.vbuffers[i].offs; - vb.Size = rs.vbuffers[i].size; - vb.Stride = rs.vbuffers[i].stride; + vb.resourceId = rm->GetOriginalID(rs.vbuffers[i].buf); + vb.byteOffset = rs.vbuffers[i].offs; + vb.byteSize = rs.vbuffers[i].size; + vb.byteStride = rs.vbuffers[i].stride; } - state.m_IA.ibuffer.Buffer = rm->GetOriginalID(rs.ibuffer.buf); - state.m_IA.ibuffer.Offset = rs.ibuffer.offs; - state.m_IA.ibuffer.Size = rs.ibuffer.size; + state.inputAssembly.indexBuffer.resourceId = rm->GetOriginalID(rs.ibuffer.buf); + state.inputAssembly.indexBuffer.byteOffset = rs.ibuffer.offs; + state.inputAssembly.indexBuffer.byteSize = rs.ibuffer.size; } ///////////////////////////////////////////////// @@ -948,19 +951,20 @@ void D3D12Replay::SavePipelineState() { WrappedID3D12Shader *sh = (WrappedID3D12Shader *)pipe->compute->CS.pShaderBytecode; - state.m_CS.Object = sh->GetResourceID(); - state.m_CS.stage = ShaderStage::Compute; - state.m_CS.ShaderDetails = &sh->GetDetails(); - state.m_CS.BindpointMapping = sh->GetMapping(); + state.computeShader.resourceId = sh->GetResourceID(); + state.computeShader.stage = ShaderStage::Compute; + state.computeShader.reflection = &sh->GetDetails(); + state.computeShader.bindpointMapping = sh->GetMapping(); - state.rootSig = rm->GetOriginalID(rs.compute.rootsig); + state.rootSignatureResourceId = rm->GetOriginalID(rs.compute.rootsig); if(rs.compute.rootsig != ResourceId()) - FillRegisterSpaces(rs.compute, state.m_CS.Spaces, D3D12_SHADER_VISIBILITY_ALL); + FillRegisterSpaces(rs.compute, state.computeShader.spaces, D3D12_SHADER_VISIBILITY_ALL); } else if(pipe) { - D3D12Pipe::Shader *dstArr[] = {&state.m_VS, &state.m_HS, &state.m_DS, &state.m_GS, &state.m_PS}; + D3D12Pipe::Shader *dstArr[] = {&state.vertexShader, &state.hullShader, &state.domainShader, + &state.geometryShader, &state.pixelShader}; D3D12_SHADER_BYTECODE *srcArr[] = {&pipe->graphics->VS, &pipe->graphics->HS, &pipe->graphics->DS, &pipe->graphics->GS, &pipe->graphics->PS}; @@ -980,16 +984,16 @@ void D3D12Replay::SavePipelineState() if(sh) { - dst.Object = sh->GetResourceID(); - dst.BindpointMapping = sh->GetMapping(); - dst.ShaderDetails = &sh->GetDetails(); + dst.resourceId = sh->GetResourceID(); + dst.bindpointMapping = sh->GetMapping(); + dst.reflection = &sh->GetDetails(); } if(rs.graphics.rootsig != ResourceId()) - FillRegisterSpaces(rs.graphics, dst.Spaces, visibility[stage]); + FillRegisterSpaces(rs.graphics, dst.spaces, visibility[stage]); } - state.rootSig = rm->GetOriginalID(rs.graphics.rootsig); + state.rootSignatureResourceId = rm->GetOriginalID(rs.graphics.rootsig); } if(pipe && pipe->IsGraphics()) @@ -998,28 +1002,29 @@ void D3D12Replay::SavePipelineState() // Stream Out ///////////////////////////////////////////////// - state.m_SO.Outputs.resize(rs.streamouts.size()); + state.streamOut.outputs.resize(rs.streamouts.size()); for(size_t s = 0; s < rs.streamouts.size(); s++) { - state.m_SO.Outputs[s].Buffer = rm->GetOriginalID(rs.streamouts[s].buf); - state.m_SO.Outputs[s].Offset = rs.streamouts[s].offs; - state.m_SO.Outputs[s].Size = rs.streamouts[s].size; + state.streamOut.outputs[s].resourceId = rm->GetOriginalID(rs.streamouts[s].buf); + state.streamOut.outputs[s].byteOffset = rs.streamouts[s].offs; + state.streamOut.outputs[s].byteSize = rs.streamouts[s].size; - state.m_SO.Outputs[s].WrittenCountBuffer = rm->GetOriginalID(rs.streamouts[s].countbuf); - state.m_SO.Outputs[s].WrittenCountOffset = rs.streamouts[s].countoffs; + state.streamOut.outputs[s].writtenCountResourceId = + rm->GetOriginalID(rs.streamouts[s].countbuf); + state.streamOut.outputs[s].writtenCountByteOffset = rs.streamouts[s].countoffs; } ///////////////////////////////////////////////// // Rasterizer ///////////////////////////////////////////////// - state.m_RS.SampleMask = pipe->graphics->SampleMask; + state.rasterizer.sampleMask = pipe->graphics->SampleMask; { - D3D12Pipe::RasterizerState &dst = state.m_RS.m_State; + D3D12Pipe::RasterizerState &dst = state.rasterizer.state; D3D12_RASTERIZER_DESC &src = pipe->graphics->RasterizerState; - dst.AntialiasedLineEnable = src.AntialiasedLineEnable == TRUE; + dst.antialiasedLines = src.AntialiasedLineEnable == TRUE; dst.cullMode = CullMode::NoCull; if(src.CullMode == D3D12_CULL_MODE_FRONT) @@ -1031,36 +1036,37 @@ void D3D12Replay::SavePipelineState() if(src.FillMode == D3D12_FILL_MODE_WIREFRAME) dst.fillMode = FillMode::Wireframe; - dst.DepthBias = src.DepthBias; - dst.DepthBiasClamp = src.DepthBiasClamp; - dst.DepthClip = src.DepthClipEnable == TRUE; - dst.FrontCCW = src.FrontCounterClockwise == TRUE; - dst.MultisampleEnable = src.MultisampleEnable == TRUE; - dst.SlopeScaledDepthBias = src.SlopeScaledDepthBias; - dst.ForcedSampleCount = src.ForcedSampleCount; - dst.ConservativeRasterization = + dst.depthBias = src.DepthBias; + dst.depthBiasClamp = src.DepthBiasClamp; + dst.depthClip = src.DepthClipEnable == TRUE; + dst.frontCCW = src.FrontCounterClockwise == TRUE; + dst.multisampleEnable = src.MultisampleEnable == TRUE; + dst.slopeScaledDepthBias = src.SlopeScaledDepthBias; + dst.forcedSampleCount = src.ForcedSampleCount; + dst.conservativeRasterization = src.ConservativeRaster == D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON; } - state.m_RS.Scissors.resize(rs.scissors.size()); + state.rasterizer.scissors.resize(rs.scissors.size()); for(size_t i = 0; i < rs.scissors.size(); i++) - state.m_RS.Scissors[i] = D3D12Pipe::Scissor(rs.scissors[i].left, rs.scissors[i].top, - rs.scissors[i].right, rs.scissors[i].bottom); + state.rasterizer.scissors[i] = Scissor(rs.scissors[i].left, rs.scissors[i].top, + rs.scissors[i].right - rs.scissors[i].left, + rs.scissors[i].bottom - rs.scissors[i].top); - state.m_RS.Viewports.resize(rs.views.size()); + state.rasterizer.viewports.resize(rs.views.size()); for(size_t i = 0; i < rs.views.size(); i++) - state.m_RS.Viewports[i] = - D3D12Pipe::Viewport(rs.views[i].TopLeftX, rs.views[i].TopLeftY, rs.views[i].Width, - rs.views[i].Height, rs.views[i].MinDepth, rs.views[i].MaxDepth); + state.rasterizer.viewports[i] = + Viewport(rs.views[i].TopLeftX, rs.views[i].TopLeftY, rs.views[i].Width, + rs.views[i].Height, rs.views[i].MinDepth, rs.views[i].MaxDepth); ///////////////////////////////////////////////// // Output Merger ///////////////////////////////////////////////// - state.m_OM.RenderTargets.resize(rs.rts.size()); + state.outputMerger.renderTargets.resize(rs.rts.size()); for(size_t i = 0; i < rs.rts.size(); i++) { - D3D12Pipe::View &view = state.m_OM.RenderTargets[i]; + D3D12Pipe::View &view = state.outputMerger.renderTargets[i]; D3D12Descriptor *desc = rs.rtSingle ? GetWrapped(rs.rts[0]) : GetWrapped(rs.rts[i]); @@ -1069,91 +1075,105 @@ void D3D12Replay::SavePipelineState() if(rs.rtSingle) desc += i; - view.RootElement = (uint32_t)i; - view.Immediate = false; + view.rootElement = (uint32_t)i; + view.immediate = false; FillResourceView(view, desc); } } { - D3D12Pipe::View &view = state.m_OM.DepthTarget; + D3D12Pipe::View &view = state.outputMerger.depthTarget; if(rs.dsv.ptr) { D3D12Descriptor *desc = GetWrapped(rs.dsv); - view.RootElement = 0; - view.Immediate = false; + view.rootElement = 0; + view.immediate = false; FillResourceView(view, desc); } } - memcpy(state.m_OM.m_BlendState.BlendFactor, rs.blendFactor, sizeof(FLOAT) * 4); + memcpy(state.outputMerger.blendState.blendFactor, rs.blendFactor, sizeof(FLOAT) * 4); { D3D12_BLEND_DESC &src = pipe->graphics->BlendState; - state.m_OM.m_BlendState.AlphaToCoverage = src.AlphaToCoverageEnable == TRUE; - state.m_OM.m_BlendState.IndependentBlend = src.IndependentBlendEnable == TRUE; + state.outputMerger.blendState.alphaToCoverage = src.AlphaToCoverageEnable == TRUE; + state.outputMerger.blendState.independentBlend = src.IndependentBlendEnable == TRUE; - state.m_OM.m_BlendState.Blends.resize(8); + state.outputMerger.blendState.blends.resize(8); for(size_t i = 0; i < 8; i++) { - D3D12Pipe::Blend &blend = state.m_OM.m_BlendState.Blends[i]; + ColorBlend &blend = state.outputMerger.blendState.blends[i]; - blend.Enabled = src.RenderTarget[i].BlendEnable == TRUE; + blend.enabled = src.RenderTarget[i].BlendEnable == TRUE; - blend.LogicEnabled = src.RenderTarget[i].LogicOpEnable == TRUE; - blend.Logic = MakeLogicOp(src.RenderTarget[i].LogicOp); + blend.logicOperationEnabled = src.RenderTarget[i].LogicOpEnable == TRUE; + blend.logicOperation = MakeLogicOp(src.RenderTarget[i].LogicOp); - blend.m_AlphaBlend.Source = MakeBlendMultiplier(src.RenderTarget[i].SrcBlendAlpha, true); - blend.m_AlphaBlend.Destination = - MakeBlendMultiplier(src.RenderTarget[i].DestBlendAlpha, true); - blend.m_AlphaBlend.Operation = MakeBlendOp(src.RenderTarget[i].BlendOpAlpha); + blend.alphaBlend.source = MakeBlendMultiplier(src.RenderTarget[i].SrcBlendAlpha, true); + blend.alphaBlend.destination = MakeBlendMultiplier(src.RenderTarget[i].DestBlendAlpha, true); + blend.alphaBlend.operation = MakeBlendOp(src.RenderTarget[i].BlendOpAlpha); - blend.m_Blend.Source = MakeBlendMultiplier(src.RenderTarget[i].SrcBlend, false); - blend.m_Blend.Destination = MakeBlendMultiplier(src.RenderTarget[i].DestBlend, false); - blend.m_Blend.Operation = MakeBlendOp(src.RenderTarget[i].BlendOp); + blend.colorBlend.source = MakeBlendMultiplier(src.RenderTarget[i].SrcBlend, false); + blend.colorBlend.destination = MakeBlendMultiplier(src.RenderTarget[i].DestBlend, false); + blend.colorBlend.operation = MakeBlendOp(src.RenderTarget[i].BlendOp); - blend.WriteMask = src.RenderTarget[i].RenderTargetWriteMask; + blend.writeMask = src.RenderTarget[i].RenderTargetWriteMask; } } { D3D12_DEPTH_STENCIL_DESC &src = pipe->graphics->DepthStencilState; - state.m_OM.m_State.DepthEnable = src.DepthEnable == TRUE; - state.m_OM.m_State.DepthFunc = MakeCompareFunc(src.DepthFunc); - state.m_OM.m_State.DepthWrites = src.DepthWriteMask == D3D12_DEPTH_WRITE_MASK_ALL; - state.m_OM.m_State.StencilEnable = src.StencilEnable == TRUE; - state.m_OM.m_State.StencilRef = rs.stencilRef; - state.m_OM.m_State.StencilReadMask = src.StencilReadMask; - state.m_OM.m_State.StencilWriteMask = src.StencilWriteMask; + state.outputMerger.depthStencilState.depthEnable = src.DepthEnable == TRUE; + state.outputMerger.depthStencilState.depthFunction = MakeCompareFunc(src.DepthFunc); + state.outputMerger.depthStencilState.depthWrites = + src.DepthWriteMask == D3D12_DEPTH_WRITE_MASK_ALL; + state.outputMerger.depthStencilState.stencilEnable = src.StencilEnable == TRUE; - state.m_OM.m_State.m_FrontFace.Func = MakeCompareFunc(src.FrontFace.StencilFunc); - state.m_OM.m_State.m_FrontFace.DepthFailOp = MakeStencilOp(src.FrontFace.StencilDepthFailOp); - state.m_OM.m_State.m_FrontFace.PassOp = MakeStencilOp(src.FrontFace.StencilPassOp); - state.m_OM.m_State.m_FrontFace.FailOp = MakeStencilOp(src.FrontFace.StencilFailOp); + state.outputMerger.depthStencilState.frontFace.function = + MakeCompareFunc(src.FrontFace.StencilFunc); + state.outputMerger.depthStencilState.frontFace.depthFailOperation = + MakeStencilOp(src.FrontFace.StencilDepthFailOp); + state.outputMerger.depthStencilState.frontFace.passOperation = + MakeStencilOp(src.FrontFace.StencilPassOp); + state.outputMerger.depthStencilState.frontFace.failOperation = + MakeStencilOp(src.FrontFace.StencilFailOp); - state.m_OM.m_State.m_BackFace.Func = MakeCompareFunc(src.BackFace.StencilFunc); - state.m_OM.m_State.m_BackFace.DepthFailOp = MakeStencilOp(src.BackFace.StencilDepthFailOp); - state.m_OM.m_State.m_BackFace.PassOp = MakeStencilOp(src.BackFace.StencilPassOp); - state.m_OM.m_State.m_BackFace.FailOp = MakeStencilOp(src.BackFace.StencilFailOp); + state.outputMerger.depthStencilState.backFace.function = + MakeCompareFunc(src.BackFace.StencilFunc); + state.outputMerger.depthStencilState.backFace.depthFailOperation = + MakeStencilOp(src.BackFace.StencilDepthFailOp); + state.outputMerger.depthStencilState.backFace.passOperation = + MakeStencilOp(src.BackFace.StencilPassOp); + state.outputMerger.depthStencilState.backFace.failOperation = + MakeStencilOp(src.BackFace.StencilFailOp); + + // due to shared structs, this is slightly duplicated - D3D doesn't have separate states for + // front/back. + state.outputMerger.depthStencilState.frontFace.reference = rs.stencilRef; + state.outputMerger.depthStencilState.frontFace.compareMask = src.StencilReadMask; + state.outputMerger.depthStencilState.frontFace.writeMask = src.StencilWriteMask; + state.outputMerger.depthStencilState.backFace.reference = rs.stencilRef; + state.outputMerger.depthStencilState.backFace.compareMask = src.StencilReadMask; + state.outputMerger.depthStencilState.backFace.writeMask = src.StencilWriteMask; } } // resource states { const std::map &states = m_pDevice->GetSubresourceStates(); - state.Resources.resize(states.size()); + state.resourceStates.resize(states.size()); size_t i = 0; for(auto it = states.begin(); it != states.end(); ++it) { - D3D12Pipe::ResourceData &res = state.Resources[i]; + D3D12Pipe::ResourceData &res = state.resourceStates[i]; - res.id = rm->GetOriginalID(it->first); + res.resourceId = rm->GetOriginalID(it->first); res.states.resize(it->second.size()); for(size_t l = 0; l < it->second.size(); l++) @@ -1181,10 +1201,10 @@ bool D3D12Replay::RenderTexture(TextureDisplay cfg) return m_pDevice->GetDebugManager()->RenderTexture(cfg, true); } -void D3D12Replay::RenderMesh(uint32_t eventID, const vector &secondaryDraws, +void D3D12Replay::RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { - return m_pDevice->GetDebugManager()->RenderMesh(eventID, secondaryDraws, cfg); + return m_pDevice->GetDebugManager()->RenderMesh(eventId, secondaryDraws, cfg); } bool D3D12Replay::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample, @@ -1203,9 +1223,9 @@ bool D3D12Replay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mi } ResourceId D3D12Replay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { - return m_pDevice->GetDebugManager()->RenderOverlay(texid, typeHint, overlay, eventID, passEvents); + return m_pDevice->GetDebugManager()->RenderOverlay(texid, typeHint, overlay, eventId, passEvents); } bool D3D12Replay::IsRenderOutput(ResourceId id) @@ -1239,11 +1259,11 @@ bool D3D12Replay::IsRenderOutput(ResourceId id) return false; } -vector D3D12Replay::GetPassEvents(uint32_t eventID) +vector D3D12Replay::GetPassEvents(uint32_t eventId) { vector passEvents; - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventID); + const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); if(!draw) return passEvents; @@ -1294,7 +1314,7 @@ vector D3D12Replay::GetPassEvents(uint32_t eventID) // but it's useful to have the first part of the pass as part // of the list if(start->flags & (DrawFlags::Drawcall | DrawFlags::PassBoundary)) - passEvents.push_back(start->eventID); + passEvents.push_back(start->eventId); start = m_pDevice->GetDrawcall((uint32_t)start->next); } @@ -1358,12 +1378,12 @@ void D3D12Replay::FillCBufferVariables(ResourceId shader, string entryPoint, uin idx++; } - if(cb && cbufSlot < (uint32_t)bindMap.ConstantBlocks.count()) + if(cb && cbufSlot < (uint32_t)bindMap.constantBlocks.count()) { // check if the data actually comes from root constants const D3D12RenderState &rs = m_pDevice->GetQueue()->GetCommandData()->m_RenderState; - BindpointMap bind = bindMap.ConstantBlocks[cbufSlot]; + Bindpoint bind = bindMap.constantBlocks[cbufSlot]; WrappedID3D12RootSignature *sig = NULL; const vector *sigElems = NULL; @@ -1415,9 +1435,9 @@ void D3D12Replay::FillCBufferVariables(ResourceId shader, string entryPoint, uin } } -void D3D12Replay::InitPostVSBuffers(uint32_t eventID) +void D3D12Replay::InitPostVSBuffers(uint32_t eventId) { - m_pDevice->GetDebugManager()->InitPostVSBuffers(eventID); + m_pDevice->GetDebugManager()->InitPostVSBuffers(eventId); } struct D3D12InitPostVSCallback : public D3D12DrawcallCallback @@ -1465,14 +1485,14 @@ void D3D12Replay::InitPostVSBuffers(const vector &events) m_pDevice->ReplayLog(events.front(), events.back(), eReplay_Full); } -MeshFormat D3D12Replay::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat D3D12Replay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { - return m_pDevice->GetDebugManager()->GetPostVSBuffers(eventID, instID, stage); + return m_pDevice->GetDebugManager()->GetPostVSBuffers(eventId, instID, stage); } -uint32_t D3D12Replay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) +uint32_t D3D12Replay::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - return m_pDevice->GetDebugManager()->PickVertex(eventID, cfg, x, y); + return m_pDevice->GetDebugManager()->PickVertex(eventId, cfg, x, y); } uint64_t D3D12Replay::MakeOutputWindow(WindowingSystem system, void *data, bool depth) @@ -1671,19 +1691,19 @@ vector D3D12Replay::PixelHistory(vector events, R return vector(); } -ShaderDebugTrace D3D12Replay::DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, +ShaderDebugTrace D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { return ShaderDebugTrace(); } -ShaderDebugTrace D3D12Replay::DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample, +ShaderDebugTrace D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { return ShaderDebugTrace(); } -ShaderDebugTrace D3D12Replay::DebugThread(uint32_t eventID, const uint32_t groupid[3], +ShaderDebugTrace D3D12Replay::DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { return ShaderDebugTrace(); @@ -1828,7 +1848,7 @@ void D3D12_ProcessStructured(RDCFile *rdc, SDFile &output) ReplayStatus status = device.ReadLogInitialisation(rdc, true); if(status == ReplayStatus::Succeeded) - device.GetStructuredFile().swap(output); + device.GetStructuredFile().Swap(output); } static StructuredProcessRegistration D3D12ProcessRegistration(RDC_D3D12, &D3D12_ProcessStructured); diff --git a/renderdoc/driver/d3d12/d3d12_replay.h b/renderdoc/driver/d3d12/d3d12_replay.h index aa06c1e21..56c3dc5c7 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.h +++ b/renderdoc/driver/d3d12/d3d12_replay.h @@ -79,7 +79,7 @@ public: void ReplayLog(uint32_t endEventID, ReplayLogType replayType); const SDFile &GetStructuredFile(); - vector GetPassEvents(uint32_t eventID); + vector GetPassEvents(uint32_t eventId); vector GetSupportedWindowSystems() { @@ -98,7 +98,7 @@ public: bool IsOutputWindowVisible(uint64_t id); void FlipOutputWindow(uint64_t id); - void InitPostVSBuffers(uint32_t eventID); + void InitPostVSBuffers(uint32_t eventId); void InitPostVSBuffers(const vector &passEvents); ResourceId GetLiveID(ResourceId id); @@ -109,7 +109,7 @@ public: CompType typeHint, float minval, float maxval, bool channels[4], vector &histogram); - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData); void GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, @@ -133,7 +133,7 @@ public: ResourceId CreateProxyBuffer(const BufferDescription &templateBuf); void SetProxyBufferData(ResourceId bufid, byte *data, size_t dataSize); - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg); + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg); bool RenderTexture(TextureDisplay cfg); @@ -147,18 +147,18 @@ public: vector PixelHistory(vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint); - ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx, + 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, + ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive); - ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + 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 PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y); + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y); ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents); + uint32_t eventId, const vector &passEvents); void BuildCustomShader(string source, string entry, const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id, string *errors); diff --git a/renderdoc/driver/d3d12/d3d12_resources.cpp b/renderdoc/driver/d3d12/d3d12_resources.cpp index 1c1fb08e9..31f3f32d5 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.cpp +++ b/renderdoc/driver/d3d12/d3d12_resources.cpp @@ -501,5 +501,5 @@ void WrappedID3D12PipelineState::ShaderEntry::BuildReflection() "Mismatched vertex input count"); MakeShaderReflection(m_DXBCFile, &m_Details, &m_Mapping); - m_Details.ID = GetResourceID(); + m_Details.resourceId = GetResourceID(); } diff --git a/renderdoc/driver/dxgi/dxgi_wrapped.cpp b/renderdoc/driver/dxgi/dxgi_wrapped.cpp index de698d0a5..411c718fd 100644 --- a/renderdoc/driver/dxgi/dxgi_wrapped.cpp +++ b/renderdoc/driver/dxgi/dxgi_wrapped.cpp @@ -385,7 +385,7 @@ HRESULT WrappedIDXGISwapChain4::SetFullscreenState( WrappedIDXGIOutput5 *wrappedOutput = (WrappedIDXGIOutput5 *)pTarget; IDXGIOutput *unwrappedOutput = wrappedOutput ? wrappedOutput->GetReal() : NULL; - if(RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if(RenderDoc::Inst().GetCaptureOptions().allowFullscreen) return m_pReal->SetFullscreenState(Fullscreen, unwrappedOutput); return S_OK; @@ -516,7 +516,7 @@ HRESULT WrappedIDXGISwapChain4::Present( /* [in] */ UINT SyncInterval, /* [in] */ UINT Flags) { - if(!RenderDoc::Inst().GetCaptureOptions().AllowVSync) + if(!RenderDoc::Inst().GetCaptureOptions().allowVSync) { SyncInterval = 0; } @@ -529,7 +529,7 @@ HRESULT WrappedIDXGISwapChain4::Present( HRESULT WrappedIDXGISwapChain4::Present1(UINT SyncInterval, UINT Flags, const DXGI_PRESENT_PARAMETERS *pPresentParameters) { - if(!RenderDoc::Inst().GetCaptureOptions().AllowVSync) + if(!RenderDoc::Inst().GetCaptureOptions().allowVSync) { SyncInterval = 0; } @@ -948,7 +948,7 @@ HRESULT WrappedIDXGIFactory5::CreateSwapChain(IUnknown *pDevice, DXGI_SWAP_CHAIN if(wrapDevice) { - if(!RenderDoc::Inst().GetCaptureOptions().AllowFullscreen && pDesc) + if(!RenderDoc::Inst().GetCaptureOptions().allowFullscreen && pDesc) { pDesc->Windowed = TRUE; } @@ -981,7 +981,7 @@ HRESULT WrappedIDXGIFactory5::CreateSwapChainForHwnd( if(wrapDevice) { - if(!RenderDoc::Inst().GetCaptureOptions().AllowFullscreen && pFullscreenDesc) + if(!RenderDoc::Inst().GetCaptureOptions().allowFullscreen && pFullscreenDesc) { pFullscreenDesc = NULL; } @@ -1015,7 +1015,7 @@ HRESULT WrappedIDXGIFactory5::CreateSwapChainForCoreWindow(IUnknown *pDevice, IU WrappedIDXGIOutput5 *wrappedOutput = (WrappedIDXGIOutput5 *)pRestrictToOutput; IDXGIOutput *unwrappedOutput = wrappedOutput ? wrappedOutput->GetReal() : NULL; - if(!RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if(!RenderDoc::Inst().GetCaptureOptions().allowFullscreen) { RDCWARN("Impossible to disallow fullscreen on call to CreateSwapChainForCoreWindow"); } @@ -1055,7 +1055,7 @@ HRESULT WrappedIDXGIFactory5::CreateSwapChainForComposition(IUnknown *pDevice, WrappedIDXGIOutput5 *wrappedOutput = (WrappedIDXGIOutput5 *)pRestrictToOutput; IDXGIOutput *unwrappedOutput = wrappedOutput ? wrappedOutput->GetReal() : NULL; - if(!RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if(!RenderDoc::Inst().GetCaptureOptions().allowFullscreen) { RDCWARN("Impossible to disallow fullscreen on call to CreateSwapChainForComposition"); } diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index cdb28bcfd..e1c85d2ed 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -1066,7 +1066,7 @@ TextureFilter MakeFilter(GLenum minf, GLenum magf, bool shadowSampler, float max ret.magnify = (magf == eGL_LINEAR) ? FilterMode::Linear : FilterMode::Point; } - ret.func = shadowSampler ? FilterFunc::Comparison : FilterFunc::Normal; + ret.filter = shadowSampler ? FilterFunction::Comparison : FilterFunction::Normal; return ret; } @@ -1087,66 +1087,66 @@ ShaderStage MakeShaderStage(GLenum type) return ShaderStage::Count; } -CompareFunc MakeCompareFunc(GLenum func) +CompareFunction MakeCompareFunc(GLenum func) { switch(func) { - case GL_NEVER: return CompareFunc::Never; - case GL_LESS: return CompareFunc::Less; - case GL_EQUAL: return CompareFunc::Equal; - case GL_LEQUAL: return CompareFunc::LessEqual; - case GL_GREATER: return CompareFunc::Greater; - case GL_NOTEQUAL: return CompareFunc::NotEqual; - case GL_GEQUAL: return CompareFunc::GreaterEqual; - case GL_ALWAYS: return CompareFunc::AlwaysTrue; + case eGL_NEVER: return CompareFunction::Never; + case eGL_LESS: return CompareFunction::Less; + case eGL_EQUAL: return CompareFunction::Equal; + case eGL_LEQUAL: return CompareFunction::LessEqual; + case eGL_GREATER: return CompareFunction::Greater; + case eGL_NOTEQUAL: return CompareFunction::NotEqual; + case eGL_GEQUAL: return CompareFunction::GreaterEqual; + case eGL_ALWAYS: return CompareFunction::AlwaysTrue; default: break; } - return CompareFunc::AlwaysTrue; + return CompareFunction::AlwaysTrue; } -StencilOp MakeStencilOp(GLenum op) +StencilOperation MakeStencilOp(GLenum op) { switch(op) { - case eGL_KEEP: return StencilOp::Keep; - case eGL_ZERO: return StencilOp::Zero; - case eGL_REPLACE: return StencilOp::Replace; - case eGL_INCR: return StencilOp::IncSat; - case eGL_DECR: return StencilOp::DecSat; - case eGL_INVERT: return StencilOp::Invert; - case eGL_INCR_WRAP: return StencilOp::IncWrap; - case eGL_DECR_WRAP: return StencilOp::DecWrap; + case eGL_KEEP: return StencilOperation::Keep; + case eGL_ZERO: return StencilOperation::Zero; + case eGL_REPLACE: return StencilOperation::Replace; + case eGL_INCR: return StencilOperation::IncSat; + case eGL_DECR: return StencilOperation::DecSat; + case eGL_INVERT: return StencilOperation::Invert; + case eGL_INCR_WRAP: return StencilOperation::IncWrap; + case eGL_DECR_WRAP: return StencilOperation::DecWrap; default: break; } - return StencilOp::Keep; + return StencilOperation::Keep; } -LogicOp MakeLogicOp(GLenum op) +LogicOperation MakeLogicOp(GLenum op) { switch(op) { - case GL_CLEAR: return LogicOp::Clear; - case GL_AND: return LogicOp::And; - case GL_AND_REVERSE: return LogicOp::AndReverse; - case GL_COPY: return LogicOp::Copy; - case GL_AND_INVERTED: return LogicOp::AndInverted; - case GL_NOOP: return LogicOp::NoOp; - case GL_XOR: return LogicOp::Xor; - case GL_OR: return LogicOp::Or; - case GL_NOR: return LogicOp::Nor; - case GL_EQUIV: return LogicOp::Equivalent; - case GL_INVERT: return LogicOp::Invert; - case GL_OR_REVERSE: return LogicOp::OrReverse; - case GL_COPY_INVERTED: return LogicOp::CopyInverted; - case GL_OR_INVERTED: return LogicOp::OrInverted; - case GL_NAND: return LogicOp::Nand; - case GL_SET: return LogicOp::Set; + case eGL_CLEAR: return LogicOperation::Clear; + case eGL_AND: return LogicOperation::And; + case eGL_AND_REVERSE: return LogicOperation::AndReverse; + case eGL_COPY: return LogicOperation::Copy; + case eGL_AND_INVERTED: return LogicOperation::AndInverted; + case eGL_NOOP: return LogicOperation::NoOp; + case eGL_XOR: return LogicOperation::Xor; + case eGL_OR: return LogicOperation::Or; + case eGL_NOR: return LogicOperation::Nor; + case eGL_EQUIV: return LogicOperation::Equivalent; + case eGL_INVERT: return LogicOperation::Invert; + case eGL_OR_REVERSE: return LogicOperation::OrReverse; + case eGL_COPY_INVERTED: return LogicOperation::CopyInverted; + case eGL_OR_INVERTED: return LogicOperation::OrInverted; + case eGL_NAND: return LogicOperation::Nand; + case eGL_SET: return LogicOperation::Set; default: break; } - return LogicOp::NoOp; + return LogicOperation::NoOp; } BlendMultiplier MakeBlendMultiplier(GLenum blend) @@ -1178,19 +1178,19 @@ BlendMultiplier MakeBlendMultiplier(GLenum blend) return BlendMultiplier::One; } -BlendOp MakeBlendOp(GLenum op) +BlendOperation MakeBlendOp(GLenum op) { switch(op) { - case eGL_FUNC_ADD: return BlendOp::Add; - case eGL_FUNC_SUBTRACT: return BlendOp::Subtract; - case eGL_FUNC_REVERSE_SUBTRACT: return BlendOp::ReversedSubtract; - case eGL_MIN: return BlendOp::Minimum; - case eGL_MAX: return BlendOp::Maximum; + case eGL_FUNC_ADD: return BlendOperation::Add; + case eGL_FUNC_SUBTRACT: return BlendOperation::Subtract; + case eGL_FUNC_REVERSE_SUBTRACT: return BlendOperation::ReversedSubtract; + case eGL_MIN: return BlendOperation::Minimum; + case eGL_MAX: return BlendOperation::Maximum; default: break; } - return BlendOp::Add; + return BlendOperation::Add; } const char *BlendString(GLenum blendenum) diff --git a/renderdoc/driver/gl/gl_common.h b/renderdoc/driver/gl/gl_common.h index 2147bd43e..780ee7b96 100644 --- a/renderdoc/driver/gl/gl_common.h +++ b/renderdoc/driver/gl/gl_common.h @@ -304,11 +304,11 @@ BufferCategory MakeBufferCategory(GLenum bufferTarget); AddressMode MakeAddressMode(GLenum addr); TextureFilter MakeFilter(GLenum minf, GLenum magf, bool shadowSampler, float maxAniso); ShaderStage MakeShaderStage(GLenum type); -CompareFunc MakeCompareFunc(GLenum func); -StencilOp MakeStencilOp(GLenum op); -LogicOp MakeLogicOp(GLenum op); +CompareFunction MakeCompareFunc(GLenum func); +StencilOperation MakeStencilOp(GLenum op); +LogicOperation MakeLogicOp(GLenum op); BlendMultiplier MakeBlendMultiplier(GLenum blend); -BlendOp MakeBlendOp(GLenum op); +BlendOperation MakeBlendOp(GLenum op); const char *BlendString(GLenum blendenum); const char *SamplerString(GLenum smpenum); diff --git a/renderdoc/driver/gl/gl_counters.cpp b/renderdoc/driver/gl/gl_counters.cpp index c48f550b2..7e000aedb 100644 --- a/renderdoc/driver/gl/gl_counters.cpp +++ b/renderdoc/driver/gl/gl_counters.cpp @@ -67,7 +67,7 @@ CounterDescription GLReplay::DescribeCounter(GPUCounter counterID) { CounterDescription desc = {}; - desc.counterID = counterID; + desc.counter = counterID; // FFBA5548-FBF8-405D-BA18-F0329DA370A0 desc.uuid.words[0] = 0xFFBA5548; desc.uuid.words[1] = 0xFBF8405D; @@ -183,7 +183,7 @@ CounterDescription GLReplay::DescribeCounter(GPUCounter counterID) struct GPUQueries { GLuint obj[ENUM_ARRAY_SIZE(GPUCounter)]; - uint32_t eventID; + uint32_t eventId; }; struct GLCounterContext @@ -229,7 +229,7 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &draw ctx.queries.push_back(GPUQueries()); queries = &ctx.queries.back(); - queries->eventID = d.eventID; + queries->eventId = d.eventId; for(auto q : indices()) queries->obj[q] = 0; @@ -241,7 +241,7 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &draw } } - m_pDriver->ReplayLog(ctx.eventStart, d.eventID, eReplay_WithoutDraw); + m_pDriver->ReplayLog(ctx.eventStart, d.eventId, eReplay_WithoutDraw); // Reverse order so that Timer counter is queried the last. for(int32_t q = uint32_t(GPUCounter::Count) - 1; q >= 0; q--) @@ -255,13 +255,13 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &draw } } - m_pDriver->ReplayLog(ctx.eventStart, d.eventID, eReplay_OnlyDraw); + m_pDriver->ReplayLog(ctx.eventStart, d.eventId, eReplay_OnlyDraw); for(auto q : indices()) if(queries->obj[q]) m_pDriver->glEndQuery(glCounters[q]); - ctx.eventStart = d.eventID + 1; + ctx.eventStart = d.eventId + 1; } } @@ -310,13 +310,13 @@ vector GLReplay::FetchCounters(const vector &counters if(counters[c] == GPUCounter::EventGPUDuration) { - ret.push_back(CounterResult(ctx.queries[i].eventID, GPUCounter::EventGPUDuration, duration)); + ret.push_back(CounterResult(ctx.queries[i].eventId, GPUCounter::EventGPUDuration, duration)); } else - ret.push_back(CounterResult(ctx.queries[i].eventID, counters[c], data)); + ret.push_back(CounterResult(ctx.queries[i].eventId, counters[c], data)); } else - ret.push_back(CounterResult(ctx.queries[i].eventID, counters[c], (uint64_t)-1)); + ret.push_back(CounterResult(ctx.queries[i].eventId, counters[c], (uint64_t)-1)); } } diff --git a/renderdoc/driver/gl/gl_debug.cpp b/renderdoc/driver/gl/gl_debug.cpp index d9d26f854..4e17692b4 100644 --- a/renderdoc/driver/gl/gl_debug.cpp +++ b/renderdoc/driver/gl/gl_debug.cpp @@ -1165,7 +1165,7 @@ bool GLReplay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, return true; } -uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) +uint32_t GLReplay::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { WrappedOpenGL &gl = *m_pDriver; @@ -1254,10 +1254,10 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t cdata->rayPos = rayPos; cdata->rayDir = rayDir; - cdata->use_indices = cfg.position.idxByteWidth ? 1U : 0U; - cdata->numVerts = cfg.position.numVerts; + cdata->use_indices = cfg.position.indexByteStride ? 1U : 0U; + cdata->numVerts = cfg.position.numIndices; bool isTriangleMesh = true; - switch(cfg.position.topo) + switch(cfg.position.topology) { case Topology::TriangleList: { @@ -1301,8 +1301,8 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t GLuint ib = 0; - if(cfg.position.idxByteWidth && cfg.position.idxbuf != ResourceId()) - ib = m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.idxbuf).name; + if(cfg.position.indexByteStride && cfg.position.indexResourceId != ResourceId()) + ib = m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.indexResourceId).name; // We copy into our own buffers to promote to the target type (uint32) that the // shader expects. Most IBs will be 16-bit indices, most VBs will not be float4. @@ -1310,83 +1310,83 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t if(ib) { // resize up on demand - if(DebugData.pickIBBuf == 0 || DebugData.pickIBSize < cfg.position.numVerts * sizeof(uint32_t)) + if(DebugData.pickIBBuf == 0 || DebugData.pickIBSize < cfg.position.numIndices * sizeof(uint32_t)) { gl.glDeleteBuffers(1, &DebugData.pickIBBuf); gl.glGenBuffers(1, &DebugData.pickIBBuf); gl.glBindBuffer(eGL_SHADER_STORAGE_BUFFER, DebugData.pickIBBuf); - gl.glNamedBufferDataEXT(DebugData.pickIBBuf, cfg.position.numVerts * sizeof(uint32_t), NULL, + gl.glNamedBufferDataEXT(DebugData.pickIBBuf, cfg.position.numIndices * sizeof(uint32_t), NULL, eGL_STREAM_DRAW); - DebugData.pickIBSize = cfg.position.numVerts * sizeof(uint32_t); + DebugData.pickIBSize = cfg.position.numIndices * sizeof(uint32_t); } - byte *idxs = new byte[cfg.position.numVerts * cfg.position.idxByteWidth]; - memset(idxs, 0, cfg.position.numVerts * cfg.position.idxByteWidth); + byte *idxs = new byte[cfg.position.numIndices * cfg.position.indexByteStride]; + memset(idxs, 0, cfg.position.numIndices * cfg.position.indexByteStride); uint32_t *outidxs = NULL; - if(cfg.position.idxByteWidth < 4) - outidxs = new uint32_t[cfg.position.numVerts]; + if(cfg.position.indexByteStride < 4) + outidxs = new uint32_t[cfg.position.numIndices]; gl.glBindBuffer(eGL_COPY_READ_BUFFER, ib); GLint bufsize = 0; gl.glGetBufferParameteriv(eGL_COPY_READ_BUFFER, eGL_BUFFER_SIZE, &bufsize); - gl.glGetBufferSubData(eGL_COPY_READ_BUFFER, (GLintptr)cfg.position.idxoffs, - RDCMIN(uint32_t(bufsize) - uint32_t(cfg.position.idxoffs), - cfg.position.numVerts * cfg.position.idxByteWidth), + gl.glGetBufferSubData(eGL_COPY_READ_BUFFER, (GLintptr)cfg.position.indexByteOffset, + RDCMIN(uint32_t(bufsize) - uint32_t(cfg.position.indexByteOffset), + cfg.position.numIndices * cfg.position.indexByteStride), idxs); uint16_t *idxs16 = (uint16_t *)idxs; - if(cfg.position.idxByteWidth == 1) + if(cfg.position.indexByteStride == 1) { - for(uint32_t i = 0; i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < cfg.position.numIndices; i++) outidxs[i] = idxs[i]; gl.glBindBuffer(eGL_SHADER_STORAGE_BUFFER, DebugData.pickIBBuf); - gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numVerts * sizeof(uint32_t), + gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numIndices * sizeof(uint32_t), outidxs); } - else if(cfg.position.idxByteWidth == 2) + else if(cfg.position.indexByteStride == 2) { - for(uint32_t i = 0; i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < cfg.position.numIndices; i++) outidxs[i] = idxs16[i]; gl.glBindBuffer(eGL_SHADER_STORAGE_BUFFER, DebugData.pickIBBuf); - gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numVerts * sizeof(uint32_t), + gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numIndices * sizeof(uint32_t), outidxs); } else { gl.glBindBuffer(eGL_SHADER_STORAGE_BUFFER, DebugData.pickIBBuf); - gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numVerts * sizeof(uint32_t), + gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numIndices * sizeof(uint32_t), idxs); } SAFE_DELETE_ARRAY(outidxs); } - if(DebugData.pickVBBuf == 0 || DebugData.pickVBSize < cfg.position.numVerts * sizeof(Vec4f)) + if(DebugData.pickVBBuf == 0 || DebugData.pickVBSize < cfg.position.numIndices * sizeof(Vec4f)) { gl.glDeleteBuffers(1, &DebugData.pickVBBuf); gl.glGenBuffers(1, &DebugData.pickVBBuf); gl.glBindBuffer(eGL_SHADER_STORAGE_BUFFER, DebugData.pickVBBuf); - gl.glNamedBufferDataEXT(DebugData.pickVBBuf, cfg.position.numVerts * sizeof(Vec4f), NULL, + gl.glNamedBufferDataEXT(DebugData.pickVBBuf, cfg.position.numIndices * sizeof(Vec4f), NULL, eGL_DYNAMIC_DRAW); - DebugData.pickVBSize = cfg.position.numVerts * sizeof(Vec4f); + DebugData.pickVBSize = cfg.position.numIndices * sizeof(Vec4f); } // unpack and linearise the data { - FloatVector *vbData = new FloatVector[cfg.position.numVerts]; + FloatVector *vbData = new FloatVector[cfg.position.numIndices]; bytebuf oldData; - GetBufferData(cfg.position.buf, cfg.position.offset, 0, oldData); + GetBufferData(cfg.position.vertexResourceId, cfg.position.vertexByteOffset, 0, oldData); byte *data = &oldData[0]; byte *dataEnd = data + oldData.size(); @@ -1397,7 +1397,7 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t if(cfg.position.baseVertex < 0) idxclamp = uint32_t(-cfg.position.baseVertex); - for(uint32_t i = 0; i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < cfg.position.numIndices; i++) { uint32_t idx = i; @@ -1413,7 +1413,7 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t } gl.glBindBuffer(eGL_SHADER_STORAGE_BUFFER, DebugData.pickVBBuf); - gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numVerts * sizeof(Vec4f), vbData); + gl.glBufferSubData(eGL_SHADER_STORAGE_BUFFER, 0, cfg.position.numIndices * sizeof(Vec4f), vbData); delete[] vbData; } @@ -1424,11 +1424,11 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t gl.glBindBufferBase(eGL_SHADER_STORAGE_BUFFER, 1, DebugData.pickVBBuf); gl.glBindBufferRange( - eGL_SHADER_STORAGE_BUFFER, 2, DebugData.pickIBBuf, (GLintptr)cfg.position.idxoffs, - (GLsizeiptr)(cfg.position.idxoffs + sizeof(uint32_t) * cfg.position.numVerts)); + eGL_SHADER_STORAGE_BUFFER, 2, DebugData.pickIBBuf, (GLintptr)cfg.position.indexByteOffset, + (GLsizeiptr)(cfg.position.indexByteOffset + sizeof(uint32_t) * cfg.position.numIndices)); gl.glBindBufferBase(eGL_SHADER_STORAGE_BUFFER, 3, DebugData.pickResultBuf); - gl.glDispatchCompute(GLuint((cfg.position.numVerts) / 128 + 1), 1, 1); + gl.glDispatchCompute(GLuint((cfg.position.numIndices) / 128 + 1), 1, 1); gl.glMemoryBarrier(GL_ATOMIC_COUNTER_BARRIER_BIT | GL_SHADER_STORAGE_BARRIER_BIT); uint32_t numResults = 0; @@ -1532,22 +1532,22 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sl TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.FlipY = false; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.flipY = false; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = true; texDisplay.mip = mip; texDisplay.sampleIdx = sample; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = sliceFace; - texDisplay.rangemin = 0.0f; - texDisplay.rangemax = 1.0f; + texDisplay.rangeMin = 0.0f; + texDisplay.rangeMax = 1.0f; texDisplay.scale = 1.0f; - texDisplay.texid = texture; + texDisplay.resourceId = texture; texDisplay.typeHint = typeHint; - texDisplay.rawoutput = true; - texDisplay.offx = -float(x); - texDisplay.offy = -float(y); + texDisplay.rawOutput = true; + texDisplay.xOffset = -float(x); + texDisplay.yOffset = -float(y); RenderTextureInternal(texDisplay, eTexDisplay_MipShift); @@ -1555,7 +1555,7 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sl if(!HasExt[ARB_gpu_shader5]) { - auto &texDetails = m_pDriver->m_Textures[texDisplay.texid]; + auto &texDetails = m_pDriver->m_Textures[texDisplay.resourceId]; if(IsSIntFormat(texDetails.internalFormat)) { @@ -1584,7 +1584,7 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sl texDetails.internalFormat == eGL_DEPTH32F_STENCIL8 || texDetails.internalFormat == eGL_STENCIL_INDEX8) { - texDisplay.Red = texDisplay.Blue = texDisplay.Alpha = false; + texDisplay.red = texDisplay.blue = texDisplay.alpha = false; RenderTextureInternal(texDisplay, eTexDisplay_MipShift); @@ -1729,7 +1729,7 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) WrappedOpenGL &gl = *m_pDriver; - auto &texDetails = m_pDriver->m_Textures[cfg.texid]; + auto &texDetails = m_pDriver->m_Textures[cfg.resourceId]; if(texDetails.internalFormat == eGL_NONE) return false; @@ -1801,22 +1801,22 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) // stencil-only, make sure we display it as such if(texDetails.internalFormat == eGL_STENCIL_INDEX8) { - cfg.Red = false; - cfg.Green = true; - cfg.Blue = false; - cfg.Alpha = false; + cfg.red = false; + cfg.green = true; + cfg.blue = false; + cfg.alpha = false; } // depth-only, make sure we display it as such if(GetBaseFormat(texDetails.internalFormat) == eGL_DEPTH_COMPONENT) { - cfg.Red = true; - cfg.Green = false; - cfg.Blue = false; - cfg.Alpha = false; + cfg.red = true; + cfg.green = false; + cfg.blue = false; + cfg.alpha = false; } - if(!cfg.Red && cfg.Green) + if(!cfg.red && cfg.green) { dsTexMode = eGL_STENCIL_INDEX; @@ -1835,8 +1835,8 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) case eGL_STENCIL_INDEX8: rangeScale = 255.0f; break; case eGL_STENCIL_INDEX16: rangeScale = 65535.0f; break; } - cfg.rangemin *= rangeScale; - cfg.rangemax *= rangeScale; + cfg.rangeMin *= rangeScale; + cfg.rangeMax *= rangeScale; } else dsTexMode = eGL_DEPTH_COMPONENT; @@ -1857,9 +1857,10 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) int numMips = GetNumMips(gl.m_Real, target, texname, texDetails.width, texDetails.height, texDetails.depth); - if(cfg.CustomShader != ResourceId() && gl.GetResourceManager()->HasCurrentResource(cfg.CustomShader)) + if(cfg.customShaderId != ResourceId() && + gl.GetResourceManager()->HasCurrentResource(cfg.customShaderId)) { - GLuint customProg = gl.GetResourceManager()->GetCurrentResource(cfg.CustomShader).name; + GLuint customProg = gl.GetResourceManager()->GetCurrentResource(cfg.customShaderId).name; gl.glUseProgramStages(DebugData.texDisplayPipe, eGL_FRAGMENT_SHADER_BIT, customProg); GLint loc = -1; @@ -1908,13 +1909,13 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) GLint maxlevel[4] = {-1}; GLint clampmaxlevel[4] = {}; - if(cfg.texid != DebugData.CustomShaderTexID) + if(cfg.resourceId != DebugData.CustomShaderTexID) clampmaxlevel[0] = GLint(numMips - 1); gl.glGetTextureParameterivEXT(texname, target, eGL_TEXTURE_MAX_LEVEL, maxlevel); // need to ensure texture is mipmap complete by clamping TEXTURE_MAX_LEVEL. - if(clampmaxlevel[0] != maxlevel[0] && cfg.texid != DebugData.CustomShaderTexID) + if(clampmaxlevel[0] != maxlevel[0] && cfg.resourceId != DebugData.CustomShaderTexID) { gl.glTextureParameterivEXT(texname, target, eGL_TEXTURE_MAX_LEVEL, clampmaxlevel); } @@ -1944,8 +1945,8 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) (TexDisplayUBOData *)gl.glMapBufferRange(eGL_UNIFORM_BUFFER, 0, sizeof(TexDisplayUBOData), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); - float x = cfg.offx; - float y = cfg.offy; + float x = cfg.xOffset; + float y = cfg.yOffset; ubo->Position.x = x; ubo->Position.y = y; @@ -1970,19 +1971,19 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) } } - ubo->HDRMul = cfg.HDRMul; + ubo->HDRMul = cfg.hdrMultiplier; - ubo->FlipY = cfg.FlipY ? 1 : 0; + ubo->FlipY = cfg.flipY ? 1 : 0; - if(cfg.rangemax <= cfg.rangemin) - cfg.rangemax += 0.00001f; + if(cfg.rangeMax <= cfg.rangeMin) + cfg.rangeMax += 0.00001f; if(dsTexMode == eGL_NONE) { - ubo->Channels.x = cfg.Red ? 1.0f : 0.0f; - ubo->Channels.y = cfg.Green ? 1.0f : 0.0f; - ubo->Channels.z = cfg.Blue ? 1.0f : 0.0f; - ubo->Channels.w = cfg.Alpha ? 1.0f : 0.0f; + ubo->Channels.x = cfg.red ? 1.0f : 0.0f; + ubo->Channels.y = cfg.green ? 1.0f : 0.0f; + ubo->Channels.z = cfg.blue ? 1.0f : 0.0f; + ubo->Channels.w = cfg.alpha ? 1.0f : 0.0f; } else { @@ -1993,8 +1994,8 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) ubo->Channels.w = 0.0f; } - ubo->RangeMinimum = cfg.rangemin; - ubo->InverseRangeSize = 1.0f / (cfg.rangemax - cfg.rangemin); + ubo->RangeMinimum = cfg.rangeMin; + ubo->InverseRangeSize = 1.0f / (cfg.rangeMax - cfg.rangeMin); ubo->MipLevel = (int)cfg.mip; if(texDetails.curType != eGL_TEXTURE_3D) @@ -2013,7 +2014,7 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) if(!IsSRGBFormat(texDetails.internalFormat) && cfg.linearDisplayAsGamma) ubo->OutputDisplayFormat |= TEXDISPLAY_GAMMA_CURVE; - ubo->RawOutput = cfg.rawoutput ? 1 : 0; + ubo->RawOutput = cfg.rawOutput ? 1 : 0; ubo->TextureResolutionPS.x = float(RDCMAX(1, tex_x >> cfg.mip)); ubo->TextureResolutionPS.y = float(RDCMAX(1, tex_y >> cfg.mip)); @@ -2035,7 +2036,7 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, int flags) gl.glUnmapBuffer(eGL_UNIFORM_BUFFER); - if(cfg.rawoutput || !blendAlpha) + if(cfg.rawOutput || !blendAlpha) { gl.glDisable(eGL_BLEND); } @@ -2219,7 +2220,7 @@ void GLReplay::SetupOverlayPipeline(GLuint Program, GLuint Pipeline, GLuint frag } ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { WrappedOpenGL &gl = *m_pDriver; @@ -2338,7 +2339,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve float colVal[] = {0.8f, 0.1f, 0.8f, 1.0f}; gl.glProgramUniform4fv(DebugData.fixedcolFSProg, colLoc, 1, colVal); - ReplayLog(eventID, eReplay_OnlyDraw); + ReplayLog(eventId, eReplay_OnlyDraw); } else if(overlay == DebugOverlay::Wireframe) { @@ -2352,7 +2353,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve if(!IsGLES) gl.glPolygonMode(eGL_FRONT_AND_BACK, eGL_LINE); - ReplayLog(eventID, eReplay_OnlyDraw); + ReplayLog(eventId, eReplay_OnlyDraw); } else if(overlay == DebugOverlay::ViewportScissor) { @@ -2420,7 +2421,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve float red[] = {1.0f, 0.0f, 0.0f, 1.0f}; gl.glProgramUniform4fv(DebugData.fixedcolFSProg, colLoc, 1, red); - ReplayLog(eventID, eReplay_OnlyDraw); + ReplayLog(eventId, eReplay_OnlyDraw); GLuint curDepth = 0, curStencil = 0; @@ -2628,7 +2629,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve DebugData.overlayTexWidth, DebugData.overlayTexHeight, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, eGL_NEAREST); - ReplayLog(eventID, eReplay_OnlyDraw); + ReplayLog(eventId, eReplay_OnlyDraw); // unset depth/stencil textures from overlay FBO and delete temp depth/stencil if(curDepth != 0 && curDepth == curStencil) @@ -2653,7 +2654,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve GLint colLoc = gl.glGetUniformLocation(DebugData.fixedcolFSProg, "RENDERDOC_Fixed_Color"); gl.glProgramUniform4fv(DebugData.fixedcolFSProg, colLoc, 1, col); - ReplayLog(eventID, eReplay_OnlyDraw); + ReplayLog(eventId, eReplay_OnlyDraw); // only enable cull face if it was enabled originally (otherwise // we just render green over the exact same area, so it shows up "passing") @@ -2665,7 +2666,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve gl.glProgramUniform4fv(DebugData.fixedcolFSProg, colLoc, 1, col); - ReplayLog(eventID, eReplay_OnlyDraw); + ReplayLog(eventId, eReplay_OnlyDraw); } else if(overlay == DebugOverlay::ClearBeforeDraw || overlay == DebugOverlay::ClearBeforePass) { @@ -2677,7 +2678,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve if(overlay == DebugOverlay::ClearBeforeDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty()) { @@ -2741,7 +2742,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve if(overlay == DebugOverlay::TriangleSizeDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty() && DebugData.trisizeProg) { @@ -2911,125 +2912,130 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) { MeshFormat postvs = GetPostVSBuffers(events[i], inst, MeshDataStage::GSOut); - if(postvs.buf == ResourceId()) + if(postvs.vertexResourceId == ResourceId()) postvs = GetPostVSBuffers(events[i], inst, MeshDataStage::VSOut); - if(postvs.buf != ResourceId()) + if(postvs.vertexResourceId != ResourceId()) { - GLenum topo = MakeGLPrimitiveTopology(postvs.topo); + GLenum topo = MakeGLPrimitiveTopology(postvs.topology); gl.glBindVertexArray(tempVAO); { - if(postvs.fmt.Special()) + if(postvs.format.Special()) { - if(postvs.fmt.type == ResourceFormatType::R10G10B10A2) + if(postvs.format.type == ResourceFormatType::R10G10B10A2) { - if(postvs.fmt.compType == CompType::UInt) + if(postvs.format.compType == CompType::UInt) gl.glVertexAttribIFormat(0, 4, eGL_UNSIGNED_INT_2_10_10_10_REV, 0); - if(postvs.fmt.compType == CompType::SInt) + if(postvs.format.compType == CompType::SInt) gl.glVertexAttribIFormat(0, 4, eGL_INT_2_10_10_10_REV, 0); } - else if(postvs.fmt.type == ResourceFormatType::R11G11B10) + else if(postvs.format.type == ResourceFormatType::R11G11B10) { gl.glVertexAttribFormat(0, 4, eGL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0); } else { - RDCWARN("Unsupported vertex attribute format: %x", postvs.fmt.type); + RDCWARN("Unsupported vertex attribute format: %x", postvs.format.type); } } - else if(postvs.fmt.compType == CompType::Float || - postvs.fmt.compType == CompType::UNorm || - postvs.fmt.compType == CompType::SNorm) + else if(postvs.format.compType == CompType::Float || + postvs.format.compType == CompType::UNorm || + postvs.format.compType == CompType::SNorm) { GLenum fmttype = eGL_UNSIGNED_INT; - if(postvs.fmt.compByteWidth == 4) + if(postvs.format.compByteWidth == 4) { - if(postvs.fmt.compType == CompType::Float) + if(postvs.format.compType == CompType::Float) fmttype = eGL_FLOAT; - else if(postvs.fmt.compType == CompType::UNorm) + else if(postvs.format.compType == CompType::UNorm) fmttype = eGL_UNSIGNED_INT; - else if(postvs.fmt.compType == CompType::SNorm) + else if(postvs.format.compType == CompType::SNorm) fmttype = eGL_INT; } - else if(postvs.fmt.compByteWidth == 2) + else if(postvs.format.compByteWidth == 2) { - if(postvs.fmt.compType == CompType::Float) + if(postvs.format.compType == CompType::Float) fmttype = eGL_HALF_FLOAT; - else if(postvs.fmt.compType == CompType::UNorm) + else if(postvs.format.compType == CompType::UNorm) fmttype = eGL_UNSIGNED_SHORT; - else if(postvs.fmt.compType == CompType::SNorm) + else if(postvs.format.compType == CompType::SNorm) fmttype = eGL_SHORT; } - else if(postvs.fmt.compByteWidth == 1) + else if(postvs.format.compByteWidth == 1) { - if(postvs.fmt.compType == CompType::UNorm) + if(postvs.format.compType == CompType::UNorm) fmttype = eGL_UNSIGNED_BYTE; - else if(postvs.fmt.compType == CompType::SNorm) + else if(postvs.format.compType == CompType::SNorm) fmttype = eGL_BYTE; } - gl.glVertexAttribFormat(0, postvs.fmt.compCount, fmttype, - postvs.fmt.compType != CompType::Float, 0); + gl.glVertexAttribFormat(0, postvs.format.compCount, fmttype, + postvs.format.compType != CompType::Float, 0); } - else if(postvs.fmt.compType == CompType::UInt || postvs.fmt.compType == CompType::SInt) + else if(postvs.format.compType == CompType::UInt || + postvs.format.compType == CompType::SInt) { GLenum fmttype = eGL_UNSIGNED_INT; - if(postvs.fmt.compByteWidth == 4) + if(postvs.format.compByteWidth == 4) { - if(postvs.fmt.compType == CompType::UInt) + if(postvs.format.compType == CompType::UInt) fmttype = eGL_UNSIGNED_INT; - else if(postvs.fmt.compType == CompType::SInt) + else if(postvs.format.compType == CompType::SInt) fmttype = eGL_INT; } - else if(postvs.fmt.compByteWidth == 2) + else if(postvs.format.compByteWidth == 2) { - if(postvs.fmt.compType == CompType::UInt) + if(postvs.format.compType == CompType::UInt) fmttype = eGL_UNSIGNED_SHORT; - else if(postvs.fmt.compType == CompType::SInt) + else if(postvs.format.compType == CompType::SInt) fmttype = eGL_SHORT; } - else if(postvs.fmt.compByteWidth == 1) + else if(postvs.format.compByteWidth == 1) { - if(postvs.fmt.compType == CompType::UInt) + if(postvs.format.compType == CompType::UInt) fmttype = eGL_UNSIGNED_BYTE; - else if(postvs.fmt.compType == CompType::SInt) + else if(postvs.format.compType == CompType::SInt) fmttype = eGL_BYTE; } - gl.glVertexAttribIFormat(0, postvs.fmt.compCount, fmttype, 0); + gl.glVertexAttribIFormat(0, postvs.format.compCount, fmttype, 0); } - else if(postvs.fmt.compType == CompType::Double) + else if(postvs.format.compType == CompType::Double) { - gl.glVertexAttribLFormat(0, postvs.fmt.compCount, eGL_DOUBLE, 0); + gl.glVertexAttribLFormat(0, postvs.format.compCount, eGL_DOUBLE, 0); } - GLuint vb = m_pDriver->GetResourceManager()->GetCurrentResource(postvs.buf).name; - gl.glBindVertexBuffer(0, vb, (GLintptr)postvs.offset, postvs.stride); + GLuint vb = + m_pDriver->GetResourceManager()->GetCurrentResource(postvs.vertexResourceId).name; + gl.glBindVertexBuffer(0, vb, (GLintptr)postvs.vertexByteOffset, + postvs.vertexByteStride); } gl.glEnableVertexAttribArray(0); gl.glDisableVertexAttribArray(1); - if(postvs.idxByteWidth) + if(postvs.indexByteStride) { GLenum idxtype = eGL_UNSIGNED_BYTE; - if(postvs.idxByteWidth == 2) + if(postvs.indexByteStride == 2) idxtype = eGL_UNSIGNED_SHORT; - else if(postvs.idxByteWidth == 4) + else if(postvs.indexByteStride == 4) idxtype = eGL_UNSIGNED_INT; - GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(postvs.idxbuf).name; + GLuint ib = + m_pDriver->GetResourceManager()->GetCurrentResource(postvs.indexResourceId).name; gl.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, ib); - gl.glDrawElementsBaseVertex(topo, postvs.numVerts, idxtype, - (const void *)uintptr_t(postvs.idxoffs), postvs.baseVertex); + gl.glDrawElementsBaseVertex(topo, postvs.numIndices, idxtype, + (const void *)uintptr_t(postvs.indexByteOffset), + postvs.baseVertex); } else { - gl.glDrawArrays(topo, 0, postvs.numVerts); + gl.glDrawArrays(topo, 0, postvs.numIndices); } } } @@ -3075,7 +3081,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve gl.glDeleteVertexArrays(1, &tempVAO); if(overlay == DebugOverlay::TriangleSizePass) - ReplayLog(eventID, eReplay_WithoutDraw); + ReplayLog(eventId, eReplay_WithoutDraw); } } else if(overlay == DebugOverlay::QuadOverdrawDraw || overlay == DebugOverlay::QuadOverdrawPass) @@ -3092,7 +3098,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve if(overlay == DebugOverlay::QuadOverdrawDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); if(!events.empty()) { @@ -3313,7 +3319,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve gl.glDeleteTextures(3, quadtexs); if(overlay == DebugOverlay::QuadOverdrawPass) - ReplayLog(eventID, eReplay_WithoutDraw); + ReplayLog(eventId, eReplay_WithoutDraw); } } } @@ -3344,9 +3350,9 @@ void GLReplay::ClearPostVSCache() m_PostVSData.clear(); } -void GLReplay::InitPostVSBuffers(uint32_t eventID) +void GLReplay::InitPostVSBuffers(uint32_t eventId) { - if(m_PostVSData.find(eventID) != m_PostVSData.end()) + if(m_PostVSData.find(eventId) != m_PostVSData.end()) return; MakeCurrentReplayContext(&m_ReplayCtx); @@ -3453,16 +3459,16 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) { // no vertex shader bound (no vertex processing - compute only program // or no program bound, for a clear etc) - m_PostVSData[eventID] = GLPostVSData(); + m_PostVSData[eventId] = GLPostVSData(); return; } - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventID); + const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); if(drawcall->numIndices == 0) { // draw is 0 length, nothing to do - m_PostVSData[eventID] = GLPostVSData(); + m_PostVSData[eventId] = GLPostVSData(); return; } @@ -3479,7 +3485,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) uint32_t stride = 0; int32_t posidx = -1; - for(const SigParameter &sig : vsRefl->OutputSig) + for(const SigParameter &sig : vsRefl->outputSignature) { const char *name = sig.varName.c_str(); size_t len = sig.varName.size(); @@ -3639,7 +3645,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) char buffer[1025] = {0}; gl.glGetProgramInfoLog(vsProg, 1024, NULL, buffer); RDCERR("Failed to fix-up. Link error making xfb vs program: %s", buffer); - m_PostVSData[eventID] = GLPostVSData(); + m_PostVSData[eventId] = GLPostVSData(); return; } @@ -3936,7 +3942,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) else gl.glEnable(eGL_RASTERIZER_DISCARD); - m_PostVSData[eventID] = GLPostVSData(); + m_PostVSData[eventId] = GLPostVSData(); return; } @@ -4010,30 +4016,30 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) gl.glUnmapNamedBufferEXT(DebugData.feedbackBuffer); // store everything out to the PostVS data cache - m_PostVSData[eventID].vsin.topo = drawcall->topology; - m_PostVSData[eventID].vsout.buf = vsoutBuffer; - m_PostVSData[eventID].vsout.vertStride = stride; - m_PostVSData[eventID].vsout.nearPlane = nearp; - m_PostVSData[eventID].vsout.farPlane = farp; + m_PostVSData[eventId].vsin.topo = drawcall->topology; + m_PostVSData[eventId].vsout.buf = vsoutBuffer; + m_PostVSData[eventId].vsout.vertStride = stride; + m_PostVSData[eventId].vsout.nearPlane = nearp; + m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventID].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); - m_PostVSData[eventID].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); + m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; - m_PostVSData[eventID].vsout.instStride = 0; + m_PostVSData[eventId].vsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].vsout.instStride = + m_PostVSData[eventId].vsout.instStride = (stride * primsWritten) / RDCMAX(1U, drawcall->numInstances); - m_PostVSData[eventID].vsout.idxBuf = 0; - m_PostVSData[eventID].vsout.idxByteWidth = drawcall->indexByteWidth; - if(m_PostVSData[eventID].vsout.useIndices && idxBuf) + m_PostVSData[eventId].vsout.idxBuf = 0; + m_PostVSData[eventId].vsout.idxByteWidth = drawcall->indexByteWidth; + if(m_PostVSData[eventId].vsout.useIndices && idxBuf) { - m_PostVSData[eventID].vsout.idxBuf = idxBuf; + m_PostVSData[eventId].vsout.idxBuf = idxBuf; } - m_PostVSData[eventID].vsout.hasPosOut = posidx >= 0; + m_PostVSData[eventId].vsout.hasPosOut = posidx >= 0; - m_PostVSData[eventID].vsout.topo = drawcall->topology; + m_PostVSData[eventId].vsout.topo = drawcall->topology; // set vsProg back to no varyings, for future use gl.glTransformFeedbackVaryings(vsProg, 0, NULL, eGL_INTERLEAVED_ATTRIBS); @@ -4059,7 +4065,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) stride = 0; posidx = -1; - for(const SigParameter &sig : lastRefl->OutputSig) + for(const SigParameter &sig : lastRefl->outputSignature) { const char *name = sig.varName.c_str(); size_t len = sig.varName.size(); @@ -4552,19 +4558,19 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) // primitive counter is the number of primitives, not vertices if(shaderOutMode == eGL_TRIANGLES || shaderOutMode == eGL_QUADS) // query for quads returns # triangles - m_PostVSData[eventID].gsout.numVerts = primsWritten * 3; + m_PostVSData[eventId].gsout.numVerts = primsWritten * 3; else if(shaderOutMode == eGL_ISOLINES) - m_PostVSData[eventID].gsout.numVerts = primsWritten * 2; + m_PostVSData[eventId].gsout.numVerts = primsWritten * 2; } else if(lastProg == gsProg) { // primitive counter is the number of primitives, not vertices if(shaderOutMode == eGL_POINTS) - m_PostVSData[eventID].gsout.numVerts = primsWritten; + m_PostVSData[eventId].gsout.numVerts = primsWritten; else if(shaderOutMode == eGL_LINE_STRIP) - m_PostVSData[eventID].gsout.numVerts = primsWritten * 2; + m_PostVSData[eventId].gsout.numVerts = primsWritten * 2; else if(shaderOutMode == eGL_TRIANGLE_STRIP) - m_PostVSData[eventID].gsout.numVerts = primsWritten * 3; + m_PostVSData[eventId].gsout.numVerts = primsWritten * 3; } // create a buffer with this data, for future use (typed to ARRAY_BUFFER so we @@ -4572,7 +4578,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) GLuint lastoutBuffer = 0; gl.glGenBuffers(1, &lastoutBuffer); gl.glBindBuffer(eGL_ARRAY_BUFFER, lastoutBuffer); - gl.glNamedBufferDataEXT(lastoutBuffer, stride * m_PostVSData[eventID].gsout.numVerts, data, + gl.glNamedBufferDataEXT(lastoutBuffer, stride * m_PostVSData[eventId].gsout.numVerts, data, eGL_STATIC_DRAW); byteData = (byte *)data; @@ -4584,7 +4590,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) found = false; - for(uint32_t i = 1; posidx != -1 && i < m_PostVSData[eventID].gsout.numVerts; i++) + for(uint32_t i = 1; posidx != -1 && i < m_PostVSData[eventId].gsout.numVerts; i++) { ////////////////////////////////////////////////////////////////////////////////// // derive near/far, assuming a standard perspective matrix @@ -4638,27 +4644,27 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID) gl.glUnmapNamedBufferEXT(DebugData.feedbackBuffer); // store everything out to the PostVS data cache - m_PostVSData[eventID].gsout.buf = lastoutBuffer; - m_PostVSData[eventID].gsout.instStride = 0; + m_PostVSData[eventId].gsout.buf = lastoutBuffer; + m_PostVSData[eventId].gsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) { - m_PostVSData[eventID].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); - m_PostVSData[eventID].gsout.instStride = stride * m_PostVSData[eventID].gsout.numVerts; + m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); + m_PostVSData[eventId].gsout.instStride = stride * m_PostVSData[eventId].gsout.numVerts; } - m_PostVSData[eventID].gsout.vertStride = stride; - m_PostVSData[eventID].gsout.nearPlane = nearp; - m_PostVSData[eventID].gsout.farPlane = farp; + m_PostVSData[eventId].gsout.vertStride = stride; + m_PostVSData[eventId].gsout.nearPlane = nearp; + m_PostVSData[eventId].gsout.farPlane = farp; - m_PostVSData[eventID].gsout.useIndices = false; + m_PostVSData[eventId].gsout.useIndices = false; - m_PostVSData[eventID].gsout.hasPosOut = posidx >= 0; + m_PostVSData[eventId].gsout.hasPosOut = posidx >= 0; - m_PostVSData[eventID].gsout.idxBuf = 0; - m_PostVSData[eventID].gsout.idxByteWidth = 0; + m_PostVSData[eventId].gsout.idxBuf = 0; + m_PostVSData[eventId].gsout.idxByteWidth = 0; - m_PostVSData[eventID].gsout.topo = MakePrimitiveTopology(gl.GetHookset(), lastOutTopo); + m_PostVSData[eventId].gsout.topo = MakePrimitiveTopology(gl.GetHookset(), lastOutTopo); - m_PostVSData[eventID].gsout.instData = instData; + m_PostVSData[eventId].gsout.instData = instData; } // set lastProg back to no varyings, for future use @@ -4708,44 +4714,44 @@ void GLReplay::InitPostVSBuffers(const vector &passEvents) } } -MeshFormat GLReplay::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat GLReplay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { GLPostVSData postvs; RDCEraseEl(postvs); - if(m_PostVSData.find(eventID) != m_PostVSData.end()) - postvs = m_PostVSData[eventID]; + if(m_PostVSData.find(eventId) != m_PostVSData.end()) + postvs = m_PostVSData[eventId]; const GLPostVSData::StageData &s = postvs.GetStage(stage); MeshFormat ret; if(s.useIndices && s.idxBuf) - ret.idxbuf = m_pDriver->GetResourceManager()->GetID(BufferRes(NULL, s.idxBuf)); + ret.indexResourceId = m_pDriver->GetResourceManager()->GetID(BufferRes(NULL, s.idxBuf)); else - ret.idxbuf = ResourceId(); - ret.idxoffs = 0; - ret.idxByteWidth = s.idxByteWidth; + ret.indexResourceId = ResourceId(); + ret.indexByteOffset = 0; + ret.indexByteStride = s.idxByteWidth; ret.baseVertex = 0; if(s.buf) - ret.buf = m_pDriver->GetResourceManager()->GetID(BufferRes(NULL, s.buf)); + ret.vertexResourceId = m_pDriver->GetResourceManager()->GetID(BufferRes(NULL, s.buf)); else - ret.buf = ResourceId(); + ret.vertexResourceId = ResourceId(); - ret.offset = s.instStride * instID; - ret.stride = s.vertStride; + ret.vertexByteOffset = s.instStride * instID; + ret.vertexByteStride = s.vertStride; - ret.fmt.compCount = 4; - ret.fmt.compByteWidth = 4; - ret.fmt.compType = CompType::Float; - ret.fmt.type = ResourceFormatType::Regular; - ret.fmt.bgraOrder = false; + ret.format.compCount = 4; + ret.format.compByteWidth = 4; + ret.format.compType = CompType::Float; + ret.format.type = ResourceFormatType::Regular; + ret.format.bgraOrder = false; ret.showAlpha = false; - ret.topo = s.topo; - ret.numVerts = s.numVerts; + ret.topology = s.topo; + ret.numIndices = s.numVerts; ret.unproject = s.hasPosOut; ret.nearPlane = s.nearPlane; @@ -4755,19 +4761,19 @@ MeshFormat GLReplay::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDat { GLPostVSData::InstData inst = s.instData[instID]; - ret.offset = inst.bufOffset; - ret.numVerts = inst.numVerts; + ret.vertexByteOffset = inst.bufOffset; + ret.numIndices = inst.numVerts; } return ret; } -void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryDraws, +void GLReplay::RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { WrappedOpenGL &gl = *m_pDriver; - if(cfg.position.buf == ResourceId()) + if(cfg.position.vertexResourceId == ResourceId()) return; MakeCurrentReplayContext(m_DebugCtx); @@ -4784,7 +4790,7 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD const MeshFormat *meshData[2] = {&cfg.position, &cfg.second}; - GLenum topo = MakeGLPrimitiveTopology(cfg.position.topo); + GLenum topo = MakeGLPrimitiveTopology(cfg.position.topology); GLuint prog = DebugData.meshProg; @@ -4836,7 +4842,7 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD { const MeshFormat &fmt = secondaryDraws[i]; - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { uboParams.color = Vec4f(fmt.meshColor.x, fmt.meshColor.y, fmt.meshColor.z, fmt.meshColor.w); @@ -4845,28 +4851,28 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD *uboptr = uboParams; gl.glUnmapBuffer(eGL_UNIFORM_BUFFER); - GLuint vb = m_pDriver->GetResourceManager()->GetCurrentResource(fmt.buf).name; - gl.glBindVertexBuffer(0, vb, (GLintptr)fmt.offset, fmt.stride); + GLuint vb = m_pDriver->GetResourceManager()->GetCurrentResource(fmt.vertexResourceId).name; + gl.glBindVertexBuffer(0, vb, (GLintptr)fmt.vertexByteOffset, fmt.vertexByteStride); - GLenum secondarytopo = MakeGLPrimitiveTopology(fmt.topo); + GLenum secondarytopo = MakeGLPrimitiveTopology(fmt.topology); - if(fmt.idxByteWidth) + if(fmt.indexByteStride) { - GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(fmt.idxbuf).name; + GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(fmt.indexResourceId).name; gl.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, ib); GLenum idxtype = eGL_UNSIGNED_BYTE; - if(fmt.idxByteWidth == 2) + if(fmt.indexByteStride == 2) idxtype = eGL_UNSIGNED_SHORT; - else if(fmt.idxByteWidth == 4) + else if(fmt.indexByteStride == 4) idxtype = eGL_UNSIGNED_INT; - gl.glDrawElementsBaseVertex(secondarytopo, fmt.numVerts, idxtype, - (const void *)uintptr_t(fmt.idxoffs), fmt.baseVertex); + gl.glDrawElementsBaseVertex(secondarytopo, fmt.numIndices, idxtype, + (const void *)uintptr_t(fmt.indexByteOffset), fmt.baseVertex); } else { - gl.glDrawArrays(secondarytopo, 0, fmt.numVerts); + gl.glDrawArrays(secondarytopo, 0, fmt.numIndices); } } } @@ -4874,97 +4880,100 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD for(uint32_t i = 0; i < 2; i++) { - if(meshData[i]->buf == ResourceId()) + if(meshData[i]->vertexResourceId == ResourceId()) continue; - if(meshData[i]->fmt.Special()) + if(meshData[i]->format.Special()) { - if(meshData[i]->fmt.type == ResourceFormatType::R10G10B10A2) + if(meshData[i]->format.type == ResourceFormatType::R10G10B10A2) { - if(meshData[i]->fmt.compType == CompType::UInt) + if(meshData[i]->format.compType == CompType::UInt) gl.glVertexAttribIFormat(i, 4, eGL_UNSIGNED_INT_2_10_10_10_REV, 0); - if(meshData[i]->fmt.compType == CompType::SInt) + if(meshData[i]->format.compType == CompType::SInt) gl.glVertexAttribIFormat(i, 4, eGL_INT_2_10_10_10_REV, 0); } - else if(meshData[i]->fmt.type == ResourceFormatType::R11G11B10) + else if(meshData[i]->format.type == ResourceFormatType::R11G11B10) { gl.glVertexAttribFormat(i, 4, eGL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0); } else { - RDCWARN("Unsupported vertex attribute format: %x", meshData[i]->fmt.type); + RDCWARN("Unsupported vertex attribute format: %x", meshData[i]->format.type); } } - else if(meshData[i]->fmt.compType == CompType::Float || - meshData[i]->fmt.compType == CompType::UNorm || - meshData[i]->fmt.compType == CompType::SNorm) + else if(meshData[i]->format.compType == CompType::Float || + meshData[i]->format.compType == CompType::UNorm || + meshData[i]->format.compType == CompType::SNorm) { GLenum fmttype = eGL_UNSIGNED_INT; - if(meshData[i]->fmt.compByteWidth == 4) + if(meshData[i]->format.compByteWidth == 4) { - if(meshData[i]->fmt.compType == CompType::Float) + if(meshData[i]->format.compType == CompType::Float) fmttype = eGL_FLOAT; - else if(meshData[i]->fmt.compType == CompType::UNorm) + else if(meshData[i]->format.compType == CompType::UNorm) fmttype = eGL_UNSIGNED_INT; - else if(meshData[i]->fmt.compType == CompType::SNorm) + else if(meshData[i]->format.compType == CompType::SNorm) fmttype = eGL_INT; } - else if(meshData[i]->fmt.compByteWidth == 2) + else if(meshData[i]->format.compByteWidth == 2) { - if(meshData[i]->fmt.compType == CompType::Float) + if(meshData[i]->format.compType == CompType::Float) fmttype = eGL_HALF_FLOAT; - else if(meshData[i]->fmt.compType == CompType::UNorm) + else if(meshData[i]->format.compType == CompType::UNorm) fmttype = eGL_UNSIGNED_SHORT; - else if(meshData[i]->fmt.compType == CompType::SNorm) + else if(meshData[i]->format.compType == CompType::SNorm) fmttype = eGL_SHORT; } - else if(meshData[i]->fmt.compByteWidth == 1) + else if(meshData[i]->format.compByteWidth == 1) { - if(meshData[i]->fmt.compType == CompType::UNorm) + if(meshData[i]->format.compType == CompType::UNorm) fmttype = eGL_UNSIGNED_BYTE; - else if(meshData[i]->fmt.compType == CompType::SNorm) + else if(meshData[i]->format.compType == CompType::SNorm) fmttype = eGL_BYTE; } - gl.glVertexAttribFormat(i, meshData[i]->fmt.compCount, fmttype, - meshData[i]->fmt.compType != CompType::Float, 0); + gl.glVertexAttribFormat(i, meshData[i]->format.compCount, fmttype, + meshData[i]->format.compType != CompType::Float, 0); } - else if(meshData[i]->fmt.compType == CompType::UInt || meshData[i]->fmt.compType == CompType::SInt) + else if(meshData[i]->format.compType == CompType::UInt || + meshData[i]->format.compType == CompType::SInt) { GLenum fmttype = eGL_UNSIGNED_INT; - if(meshData[i]->fmt.compByteWidth == 4) + if(meshData[i]->format.compByteWidth == 4) { - if(meshData[i]->fmt.compType == CompType::UInt) + if(meshData[i]->format.compType == CompType::UInt) fmttype = eGL_UNSIGNED_INT; - else if(meshData[i]->fmt.compType == CompType::SInt) + else if(meshData[i]->format.compType == CompType::SInt) fmttype = eGL_INT; } - else if(meshData[i]->fmt.compByteWidth == 2) + else if(meshData[i]->format.compByteWidth == 2) { - if(meshData[i]->fmt.compType == CompType::UInt) + if(meshData[i]->format.compType == CompType::UInt) fmttype = eGL_UNSIGNED_SHORT; - else if(meshData[i]->fmt.compType == CompType::SInt) + else if(meshData[i]->format.compType == CompType::SInt) fmttype = eGL_SHORT; } - else if(meshData[i]->fmt.compByteWidth == 1) + else if(meshData[i]->format.compByteWidth == 1) { - if(meshData[i]->fmt.compType == CompType::UInt) + if(meshData[i]->format.compType == CompType::UInt) fmttype = eGL_UNSIGNED_BYTE; - else if(meshData[i]->fmt.compType == CompType::SInt) + else if(meshData[i]->format.compType == CompType::SInt) fmttype = eGL_BYTE; } - gl.glVertexAttribIFormat(i, meshData[i]->fmt.compCount, fmttype, 0); + gl.glVertexAttribIFormat(i, meshData[i]->format.compCount, fmttype, 0); } - else if(meshData[i]->fmt.compType == CompType::Double) + else if(meshData[i]->format.compType == CompType::Double) { - gl.glVertexAttribLFormat(i, meshData[i]->fmt.compCount, eGL_DOUBLE, 0); + gl.glVertexAttribLFormat(i, meshData[i]->format.compCount, eGL_DOUBLE, 0); } - GLuint vb = m_pDriver->GetResourceManager()->GetCurrentResource(meshData[i]->buf).name; - gl.glBindVertexBuffer(i, vb, (GLintptr)meshData[i]->offset, meshData[i]->stride); + GLuint vb = + m_pDriver->GetResourceManager()->GetCurrentResource(meshData[i]->vertexResourceId).name; + gl.glBindVertexBuffer(i, vb, (GLintptr)meshData[i]->vertexByteOffset, + meshData[i]->vertexByteStride); } // enable position attribute @@ -5011,32 +5020,33 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD gl.glUnmapBuffer(eGL_UNIFORM_BUFFER); - if(cfg.second.buf != ResourceId()) + if(cfg.second.vertexResourceId != ResourceId()) gl.glEnableVertexAttribArray(1); if(!IsGLES) gl.glPolygonMode(eGL_FRONT_AND_BACK, eGL_FILL); - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) { GLenum idxtype = eGL_UNSIGNED_BYTE; - if(cfg.position.idxByteWidth == 2) + if(cfg.position.indexByteStride == 2) idxtype = eGL_UNSIGNED_SHORT; - else if(cfg.position.idxByteWidth == 4) + else if(cfg.position.indexByteStride == 4) idxtype = eGL_UNSIGNED_INT; - if(cfg.position.idxbuf != ResourceId()) + if(cfg.position.indexResourceId != ResourceId()) { - GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.idxbuf).name; + GLuint ib = + m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.indexResourceId).name; gl.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, ib); } - gl.glDrawElementsBaseVertex(topo, cfg.position.numVerts, idxtype, - (const void *)uintptr_t(cfg.position.idxoffs), + gl.glDrawElementsBaseVertex(topo, cfg.position.numIndices, idxtype, + (const void *)uintptr_t(cfg.position.indexByteOffset), cfg.position.baseVertex); } else { - gl.glDrawArrays(topo, 0, cfg.position.numVerts); + gl.glDrawArrays(topo, 0, cfg.position.numIndices); } gl.glDisableVertexAttribArray(1); @@ -5062,27 +5072,28 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD *uboptr = uboParams; gl.glUnmapBuffer(eGL_UNIFORM_BUFFER); - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) { GLenum idxtype = eGL_UNSIGNED_BYTE; - if(cfg.position.idxByteWidth == 2) + if(cfg.position.indexByteStride == 2) idxtype = eGL_UNSIGNED_SHORT; - else if(cfg.position.idxByteWidth == 4) + else if(cfg.position.indexByteStride == 4) idxtype = eGL_UNSIGNED_INT; - if(cfg.position.idxbuf != ResourceId()) + if(cfg.position.indexResourceId != ResourceId()) { - GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.idxbuf).name; + GLuint ib = + m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.indexResourceId).name; gl.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, ib); - gl.glDrawElementsBaseVertex(topo != eGL_PATCHES ? topo : eGL_POINTS, cfg.position.numVerts, - idxtype, (const void *)uintptr_t(cfg.position.idxoffs), + gl.glDrawElementsBaseVertex(topo != eGL_PATCHES ? topo : eGL_POINTS, cfg.position.numIndices, + idxtype, (const void *)uintptr_t(cfg.position.indexByteOffset), cfg.position.baseVertex); } } else { - gl.glDrawArrays(topo != eGL_PATCHES ? topo : eGL_POINTS, 0, cfg.position.numVerts); + gl.glDrawArrays(topo != eGL_PATCHES ? topo : eGL_POINTS, 0, cfg.position.numIndices); } } @@ -5184,7 +5195,7 @@ void GLReplay::RenderMesh(uint32_t eventID, const vector &secondaryD // show highlighted vertex if(cfg.highlightVert != ~0U) { - m_HighlightCache.CacheHighlightingData(eventID, cfg); + m_HighlightCache.CacheHighlightingData(eventId, cfg); GLenum meshtopo = topo; diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 129cda445..52e9a449f 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -509,7 +509,7 @@ WrappedOpenGL::WrappedOpenGL(const GLHookSet &funcs, GLPlatform &platform) uint32_t flags = WriteSerialiser::ChunkDuration | WriteSerialiser::ChunkTimestamp | WriteSerialiser::ChunkThreadID; - if(RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks) + if(RenderDoc::Inst().GetCaptureOptions().captureCallstacks) flags |= WriteSerialiser::ChunkCallstack; m_ScratchSerialiser.SetChunkMetadataRecording(flags); @@ -1146,7 +1146,7 @@ void WrappedOpenGL::ActivateContext(GLWindowingData winData) const GLHookSet &gl = m_Real; if(HasExt[KHR_debug] && gl.glDebugMessageCallback && - RenderDoc::Inst().GetCaptureOptions().APIValidation) + RenderDoc::Inst().GetCaptureOptions().apiValidation) { gl.glDebugMessageCallback(&DebugSnoopStatic, this); gl.glEnable(eGL_DEBUG_OUTPUT_SYNCHRONOUS); @@ -2884,7 +2884,7 @@ void WrappedOpenGL::AddDebugMessage(MessageCategory c, MessageSeverity sv, Messa if(IsLoading(m_State) || src == MessageSource::RuntimeWarning) { DebugMessage msg; - msg.eventID = m_CurEventID; + msg.eventId = m_CurEventID; msg.messageID = 0; msg.source = src; msg.category = c; @@ -2921,7 +2921,7 @@ void WrappedOpenGL::Serialise_DebugMessages(SerialiserType &ser) { for(DebugMessage &msg : DebugMessages) { - msg.eventID = m_CurEventID; + msg.eventId = m_CurEventID; AddDebugMessage(msg); } } @@ -3024,7 +3024,7 @@ void WrappedOpenGL::DebugSnoop(GLenum source, GLenum type, GLuint id, GLenum sev } } - if(m_RealDebugFunc && !RenderDoc::Inst().GetCaptureOptions().DebugOutputMute) + if(m_RealDebugFunc && !RenderDoc::Inst().GetCaptureOptions().debugOutputMute) m_RealDebugFunc(source, type, id, severity, length, message, m_RealDebugFuncParam); } @@ -3179,7 +3179,7 @@ ReplayStatus WrappedOpenGL::ReadLogInitialisation(RDCFile *rdc, bool storeStruct #endif // steal the structured data for ourselves - m_StructuredFile->swap(m_StoredStructuredData); + m_StructuredFile->Swap(m_StoredStructuredData); // and in future use this file. m_StructuredFile = &m_StoredStructuredData; @@ -4667,7 +4667,7 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta { ser.ConfigureStructuredExport(&GetChunkName, IsStructuredExporting(m_State)); - ser.GetStructuredFile().swap(*m_StructuredFile); + ser.GetStructuredFile().Swap(*m_StructuredFile); m_StructuredFile = &ser.GetStructuredFile(); } @@ -4722,7 +4722,7 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta if(IsActiveReplaying(m_State)) { APIEvent ev = GetEvent(startEventID); - m_CurEventID = ev.eventID; + m_CurEventID = ev.eventId; if(partial) ser.GetReader()->SetOffset(ev.fileOffset); m_FirstEventID = startEventID; @@ -4778,7 +4778,7 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta // swap the structure back now that we've accumulated the frame as well. if(IsLoading(m_State) || IsStructuredExporting(m_State)) - ser.GetStructuredFile().swap(*prevFile); + ser.GetStructuredFile().Swap(*prevFile); m_StructuredFile = prevFile; @@ -4866,7 +4866,7 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d) void *ctx = GetCtx(); - uint32_t e = d.eventID; + uint32_t e = d.eventId; ////////////////////////////// // Input @@ -4953,31 +4953,31 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d) if(refl[i]) { - for(const ConstantBlock &cblock : refl[i]->ConstantBlocks) + for(const ConstantBlock &cblock : refl[i]->constantBlocks) { if(!cblock.bufferBacked) continue; - if(cblock.bindPoint < 0 || cblock.bindPoint >= mapping[i].ConstantBlocks.count()) + if(cblock.bindPoint < 0 || cblock.bindPoint >= mapping[i].constantBlocks.count()) continue; - int32_t bind = mapping[i].ConstantBlocks[cblock.bindPoint].bind; + int32_t bind = mapping[i].constantBlocks[cblock.bindPoint].bind; if(rs.UniformBinding[bind].res.name) m_ResourceUses[rm->GetID(rs.UniformBinding[bind].res)].push_back(cb); } - for(const ShaderResource &res : refl[i]->ReadWriteResources) + for(const ShaderResource &res : refl[i]->readWriteResources) { - int32_t bind = mapping[i].ReadWriteResources[res.bindPoint].bind; + int32_t bind = mapping[i].readWriteResources[res.bindPoint].bind; - if(res.IsTexture) + if(res.isTexture) { if(rs.Images[bind].res.name) m_ResourceUses[rm->GetID(rs.Images[bind].res)].push_back(rw); } else { - if(res.variableType.descriptor.cols == 1 && res.variableType.descriptor.rows == 1 && + if(res.variableType.descriptor.columns == 1 && res.variableType.descriptor.rows == 1 && res.variableType.descriptor.type == VarType::UInt) { if(rs.AtomicCounter[bind].res.name) @@ -4991,9 +4991,9 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d) } } - for(const ShaderResource &res : refl[i]->ReadOnlyResources) + for(const ShaderResource &res : refl[i]->readOnlyResources) { - int32_t bind = mapping[i].ReadOnlyResources[res.bindPoint].bind; + int32_t bind = mapping[i].readOnlyResources[res.bindPoint].bind; GLResource *texList = NULL; const int32_t listSize = (int32_t)ARRAY_COUNT(rs.Tex2D); @@ -5001,19 +5001,19 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d) switch(res.resType) { - case TextureDim::Unknown: texList = NULL; break; - case TextureDim::Buffer: texList = rs.TexBuffer; break; - case TextureDim::Texture1D: texList = rs.Tex1D; break; - case TextureDim::Texture1DArray: texList = rs.Tex1DArray; break; - case TextureDim::Texture2D: texList = rs.Tex2D; break; - case TextureDim::TextureRect: texList = rs.TexRect; break; - case TextureDim::Texture2DArray: texList = rs.Tex2DArray; break; - case TextureDim::Texture2DMS: texList = rs.Tex2DMS; break; - case TextureDim::Texture2DMSArray: texList = rs.Tex2DMSArray; break; - case TextureDim::Texture3D: texList = rs.Tex3D; break; - case TextureDim::TextureCube: texList = rs.TexCube; break; - case TextureDim::TextureCubeArray: texList = rs.TexCubeArray; break; - case TextureDim::Count: RDCERR("Invalid shader resource type"); break; + case TextureType::Unknown: texList = NULL; break; + case TextureType::Buffer: texList = rs.TexBuffer; break; + case TextureType::Texture1D: texList = rs.Tex1D; break; + case TextureType::Texture1DArray: texList = rs.Tex1DArray; break; + case TextureType::Texture2D: texList = rs.Tex2D; break; + case TextureType::TextureRect: texList = rs.TexRect; break; + case TextureType::Texture2DArray: texList = rs.Tex2DArray; break; + case TextureType::Texture2DMS: texList = rs.Tex2DMS; break; + case TextureType::Texture2DMSArray: texList = rs.Tex2DMSArray; break; + case TextureType::Texture3D: texList = rs.Tex3D; break; + case TextureType::TextureCube: texList = rs.TexCube; break; + case TextureType::TextureCubeArray: texList = rs.TexCubeArray; break; + case TextureType::Count: RDCERR("Invalid shader resource type"); break; } if(texList != NULL && bind >= 0 && bind < listSize && texList[bind].name != 0) @@ -5108,8 +5108,8 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d, bool hasEvents) WrappedOpenGL *context = this; DrawcallDescription draw = d; - draw.eventID = m_CurEventID; - draw.drawcallID = m_CurDrawcallID; + draw.eventId = m_CurEventID; + draw.drawcallId = m_CurDrawcallID; GLenum type; GLuint curCol[8] = {0}; @@ -5182,7 +5182,7 @@ void WrappedOpenGL::AddEvent() APIEvent apievent; apievent.fileOffset = m_CurChunkOffset; - apievent.eventID = m_CurEventID; + apievent.eventId = m_CurEventID; apievent.chunkIndex = uint32_t(m_StructuredFile->chunks.size() - 1); @@ -5194,23 +5194,23 @@ void WrappedOpenGL::AddEvent() m_Events.push_back(apievent); } -const APIEvent &WrappedOpenGL::GetEvent(uint32_t eventID) +const APIEvent &WrappedOpenGL::GetEvent(uint32_t eventId) { for(const APIEvent &e : m_Events) { - if(e.eventID >= eventID) + if(e.eventId >= eventId) return e; } return m_Events.back(); } -const DrawcallDescription *WrappedOpenGL::GetDrawcall(uint32_t eventID) +const DrawcallDescription *WrappedOpenGL::GetDrawcall(uint32_t eventId) { - if(eventID >= m_Drawcalls.size()) + if(eventId >= m_Drawcalls.size()) return NULL; - return m_Drawcalls[eventID]; + return m_Drawcalls[eventId]; } void WrappedOpenGL::ReplayLog(uint32_t startEventID, uint32_t endEventID, ReplayLogType replayType) diff --git a/renderdoc/driver/gl/gl_driver.h b/renderdoc/driver/gl/gl_driver.h index a9feb6a2a..64e2d595f 100644 --- a/renderdoc/driver/gl/gl_driver.h +++ b/renderdoc/driver/gl/gl_driver.h @@ -572,10 +572,10 @@ public: GLuint GetFakeBBFBO() { return m_FakeBB_FBO; } GLuint GetFakeVAO() { return m_FakeVAO; } FrameRecord &GetFrameRecord() { return m_FrameRecord; } - const APIEvent &GetEvent(uint32_t eventID); + const APIEvent &GetEvent(uint32_t eventId); const DrawcallDescription &GetRootDraw() { return m_ParentDrawcall; } - const DrawcallDescription *GetDrawcall(uint32_t eventID); + const DrawcallDescription *GetDrawcall(uint32_t eventId); void SuppressDebugMessages(bool suppress) { m_SuppressDebugMessages = suppress; } vector GetUsage(ResourceId id) { return m_ResourceUses[id]; } diff --git a/renderdoc/driver/gl/gl_hooks_egl.cpp b/renderdoc/driver/gl/gl_hooks_egl.cpp index 46df746e0..9066409dd 100644 --- a/renderdoc/driver/gl/gl_hooks_egl.cpp +++ b/renderdoc/driver/gl/gl_hooks_egl.cpp @@ -265,7 +265,7 @@ __attribute__((visibility("default"))) EGLContext eglCreateContext(EGLDisplay di if(name == EGL_CONTEXT_FLAGS_KHR) { - if(RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(RenderDoc::Inst().GetCaptureOptions().apiValidation) val |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; else val &= ~EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; @@ -277,7 +277,7 @@ __attribute__((visibility("default"))) EGLContext eglCreateContext(EGLDisplay di attribVec.push_back(val); } - if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().apiValidation) { attribVec.push_back(EGL_CONTEXT_FLAGS_KHR); attribVec.push_back(EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR); diff --git a/renderdoc/driver/gl/gl_hooks_linux.cpp b/renderdoc/driver/gl/gl_hooks_linux.cpp index 4b45f1a92..fb05cea71 100644 --- a/renderdoc/driver/gl/gl_hooks_linux.cpp +++ b/renderdoc/driver/gl/gl_hooks_linux.cpp @@ -546,7 +546,7 @@ __attribute__((visibility("default"))) GLXContext glXCreateContextAttribsARB( if(name == GLX_CONTEXT_FLAGS_ARB) { - if(RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(RenderDoc::Inst().GetCaptureOptions().apiValidation) val |= GLX_CONTEXT_DEBUG_BIT_ARB; else val &= ~GLX_CONTEXT_DEBUG_BIT_ARB; @@ -561,7 +561,7 @@ __attribute__((visibility("default"))) GLXContext glXCreateContextAttribsARB( attribVec.push_back(val); } - if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().apiValidation) { attribVec.push_back(GLX_CONTEXT_FLAGS_ARB); attribVec.push_back(GLX_CONTEXT_DEBUG_BIT_ARB); diff --git a/renderdoc/driver/gl/gl_hooks_win32.cpp b/renderdoc/driver/gl/gl_hooks_win32.cpp index f68edbdcc..5d989a037 100644 --- a/renderdoc/driver/gl/gl_hooks_win32.cpp +++ b/renderdoc/driver/gl/gl_hooks_win32.cpp @@ -1012,7 +1012,7 @@ private: if(name == WGL_CONTEXT_FLAGS_ARB) { - if(RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(RenderDoc::Inst().GetCaptureOptions().apiValidation) val |= WGL_CONTEXT_DEBUG_BIT_ARB; else val &= ~WGL_CONTEXT_DEBUG_BIT_ARB; @@ -1027,7 +1027,7 @@ private: attribVec.push_back(val); } - if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().apiValidation) { attribVec.push_back(WGL_CONTEXT_FLAGS_ARB); attribVec.push_back(WGL_CONTEXT_DEBUG_BIT_ARB); @@ -1213,7 +1213,7 @@ private: static LONG WINAPI ChangeDisplaySettingsA_hooked(DEVMODEA *mode, DWORD flags) { - if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().allowFullscreen) return glhooks.ChangeDisplaySettingsA_hook()(mode, flags); return DISP_CHANGE_SUCCESSFUL; @@ -1221,7 +1221,7 @@ private: static LONG WINAPI ChangeDisplaySettingsW_hooked(DEVMODEW *mode, DWORD flags) { - if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().allowFullscreen) return glhooks.ChangeDisplaySettingsW_hook()(mode, flags); return DISP_CHANGE_SUCCESSFUL; @@ -1230,7 +1230,7 @@ private: static LONG WINAPI ChangeDisplaySettingsExA_hooked(LPCSTR devname, DEVMODEA *mode, HWND wnd, DWORD flags, LPVOID param) { - if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().allowFullscreen) return glhooks.ChangeDisplaySettingsExA_hook()(devname, mode, wnd, flags, param); return DISP_CHANGE_SUCCESSFUL; @@ -1239,7 +1239,7 @@ private: static LONG WINAPI ChangeDisplaySettingsExW_hooked(LPCWSTR devname, DEVMODEW *mode, HWND wnd, DWORD flags, LPVOID param) { - if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().AllowFullscreen) + if((flags & CDS_FULLSCREEN) == 0 || RenderDoc::Inst().GetCaptureOptions().allowFullscreen) return glhooks.ChangeDisplaySettingsExW_hook()(devname, mode, wnd, flags, param); return DISP_CHANGE_SUCCESSFUL; diff --git a/renderdoc/driver/gl/gl_initstate.cpp b/renderdoc/driver/gl/gl_initstate.cpp index 60d36520b..2145efee2 100644 --- a/renderdoc/driver/gl/gl_initstate.cpp +++ b/renderdoc/driver/gl/gl_initstate.cpp @@ -977,7 +977,7 @@ bool GLResourceManager::Force_InitialState(GLResource res, bool prepare) return false; // don't need to force anything if we're already including all resources - if(RenderDoc::Inst().GetCaptureOptions().RefAllResources) + if(RenderDoc::Inst().GetCaptureOptions().refAllResources) return false; GLResourceRecord *record = GetResourceRecord(res); @@ -1201,7 +1201,7 @@ bool GLResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceId r if(shadDetails.type == eGL_VERTEX_SHADER) { - for(const SigParameter &sig : shadDetails.reflection.OutputSig) + for(const SigParameter &sig : shadDetails.reflection.outputSignature) { std::string name = sig.varName; diff --git a/renderdoc/driver/gl/gl_program_iterate.cpp b/renderdoc/driver/gl/gl_program_iterate.cpp index 28cc1b9fa..5e4250043 100644 --- a/renderdoc/driver/gl/gl_program_iterate.cpp +++ b/renderdoc/driver/gl/gl_program_iterate.cpp @@ -801,7 +801,7 @@ void CopyProgramAttribBindings(const GLHookSet &gl, GLuint progsrc, GLuint progd ShaderReflection *refl) { // copy over attrib bindings - for(const SigParameter &sig : refl->InputSig) + for(const SigParameter &sig : refl->inputSignature) { // skip built-ins if(sig.systemValue != ShaderBuiltin::Undefined) @@ -819,16 +819,16 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro uint64_t used = 0; // copy over fragdata bindings - for(size_t i = 0; i < refl->OutputSig.size(); i++) + for(size_t i = 0; i < refl->outputSignature.size(); i++) { // only look at colour outputs (should be the only outputs from fs) - if(refl->OutputSig[i].systemValue != ShaderBuiltin::ColorOutput) + if(refl->outputSignature[i].systemValue != ShaderBuiltin::ColorOutput) continue; - if(!strncmp("gl_", refl->OutputSig[i].varName.c_str(), 3)) + if(!strncmp("gl_", refl->outputSignature[i].varName.c_str(), 3)) continue; // GL_INVALID_OPERATION if name starts with reserved gl_ prefix - GLint idx = gl.glGetFragDataLocation(progsrc, refl->OutputSig[i].varName.c_str()); + GLint idx = gl.glGetFragDataLocation(progsrc, refl->outputSignature[i].varName.c_str()); if(idx >= 0) { uint64_t mask = 1ULL << idx; @@ -836,7 +836,7 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro if(used & mask) { RDCWARN("Multiple signatures bound to output %zu, ignoring %s", i, - refl->OutputSig[i].varName.c_str()); + refl->outputSignature[i].varName.c_str()); continue; } @@ -844,7 +844,7 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro if(gl.glBindFragDataLocation) { - gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.c_str()); + gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->outputSignature[i].varName.c_str()); } else { diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 1d7573671..35149f99b 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -90,11 +90,11 @@ const SDFile &GLReplay::GetStructuredFile() return m_pDriver->GetStructuredFile(); } -vector GLReplay::GetPassEvents(uint32_t eventID) +vector GLReplay::GetPassEvents(uint32_t eventId) { vector passEvents; - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventID); + const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); const DrawcallDescription *start = draw; while(start && start->previous != 0 && @@ -115,7 +115,7 @@ vector GLReplay::GetPassEvents(uint32_t eventID) break; if(start->flags & DrawFlags::Drawcall) - passEvents.push_back(start->eventID); + passEvents.push_back(start->eventId); start = m_pDriver->GetDrawcall((uint32_t)start->next); } @@ -170,7 +170,7 @@ ResourceDescription &GLReplay::GetResourceDesc(ResourceId id) { m_ResourceIdx[id] = m_Resources.size(); m_Resources.push_back(ResourceDescription()); - m_Resources.back().ID = id; + m_Resources.back().resourceId = id; return m_Resources.back(); } @@ -441,14 +441,14 @@ void GLReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, byt bool GLReplay::IsRenderOutput(ResourceId id) { - for(const GLPipe::Attachment &att : m_CurPipelineState.m_FB.m_DrawFBO.Color) + for(const GLPipe::Attachment &att : m_CurPipelineState.framebuffer.drawFBO.colorAttachments) { - if(att.Obj == id) + if(att.resourceId == id) return true; } - if(m_CurPipelineState.m_FB.m_DrawFBO.Depth.Obj == id || - m_CurPipelineState.m_FB.m_DrawFBO.Stencil.Obj == id) + if(m_CurPipelineState.framebuffer.drawFBO.depthAttachment.resourceId == id || + m_CurPipelineState.framebuffer.drawFBO.stencilAttachment.resourceId == id) return true; return false; @@ -475,7 +475,7 @@ void GLReplay::CacheTexture(ResourceId id) auto &res = m_pDriver->m_Textures[id]; WrappedOpenGL &gl = *m_pDriver; - tex.ID = m_pDriver->GetResourceManager()->GetOriginalID(id); + tex.resourceId = m_pDriver->GetResourceManager()->GetOriginalID(id); if(res.resource.Namespace == eResUnknown || res.curType == eGL_NONE) { @@ -484,7 +484,7 @@ void GLReplay::CacheTexture(ResourceId id) tex.format = ResourceFormat(); tex.dimension = 1; - tex.resType = TextureDim::Unknown; + tex.type = TextureType::Unknown; tex.width = tex.height = tex.depth = 1; tex.cubemap = false; tex.mips = 1; @@ -501,7 +501,7 @@ void GLReplay::CacheTexture(ResourceId id) if(res.resource.Namespace == eResRenderbuffer || res.curType == eGL_RENDERBUFFER) { tex.dimension = 2; - tex.resType = TextureDim::Texture2D; + tex.type = TextureType::Texture2D; tex.width = res.width; tex.height = res.height; tex.depth = 1; @@ -570,20 +570,20 @@ void GLReplay::CacheTexture(ResourceId id) switch(target) { - case eGL_TEXTURE_BUFFER: tex.resType = TextureDim::Buffer; break; - case eGL_TEXTURE_1D: tex.resType = TextureDim::Texture1D; break; - case eGL_TEXTURE_2D: tex.resType = TextureDim::Texture2D; break; - case eGL_TEXTURE_3D: tex.resType = TextureDim::Texture3D; break; - case eGL_TEXTURE_1D_ARRAY: tex.resType = TextureDim::Texture1DArray; break; - case eGL_TEXTURE_2D_ARRAY: tex.resType = TextureDim::Texture2DArray; break; - case eGL_TEXTURE_RECTANGLE: tex.resType = TextureDim::TextureRect; break; - case eGL_TEXTURE_2D_MULTISAMPLE: tex.resType = TextureDim::Texture2DMS; break; - case eGL_TEXTURE_2D_MULTISAMPLE_ARRAY: tex.resType = TextureDim::Texture2DMSArray; break; - case eGL_TEXTURE_CUBE_MAP: tex.resType = TextureDim::TextureCube; break; - case eGL_TEXTURE_CUBE_MAP_ARRAY: tex.resType = TextureDim::TextureCubeArray; break; + case eGL_TEXTURE_BUFFER: tex.type = TextureType::Buffer; break; + case eGL_TEXTURE_1D: tex.type = TextureType::Texture1D; break; + case eGL_TEXTURE_2D: tex.type = TextureType::Texture2D; break; + case eGL_TEXTURE_3D: tex.type = TextureType::Texture3D; break; + case eGL_TEXTURE_1D_ARRAY: tex.type = TextureType::Texture1DArray; break; + case eGL_TEXTURE_2D_ARRAY: tex.type = TextureType::Texture2DArray; break; + case eGL_TEXTURE_RECTANGLE: tex.type = TextureType::TextureRect; break; + case eGL_TEXTURE_2D_MULTISAMPLE: tex.type = TextureType::Texture2DMS; break; + case eGL_TEXTURE_2D_MULTISAMPLE_ARRAY: tex.type = TextureType::Texture2DMSArray; break; + case eGL_TEXTURE_CUBE_MAP: tex.type = TextureType::TextureCube; break; + case eGL_TEXTURE_CUBE_MAP_ARRAY: tex.type = TextureType::TextureCubeArray; break; default: - tex.resType = TextureDim::Unknown; + tex.type = TextureType::Unknown; RDCERR("Unexpected texture enum %s", ToStr(target).c_str()); } @@ -715,7 +715,7 @@ BufferDescription GLReplay::GetBuffer(ResourceId id) WrappedOpenGL &gl = *m_pDriver; - ret.ID = m_pDriver->GetResourceManager()->GetOriginalID(id); + ret.resourceId = m_pDriver->GetResourceManager()->GetOriginalID(id); GLint prevBind = 0; if(res.curType != eGL_NONE) @@ -803,7 +803,8 @@ vector GLReplay::GetDisassemblyTargets() string GLReplay::DisassembleShader(ResourceId pipeline, const ShaderReflection *refl, const string &target) { - auto &shaderDetails = m_pDriver->m_Shaders[m_pDriver->GetResourceManager()->GetLiveID(refl->ID)]; + auto &shaderDetails = + m_pDriver->m_Shaders[m_pDriver->GetResourceManager()->GetLiveID(refl->resourceId)]; if(shaderDetails.sources.empty()) return "Invalid Shader Specified"; @@ -813,7 +814,7 @@ string GLReplay::DisassembleShader(ResourceId pipeline, const ShaderReflection * std::string &disasm = shaderDetails.disassembly; if(disasm.empty()) - disasm = shaderDetails.spirv.Disassemble(refl->EntryPoint.c_str()); + disasm = shaderDetails.spirv.Disassemble(refl->entryPoint.c_str()); return disasm; } @@ -843,12 +844,12 @@ void GLReplay::SavePipelineState() GLuint ibuffer = 0; gl.glGetIntegerv(eGL_ELEMENT_ARRAY_BUFFER_BINDING, (GLint *)&ibuffer); - pipe.m_VtxIn.ibuffer = rm->GetOriginalID(rm->GetID(BufferRes(ctx, ibuffer))); + pipe.vertexInput.indexBuffer = rm->GetOriginalID(rm->GetID(BufferRes(ctx, ibuffer))); - pipe.m_VtxIn.primitiveRestart = rs.Enabled[GLRenderState::eEnabled_PrimitiveRestart]; - pipe.m_VtxIn.restartIndex = rs.Enabled[GLRenderState::eEnabled_PrimitiveRestartFixedIndex] - ? ~0U - : rs.PrimitiveRestartIndex; + pipe.vertexInput.primitiveRestart = rs.Enabled[GLRenderState::eEnabled_PrimitiveRestart]; + pipe.vertexInput.restartIndex = rs.Enabled[GLRenderState::eEnabled_PrimitiveRestartFixedIndex] + ? ~0U + : rs.PrimitiveRestartIndex; // Vertex buffers and attributes GLint numVBufferBindings = 16; @@ -857,28 +858,32 @@ void GLReplay::SavePipelineState() GLint numVAttribBindings = 16; gl.glGetIntegerv(eGL_MAX_VERTEX_ATTRIBS, &numVAttribBindings); - pipe.m_VtxIn.vbuffers.resize(numVBufferBindings); - pipe.m_VtxIn.attributes.resize(numVAttribBindings); + pipe.vertexInput.vertexBuffers.resize(numVBufferBindings); + pipe.vertexInput.attributes.resize(numVAttribBindings); for(GLuint i = 0; i < (GLuint)numVBufferBindings; i++) { GLuint buffer = GetBoundVertexBuffer(gl.m_Real, i); - pipe.m_VtxIn.vbuffers[i].Buffer = rm->GetOriginalID(rm->GetID(BufferRes(ctx, buffer))); + pipe.vertexInput.vertexBuffers[i].resourceId = + rm->GetOriginalID(rm->GetID(BufferRes(ctx, buffer))); - gl.glGetIntegeri_v(eGL_VERTEX_BINDING_STRIDE, i, (GLint *)&pipe.m_VtxIn.vbuffers[i].Stride); - gl.glGetIntegeri_v(eGL_VERTEX_BINDING_OFFSET, i, (GLint *)&pipe.m_VtxIn.vbuffers[i].Offset); - gl.glGetIntegeri_v(eGL_VERTEX_BINDING_DIVISOR, i, (GLint *)&pipe.m_VtxIn.vbuffers[i].Divisor); + gl.glGetIntegeri_v(eGL_VERTEX_BINDING_STRIDE, i, + (GLint *)&pipe.vertexInput.vertexBuffers[i].byteStride); + gl.glGetIntegeri_v(eGL_VERTEX_BINDING_OFFSET, i, + (GLint *)&pipe.vertexInput.vertexBuffers[i].byteOffset); + gl.glGetIntegeri_v(eGL_VERTEX_BINDING_DIVISOR, i, + (GLint *)&pipe.vertexInput.vertexBuffers[i].instanceDivisor); } for(GLuint i = 0; i < (GLuint)numVAttribBindings; i++) { gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_ENABLED, - (GLint *)&pipe.m_VtxIn.attributes[i].Enabled); + (GLint *)&pipe.vertexInput.attributes[i].enabled); gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_BINDING, - (GLint *)&pipe.m_VtxIn.attributes[i].BufferSlot); + (GLint *)&pipe.vertexInput.attributes[i].vertexBufferSlot); gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_RELATIVE_OFFSET, - (GLint *)&pipe.m_VtxIn.attributes[i].RelativeOffset); + (GLint *)&pipe.vertexInput.attributes[i].byteOffset); GLenum type = eGL_FLOAT; GLint normalized = 0; @@ -889,9 +894,9 @@ void GLReplay::SavePipelineState() GLint integer = 0; gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_INTEGER, &integer); - RDCEraseEl(pipe.m_VtxIn.attributes[i].GenericValue); + RDCEraseEl(pipe.vertexInput.attributes[i].genericValue); gl.glGetVertexAttribfv(i, eGL_CURRENT_VERTEX_ATTRIB, - pipe.m_VtxIn.attributes[i].GenericValue.value_f); + pipe.vertexInput.attributes[i].genericValue.floatValue); ResourceFormat fmt; @@ -979,55 +984,56 @@ void GLReplay::SavePipelineState() } } - pipe.m_VtxIn.attributes[i].Format = fmt; + pipe.vertexInput.attributes[i].format = fmt; } - pipe.m_VtxIn.provokingVertexLast = (rs.ProvokingVertex != eGL_FIRST_VERTEX_CONVENTION); + pipe.vertexInput.provokingVertexLast = (rs.ProvokingVertex != eGL_FIRST_VERTEX_CONVENTION); - memcpy(pipe.m_VtxProcess.defaultInnerLevel, rs.PatchParams.defaultInnerLevel, + memcpy(pipe.vertexProcessing.defaultInnerLevel, rs.PatchParams.defaultInnerLevel, sizeof(rs.PatchParams.defaultInnerLevel)); - memcpy(pipe.m_VtxProcess.defaultOuterLevel, rs.PatchParams.defaultOuterLevel, + memcpy(pipe.vertexProcessing.defaultOuterLevel, rs.PatchParams.defaultOuterLevel, sizeof(rs.PatchParams.defaultOuterLevel)); - pipe.m_VtxProcess.discard = rs.Enabled[GLRenderState::eEnabled_RasterizerDiscard]; - pipe.m_VtxProcess.clipOriginLowerLeft = (rs.ClipOrigin != eGL_UPPER_LEFT); - pipe.m_VtxProcess.clipNegativeOneToOne = (rs.ClipDepth != eGL_ZERO_TO_ONE); + pipe.vertexProcessing.discard = rs.Enabled[GLRenderState::eEnabled_RasterizerDiscard]; + pipe.vertexProcessing.clipOriginLowerLeft = (rs.ClipOrigin != eGL_UPPER_LEFT); + pipe.vertexProcessing.clipNegativeOneToOne = (rs.ClipDepth != eGL_ZERO_TO_ONE); for(int i = 0; i < 8; i++) - pipe.m_VtxProcess.clipPlanes[i] = rs.Enabled[GLRenderState::eEnabled_ClipDistance0 + i]; + pipe.vertexProcessing.clipPlanes[i] = rs.Enabled[GLRenderState::eEnabled_ClipDistance0 + i]; // Shader stages & Textures GLint numTexUnits = 8; gl.glGetIntegerv(eGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numTexUnits); - pipe.Textures.resize(numTexUnits); - pipe.Samplers.resize(numTexUnits); + pipe.textures.resize(numTexUnits); + pipe.samplers.resize(numTexUnits); GLenum activeTexture = eGL_TEXTURE0; gl.glGetIntegerv(eGL_ACTIVE_TEXTURE, (GLint *)&activeTexture); - pipe.m_VS.stage = ShaderStage::Vertex; - pipe.m_TCS.stage = ShaderStage::Tess_Control; - pipe.m_TES.stage = ShaderStage::Tess_Eval; - pipe.m_GS.stage = ShaderStage::Geometry; - pipe.m_FS.stage = ShaderStage::Fragment; - pipe.m_CS.stage = ShaderStage::Compute; + pipe.vertexShader.stage = ShaderStage::Vertex; + pipe.tessControlShader.stage = ShaderStage::Tess_Control; + pipe.tessEvalShader.stage = ShaderStage::Tess_Eval; + pipe.geometryShader.stage = ShaderStage::Geometry; + pipe.fragmentShader.stage = ShaderStage::Fragment; + pipe.computeShader.stage = ShaderStage::Compute; GLuint curProg = 0; gl.glGetIntegerv(eGL_CURRENT_PROGRAM, (GLint *)&curProg); GLPipe::Shader *stages[6] = { - &pipe.m_VS, &pipe.m_TCS, &pipe.m_TES, &pipe.m_GS, &pipe.m_FS, &pipe.m_CS, + &pipe.vertexShader, &pipe.tessControlShader, &pipe.tessEvalShader, + &pipe.geometryShader, &pipe.fragmentShader, &pipe.computeShader, }; ShaderReflection *refls[6] = {NULL}; ShaderBindpointMapping *mappings[6] = {NULL}; for(int i = 0; i < 6; i++) { - stages[i]->Object = ResourceId(); - stages[i]->ShaderDetails = NULL; - stages[i]->BindpointMapping.ConstantBlocks.clear(); - stages[i]->BindpointMapping.ReadOnlyResources.clear(); - stages[i]->BindpointMapping.ReadWriteResources.clear(); + stages[i]->programResourceId = stages[i]->shaderResourceId = ResourceId(); + stages[i]->reflection = NULL; + stages[i]->bindpointMapping.constantBlocks.clear(); + stages[i]->bindpointMapping.readOnlyResources.clear(); + stages[i]->bindpointMapping.readWriteResources.clear(); } if(curProg == 0) @@ -1038,8 +1044,8 @@ void GLReplay::SavePipelineState() { for(GLint unit = 0; unit < numTexUnits; unit++) { - RDCEraseEl(pipe.Textures[unit]); - RDCEraseEl(pipe.Samplers[unit]); + RDCEraseEl(pipe.textures[unit]); + RDCEraseEl(pipe.samplers[unit]); } } else @@ -1047,25 +1053,24 @@ void GLReplay::SavePipelineState() ResourceId id = rm->GetID(ProgramPipeRes(ctx, curProg)); auto &pipeDetails = m_pDriver->m_Pipelines[id]; - pipe.Pipeline = rm->GetOriginalID(id); + pipe.pipelineResourceId = rm->GetOriginalID(id); for(size_t i = 0; i < ARRAY_COUNT(pipeDetails.stageShaders); i++) { if(pipeDetails.stageShaders[i] != ResourceId()) { curProg = rm->GetCurrentResource(pipeDetails.stagePrograms[i]).name; - stages[i]->Object = rm->GetOriginalID(pipeDetails.stageShaders[i]); - stages[i]->ShaderDetails = refls[i] = GetShader(pipeDetails.stageShaders[i], ""); + stages[i]->reflection = refls[i] = GetShader(pipeDetails.stageShaders[i], ""); GetBindpointMapping(gl.GetHookset(), curProg, (int)i, refls[i], - stages[i]->BindpointMapping); - mappings[i] = &stages[i]->BindpointMapping; + stages[i]->bindpointMapping); + mappings[i] = &stages[i]->bindpointMapping; - stages[i]->Program = rm->GetOriginalID(pipeDetails.stagePrograms[i]); - stages[i]->Object = rm->GetOriginalID(pipeDetails.stageShaders[i]); + stages[i]->programResourceId = rm->GetOriginalID(pipeDetails.stagePrograms[i]); + stages[i]->shaderResourceId = rm->GetOriginalID(pipeDetails.stageShaders[i]); } else { - stages[i]->Program = stages[i]->Object = ResourceId(); + stages[i]->programResourceId = stages[i]->shaderResourceId = ResourceId(); } } } @@ -1075,24 +1080,22 @@ void GLReplay::SavePipelineState() ResourceId id = rm->GetID(ProgramRes(ctx, curProg)); auto &progDetails = m_pDriver->m_Programs[id]; - pipe.Pipeline = ResourceId(); + pipe.pipelineResourceId = ResourceId(); for(size_t i = 0; i < ARRAY_COUNT(progDetails.stageShaders); i++) { if(progDetails.stageShaders[i] != ResourceId()) { - stages[i]->Program = rm->GetOriginalID(id); + stages[i]->reflection = refls[i] = GetShader(progDetails.stageShaders[i], ""); + GetBindpointMapping(gl.GetHookset(), curProg, (int)i, refls[i], stages[i]->bindpointMapping); + mappings[i] = &stages[i]->bindpointMapping; - stages[i]->Object = rm->GetOriginalID(progDetails.stageShaders[i]); - stages[i]->ShaderDetails = refls[i] = GetShader(progDetails.stageShaders[i], ""); - GetBindpointMapping(gl.GetHookset(), curProg, (int)i, refls[i], stages[i]->BindpointMapping); - mappings[i] = &stages[i]->BindpointMapping; - - stages[i]->Object = rm->GetOriginalID(progDetails.stageShaders[i]); + stages[i]->programResourceId = rm->GetOriginalID(id); + stages[i]->shaderResourceId = rm->GetOriginalID(progDetails.stageShaders[i]); } else { - stages[i]->Program = stages[i]->Object = ResourceId(); + stages[i]->programResourceId = stages[i]->shaderResourceId = ResourceId(); } } } @@ -1102,7 +1105,7 @@ void GLReplay::SavePipelineState() for(size_t i = 0; i < ARRAY_COUNT(refls); i++) ResortBindings(refls[i], mappings[i]); - RDCEraseEl(pipe.m_Feedback); + RDCEraseEl(pipe.transformFeedback); if(HasExt[ARB_transform_feedback2]) { @@ -1110,28 +1113,30 @@ void GLReplay::SavePipelineState() gl.glGetIntegerv(eGL_TRANSFORM_FEEDBACK_BINDING, (GLint *)&feedback); if(feedback != 0) - pipe.m_Feedback.Obj = rm->GetOriginalID(rm->GetID(FeedbackRes(ctx, feedback))); + pipe.transformFeedback.feedbackResourceId = + rm->GetOriginalID(rm->GetID(FeedbackRes(ctx, feedback))); GLint maxCount = 0; gl.glGetIntegerv(eGL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxCount); - for(int i = 0; i < (int)ARRAY_COUNT(pipe.m_Feedback.BufferBinding) && i < maxCount; i++) + for(int i = 0; i < (int)ARRAY_COUNT(pipe.transformFeedback.bufferResourceId) && i < maxCount; i++) { GLuint buffer = 0; gl.glGetIntegeri_v(eGL_TRANSFORM_FEEDBACK_BUFFER_BINDING, i, (GLint *)&buffer); - pipe.m_Feedback.BufferBinding[i] = rm->GetOriginalID(rm->GetID(BufferRes(ctx, buffer))); + pipe.transformFeedback.bufferResourceId[i] = + rm->GetOriginalID(rm->GetID(BufferRes(ctx, buffer))); gl.glGetInteger64i_v(eGL_TRANSFORM_FEEDBACK_BUFFER_START, i, - (GLint64 *)&pipe.m_Feedback.Offset[i]); + (GLint64 *)&pipe.transformFeedback.byteOffset[i]); gl.glGetInteger64i_v(eGL_TRANSFORM_FEEDBACK_BUFFER_SIZE, i, - (GLint64 *)&pipe.m_Feedback.Size[i]); + (GLint64 *)&pipe.transformFeedback.byteSize[i]); } GLint p = 0; gl.glGetIntegerv(eGL_TRANSFORM_FEEDBACK_BUFFER_PAUSED, &p); - pipe.m_Feedback.Paused = (p != 0); + pipe.transformFeedback.paused = (p != 0); gl.glGetIntegerv(eGL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE, &p); - pipe.m_Feedback.Active = (p != 0) || m_pDriver->m_WasActiveFeedback; + pipe.transformFeedback.active = (p != 0) || m_pDriver->m_WasActiveFeedback; } for(int i = 0; i < 6; i++) @@ -1139,12 +1144,12 @@ void GLReplay::SavePipelineState() size_t num = RDCMIN(128, rs.Subroutines[i].numSubroutines); if(num == 0) { - RDCEraseEl(stages[i]->Subroutines); + RDCEraseEl(stages[i]->subroutines); } else { - stages[i]->Subroutines.resize(num); - memcpy(stages[i]->Subroutines.data(), rs.Subroutines[i].Values, num * sizeof(uint32_t)); + stages[i]->subroutines.resize(num); + memcpy(stages[i]->subroutines.data(), rs.Subroutines[i].Values, num * sizeof(uint32_t)); } } @@ -1167,7 +1172,7 @@ void GLReplay::SavePipelineState() { GLenum binding = eGL_NONE; GLenum target = eGL_NONE; - TextureDim resType = TextureDim::Unknown; + TextureType resType = TextureType::Unknown; bool shadow = false; @@ -1176,10 +1181,10 @@ void GLReplay::SavePipelineState() if(refls[s] == NULL) continue; - for(const ShaderResource &res : refls[s]->ReadOnlyResources) + for(const ShaderResource &res : refls[s]->readOnlyResources) { // bindPoint is the uniform value for this sampler - if(mappings[s]->ReadOnlyResources[res.bindPoint].bind == unit) + if(mappings[s]->readOnlyResources[res.bindPoint].bind == unit) { GLenum t = eGL_NONE; @@ -1188,19 +1193,19 @@ void GLReplay::SavePipelineState() switch(res.resType) { - case TextureDim::Unknown: target = eGL_NONE; break; - case TextureDim::Buffer: target = eGL_TEXTURE_BUFFER; break; - case TextureDim::Texture1D: target = eGL_TEXTURE_1D; break; - case TextureDim::Texture1DArray: target = eGL_TEXTURE_1D_ARRAY; break; - case TextureDim::Texture2D: target = eGL_TEXTURE_2D; break; - case TextureDim::TextureRect: target = eGL_TEXTURE_RECTANGLE; break; - case TextureDim::Texture2DArray: target = eGL_TEXTURE_2D_ARRAY; break; - case TextureDim::Texture2DMS: target = eGL_TEXTURE_2D_MULTISAMPLE; break; - case TextureDim::Texture2DMSArray: target = eGL_TEXTURE_2D_MULTISAMPLE_ARRAY; break; - case TextureDim::Texture3D: target = eGL_TEXTURE_3D; break; - case TextureDim::TextureCube: target = eGL_TEXTURE_CUBE_MAP; break; - case TextureDim::TextureCubeArray: target = eGL_TEXTURE_CUBE_MAP_ARRAY; break; - case TextureDim::Count: RDCERR("Invalid shader resource type"); break; + case TextureType::Unknown: target = eGL_NONE; break; + case TextureType::Buffer: target = eGL_TEXTURE_BUFFER; break; + case TextureType::Texture1D: target = eGL_TEXTURE_1D; break; + case TextureType::Texture1DArray: target = eGL_TEXTURE_1D_ARRAY; break; + case TextureType::Texture2D: target = eGL_TEXTURE_2D; break; + case TextureType::TextureRect: target = eGL_TEXTURE_RECTANGLE; break; + case TextureType::Texture2DArray: target = eGL_TEXTURE_2D_ARRAY; break; + case TextureType::Texture2DMS: target = eGL_TEXTURE_2D_MULTISAMPLE; break; + case TextureType::Texture2DMSArray: target = eGL_TEXTURE_2D_MULTISAMPLE_ARRAY; break; + case TextureType::Texture3D: target = eGL_TEXTURE_3D; break; + case TextureType::TextureCube: target = eGL_TEXTURE_CUBE_MAP; break; + case TextureType::TextureCubeArray: target = eGL_TEXTURE_CUBE_MAP_ARRAY; break; + case TextureType::Count: RDCERR("Invalid shader resource type"); break; } if(target != eGL_NONE) @@ -1239,26 +1244,26 @@ void GLReplay::SavePipelineState() if(tex == 0) { - pipe.Textures[unit].Resource = ResourceId(); - pipe.Textures[unit].FirstSlice = 0; - pipe.Textures[unit].ResType = TextureDim::Unknown; - pipe.Textures[unit].DepthReadChannel = -1; - pipe.Textures[unit].Swizzle[0] = TextureSwizzle::Red; - pipe.Textures[unit].Swizzle[1] = TextureSwizzle::Green; - pipe.Textures[unit].Swizzle[2] = TextureSwizzle::Blue; - pipe.Textures[unit].Swizzle[3] = TextureSwizzle::Alpha; + pipe.textures[unit].resourceId = ResourceId(); + pipe.textures[unit].firstSlice = 0; + pipe.textures[unit].type = TextureType::Unknown; + pipe.textures[unit].depthReadChannel = -1; + pipe.textures[unit].swizzle[0] = TextureSwizzle::Red; + pipe.textures[unit].swizzle[1] = TextureSwizzle::Green; + pipe.textures[unit].swizzle[2] = TextureSwizzle::Blue; + pipe.textures[unit].swizzle[3] = TextureSwizzle::Alpha; - RDCEraseEl(pipe.Samplers[unit].BorderColor); - pipe.Samplers[unit].AddressS = AddressMode::Wrap; - pipe.Samplers[unit].AddressT = AddressMode::Wrap; - pipe.Samplers[unit].AddressR = AddressMode::Wrap; - pipe.Samplers[unit].Comparison = CompareFunc::AlwaysTrue; - pipe.Samplers[unit].Filter = TextureFilter(); - pipe.Samplers[unit].SeamlessCube = false; - pipe.Samplers[unit].MaxAniso = 0.0f; - pipe.Samplers[unit].MaxLOD = 0.0f; - pipe.Samplers[unit].MinLOD = 0.0f; - pipe.Samplers[unit].MipLODBias = 0.0f; + RDCEraseEl(pipe.samplers[unit].borderColor); + pipe.samplers[unit].addressS = AddressMode::Wrap; + pipe.samplers[unit].addressT = AddressMode::Wrap; + pipe.samplers[unit].addressR = AddressMode::Wrap; + pipe.samplers[unit].compareFunction = CompareFunction::AlwaysTrue; + pipe.samplers[unit].filter = TextureFilter(); + pipe.samplers[unit].seamlessCubeMap = false; + pipe.samplers[unit].maxAnisotropy = 0.0f; + pipe.samplers[unit].maxLOD = 0.0f; + pipe.samplers[unit].minLOD = 0.0f; + pipe.samplers[unit].mipLODBias = 0.0f; } else { @@ -1271,12 +1276,12 @@ void GLReplay::SavePipelineState() gl.glGetTexParameteriv(target, eGL_TEXTURE_VIEW_MIN_LAYER, &firstSlice); } - pipe.Textures[unit].Resource = rm->GetOriginalID(rm->GetID(TextureRes(ctx, tex))); - pipe.Textures[unit].HighestMip = (uint32_t)firstMip; - pipe.Textures[unit].FirstSlice = (uint32_t)firstSlice; - pipe.Textures[unit].ResType = resType; + pipe.textures[unit].resourceId = rm->GetOriginalID(rm->GetID(TextureRes(ctx, tex))); + pipe.textures[unit].firstMip = (uint32_t)firstMip; + pipe.textures[unit].firstSlice = (uint32_t)firstSlice; + pipe.textures[unit].type = resType; - pipe.Textures[unit].DepthReadChannel = -1; + pipe.textures[unit].depthReadChannel = -1; GLenum levelQueryType = target == eGL_TEXTURE_CUBE_MAP ? eGL_TEXTURE_CUBE_MAP_POSITIVE_X : target; @@ -1291,9 +1296,9 @@ void GLReplay::SavePipelineState() gl.glGetTexParameteriv(target, eGL_DEPTH_STENCIL_TEXTURE_MODE, &depthMode); if(depthMode == eGL_DEPTH_COMPONENT) - pipe.Textures[unit].DepthReadChannel = 0; + pipe.textures[unit].depthReadChannel = 0; else if(depthMode == eGL_STENCIL_INDEX) - pipe.Textures[unit].DepthReadChannel = 1; + pipe.textures[unit].depthReadChannel = 1; } GLint swizzles[4] = {eGL_RED, eGL_GREEN, eGL_BLUE, eGL_ALPHA}; @@ -1306,12 +1311,12 @@ void GLReplay::SavePipelineState() switch(swizzles[i]) { default: - case GL_ZERO: pipe.Textures[unit].Swizzle[i] = TextureSwizzle::Zero; break; - case GL_ONE: pipe.Textures[unit].Swizzle[i] = TextureSwizzle::One; break; - case eGL_RED: pipe.Textures[unit].Swizzle[i] = TextureSwizzle::Red; break; - case eGL_GREEN: pipe.Textures[unit].Swizzle[i] = TextureSwizzle::Green; break; - case eGL_BLUE: pipe.Textures[unit].Swizzle[i] = TextureSwizzle::Blue; break; - case eGL_ALPHA: pipe.Textures[unit].Swizzle[i] = TextureSwizzle::Alpha; break; + case GL_ZERO: pipe.textures[unit].swizzle[i] = TextureSwizzle::Zero; break; + case GL_ONE: pipe.textures[unit].swizzle[i] = TextureSwizzle::One; break; + case eGL_RED: pipe.textures[unit].swizzle[i] = TextureSwizzle::Red; break; + case eGL_GREEN: pipe.textures[unit].swizzle[i] = TextureSwizzle::Green; break; + case eGL_BLUE: pipe.textures[unit].swizzle[i] = TextureSwizzle::Blue; break; + case eGL_ALPHA: pipe.textures[unit].swizzle[i] = TextureSwizzle::Alpha; break; } } @@ -1319,16 +1324,16 @@ void GLReplay::SavePipelineState() if(HasExt[ARB_sampler_objects]) gl.glGetIntegerv(eGL_SAMPLER_BINDING, (GLint *)&samp); - pipe.Samplers[unit].Samp = rm->GetOriginalID(rm->GetID(SamplerRes(ctx, samp))); + pipe.samplers[unit].resourceId = rm->GetOriginalID(rm->GetID(SamplerRes(ctx, samp))); if(target != eGL_TEXTURE_BUFFER) { if(samp != 0) gl.glGetSamplerParameterfv(samp, eGL_TEXTURE_BORDER_COLOR, - &pipe.Samplers[unit].BorderColor[0]); + &pipe.samplers[unit].borderColor[0]); else gl.glGetTexParameterfv(target, eGL_TEXTURE_BORDER_COLOR, - &pipe.Samplers[unit].BorderColor[0]); + &pipe.samplers[unit].borderColor[0]); GLint v; v = 0; @@ -1336,21 +1341,21 @@ void GLReplay::SavePipelineState() gl.glGetSamplerParameteriv(samp, eGL_TEXTURE_WRAP_S, &v); else gl.glGetTexParameteriv(target, eGL_TEXTURE_WRAP_S, &v); - pipe.Samplers[unit].AddressS = MakeAddressMode((GLenum)v); + pipe.samplers[unit].addressS = MakeAddressMode((GLenum)v); v = 0; if(samp != 0) gl.glGetSamplerParameteriv(samp, eGL_TEXTURE_WRAP_T, &v); else gl.glGetTexParameteriv(target, eGL_TEXTURE_WRAP_T, &v); - pipe.Samplers[unit].AddressT = MakeAddressMode((GLenum)v); + pipe.samplers[unit].addressT = MakeAddressMode((GLenum)v); v = 0; if(samp != 0) gl.glGetSamplerParameteriv(samp, eGL_TEXTURE_WRAP_R, &v); else gl.glGetTexParameteriv(target, eGL_TEXTURE_WRAP_R, &v); - pipe.Samplers[unit].AddressR = MakeAddressMode((GLenum)v); + pipe.samplers[unit].addressR = MakeAddressMode((GLenum)v); v = 0; if(HasExt[ARB_seamless_cubemap_per_texture]) @@ -1360,7 +1365,7 @@ void GLReplay::SavePipelineState() else gl.glGetTexParameteriv(target, eGL_TEXTURE_CUBE_MAP_SEAMLESS, &v); } - pipe.Samplers[unit].SeamlessCube = + pipe.samplers[unit].seamlessCubeMap = (v != 0 || rs.Enabled[GLRenderState::eEnabled_TexCubeSeamless]); v = 0; @@ -1368,7 +1373,7 @@ void GLReplay::SavePipelineState() gl.glGetSamplerParameteriv(samp, eGL_TEXTURE_COMPARE_FUNC, &v); else gl.glGetTexParameteriv(target, eGL_TEXTURE_COMPARE_FUNC, &v); - pipe.Samplers[unit].Comparison = MakeCompareFunc((GLenum)v); + pipe.samplers[unit].compareFunction = MakeCompareFunc((GLenum)v); GLint minf = 0; GLint magf = 0; @@ -1386,40 +1391,40 @@ void GLReplay::SavePipelineState() { if(samp != 0) gl.glGetSamplerParameterfv(samp, eGL_TEXTURE_MAX_ANISOTROPY_EXT, - &pipe.Samplers[unit].MaxAniso); + &pipe.samplers[unit].maxAnisotropy); else gl.glGetTexParameterfv(target, eGL_TEXTURE_MAX_ANISOTROPY_EXT, - &pipe.Samplers[unit].MaxAniso); + &pipe.samplers[unit].maxAnisotropy); } else { - pipe.Samplers[unit].MaxAniso = 0.0f; + pipe.samplers[unit].maxAnisotropy = 0.0f; } - pipe.Samplers[unit].Filter = - MakeFilter((GLenum)minf, (GLenum)magf, shadow, pipe.Samplers[unit].MaxAniso); + pipe.samplers[unit].filter = + MakeFilter((GLenum)minf, (GLenum)magf, shadow, pipe.samplers[unit].maxAnisotropy); - gl.glGetTexParameterfv(target, eGL_TEXTURE_MAX_LOD, &pipe.Samplers[unit].MaxLOD); - gl.glGetTexParameterfv(target, eGL_TEXTURE_MIN_LOD, &pipe.Samplers[unit].MinLOD); + gl.glGetTexParameterfv(target, eGL_TEXTURE_MAX_LOD, &pipe.samplers[unit].maxLOD); + gl.glGetTexParameterfv(target, eGL_TEXTURE_MIN_LOD, &pipe.samplers[unit].minLOD); if(!IsGLES) - gl.glGetTexParameterfv(target, eGL_TEXTURE_LOD_BIAS, &pipe.Samplers[unit].MipLODBias); + gl.glGetTexParameterfv(target, eGL_TEXTURE_LOD_BIAS, &pipe.samplers[unit].mipLODBias); else - pipe.Samplers[unit].MipLODBias = 0.0f; + pipe.samplers[unit].mipLODBias = 0.0f; } else { // texture buffers don't support sampling - RDCEraseEl(pipe.Samplers[unit].BorderColor); - pipe.Samplers[unit].AddressS = AddressMode::Wrap; - pipe.Samplers[unit].AddressT = AddressMode::Wrap; - pipe.Samplers[unit].AddressR = AddressMode::Wrap; - pipe.Samplers[unit].Comparison = CompareFunc::AlwaysTrue; - pipe.Samplers[unit].Filter = TextureFilter(); - pipe.Samplers[unit].SeamlessCube = false; - pipe.Samplers[unit].MaxAniso = 0.0f; - pipe.Samplers[unit].MaxLOD = 0.0f; - pipe.Samplers[unit].MinLOD = 0.0f; - pipe.Samplers[unit].MipLODBias = 0.0f; + RDCEraseEl(pipe.samplers[unit].borderColor); + pipe.samplers[unit].addressS = AddressMode::Wrap; + pipe.samplers[unit].addressT = AddressMode::Wrap; + pipe.samplers[unit].addressR = AddressMode::Wrap; + pipe.samplers[unit].compareFunction = CompareFunction::AlwaysTrue; + pipe.samplers[unit].filter = TextureFilter(); + pipe.samplers[unit].seamlessCubeMap = false; + pipe.samplers[unit].maxAnisotropy = 0.0f; + pipe.samplers[unit].maxLOD = 0.0f; + pipe.samplers[unit].minLOD = 0.0f; + pipe.samplers[unit].mipLODBias = 0.0f; } } } @@ -1432,87 +1437,87 @@ void GLReplay::SavePipelineState() gl.glActiveTexture(activeTexture); - pipe.UniformBuffers.resize(ARRAY_COUNT(rs.UniformBinding)); - for(size_t b = 0; b < pipe.UniformBuffers.size(); b++) + pipe.uniformBuffers.resize(ARRAY_COUNT(rs.UniformBinding)); + for(size_t b = 0; b < pipe.uniformBuffers.size(); b++) { if(rs.UniformBinding[b].res.name == 0) { - pipe.UniformBuffers[b].Resource = ResourceId(); - pipe.UniformBuffers[b].Offset = pipe.UniformBuffers[b].Size = 0; + pipe.uniformBuffers[b].resourceId = ResourceId(); + pipe.uniformBuffers[b].byteOffset = pipe.uniformBuffers[b].byteSize = 0; } else { - pipe.UniformBuffers[b].Resource = rm->GetOriginalID(rm->GetID(rs.UniformBinding[b].res)); - pipe.UniformBuffers[b].Offset = rs.UniformBinding[b].start; - pipe.UniformBuffers[b].Size = rs.UniformBinding[b].size; + pipe.uniformBuffers[b].resourceId = rm->GetOriginalID(rm->GetID(rs.UniformBinding[b].res)); + pipe.uniformBuffers[b].byteOffset = rs.UniformBinding[b].start; + pipe.uniformBuffers[b].byteSize = rs.UniformBinding[b].size; } } - pipe.AtomicBuffers.resize(ARRAY_COUNT(rs.AtomicCounter)); - for(size_t b = 0; b < pipe.AtomicBuffers.size(); b++) + pipe.atomicBuffers.resize(ARRAY_COUNT(rs.AtomicCounter)); + for(size_t b = 0; b < pipe.atomicBuffers.size(); b++) { if(rs.AtomicCounter[b].res.name == 0) { - pipe.AtomicBuffers[b].Resource = ResourceId(); - pipe.AtomicBuffers[b].Offset = pipe.AtomicBuffers[b].Size = 0; + pipe.atomicBuffers[b].resourceId = ResourceId(); + pipe.atomicBuffers[b].byteOffset = pipe.atomicBuffers[b].byteSize = 0; } else { - pipe.AtomicBuffers[b].Resource = rm->GetOriginalID(rm->GetID(rs.AtomicCounter[b].res)); - pipe.AtomicBuffers[b].Offset = rs.AtomicCounter[b].start; - pipe.AtomicBuffers[b].Size = rs.AtomicCounter[b].size; + pipe.atomicBuffers[b].resourceId = rm->GetOriginalID(rm->GetID(rs.AtomicCounter[b].res)); + pipe.atomicBuffers[b].byteOffset = rs.AtomicCounter[b].start; + pipe.atomicBuffers[b].byteSize = rs.AtomicCounter[b].size; } } - pipe.ShaderStorageBuffers.resize(ARRAY_COUNT(rs.ShaderStorage)); - for(size_t b = 0; b < pipe.ShaderStorageBuffers.size(); b++) + pipe.shaderStorageBuffers.resize(ARRAY_COUNT(rs.ShaderStorage)); + for(size_t b = 0; b < pipe.shaderStorageBuffers.size(); b++) { if(rs.ShaderStorage[b].res.name == 0) { - pipe.ShaderStorageBuffers[b].Resource = ResourceId(); - pipe.ShaderStorageBuffers[b].Offset = pipe.ShaderStorageBuffers[b].Size = 0; + pipe.shaderStorageBuffers[b].resourceId = ResourceId(); + pipe.shaderStorageBuffers[b].byteOffset = pipe.shaderStorageBuffers[b].byteSize = 0; } else { - pipe.ShaderStorageBuffers[b].Resource = rm->GetOriginalID(rm->GetID(rs.ShaderStorage[b].res)); - pipe.ShaderStorageBuffers[b].Offset = rs.ShaderStorage[b].start; - pipe.ShaderStorageBuffers[b].Size = rs.ShaderStorage[b].size; + pipe.shaderStorageBuffers[b].resourceId = rm->GetOriginalID(rm->GetID(rs.ShaderStorage[b].res)); + pipe.shaderStorageBuffers[b].byteOffset = rs.ShaderStorage[b].start; + pipe.shaderStorageBuffers[b].byteSize = rs.ShaderStorage[b].size; } } - pipe.Images.resize(ARRAY_COUNT(rs.Images)); - for(size_t i = 0; i < pipe.Images.size(); i++) + pipe.images.resize(ARRAY_COUNT(rs.Images)); + for(size_t i = 0; i < pipe.images.size(); i++) { if(rs.Images[i].res.name == 0) { - RDCEraseEl(pipe.Images[i]); + RDCEraseEl(pipe.images[i]); } else { ResourceId id = rm->GetID(rs.Images[i].res); - pipe.Images[i].Resource = rm->GetOriginalID(id); - pipe.Images[i].Level = rs.Images[i].level; - pipe.Images[i].Layered = rs.Images[i].layered; - pipe.Images[i].Layer = rs.Images[i].layer; + pipe.images[i].resourceId = rm->GetOriginalID(id); + pipe.images[i].mipLevel = rs.Images[i].level; + pipe.images[i].layered = rs.Images[i].layered; + pipe.images[i].slice = rs.Images[i].layer; if(rs.Images[i].access == eGL_READ_ONLY) { - pipe.Images[i].readAllowed = true; - pipe.Images[i].writeAllowed = false; + pipe.images[i].readAllowed = true; + pipe.images[i].writeAllowed = false; } else if(rs.Images[i].access == eGL_WRITE_ONLY) { - pipe.Images[i].readAllowed = false; - pipe.Images[i].writeAllowed = true; + pipe.images[i].readAllowed = false; + pipe.images[i].writeAllowed = true; } else { - pipe.Images[i].readAllowed = true; - pipe.Images[i].writeAllowed = true; + pipe.images[i].readAllowed = true; + pipe.images[i].writeAllowed = true; } - pipe.Images[i].Format = + pipe.images[i].imageFormat = MakeResourceFormat(gl.GetHookset(), eGL_TEXTURE_2D, rs.Images[i].format); - pipe.Images[i].ResType = m_CachedTextures[id].resType; + pipe.images[i].type = m_CachedTextures[id].type; } } @@ -1520,25 +1525,25 @@ void GLReplay::SavePipelineState() RDCCOMPILE_ASSERT(ARRAY_COUNT(rs.Viewports) == ARRAY_COUNT(rs.DepthRanges), "GL Viewport count does not match depth ranges count"); - pipe.m_Rasterizer.Viewports.resize(ARRAY_COUNT(rs.Viewports)); - for(size_t v = 0; v < pipe.m_Rasterizer.Viewports.size(); ++v) + pipe.rasterizer.viewports.resize(ARRAY_COUNT(rs.Viewports)); + for(size_t v = 0; v < pipe.rasterizer.viewports.size(); ++v) { - pipe.m_Rasterizer.Viewports[v].Left = rs.Viewports[v].x; - pipe.m_Rasterizer.Viewports[v].Bottom = rs.Viewports[v].y; - pipe.m_Rasterizer.Viewports[v].Width = rs.Viewports[v].width; - pipe.m_Rasterizer.Viewports[v].Height = rs.Viewports[v].height; - pipe.m_Rasterizer.Viewports[v].MinDepth = rs.DepthRanges[v].nearZ; - pipe.m_Rasterizer.Viewports[v].MaxDepth = rs.DepthRanges[v].farZ; + pipe.rasterizer.viewports[v].x = rs.Viewports[v].x; + pipe.rasterizer.viewports[v].y = rs.Viewports[v].y; + pipe.rasterizer.viewports[v].width = rs.Viewports[v].width; + pipe.rasterizer.viewports[v].height = rs.Viewports[v].height; + pipe.rasterizer.viewports[v].minDepth = (float)rs.DepthRanges[v].nearZ; + pipe.rasterizer.viewports[v].maxDepth = (float)rs.DepthRanges[v].farZ; } - pipe.m_Rasterizer.Scissors.resize(ARRAY_COUNT(rs.Scissors)); - for(size_t s = 0; s < pipe.m_Rasterizer.Scissors.size(); ++s) + pipe.rasterizer.scissors.resize(ARRAY_COUNT(rs.Scissors)); + for(size_t s = 0; s < pipe.rasterizer.scissors.size(); ++s) { - pipe.m_Rasterizer.Scissors[s].Left = rs.Scissors[s].x; - pipe.m_Rasterizer.Scissors[s].Bottom = rs.Scissors[s].y; - pipe.m_Rasterizer.Scissors[s].Width = rs.Scissors[s].width; - pipe.m_Rasterizer.Scissors[s].Height = rs.Scissors[s].height; - pipe.m_Rasterizer.Scissors[s].Enabled = rs.Scissors[s].enabled; + pipe.rasterizer.scissors[s].x = rs.Scissors[s].x; + pipe.rasterizer.scissors[s].y = rs.Scissors[s].y; + pipe.rasterizer.scissors[s].width = rs.Scissors[s].width; + pipe.rasterizer.scissors[s].height = rs.Scissors[s].height; + pipe.rasterizer.scissors[s].enabled = rs.Scissors[s].enabled; } int polygonOffsetEnableEnum; @@ -1548,29 +1553,29 @@ void GLReplay::SavePipelineState() RDCWARN("Unexpected value for POLYGON_MODE %x", rs.PolygonMode); // fall through case eGL_FILL: - pipe.m_Rasterizer.m_State.fillMode = FillMode::Solid; + pipe.rasterizer.state.fillMode = FillMode::Solid; polygonOffsetEnableEnum = GLRenderState::eEnabled_PolyOffsetFill; break; case eGL_LINE: - pipe.m_Rasterizer.m_State.fillMode = FillMode::Wireframe; + pipe.rasterizer.state.fillMode = FillMode::Wireframe; polygonOffsetEnableEnum = GLRenderState::eEnabled_PolyOffsetLine; break; case eGL_POINT: - pipe.m_Rasterizer.m_State.fillMode = FillMode::Point; + pipe.rasterizer.state.fillMode = FillMode::Point; polygonOffsetEnableEnum = GLRenderState::eEnabled_PolyOffsetPoint; break; } if(rs.Enabled[polygonOffsetEnableEnum]) { - pipe.m_Rasterizer.m_State.DepthBias = rs.PolygonOffset[1]; - pipe.m_Rasterizer.m_State.SlopeScaledDepthBias = rs.PolygonOffset[0]; - pipe.m_Rasterizer.m_State.OffsetClamp = rs.PolygonOffset[2]; + pipe.rasterizer.state.depthBias = rs.PolygonOffset[1]; + pipe.rasterizer.state.slopeScaledDepthBias = rs.PolygonOffset[0]; + pipe.rasterizer.state.offsetClamp = rs.PolygonOffset[2]; } else { - pipe.m_Rasterizer.m_State.DepthBias = 0.0f; - pipe.m_Rasterizer.m_State.SlopeScaledDepthBias = 0.0f; - pipe.m_Rasterizer.m_State.OffsetClamp = 0.0f; + pipe.rasterizer.state.depthBias = 0.0f; + pipe.rasterizer.state.slopeScaledDepthBias = 0.0f; + pipe.rasterizer.state.offsetClamp = 0.0f; } if(rs.Enabled[GLRenderState::eEnabled_CullFace]) @@ -1580,64 +1585,63 @@ void GLReplay::SavePipelineState() default: RDCWARN("Unexpected value for CULL_FACE %x", rs.CullFace); // fall through - case eGL_BACK: pipe.m_Rasterizer.m_State.cullMode = CullMode::Back; break; - case eGL_FRONT: pipe.m_Rasterizer.m_State.cullMode = CullMode::Front; break; - case eGL_FRONT_AND_BACK: pipe.m_Rasterizer.m_State.cullMode = CullMode::FrontAndBack; break; + case eGL_BACK: pipe.rasterizer.state.cullMode = CullMode::Back; break; + case eGL_FRONT: pipe.rasterizer.state.cullMode = CullMode::Front; break; + case eGL_FRONT_AND_BACK: pipe.rasterizer.state.cullMode = CullMode::FrontAndBack; break; } } else { - pipe.m_Rasterizer.m_State.cullMode = CullMode::NoCull; + pipe.rasterizer.state.cullMode = CullMode::NoCull; } RDCASSERT(rs.FrontFace == eGL_CCW || rs.FrontFace == eGL_CW); - pipe.m_Rasterizer.m_State.FrontCCW = rs.FrontFace == eGL_CCW; - pipe.m_Rasterizer.m_State.DepthClamp = rs.Enabled[GLRenderState::eEnabled_DepthClamp]; + pipe.rasterizer.state.frontCCW = rs.FrontFace == eGL_CCW; + pipe.rasterizer.state.depthClamp = rs.Enabled[GLRenderState::eEnabled_DepthClamp]; - pipe.m_Rasterizer.m_State.MultisampleEnable = rs.Enabled[GLRenderState::eEnabled_Multisample]; - pipe.m_Rasterizer.m_State.SampleShading = rs.Enabled[GLRenderState::eEnabled_SampleShading]; - pipe.m_Rasterizer.m_State.SampleMask = rs.Enabled[GLRenderState::eEnabled_SampleMask]; - pipe.m_Rasterizer.m_State.SampleMaskValue = + pipe.rasterizer.state.multisampleEnable = rs.Enabled[GLRenderState::eEnabled_Multisample]; + pipe.rasterizer.state.sampleShading = rs.Enabled[GLRenderState::eEnabled_SampleShading]; + pipe.rasterizer.state.sampleMask = rs.Enabled[GLRenderState::eEnabled_SampleMask]; + pipe.rasterizer.state.sampleMaskValue = rs.SampleMask[0]; // assume number of samples is less than 32 - pipe.m_Rasterizer.m_State.SampleCoverage = rs.Enabled[GLRenderState::eEnabled_SampleCoverage]; - pipe.m_Rasterizer.m_State.SampleCoverageInvert = rs.SampleCoverageInvert; - pipe.m_Rasterizer.m_State.SampleCoverageValue = rs.SampleCoverage; - pipe.m_Rasterizer.m_State.SampleAlphaToCoverage = - rs.Enabled[GLRenderState::eEnabled_SampleAlphaToCoverage]; - pipe.m_Rasterizer.m_State.SampleAlphaToOne = rs.Enabled[GLRenderState::eEnabled_SampleAlphaToOne]; - pipe.m_Rasterizer.m_State.MinSampleShadingRate = rs.MinSampleShading; + pipe.rasterizer.state.sampleCoverage = rs.Enabled[GLRenderState::eEnabled_SampleCoverage]; + pipe.rasterizer.state.sampleCoverageInvert = rs.SampleCoverageInvert; + pipe.rasterizer.state.sampleCoverageValue = rs.SampleCoverage; + pipe.rasterizer.state.alphaToCoverage = rs.Enabled[GLRenderState::eEnabled_SampleAlphaToCoverage]; + pipe.rasterizer.state.alphaToOne = rs.Enabled[GLRenderState::eEnabled_SampleAlphaToOne]; + pipe.rasterizer.state.minSampleShadingRate = rs.MinSampleShading; - pipe.m_Rasterizer.m_State.ProgrammablePointSize = rs.Enabled[rs.eEnabled_ProgramPointSize]; - pipe.m_Rasterizer.m_State.PointSize = rs.PointSize; - pipe.m_Rasterizer.m_State.LineWidth = rs.LineWidth; - pipe.m_Rasterizer.m_State.PointFadeThreshold = rs.PointFadeThresholdSize; - pipe.m_Rasterizer.m_State.PointOriginUpperLeft = (rs.PointSpriteOrigin != eGL_LOWER_LEFT); + pipe.rasterizer.state.programmablePointSize = rs.Enabled[rs.eEnabled_ProgramPointSize]; + pipe.rasterizer.state.pointSize = rs.PointSize; + pipe.rasterizer.state.lineWidth = rs.LineWidth; + pipe.rasterizer.state.pointFadeThreshold = rs.PointFadeThresholdSize; + pipe.rasterizer.state.pointOriginUpperLeft = (rs.PointSpriteOrigin != eGL_LOWER_LEFT); // depth and stencil states - pipe.m_DepthState.DepthEnable = rs.Enabled[GLRenderState::eEnabled_DepthTest]; - pipe.m_DepthState.DepthWrites = rs.DepthWriteMask != 0; - pipe.m_DepthState.DepthFunc = MakeCompareFunc(rs.DepthFunc); + pipe.depthState.depthEnable = rs.Enabled[GLRenderState::eEnabled_DepthTest]; + pipe.depthState.depthWrites = rs.DepthWriteMask != 0; + pipe.depthState.depthFunction = MakeCompareFunc(rs.DepthFunc); - pipe.m_DepthState.DepthBounds = rs.Enabled[GLRenderState::eEnabled_DepthBoundsEXT]; - pipe.m_DepthState.NearBound = rs.DepthBounds.nearZ; - pipe.m_DepthState.FarBound = rs.DepthBounds.farZ; + pipe.depthState.depthBounds = rs.Enabled[GLRenderState::eEnabled_DepthBoundsEXT]; + pipe.depthState.nearBound = rs.DepthBounds.nearZ; + pipe.depthState.farBound = rs.DepthBounds.farZ; - pipe.m_StencilState.StencilEnable = rs.Enabled[GLRenderState::eEnabled_StencilTest]; - pipe.m_StencilState.m_FrontFace.ValueMask = rs.StencilFront.valuemask; - pipe.m_StencilState.m_FrontFace.WriteMask = rs.StencilFront.writemask; - pipe.m_StencilState.m_FrontFace.Ref = uint8_t(rs.StencilFront.ref & 0xff); - pipe.m_StencilState.m_FrontFace.Func = MakeCompareFunc(rs.StencilFront.func); - pipe.m_StencilState.m_FrontFace.PassOp = MakeStencilOp(rs.StencilFront.pass); - pipe.m_StencilState.m_FrontFace.FailOp = MakeStencilOp(rs.StencilFront.stencilFail); - pipe.m_StencilState.m_FrontFace.DepthFailOp = MakeStencilOp(rs.StencilFront.depthFail); - pipe.m_StencilState.m_BackFace.ValueMask = rs.StencilBack.valuemask; - pipe.m_StencilState.m_BackFace.WriteMask = rs.StencilBack.writemask; - pipe.m_StencilState.m_BackFace.Ref = uint8_t(rs.StencilBack.ref & 0xff); - pipe.m_StencilState.m_BackFace.Func = MakeCompareFunc(rs.StencilBack.func); - pipe.m_StencilState.m_BackFace.PassOp = MakeStencilOp(rs.StencilBack.pass); - pipe.m_StencilState.m_BackFace.FailOp = MakeStencilOp(rs.StencilBack.stencilFail); - pipe.m_StencilState.m_BackFace.DepthFailOp = MakeStencilOp(rs.StencilBack.depthFail); + pipe.stencilState.stencilEnable = rs.Enabled[GLRenderState::eEnabled_StencilTest]; + pipe.stencilState.frontFace.compareMask = rs.StencilFront.valuemask; + pipe.stencilState.frontFace.writeMask = rs.StencilFront.writemask; + pipe.stencilState.frontFace.reference = uint8_t(rs.StencilFront.ref & 0xff); + pipe.stencilState.frontFace.function = MakeCompareFunc(rs.StencilFront.func); + pipe.stencilState.frontFace.passOperation = MakeStencilOp(rs.StencilFront.pass); + pipe.stencilState.frontFace.failOperation = MakeStencilOp(rs.StencilFront.stencilFail); + pipe.stencilState.frontFace.depthFailOperation = MakeStencilOp(rs.StencilFront.depthFail); + pipe.stencilState.backFace.compareMask = rs.StencilBack.valuemask; + pipe.stencilState.backFace.writeMask = rs.StencilBack.writemask; + pipe.stencilState.backFace.reference = uint8_t(rs.StencilBack.ref & 0xff); + pipe.stencilState.backFace.function = MakeCompareFunc(rs.StencilBack.func); + pipe.stencilState.backFace.passOperation = MakeStencilOp(rs.StencilBack.pass); + pipe.stencilState.backFace.failOperation = MakeStencilOp(rs.StencilBack.stencilFail); + pipe.stencilState.backFace.depthFailOperation = MakeStencilOp(rs.StencilBack.depthFail); // Frame buffer @@ -1691,20 +1695,21 @@ void GLReplay::SavePipelineState() if(type == eGL_RENDERBUFFER) rbStencil = true; - pipe.m_FB.m_DrawFBO.Obj = rm->GetOriginalID(rm->GetID(FramebufferRes(ctx, curDrawFBO))); - pipe.m_FB.m_DrawFBO.Color.resize(numCols); + pipe.framebuffer.drawFBO.resourceId = + rm->GetOriginalID(rm->GetID(FramebufferRes(ctx, curDrawFBO))); + pipe.framebuffer.drawFBO.colorAttachments.resize(numCols); for(GLint i = 0; i < numCols; i++) { ResourceId id = rm->GetID(rbCol[i] ? RenderbufferRes(ctx, curCol[i]) : TextureRes(ctx, curCol[i])); - pipe.m_FB.m_DrawFBO.Color[i].Obj = rm->GetOriginalID(id); + pipe.framebuffer.drawFBO.colorAttachments[i].resourceId = rm->GetOriginalID(id); - if(pipe.m_FB.m_DrawFBO.Color[i].Obj != ResourceId() && !rbCol[i]) + if(pipe.framebuffer.drawFBO.colorAttachments[i].resourceId != ResourceId() && !rbCol[i]) GetFramebufferMipAndLayer(gl.GetHookset(), eGL_DRAW_FRAMEBUFFER, GLenum(eGL_COLOR_ATTACHMENT0 + i), - (GLint *)&pipe.m_FB.m_DrawFBO.Color[i].Mip, - (GLint *)&pipe.m_FB.m_DrawFBO.Color[i].Layer); + (GLint *)&pipe.framebuffer.drawFBO.colorAttachments[i].mipLevel, + (GLint *)&pipe.framebuffer.drawFBO.colorAttachments[i].slice); GLint swizzles[4] = {eGL_RED, eGL_GREEN, eGL_BLUE, eGL_ALPHA}; if(!rbCol[i] && id != ResourceId() && @@ -1719,43 +1724,55 @@ void GLReplay::SavePipelineState() switch(swizzles[s]) { default: - case GL_ZERO: pipe.m_FB.m_DrawFBO.Color[i].Swizzle[s] = TextureSwizzle::Zero; break; - case GL_ONE: pipe.m_FB.m_DrawFBO.Color[i].Swizzle[s] = TextureSwizzle::One; break; - case eGL_RED: pipe.m_FB.m_DrawFBO.Color[i].Swizzle[s] = TextureSwizzle::Red; break; - case eGL_GREEN: pipe.m_FB.m_DrawFBO.Color[i].Swizzle[s] = TextureSwizzle::Green; break; - case eGL_BLUE: pipe.m_FB.m_DrawFBO.Color[i].Swizzle[s] = TextureSwizzle::Blue; break; - case eGL_ALPHA: pipe.m_FB.m_DrawFBO.Color[i].Swizzle[s] = TextureSwizzle::Alpha; break; + case GL_ZERO: + pipe.framebuffer.drawFBO.colorAttachments[i].swizzle[s] = TextureSwizzle::Zero; + break; + case GL_ONE: + pipe.framebuffer.drawFBO.colorAttachments[i].swizzle[s] = TextureSwizzle::One; + break; + case eGL_RED: + pipe.framebuffer.drawFBO.colorAttachments[i].swizzle[s] = TextureSwizzle::Red; + break; + case eGL_GREEN: + pipe.framebuffer.drawFBO.colorAttachments[i].swizzle[s] = TextureSwizzle::Green; + break; + case eGL_BLUE: + pipe.framebuffer.drawFBO.colorAttachments[i].swizzle[s] = TextureSwizzle::Blue; + break; + case eGL_ALPHA: + pipe.framebuffer.drawFBO.colorAttachments[i].swizzle[s] = TextureSwizzle::Alpha; + break; } } } - pipe.m_FB.m_DrawFBO.Depth.Obj = rm->GetOriginalID( + pipe.framebuffer.drawFBO.depthAttachment.resourceId = rm->GetOriginalID( rm->GetID(rbDepth ? RenderbufferRes(ctx, curDepth) : TextureRes(ctx, curDepth))); - pipe.m_FB.m_DrawFBO.Stencil.Obj = rm->GetOriginalID( + pipe.framebuffer.drawFBO.stencilAttachment.resourceId = rm->GetOriginalID( rm->GetID(rbStencil ? RenderbufferRes(ctx, curStencil) : TextureRes(ctx, curStencil))); - if(pipe.m_FB.m_DrawFBO.Depth.Obj != ResourceId() && !rbDepth) + if(pipe.framebuffer.drawFBO.depthAttachment.resourceId != ResourceId() && !rbDepth) GetFramebufferMipAndLayer(gl.GetHookset(), eGL_DRAW_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT, - (GLint *)&pipe.m_FB.m_DrawFBO.Depth.Mip, - (GLint *)&pipe.m_FB.m_DrawFBO.Depth.Layer); + (GLint *)&pipe.framebuffer.drawFBO.depthAttachment.mipLevel, + (GLint *)&pipe.framebuffer.drawFBO.depthAttachment.slice); - if(pipe.m_FB.m_DrawFBO.Stencil.Obj != ResourceId() && !rbStencil) + if(pipe.framebuffer.drawFBO.stencilAttachment.resourceId != ResourceId() && !rbStencil) GetFramebufferMipAndLayer(gl.GetHookset(), eGL_DRAW_FRAMEBUFFER, eGL_STENCIL_ATTACHMENT, - (GLint *)&pipe.m_FB.m_DrawFBO.Stencil.Mip, - (GLint *)&pipe.m_FB.m_DrawFBO.Stencil.Layer); + (GLint *)&pipe.framebuffer.drawFBO.stencilAttachment.mipLevel, + (GLint *)&pipe.framebuffer.drawFBO.stencilAttachment.slice); - pipe.m_FB.m_DrawFBO.DrawBuffers.resize(numCols); + pipe.framebuffer.drawFBO.drawBuffers.resize(numCols); for(GLint i = 0; i < numCols; i++) { GLenum b = eGL_NONE; gl.glGetIntegerv(GLenum(eGL_DRAW_BUFFER0 + i), (GLint *)&b); if(b >= eGL_COLOR_ATTACHMENT0 && b <= GLenum(eGL_COLOR_ATTACHMENT0 + numCols)) - pipe.m_FB.m_DrawFBO.DrawBuffers[i] = b - eGL_COLOR_ATTACHMENT0; + pipe.framebuffer.drawFBO.drawBuffers[i] = b - eGL_COLOR_ATTACHMENT0; else - pipe.m_FB.m_DrawFBO.DrawBuffers[i] = -1; + pipe.framebuffer.drawFBO.drawBuffers[i] = -1; } - pipe.m_FB.m_DrawFBO.ReadBuffer = -1; + pipe.framebuffer.drawFBO.readBuffer = -1; } { @@ -1787,121 +1804,126 @@ void GLReplay::SavePipelineState() if(type == eGL_RENDERBUFFER) rbStencil = true; - pipe.m_FB.m_ReadFBO.Obj = rm->GetOriginalID(rm->GetID(FramebufferRes(ctx, curReadFBO))); - pipe.m_FB.m_ReadFBO.Color.resize(numCols); + pipe.framebuffer.readFBO.resourceId = + rm->GetOriginalID(rm->GetID(FramebufferRes(ctx, curReadFBO))); + pipe.framebuffer.readFBO.colorAttachments.resize(numCols); for(GLint i = 0; i < numCols; i++) { - pipe.m_FB.m_ReadFBO.Color[i].Obj = rm->GetOriginalID( + pipe.framebuffer.readFBO.colorAttachments[i].resourceId = rm->GetOriginalID( rm->GetID(rbCol[i] ? RenderbufferRes(ctx, curCol[i]) : TextureRes(ctx, curCol[i]))); - if(pipe.m_FB.m_ReadFBO.Color[i].Obj != ResourceId() && !rbCol[i]) + if(pipe.framebuffer.readFBO.colorAttachments[i].resourceId != ResourceId() && !rbCol[i]) GetFramebufferMipAndLayer(gl.GetHookset(), eGL_READ_FRAMEBUFFER, GLenum(eGL_COLOR_ATTACHMENT0 + i), - (GLint *)&pipe.m_FB.m_ReadFBO.Color[i].Mip, - (GLint *)&pipe.m_FB.m_ReadFBO.Color[i].Layer); + (GLint *)&pipe.framebuffer.readFBO.colorAttachments[i].mipLevel, + (GLint *)&pipe.framebuffer.readFBO.colorAttachments[i].slice); } - pipe.m_FB.m_ReadFBO.Depth.Obj = rm->GetOriginalID( + pipe.framebuffer.readFBO.depthAttachment.resourceId = rm->GetOriginalID( rm->GetID(rbDepth ? RenderbufferRes(ctx, curDepth) : TextureRes(ctx, curDepth))); - pipe.m_FB.m_ReadFBO.Stencil.Obj = rm->GetOriginalID( + pipe.framebuffer.readFBO.stencilAttachment.resourceId = rm->GetOriginalID( rm->GetID(rbStencil ? RenderbufferRes(ctx, curStencil) : TextureRes(ctx, curStencil))); - if(pipe.m_FB.m_ReadFBO.Depth.Obj != ResourceId() && !rbDepth) + if(pipe.framebuffer.readFBO.depthAttachment.resourceId != ResourceId() && !rbDepth) GetFramebufferMipAndLayer(gl.GetHookset(), eGL_READ_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT, - (GLint *)&pipe.m_FB.m_ReadFBO.Depth.Mip, - (GLint *)&pipe.m_FB.m_ReadFBO.Depth.Layer); + (GLint *)&pipe.framebuffer.readFBO.depthAttachment.mipLevel, + (GLint *)&pipe.framebuffer.readFBO.depthAttachment.slice); - if(pipe.m_FB.m_ReadFBO.Stencil.Obj != ResourceId() && !rbStencil) + if(pipe.framebuffer.readFBO.stencilAttachment.resourceId != ResourceId() && !rbStencil) GetFramebufferMipAndLayer(gl.GetHookset(), eGL_READ_FRAMEBUFFER, eGL_STENCIL_ATTACHMENT, - (GLint *)&pipe.m_FB.m_ReadFBO.Stencil.Mip, - (GLint *)&pipe.m_FB.m_ReadFBO.Stencil.Layer); + (GLint *)&pipe.framebuffer.readFBO.stencilAttachment.mipLevel, + (GLint *)&pipe.framebuffer.readFBO.stencilAttachment.slice); - pipe.m_FB.m_ReadFBO.DrawBuffers.resize(numCols); + pipe.framebuffer.readFBO.drawBuffers.resize(numCols); for(GLint i = 0; i < numCols; i++) - pipe.m_FB.m_ReadFBO.DrawBuffers[i] = -1; + pipe.framebuffer.readFBO.drawBuffers[i] = -1; GLenum b = eGL_NONE; gl.glGetIntegerv(eGL_READ_BUFFER, (GLint *)&b); if(b >= eGL_COLOR_ATTACHMENT0 && b <= GLenum(eGL_COLOR_ATTACHMENT0 + numCols)) - pipe.m_FB.m_DrawFBO.ReadBuffer = b - eGL_COLOR_ATTACHMENT0; + pipe.framebuffer.drawFBO.readBuffer = b - eGL_COLOR_ATTACHMENT0; else - pipe.m_FB.m_DrawFBO.ReadBuffer = -1; + pipe.framebuffer.drawFBO.readBuffer = -1; } - memcpy(pipe.m_FB.m_Blending.BlendFactor, rs.BlendColor, sizeof(rs.BlendColor)); + memcpy(pipe.framebuffer.blendState.blendFactor, rs.BlendColor, sizeof(rs.BlendColor)); - pipe.m_FB.FramebufferSRGB = rs.Enabled[GLRenderState::eEnabled_FramebufferSRGB]; - pipe.m_FB.Dither = rs.Enabled[GLRenderState::eEnabled_Dither]; + pipe.framebuffer.framebufferSRGB = rs.Enabled[GLRenderState::eEnabled_FramebufferSRGB]; + pipe.framebuffer.dither = rs.Enabled[GLRenderState::eEnabled_Dither]; RDCCOMPILE_ASSERT(ARRAY_COUNT(rs.Blends) == ARRAY_COUNT(rs.ColorMasks), "Color masks and blends mismatched"); - pipe.m_FB.m_Blending.Blends.resize(ARRAY_COUNT(rs.Blends)); + pipe.framebuffer.blendState.blends.resize(ARRAY_COUNT(rs.Blends)); for(size_t i = 0; i < ARRAY_COUNT(rs.Blends); i++) { - pipe.m_FB.m_Blending.Blends[i].Enabled = rs.Blends[i].Enabled; - pipe.m_FB.m_Blending.Blends[i].Logic = LogicOp::NoOp; - if(rs.LogicOp != eGL_NONE && rs.LogicOp != eGL_COPY && - rs.Enabled[GLRenderState::eEnabled_ColorLogicOp]) - { - pipe.m_FB.m_Blending.Blends[i].Logic = MakeLogicOp(rs.LogicOp); - } + pipe.framebuffer.blendState.blends[i].enabled = rs.Blends[i].Enabled; + pipe.framebuffer.blendState.blends[i].logicOperation = LogicOperation::NoOp; - pipe.m_FB.m_Blending.Blends[i].m_Blend.Source = MakeBlendMultiplier(rs.Blends[i].SourceRGB); - pipe.m_FB.m_Blending.Blends[i].m_Blend.Destination = + if(rs.LogicOp != eGL_NONE && rs.LogicOp != eGL_COPY) + pipe.framebuffer.blendState.blends[i].logicOperation = MakeLogicOp(rs.LogicOp); + + pipe.framebuffer.blendState.blends[i].logicOperationEnabled = + rs.Enabled[GLRenderState::eEnabled_ColorLogicOp]; + + pipe.framebuffer.blendState.blends[i].colorBlend.source = + MakeBlendMultiplier(rs.Blends[i].SourceRGB); + pipe.framebuffer.blendState.blends[i].colorBlend.destination = MakeBlendMultiplier(rs.Blends[i].DestinationRGB); - pipe.m_FB.m_Blending.Blends[i].m_Blend.Operation = MakeBlendOp(rs.Blends[i].EquationRGB); + pipe.framebuffer.blendState.blends[i].colorBlend.operation = + MakeBlendOp(rs.Blends[i].EquationRGB); - pipe.m_FB.m_Blending.Blends[i].m_AlphaBlend.Source = + pipe.framebuffer.blendState.blends[i].alphaBlend.source = MakeBlendMultiplier(rs.Blends[i].SourceAlpha); - pipe.m_FB.m_Blending.Blends[i].m_AlphaBlend.Destination = + pipe.framebuffer.blendState.blends[i].alphaBlend.destination = MakeBlendMultiplier(rs.Blends[i].DestinationAlpha); - pipe.m_FB.m_Blending.Blends[i].m_AlphaBlend.Operation = MakeBlendOp(rs.Blends[i].EquationAlpha); + pipe.framebuffer.blendState.blends[i].alphaBlend.operation = + MakeBlendOp(rs.Blends[i].EquationAlpha); - pipe.m_FB.m_Blending.Blends[i].WriteMask = 0; + pipe.framebuffer.blendState.blends[i].writeMask = 0; if(rs.ColorMasks[i].red) - pipe.m_FB.m_Blending.Blends[i].WriteMask |= 1; + pipe.framebuffer.blendState.blends[i].writeMask |= 1; if(rs.ColorMasks[i].green) - pipe.m_FB.m_Blending.Blends[i].WriteMask |= 2; + pipe.framebuffer.blendState.blends[i].writeMask |= 2; if(rs.ColorMasks[i].blue) - pipe.m_FB.m_Blending.Blends[i].WriteMask |= 4; + pipe.framebuffer.blendState.blends[i].writeMask |= 4; if(rs.ColorMasks[i].alpha) - pipe.m_FB.m_Blending.Blends[i].WriteMask |= 8; + pipe.framebuffer.blendState.blends[i].writeMask |= 8; } switch(rs.Hints.Derivatives) { default: - case eGL_DONT_CARE: pipe.m_Hints.Derivatives = QualityHint::DontCare; break; - case eGL_NICEST: pipe.m_Hints.Derivatives = QualityHint::Nicest; break; - case eGL_FASTEST: pipe.m_Hints.Derivatives = QualityHint::Fastest; break; + case eGL_DONT_CARE: pipe.hints.derivatives = QualityHint::DontCare; break; + case eGL_NICEST: pipe.hints.derivatives = QualityHint::Nicest; break; + case eGL_FASTEST: pipe.hints.derivatives = QualityHint::Fastest; break; } switch(rs.Hints.LineSmooth) { default: - case eGL_DONT_CARE: pipe.m_Hints.LineSmooth = QualityHint::DontCare; break; - case eGL_NICEST: pipe.m_Hints.LineSmooth = QualityHint::Nicest; break; - case eGL_FASTEST: pipe.m_Hints.LineSmooth = QualityHint::Fastest; break; + case eGL_DONT_CARE: pipe.hints.lineSmoothing = QualityHint::DontCare; break; + case eGL_NICEST: pipe.hints.lineSmoothing = QualityHint::Nicest; break; + case eGL_FASTEST: pipe.hints.lineSmoothing = QualityHint::Fastest; break; } switch(rs.Hints.PolySmooth) { default: - case eGL_DONT_CARE: pipe.m_Hints.PolySmooth = QualityHint::DontCare; break; - case eGL_NICEST: pipe.m_Hints.PolySmooth = QualityHint::Nicest; break; - case eGL_FASTEST: pipe.m_Hints.PolySmooth = QualityHint::Fastest; break; + case eGL_DONT_CARE: pipe.hints.polySmoothing = QualityHint::DontCare; break; + case eGL_NICEST: pipe.hints.polySmoothing = QualityHint::Nicest; break; + case eGL_FASTEST: pipe.hints.polySmoothing = QualityHint::Fastest; break; } switch(rs.Hints.TexCompression) { default: - case eGL_DONT_CARE: pipe.m_Hints.TexCompression = QualityHint::DontCare; break; - case eGL_NICEST: pipe.m_Hints.TexCompression = QualityHint::Nicest; break; - case eGL_FASTEST: pipe.m_Hints.TexCompression = QualityHint::Fastest; break; + case eGL_DONT_CARE: pipe.hints.textureCompression = QualityHint::DontCare; break; + case eGL_NICEST: pipe.hints.textureCompression = QualityHint::Nicest; break; + case eGL_FASTEST: pipe.hints.textureCompression = QualityHint::Fastest; break; } - pipe.m_Hints.LineSmoothEnabled = rs.Enabled[GLRenderState::eEnabled_LineSmooth]; - pipe.m_Hints.PolySmoothEnabled = rs.Enabled[GLRenderState::eEnabled_PolySmooth]; + pipe.hints.lineSmoothingEnabled = rs.Enabled[GLRenderState::eEnabled_LineSmooth]; + pipe.hints.polySmoothingEnabled = rs.Enabled[GLRenderState::eEnabled_PolySmooth]; } void GLReplay::FillCBufferValue(WrappedOpenGL &gl, GLuint prog, bool bufferBacked, bool rowMajor, @@ -1993,7 +2015,7 @@ void GLReplay::FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferB ShaderVariable var; var.name = variables[i].name; var.rows = desc.rows; - var.columns = desc.cols; + var.columns = desc.columns; var.type = desc.type; if(!variables[i].type.members.empty()) @@ -2097,7 +2119,7 @@ void GLReplay::FillCBufferVariables(ResourceId shader, string entryPoint, uint32 auto &shaderDetails = m_pDriver->m_Shaders[shader]; - if((int32_t)cbufSlot >= shaderDetails.reflection.ConstantBlocks.count()) + if((int32_t)cbufSlot >= shaderDetails.reflection.constantBlocks.count()) { RDCERR("Requesting invalid constant block"); return; @@ -2128,7 +2150,7 @@ void GLReplay::FillCBufferVariables(ResourceId shader, string entryPoint, uint32 } } - const ConstantBlock &cblock = shaderDetails.reflection.ConstantBlocks[cbufSlot]; + const ConstantBlock &cblock = shaderDetails.reflection.constantBlocks[cbufSlot]; FillCBufferVariables(gl, curProg, cblock.bufferBacked ? true : false, "", cblock.variables, outvars, data); @@ -2243,23 +2265,23 @@ void GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = ~0U; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = arrayIdx; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = CompType::Typeless; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; if(newtarget == eGL_TEXTURE_3D) { @@ -2290,24 +2312,24 @@ void GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, { TextureDisplay texDisplay; - texDisplay.Green = true; - texDisplay.Red = texDisplay.Blue = texDisplay.Alpha = false; - texDisplay.HDRMul = -1.0f; + texDisplay.green = true; + texDisplay.red = texDisplay.blue = texDisplay.alpha = false; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = ~0U; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = arrayIdx; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = CompType::Typeless; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; gl.glViewport(0, 0, width, height); @@ -2702,21 +2724,21 @@ ResourceId GLReplay::ApplyCustomShader(ResourceId shader, ResourceId texid, uint m_pDriver->glClearBufferfv(eGL_COLOR, 0, clr); TextureDisplay disp; - disp.Red = disp.Green = disp.Blue = disp.Alpha = true; - disp.FlipY = false; - disp.offx = 0.0f; - disp.offy = 0.0f; - disp.CustomShader = shader; - disp.texid = texid; + disp.red = disp.green = disp.blue = disp.alpha = true; + disp.flipY = false; + disp.xOffset = 0.0f; + disp.yOffset = 0.0f; + disp.customShaderId = shader; + disp.resourceId = texid; disp.typeHint = typeHint; - disp.HDRMul = -1.0f; + disp.hdrMultiplier = -1.0f; disp.linearDisplayAsGamma = false; disp.mip = mip; disp.sampleIdx = sampleIdx; disp.overlay = DebugOverlay::NoOverlay; - disp.rangemin = 0.0f; - disp.rangemax = 1.0f; - disp.rawoutput = false; + disp.rangeMin = 0.0f; + disp.rangeMax = 1.0f; + disp.rawOutput = false; disp.scale = 1.0f; disp.sliceFace = arrayIdx; @@ -2870,21 +2892,21 @@ ResourceId GLReplay::CreateProxyTexture(const TextureDescription &templateTex) GLenum target = eGL_NONE; - switch(templateTex.resType) + switch(templateTex.type) { - case TextureDim::Unknown: break; - case TextureDim::Buffer: - case TextureDim::Texture1D: target = eGL_TEXTURE_1D; break; - case TextureDim::Texture1DArray: target = eGL_TEXTURE_1D_ARRAY; break; - case TextureDim::TextureRect: - case TextureDim::Texture2D: target = eGL_TEXTURE_2D; break; - case TextureDim::Texture2DArray: target = eGL_TEXTURE_2D_ARRAY; break; - case TextureDim::Texture2DMS: target = eGL_TEXTURE_2D_MULTISAMPLE; break; - case TextureDim::Texture2DMSArray: target = eGL_TEXTURE_2D_MULTISAMPLE_ARRAY; break; - case TextureDim::Texture3D: target = eGL_TEXTURE_3D; break; - case TextureDim::TextureCube: target = eGL_TEXTURE_CUBE_MAP; break; - case TextureDim::TextureCubeArray: target = eGL_TEXTURE_CUBE_MAP_ARRAY; break; - case TextureDim::Count: RDCERR("Invalid texture dimension"); break; + case TextureType::Unknown: break; + case TextureType::Buffer: + case TextureType::Texture1D: target = eGL_TEXTURE_1D; break; + case TextureType::Texture1DArray: target = eGL_TEXTURE_1D_ARRAY; break; + case TextureType::TextureRect: + case TextureType::Texture2D: target = eGL_TEXTURE_2D; break; + case TextureType::Texture2DArray: target = eGL_TEXTURE_2D_ARRAY; break; + case TextureType::Texture2DMS: target = eGL_TEXTURE_2D_MULTISAMPLE; break; + case TextureType::Texture2DMSArray: target = eGL_TEXTURE_2D_MULTISAMPLE_ARRAY; break; + case TextureType::Texture3D: target = eGL_TEXTURE_3D; break; + case TextureType::TextureCube: target = eGL_TEXTURE_CUBE_MAP; break; + case TextureType::TextureCubeArray: target = eGL_TEXTURE_CUBE_MAP_ARRAY; break; + case TextureType::Count: RDCERR("Invalid texture dimension"); break; } if(target != eGL_NONE) @@ -3204,21 +3226,21 @@ vector GLReplay::PixelHistory(vector events, Reso return vector(); } -ShaderDebugTrace GLReplay::DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, +ShaderDebugTrace GLReplay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { GLNOTIMP("DebugVertex"); return ShaderDebugTrace(); } -ShaderDebugTrace GLReplay::DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample, +ShaderDebugTrace GLReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { GLNOTIMP("DebugPixel"); return ShaderDebugTrace(); } -ShaderDebugTrace GLReplay::DebugThread(uint32_t eventID, const uint32_t groupid[3], +ShaderDebugTrace GLReplay::DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { GLNOTIMP("DebugThread"); @@ -3337,7 +3359,7 @@ void GL_ProcessStructured(RDCFile *rdc, SDFile &output) ReplayStatus status = device.ReadLogInitialisation(rdc, true); if(status == ReplayStatus::Succeeded) - device.GetStructuredFile().swap(output); + device.GetStructuredFile().Swap(output); } static StructuredProcessRegistration GLProcessRegistration(RDC_OpenGL, &GL_ProcessStructured); diff --git a/renderdoc/driver/gl/gl_replay.h b/renderdoc/driver/gl/gl_replay.h index f36ac9f93..28e028f53 100644 --- a/renderdoc/driver/gl/gl_replay.h +++ b/renderdoc/driver/gl/gl_replay.h @@ -125,7 +125,7 @@ public: void ReplayLog(uint32_t endEventID, ReplayLogType replayType); const SDFile &GetStructuredFile(); - vector GetPassEvents(uint32_t eventID); + vector GetPassEvents(uint32_t eventId); vector GetSupportedWindowSystems() { @@ -149,7 +149,7 @@ public: bool IsOutputWindowVisible(uint64_t id); void FlipOutputWindow(uint64_t id); - void InitPostVSBuffers(uint32_t eventID); + void InitPostVSBuffers(uint32_t eventId); void InitPostVSBuffers(const vector &passEvents); ResourceId GetLiveID(ResourceId id); @@ -160,7 +160,7 @@ public: CompType typeHint, float minval, float maxval, bool channels[4], vector &histogram); - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &ret); void GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, @@ -173,7 +173,7 @@ public: CounterDescription DescribeCounter(GPUCounter counterID); vector FetchCounters(const vector &counters); - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg); + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg); void BuildTargetShader(string source, string entry, const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id, string *errors); @@ -200,17 +200,17 @@ public: vector PixelHistory(vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint); - ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx, + 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, + ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive); - ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + 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 PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y); + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y); - ResourceId RenderOverlay(ResourceId id, CompType typeHint, DebugOverlay overlay, uint32_t eventID, + ResourceId RenderOverlay(ResourceId id, CompType typeHint, DebugOverlay overlay, uint32_t eventId, const vector &passEvents); ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint); @@ -368,7 +368,7 @@ private: HighlightCache m_HighlightCache; - // eventID -> data + // eventId -> data map m_PostVSData; void ClearPostVSCache(); diff --git a/renderdoc/driver/gl/gl_shader_refl.cpp b/renderdoc/driver/gl/gl_shader_refl.cpp index fd4db2ed0..e64d261d6 100644 --- a/renderdoc/driver/gl/gl_shader_refl.cpp +++ b/renderdoc/driver/gl/gl_shader_refl.cpp @@ -596,7 +596,7 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin case eGL_DOUBLE_MAT4x3: case eGL_UNSIGNED_INT_VEC4: case eGL_BOOL_VEC4: - case eGL_INT_VEC4: var.type.descriptor.cols = 4; break; + case eGL_INT_VEC4: var.type.descriptor.columns = 4; break; case eGL_FLOAT_VEC3: case eGL_FLOAT_MAT3: case eGL_FLOAT_MAT3x4: @@ -607,7 +607,7 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin case eGL_DOUBLE_MAT3x2: case eGL_UNSIGNED_INT_VEC3: case eGL_BOOL_VEC3: - case eGL_INT_VEC3: var.type.descriptor.cols = 3; break; + case eGL_INT_VEC3: var.type.descriptor.columns = 3; break; case eGL_FLOAT_VEC2: case eGL_FLOAT_MAT2: case eGL_FLOAT_MAT2x4: @@ -618,12 +618,12 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin case eGL_DOUBLE_MAT2x3: case eGL_UNSIGNED_INT_VEC2: case eGL_BOOL_VEC2: - case eGL_INT_VEC2: var.type.descriptor.cols = 2; break; + case eGL_INT_VEC2: var.type.descriptor.columns = 2; break; case eGL_FLOAT: case eGL_DOUBLE: case eGL_UNSIGNED_INT: case eGL_INT: - case eGL_BOOL: var.type.descriptor.cols = 1; break; + case eGL_BOOL: var.type.descriptor.columns = 1; break; default: break; } @@ -689,7 +689,7 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin } var.type.descriptor.rowMajorStorage = (values[6] > 0); - var.type.descriptor.arrayStride = values[7]; + var.type.descriptor.arrayByteStride = values[7]; var.name.resize(values[1] - 1); gl.glGetProgramResourceName(sepProg, query, varIdx, values[1], NULL, &var.name[0]); @@ -781,11 +781,11 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin parentVar.reg.comp = 0; parentVar.type.descriptor.name = "struct"; parentVar.type.descriptor.rows = 0; - parentVar.type.descriptor.cols = 0; + parentVar.type.descriptor.columns = 0; parentVar.type.descriptor.rowMajorStorage = false; parentVar.type.descriptor.type = var.type.descriptor.type; parentVar.type.descriptor.elements = isarray ? RDCMAX(1U, uint32_t(arrayIdx + 1)) : 0; - parentVar.type.descriptor.arrayStride = topLevelStride; + parentVar.type.descriptor.arrayByteStride = topLevelStride; bool found = false; @@ -840,15 +840,15 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, { if(shadType == eGL_COMPUTE_SHADER) { - gl.glGetProgramiv(sepProg, eGL_COMPUTE_WORK_GROUP_SIZE, (GLint *)refl.DispatchThreadsDimension); + gl.glGetProgramiv(sepProg, eGL_COMPUTE_WORK_GROUP_SIZE, (GLint *)refl.dispatchThreadsDimension); } else { - RDCEraseEl(refl.DispatchThreadsDimension); + RDCEraseEl(refl.dispatchThreadsDimension); } - rdcarray &roresources = refl.ReadOnlyResources; - rdcarray &rwresources = refl.ReadWriteResources; + rdcarray &roresources = refl.readOnlyResources; + rdcarray &rwresources = refl.readWriteResources; GLint numUniforms = 0; gl.glGetProgramInterfaceiv(sepProg, eGL_UNIFORM, eGL_ACTIVE_RESOURCES, &numUniforms); @@ -866,494 +866,494 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, gl.glGetProgramResourceiv(sepProg, eGL_UNIFORM, u, numProps, resProps, numProps, NULL, values); ShaderResource res; - res.IsReadOnly = true; - res.IsTexture = true; + res.isReadOnly = true; + res.isTexture = true; res.variableType.descriptor.rows = 1; - res.variableType.descriptor.cols = 4; + res.variableType.descriptor.columns = 4; res.variableType.descriptor.elements = 0; res.variableType.descriptor.rowMajorStorage = false; - res.variableType.descriptor.arrayStride = 0; + res.variableType.descriptor.arrayByteStride = 0; // float samplers if(values[0] == eGL_SAMPLER_BUFFER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "samplerBuffer"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_1D) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "sampler1D"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_1D_ARRAY) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "sampler1DArray"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_1D_SHADOW) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "sampler1DShadow"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_1D_ARRAY_SHADOW) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "sampler1DArrayShadow"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "sampler2D"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_ARRAY) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "sampler2DArray"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_SHADOW) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "sampler2DShadow"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_ARRAY_SHADOW) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "sampler2DArrayShadow"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_RECT) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "sampler2DRect"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_RECT_SHADOW) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "sampler2DRectShadow"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_3D) { - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; res.variableType.descriptor.name = "sampler3D"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_CUBE) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "samplerCube"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_CUBE_SHADOW) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "samplerCubeShadow"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_CUBE_MAP_ARRAY) { - res.resType = TextureDim::TextureCubeArray; + res.resType = TextureType::TextureCubeArray; res.variableType.descriptor.name = "samplerCubeArray"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_MULTISAMPLE) { - res.resType = TextureDim::Texture2DMS; + res.resType = TextureType::Texture2DMS; res.variableType.descriptor.name = "sampler2DMS"; res.variableType.descriptor.type = VarType::Float; } else if(values[0] == eGL_SAMPLER_2D_MULTISAMPLE_ARRAY) { - res.resType = TextureDim::Texture2DMSArray; + res.resType = TextureType::Texture2DMSArray; res.variableType.descriptor.name = "sampler2DMSArray"; res.variableType.descriptor.type = VarType::Float; } // int samplers else if(values[0] == eGL_INT_SAMPLER_BUFFER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "isamplerBuffer"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_1D) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "isampler1D"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_1D_ARRAY) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "isampler1DArray"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_2D) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "isampler2D"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_2D_ARRAY) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "isampler2DArray"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_2D_RECT) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "isampler2DRect"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_3D) { - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; res.variableType.descriptor.name = "isampler3D"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_CUBE) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "isamplerCube"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_CUBE_MAP_ARRAY) { - res.resType = TextureDim::TextureCubeArray; + res.resType = TextureType::TextureCubeArray; res.variableType.descriptor.name = "isamplerCubeArray"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_2D_MULTISAMPLE) { - res.resType = TextureDim::Texture2DMS; + res.resType = TextureType::Texture2DMS; res.variableType.descriptor.name = "isampler2DMS"; res.variableType.descriptor.type = VarType::Int; } else if(values[0] == eGL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY) { - res.resType = TextureDim::Texture2DMSArray; + res.resType = TextureType::Texture2DMSArray; res.variableType.descriptor.name = "isampler2DMSArray"; res.variableType.descriptor.type = VarType::Int; } // unsigned int samplers else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_BUFFER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "usamplerBuffer"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_1D) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "usampler1D"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_1D_ARRAY) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "usampler1DArray"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_2D) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "usampler2D"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_2D_ARRAY) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "usampler2DArray"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_2D_RECT) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "usampler2DRect"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_3D) { - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; res.variableType.descriptor.name = "usampler3D"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_CUBE) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "usamplerCube"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY) { - res.resType = TextureDim::TextureCubeArray; + res.resType = TextureType::TextureCubeArray; res.variableType.descriptor.name = "usamplerCubeArray"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE) { - res.resType = TextureDim::Texture2DMS; + res.resType = TextureType::Texture2DMS; res.variableType.descriptor.name = "usampler2DMS"; res.variableType.descriptor.type = VarType::UInt; } else if(values[0] == eGL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY) { - res.resType = TextureDim::Texture2DMSArray; + res.resType = TextureType::Texture2DMSArray; res.variableType.descriptor.name = "usampler2DMSArray"; res.variableType.descriptor.type = VarType::UInt; } // float images else if(values[0] == eGL_IMAGE_BUFFER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "imageBuffer"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_1D) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "image1D"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_1D_ARRAY) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "image1DArray"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_2D) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "image2D"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_2D_ARRAY) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "image2DArray"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_2D_RECT) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "image2DRect"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_3D) { - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; res.variableType.descriptor.name = "image3D"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_CUBE) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "imageCube"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_CUBE_MAP_ARRAY) { - res.resType = TextureDim::TextureCubeArray; + res.resType = TextureType::TextureCubeArray; res.variableType.descriptor.name = "imageCubeArray"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_2D_MULTISAMPLE) { - res.resType = TextureDim::Texture2DMS; + res.resType = TextureType::Texture2DMS; res.variableType.descriptor.name = "image2DMS"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_IMAGE_2D_MULTISAMPLE_ARRAY) { - res.resType = TextureDim::Texture2DMSArray; + res.resType = TextureType::Texture2DMSArray; res.variableType.descriptor.name = "image2DMSArray"; res.variableType.descriptor.type = VarType::Float; - res.IsReadOnly = false; + res.isReadOnly = false; } // int images else if(values[0] == eGL_INT_IMAGE_BUFFER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "iimageBuffer"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_1D) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "iimage1D"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_1D_ARRAY) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "iimage1DArray"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_2D) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "iimage2D"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_2D_ARRAY) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "iimage2DArray"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_2D_RECT) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "iimage2DRect"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_3D) { - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; res.variableType.descriptor.name = "iimage3D"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_CUBE) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "iimageCube"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_CUBE_MAP_ARRAY) { - res.resType = TextureDim::TextureCubeArray; + res.resType = TextureType::TextureCubeArray; res.variableType.descriptor.name = "iimageCubeArray"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_2D_MULTISAMPLE) { - res.resType = TextureDim::Texture2DMS; + res.resType = TextureType::Texture2DMS; res.variableType.descriptor.name = "iimage2DMS"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_INT_IMAGE_2D_MULTISAMPLE_ARRAY) { - res.resType = TextureDim::Texture2DMSArray; + res.resType = TextureType::Texture2DMSArray; res.variableType.descriptor.name = "iimage2DMSArray"; res.variableType.descriptor.type = VarType::Int; - res.IsReadOnly = false; + res.isReadOnly = false; } // unsigned int images else if(values[0] == eGL_UNSIGNED_INT_IMAGE_BUFFER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "uimageBuffer"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_1D) { - res.resType = TextureDim::Texture1D; + res.resType = TextureType::Texture1D; res.variableType.descriptor.name = "uimage1D"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_1D_ARRAY) { - res.resType = TextureDim::Texture1DArray; + res.resType = TextureType::Texture1DArray; res.variableType.descriptor.name = "uimage1DArray"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; res.variableType.descriptor.name = "uimage2D"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_ARRAY) { - res.resType = TextureDim::Texture2DArray; + res.resType = TextureType::Texture2DArray; res.variableType.descriptor.name = "uimage2DArray"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_RECT) { - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; res.variableType.descriptor.name = "uimage2DRect"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_3D) { - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; res.variableType.descriptor.name = "uimage3D"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_CUBE) { - res.resType = TextureDim::TextureCube; + res.resType = TextureType::TextureCube; res.variableType.descriptor.name = "uimageCube"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY) { - res.resType = TextureDim::TextureCubeArray; + res.resType = TextureType::TextureCubeArray; res.variableType.descriptor.name = "uimageCubeArray"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE) { - res.resType = TextureDim::Texture2DMS; + res.resType = TextureType::Texture2DMS; res.variableType.descriptor.name = "uimage2DMS"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY) { - res.resType = TextureDim::Texture2DMSArray; + res.resType = TextureType::Texture2DMSArray; res.variableType.descriptor.name = "uimage2DMSArray"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; + res.isReadOnly = false; } // atomic counter else if(values[0] == eGL_UNSIGNED_INT_ATOMIC_COUNTER) { - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; res.variableType.descriptor.name = "atomic_uint"; res.variableType.descriptor.type = VarType::UInt; - res.IsReadOnly = false; - res.IsTexture = false; - res.variableType.descriptor.cols = 1; + res.isReadOnly = false; + res.isTexture = false; + res.variableType.descriptor.columns = 1; } else { @@ -1369,7 +1369,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, res.name = name; - rdcarray &reslist = (res.IsReadOnly ? roresources : rwresources); + rdcarray &reslist = (res.isReadOnly ? roresources : rwresources); res.bindPoint = (int32_t)reslist.size(); reslist.push_back(res); @@ -1408,14 +1408,14 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, gl.glGetProgramResourceName(sepProg, eGL_SHADER_STORAGE_BLOCK, u, len + 1, NULL, nm); ShaderResource res; - res.IsReadOnly = false; - res.IsTexture = false; - res.resType = TextureDim::Buffer; + res.isReadOnly = false; + res.isTexture = false; + res.resType = TextureType::Buffer; res.variableType.descriptor.rows = 0; - res.variableType.descriptor.cols = 0; + res.variableType.descriptor.columns = 0; res.variableType.descriptor.elements = len; res.variableType.descriptor.rowMajorStorage = false; - res.variableType.descriptor.arrayStride = 0; + res.variableType.descriptor.arrayByteStride = 0; res.variableType.descriptor.name = "buffer"; res.variableType.descriptor.type = VarType::UInt; res.bindPoint = (int32_t)rwresources.size(); @@ -1448,11 +1448,11 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, // account for padding for std430 layout, if we have a root array of // structs, we need to pad the struct up to have the correct alignment if(members[ssbo].size() == 1 && !members[ssbo][0].type.members.empty() && - members[ssbo][0].type.descriptor.arrayStride != 0) + members[ssbo][0].type.descriptor.arrayByteStride != 0) { // now that we're sorted, see what the tightly packed stride would be by looking at the last // member - uint32_t desiredStride = members[ssbo][0].type.descriptor.arrayStride; + uint32_t desiredStride = members[ssbo][0].type.descriptor.arrayByteStride; ShaderConstant *last = &members[ssbo][0].type.members.back(); while(!last->type.members.empty()) @@ -1462,7 +1462,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, uint32_t stride = last->reg.vec * 16 + last->reg.comp * 4; // add its size - uint32_t size = last->type.descriptor.rows * last->type.descriptor.cols * 4; + uint32_t size = last->type.descriptor.rows * last->type.descriptor.columns * 4; if(last->type.descriptor.type == VarType::Double) size *= 2; @@ -1482,10 +1482,10 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, paddingVar.reg.comp = (last->reg.comp + size / 4) % 16; paddingVar.type.descriptor.type = VarType::UInt; paddingVar.type.descriptor.rows = 1; - paddingVar.type.descriptor.cols = (uint8_t)RDCMIN(padding, 255U); + paddingVar.type.descriptor.columns = (uint8_t)RDCMIN(padding, 255U); paddingVar.type.descriptor.elements = 1; paddingVar.type.descriptor.rowMajorStorage = false; - paddingVar.type.descriptor.arrayStride = 0; + paddingVar.type.descriptor.arrayByteStride = 0; paddingVar.type.descriptor.name = StringFormat::Fmt("uint%u", padding); members[ssbo][0].type.members.push_back(paddingVar); @@ -1528,7 +1528,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, ReconstructVarTree(gl, eGL_UNIFORM, sepProg, u, numUBOs, ubos, &globalUniforms); } - refl.ConstantBlocks.reserve(numUBOs + (globalUniforms.empty() ? 0 : 1)); + refl.constantBlocks.reserve(numUBOs + (globalUniforms.empty() ? 0 : 1)); if(ubos) { @@ -1539,7 +1539,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, ConstantBlock cblock; cblock.name = uboNames[i]; cblock.bufferBacked = true; - cblock.bindPoint = (int32_t)refl.ConstantBlocks.size(); + cblock.bindPoint = (int32_t)refl.constantBlocks.size(); GLenum bufSize = eGL_BUFFER_DATA_SIZE; gl.glGetProgramResourceiv(sepProg, eGL_UNIFORM_BLOCK, i, 1, &bufSize, 1, NULL, @@ -1548,7 +1548,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, sort(ubos[i]); std::swap(cblock.variables, ubos[i]); - refl.ConstantBlocks.push_back(cblock); + refl.constantBlocks.push_back(cblock); } } } @@ -1558,12 +1558,12 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, ConstantBlock globals; globals.name = "$Globals"; globals.bufferBacked = false; - globals.bindPoint = (int32_t)refl.ConstantBlocks.size(); + globals.bindPoint = (int32_t)refl.constantBlocks.size(); sort(globalUniforms); std::swap(globals.variables, globalUniforms); - refl.ConstantBlocks.push_back(globals); + refl.constantBlocks.push_back(globals); } delete[] ubos; @@ -1571,7 +1571,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg, for(int sigType = 0; sigType < 2; sigType++) { GLenum sigEnum = (sigType == 0 ? eGL_PROGRAM_INPUT : eGL_PROGRAM_OUTPUT); - rdcarray *sigArray = (sigType == 0 ? &refl.InputSig : &refl.OutputSig); + rdcarray *sigArray = (sigType == 0 ? &refl.inputSignature : &refl.outputSignature); GLint numInputs; gl.glGetProgramInterfaceiv(sepProg, sigEnum, eGL_ACTIVE_RESOURCES, &numInputs); @@ -1907,24 +1907,24 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade eGL_REFERENCED_BY_FRAGMENT_SHADER, eGL_REFERENCED_BY_COMPUTE_SHADER, }; - mapping.ReadOnlyResources.resize(refl->ReadOnlyResources.size()); - for(size_t i = 0; i < refl->ReadOnlyResources.size(); i++) + mapping.readOnlyResources.resize(refl->readOnlyResources.size()); + for(size_t i = 0; i < refl->readOnlyResources.size(); i++) { - if(refl->ReadOnlyResources[i].IsTexture) + if(refl->readOnlyResources[i].isTexture) { // normal sampler or image load/store - GLint loc = gl.glGetUniformLocation(curProg, refl->ReadOnlyResources[i].name.c_str()); + GLint loc = gl.glGetUniformLocation(curProg, refl->readOnlyResources[i].name.c_str()); if(loc >= 0) { gl.glGetUniformiv(curProg, loc, dummyReadback); - mapping.ReadOnlyResources[i].bindset = 0; - mapping.ReadOnlyResources[i].bind = dummyReadback[0]; - mapping.ReadOnlyResources[i].arraySize = 1; + mapping.readOnlyResources[i].bindset = 0; + mapping.readOnlyResources[i].bind = dummyReadback[0]; + mapping.readOnlyResources[i].arraySize = 1; } // handle sampler arrays, use the base name - std::string name = refl->ReadOnlyResources[i].name.c_str(); + std::string name = refl->readOnlyResources[i].name.c_str(); if(name.back() == ']') { do @@ -1939,42 +1939,42 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade if(idx == GL_INVALID_INDEX) { - mapping.ReadOnlyResources[i].used = false; + mapping.readOnlyResources[i].used = false; } else { GLint used = 0; gl.glGetProgramResourceiv(curProg, eGL_UNIFORM, idx, 1, &refEnum[shadIdx], 1, NULL, &used); - mapping.ReadOnlyResources[i].used = (used != 0); + mapping.readOnlyResources[i].used = (used != 0); } } else { - mapping.ReadOnlyResources[i].bindset = -1; - mapping.ReadOnlyResources[i].bind = -1; - mapping.ReadOnlyResources[i].used = false; - mapping.ReadOnlyResources[i].arraySize = 1; + mapping.readOnlyResources[i].bindset = -1; + mapping.readOnlyResources[i].bind = -1; + mapping.readOnlyResources[i].used = false; + mapping.readOnlyResources[i].arraySize = 1; } } - mapping.ReadWriteResources.resize(refl->ReadWriteResources.size()); - for(size_t i = 0; i < refl->ReadWriteResources.size(); i++) + mapping.readWriteResources.resize(refl->readWriteResources.size()); + for(size_t i = 0; i < refl->readWriteResources.size(); i++) { - if(refl->ReadWriteResources[i].IsTexture) + if(refl->readWriteResources[i].isTexture) { // image load/store - GLint loc = gl.glGetUniformLocation(curProg, refl->ReadWriteResources[i].name.c_str()); + GLint loc = gl.glGetUniformLocation(curProg, refl->readWriteResources[i].name.c_str()); if(loc >= 0) { gl.glGetUniformiv(curProg, loc, dummyReadback); - mapping.ReadWriteResources[i].bindset = 0; - mapping.ReadWriteResources[i].bind = dummyReadback[0]; - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].bindset = 0; + mapping.readWriteResources[i].bind = dummyReadback[0]; + mapping.readWriteResources[i].arraySize = 1; } // handle sampler arrays, use the base name - std::string name = refl->ReadWriteResources[i].name.c_str(); + std::string name = refl->readWriteResources[i].name.c_str(); if(name.back() == ']') { do @@ -1989,31 +1989,31 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade if(idx == GL_INVALID_INDEX) { - mapping.ReadWriteResources[i].used = false; + mapping.readWriteResources[i].used = false; } else { GLint used = 0; gl.glGetProgramResourceiv(curProg, eGL_UNIFORM, idx, 1, &refEnum[shadIdx], 1, NULL, &used); - mapping.ReadWriteResources[i].used = (used != 0); + mapping.readWriteResources[i].used = (used != 0); } } - else if(!refl->ReadWriteResources[i].IsTexture) + else if(!refl->readWriteResources[i].isTexture) { - if(refl->ReadWriteResources[i].variableType.descriptor.cols == 1 && - refl->ReadWriteResources[i].variableType.descriptor.rows == 1 && - refl->ReadWriteResources[i].variableType.descriptor.type == VarType::UInt) + if(refl->readWriteResources[i].variableType.descriptor.columns == 1 && + refl->readWriteResources[i].variableType.descriptor.rows == 1 && + refl->readWriteResources[i].variableType.descriptor.type == VarType::UInt) { // atomic uint GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_UNIFORM, - refl->ReadWriteResources[i].name.c_str()); + refl->readWriteResources[i].name.c_str()); if(idx == GL_INVALID_INDEX) { - mapping.ReadWriteResources[i].bindset = -1; - mapping.ReadWriteResources[i].bind = -1; - mapping.ReadWriteResources[i].used = false; - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].bindset = -1; + mapping.readWriteResources[i].bind = -1; + mapping.readWriteResources[i].used = false; + mapping.readWriteResources[i].arraySize = 1; } else { @@ -2024,24 +2024,24 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade if(atomicIndex == GL_INVALID_INDEX) { - mapping.ReadWriteResources[i].bindset = -1; - mapping.ReadWriteResources[i].bind = -1; - mapping.ReadWriteResources[i].used = false; - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].bindset = -1; + mapping.readWriteResources[i].bind = -1; + mapping.readWriteResources[i].used = false; + mapping.readWriteResources[i].arraySize = 1; } else { if(IsGLES) { prop = eGL_BUFFER_BINDING; - mapping.ReadWriteResources[i].bindset = 0; + mapping.readWriteResources[i].bindset = 0; gl.glGetProgramResourceiv(curProg, eGL_ATOMIC_COUNTER_BUFFER, atomicIndex, 1, &prop, - 1, NULL, &mapping.ReadWriteResources[i].bind); + 1, NULL, &mapping.readWriteResources[i].bind); GLint used = 0; gl.glGetProgramResourceiv(curProg, eGL_ATOMIC_COUNTER_BUFFER, atomicIndex, 1, &refEnum[shadIdx], 1, NULL, &used); - mapping.ReadWriteResources[i].used = (used != 0); - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].used = (used != 0); + mapping.readWriteResources[i].arraySize = 1; } else { @@ -2053,15 +2053,15 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade eGL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER, eGL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER, }; - mapping.ReadWriteResources[i].bindset = 0; + mapping.readWriteResources[i].bindset = 0; gl.glGetActiveAtomicCounterBufferiv(curProg, atomicIndex, eGL_ATOMIC_COUNTER_BUFFER_BINDING, - &mapping.ReadWriteResources[i].bind); + &mapping.readWriteResources[i].bind); GLint used = 0; gl.glGetActiveAtomicCounterBufferiv(curProg, atomicIndex, atomicRefEnum[shadIdx], &used); - mapping.ReadWriteResources[i].used = (used != 0); - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].used = (used != 0); + mapping.readWriteResources[i].arraySize = 1; } } } @@ -2070,77 +2070,77 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade { // shader storage buffer object GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_SHADER_STORAGE_BLOCK, - refl->ReadWriteResources[i].name.c_str()); + refl->readWriteResources[i].name.c_str()); if(idx == GL_INVALID_INDEX) { - mapping.ReadWriteResources[i].bindset = -1; - mapping.ReadWriteResources[i].bind = -1; - mapping.ReadWriteResources[i].used = false; - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].bindset = -1; + mapping.readWriteResources[i].bind = -1; + mapping.readWriteResources[i].used = false; + mapping.readWriteResources[i].arraySize = 1; } else { GLenum prop = eGL_BUFFER_BINDING; - mapping.ReadWriteResources[i].bindset = 0; + mapping.readWriteResources[i].bindset = 0; gl.glGetProgramResourceiv(curProg, eGL_SHADER_STORAGE_BLOCK, idx, 1, &prop, 1, NULL, - &mapping.ReadWriteResources[i].bind); + &mapping.readWriteResources[i].bind); GLint used = 0; gl.glGetProgramResourceiv(curProg, eGL_SHADER_STORAGE_BLOCK, idx, 1, &refEnum[shadIdx], 1, NULL, &used); - mapping.ReadWriteResources[i].used = (used != 0); - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].used = (used != 0); + mapping.readWriteResources[i].arraySize = 1; } } } else { - mapping.ReadWriteResources[i].bindset = -1; - mapping.ReadWriteResources[i].bind = -1; - mapping.ReadWriteResources[i].used = false; - mapping.ReadWriteResources[i].arraySize = 1; + mapping.readWriteResources[i].bindset = -1; + mapping.readWriteResources[i].bind = -1; + mapping.readWriteResources[i].used = false; + mapping.readWriteResources[i].arraySize = 1; } } - mapping.ConstantBlocks.resize(refl->ConstantBlocks.size()); - for(size_t i = 0; i < refl->ConstantBlocks.size(); i++) + mapping.constantBlocks.resize(refl->constantBlocks.size()); + for(size_t i = 0; i < refl->constantBlocks.size(); i++) { - if(refl->ConstantBlocks[i].bufferBacked) + if(refl->constantBlocks[i].bufferBacked) { - GLint loc = gl.glGetUniformBlockIndex(curProg, refl->ConstantBlocks[i].name.c_str()); + GLint loc = gl.glGetUniformBlockIndex(curProg, refl->constantBlocks[i].name.c_str()); if(loc >= 0) { gl.glGetActiveUniformBlockiv(curProg, loc, eGL_UNIFORM_BLOCK_BINDING, dummyReadback); - mapping.ConstantBlocks[i].bindset = 0; - mapping.ConstantBlocks[i].bind = dummyReadback[0]; - mapping.ConstantBlocks[i].arraySize = 1; + mapping.constantBlocks[i].bindset = 0; + mapping.constantBlocks[i].bind = dummyReadback[0]; + mapping.constantBlocks[i].arraySize = 1; } } else { - mapping.ConstantBlocks[i].bindset = -1; - mapping.ConstantBlocks[i].bind = -1; - mapping.ConstantBlocks[i].arraySize = 1; + mapping.constantBlocks[i].bindset = -1; + mapping.constantBlocks[i].bind = -1; + mapping.constantBlocks[i].arraySize = 1; } - if(!refl->ConstantBlocks[i].bufferBacked) + if(!refl->constantBlocks[i].bufferBacked) { - mapping.ConstantBlocks[i].used = true; + mapping.constantBlocks[i].used = true; } else { GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_UNIFORM_BLOCK, - refl->ConstantBlocks[i].name.c_str()); + refl->constantBlocks[i].name.c_str()); if(idx == GL_INVALID_INDEX) { - mapping.ConstantBlocks[i].used = false; + mapping.constantBlocks[i].used = false; } else { GLint used = 0; gl.glGetProgramResourceiv(curProg, eGL_UNIFORM_BLOCK, idx, 1, &refEnum[shadIdx], 1, NULL, &used); - mapping.ConstantBlocks[i].used = (used != 0); + mapping.constantBlocks[i].used = (used != 0); } } } @@ -2148,20 +2148,20 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade GLint numVAttribBindings = 16; gl.glGetIntegerv(eGL_MAX_VERTEX_ATTRIBS, &numVAttribBindings); - mapping.InputAttributes.resize(numVAttribBindings); + mapping.inputAttributes.resize(numVAttribBindings); for(int32_t i = 0; i < numVAttribBindings; i++) - mapping.InputAttributes[i] = -1; + mapping.inputAttributes[i] = -1; // override identity map with bindings if(shadIdx == 0) { - for(int32_t i = 0; i < refl->InputSig.count(); i++) + for(int32_t i = 0; i < refl->inputSignature.count(); i++) { - GLint loc = gl.glGetAttribLocation(curProg, refl->InputSig[i].varName.c_str()); + GLint loc = gl.glGetAttribLocation(curProg, refl->inputSignature[i].varName.c_str()); if(loc >= 0 && loc < numVAttribBindings) { - mapping.InputAttributes[loc] = i; + mapping.inputAttributes[loc] = i; } } } @@ -2280,44 +2280,44 @@ void ResortBindings(ShaderReflection *refl, ShaderBindpointMapping *mapping) } }; - permutation.resize(mapping->ReadOnlyResources.size()); - for(size_t i = 0; i < mapping->ReadOnlyResources.size(); i++) - permutation[i] = std::make_pair(i, mapping->ReadOnlyResources[i].bind); + permutation.resize(mapping->readOnlyResources.size()); + for(size_t i = 0; i < mapping->readOnlyResources.size(); i++) + permutation[i] = std::make_pair(i, mapping->readOnlyResources[i].bind); std::sort(permutation.begin(), permutation.end(), permutation_sort()); // apply the permutation to the mapping array, and update the bindPoint values in the shader // reflection to match, so that the re-order is applied ApplyPermutation(permutation, [mapping, refl](size_t a, size_t b) { - std::swap(mapping->ReadOnlyResources[a], mapping->ReadOnlyResources[b]); + std::swap(mapping->readOnlyResources[a], mapping->readOnlyResources[b]); }); for(size_t i = 0; i < permutation.size(); i++) - refl->ReadOnlyResources[i].bindPoint = (int)permutation[i].first; + refl->readOnlyResources[i].bindPoint = (int)permutation[i].first; - permutation.resize(mapping->ReadWriteResources.size()); - for(size_t i = 0; i < mapping->ReadWriteResources.size(); i++) - permutation[i] = std::make_pair(i, mapping->ReadWriteResources[i].bind); + permutation.resize(mapping->readWriteResources.size()); + for(size_t i = 0; i < mapping->readWriteResources.size(); i++) + permutation[i] = std::make_pair(i, mapping->readWriteResources[i].bind); std::sort(permutation.begin(), permutation.end(), permutation_sort()); ApplyPermutation(permutation, [mapping, refl](size_t a, size_t b) { - std::swap(mapping->ReadWriteResources[a], mapping->ReadWriteResources[b]); + std::swap(mapping->readWriteResources[a], mapping->readWriteResources[b]); }); for(size_t i = 0; i < permutation.size(); i++) - refl->ReadWriteResources[i].bindPoint = (int)permutation[i].first; + refl->readWriteResources[i].bindPoint = (int)permutation[i].first; - permutation.resize(mapping->ConstantBlocks.size()); - for(size_t i = 0; i < mapping->ConstantBlocks.size(); i++) - permutation[i] = std::make_pair(i, mapping->ConstantBlocks[i].bind); + permutation.resize(mapping->constantBlocks.size()); + for(size_t i = 0; i < mapping->constantBlocks.size(); i++) + permutation[i] = std::make_pair(i, mapping->constantBlocks[i].bind); std::sort(permutation.begin(), permutation.end(), permutation_sort()); ApplyPermutation(permutation, [mapping, refl](size_t a, size_t b) { - std::swap(mapping->ConstantBlocks[a], mapping->ConstantBlocks[b]); + std::swap(mapping->constantBlocks[a], mapping->constantBlocks[b]); }); for(size_t i = 0; i < permutation.size(); i++) - refl->ConstantBlocks[i].bindPoint = (int)permutation[i].first; + refl->constantBlocks[i].bindPoint = (int)permutation[i].first; } \ No newline at end of file diff --git a/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp index 65e6f952b..92e1d5426 100644 --- a/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp @@ -1900,7 +1900,7 @@ void *WrappedOpenGL::glMapNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GL if((access & GL_MAP_PERSISTENT_BIT) || record->Map.persistentPtr) directMap = false; - bool verifyWrite = (RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites != 0); + bool verifyWrite = (RenderDoc::Inst().GetCaptureOptions().verifyMapWrites != 0); // must also intercept to verify writes if(verifyWrite) diff --git a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp index 8070907e3..f28a48eab 100644 --- a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp @@ -1954,14 +1954,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawArrays(SerialiserType &ser, GLenum mode size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { @@ -2104,14 +2104,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawElements(SerialiserType &ser, GLenum mo size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { @@ -2257,14 +2257,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsBaseVertex(SerialiserType &ser, size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { @@ -2410,14 +2410,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { @@ -2581,14 +2581,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { @@ -2753,14 +2753,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCountARB(SerialiserType & size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { @@ -2934,14 +2934,14 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCountARB(SerialiserType size_t i = 0; for(; i < m_Events.size(); i++) { - if(m_Events[i].eventID >= m_CurEventID) + if(m_Events[i].eventId >= m_CurEventID) break; } while(i > 1 && m_Events[i - 1].fileOffset == m_Events[i].fileOffset) i--; - uint32_t baseEventID = m_Events[i].eventID; + uint32_t baseEventID = m_Events[i].eventId; if(m_LastEventID < baseEventID) { diff --git a/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp index 41eebcc84..db1d19781 100644 --- a/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp @@ -78,7 +78,7 @@ void WrappedOpenGL::ShaderData::Compile(WrappedOpenGL &gl, ResourceId id, GLuint concatenated += sources[i]; } - reflection.RawBytes.assign((byte *)concatenated.c_str(), concatenated.size()); + reflection.rawBytes.assign((byte *)concatenated.c_str(), concatenated.size()); } GLuint sepProg = prog; @@ -114,17 +114,17 @@ void WrappedOpenGL::ShaderData::Compile(WrappedOpenGL &gl, ResourceId id, GLuint else disassembly = s; - reflection.ID = id; - reflection.EntryPoint = "main"; + reflection.resourceId = id; + reflection.entryPoint = "main"; - reflection.Stage = MakeShaderStage(type); + reflection.stage = MakeShaderStage(type); // TODO sort these so that the first file contains the entry point - reflection.DebugInfo.files.resize(sources.size()); + reflection.debugInfo.files.resize(sources.size()); for(size_t i = 0; i < sources.size(); i++) { - reflection.DebugInfo.files[i].Filename = StringFormat::Fmt("source%u.glsl", (uint32_t)i); - reflection.DebugInfo.files[i].Contents = sources[i]; + reflection.debugInfo.files[i].filename = StringFormat::Fmt("source%u.glsl", (uint32_t)i); + reflection.debugInfo.files[i].contents = sources[i]; } } } diff --git a/renderdoc/driver/ihv/amd/amd_counters.cpp b/renderdoc/driver/ihv/amd/amd_counters.cpp index 8495556c6..29ff00076 100644 --- a/renderdoc/driver/ihv/amd/amd_counters.cpp +++ b/renderdoc/driver/ihv/amd/amd_counters.cpp @@ -124,7 +124,7 @@ vector AMDCounters::EnumerateCounters() internalDesc.desc = InternalGetCounterDescription(i); internalDesc.internalIndex = i; - internalDesc.desc.counterID = MakeAMDCounter(i); + internalDesc.desc.counter = MakeAMDCounter(i); counters.push_back(internalDesc); } diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 9dedf5b8d..f14ef2076 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -937,17 +937,17 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con } } - RDCASSERTMSG("Invalid cbuffer lookup", cb != -1 && cb < trace->cbuffers.count(), cb, - trace->cbuffers.count()); + RDCASSERTMSG("Invalid cbuffer lookup", cb != -1 && cb < trace->constantBlocks.count(), cb, + trace->constantBlocks.count()); - if(cb >= 0 && cb < trace->cbuffers.count()) + if(cb >= 0 && cb < trace->constantBlocks.count()) { RDCASSERTMSG("Out of bounds cbuffer lookup", - indices[1] < (uint32_t)trace->cbuffers[cb].members.count(), indices[1], - trace->cbuffers[cb].members.count()); + indices[1] < (uint32_t)trace->constantBlocks[cb].members.count(), indices[1], + trace->constantBlocks[cb].members.count()); - if(indices[1] < (uint32_t)trace->cbuffers[cb].members.count()) - v = s = trace->cbuffers[cb].members[indices[1]]; + if(indices[1] < (uint32_t)trace->constantBlocks[cb].members.count()) + v = s = trace->constantBlocks[cb].members[indices[1]]; else v = s = ShaderVariable("", 0U, 0U, 0U, 0U); } diff --git a/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp b/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp index 2751ed04f..b6d7e8e89 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp @@ -1435,8 +1435,8 @@ uint32_t DecodeFlags(const ShaderCompileFlags &compileFlags) { uint32_t ret = 0; - if(!compileFlags.flags.empty() && compileFlags.flags[0].Name == "compileFlags") - ret = atoi(compileFlags.flags[0].Value.c_str()); + if(!compileFlags.flags.empty() && compileFlags.flags[0].name == "compileFlags") + ret = atoi(compileFlags.flags[0].value.c_str()); return ret; } diff --git a/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp b/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp index 8572d1b60..56a0c6a47 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp @@ -49,7 +49,7 @@ static ShaderVariableType MakeShaderVariableType(DXBC::CBufferVariableType type, default: ret.descriptor.type = VarType::Float; break; } ret.descriptor.rows = (uint8_t)type.descriptor.rows; - ret.descriptor.cols = (uint8_t)type.descriptor.cols; + ret.descriptor.columns = (uint8_t)type.descriptor.cols; ret.descriptor.elements = type.descriptor.elements; ret.descriptor.name = type.descriptor.name; ret.descriptor.rowMajorStorage = (type.descriptor.varClass == DXBC::CLASS_MATRIX_ROWS); @@ -60,14 +60,14 @@ static ShaderVariableType MakeShaderVariableType(DXBC::CBufferVariableType type, uint32_t primary = ret.descriptor.rows; if(primary == 3) primary = 4; - ret.descriptor.arrayStride = baseElemSize * primary * ret.descriptor.cols; + ret.descriptor.arrayByteStride = baseElemSize * primary * ret.descriptor.columns; } else { - uint32_t primary = ret.descriptor.cols; + uint32_t primary = ret.descriptor.columns; if(primary == 3) primary = 4; - ret.descriptor.arrayStride = baseElemSize * primary * ret.descriptor.rows; + ret.descriptor.arrayByteStride = baseElemSize * primary * ret.descriptor.rows; } uint32_t o = offset; @@ -82,7 +82,7 @@ static ShaderVariableType MakeShaderVariableType(DXBC::CBufferVariableType type, if(!ret.members.empty()) { ret.descriptor.rows = 0; - ret.descriptor.cols = 0; + ret.descriptor.columns = 0; } return ret; @@ -107,7 +107,7 @@ static ShaderConstant MakeConstantBufferVariable(const DXBC::CBufferVariable &va } static void MakeResourceList(bool srv, DXBC::DXBCFile *dxbc, const vector &in, - rdcarray &mapping, rdcarray &refl) + rdcarray &mapping, rdcarray &refl) { for(size_t i = 0; i < in.size(); i++) { @@ -116,34 +116,34 @@ static void MakeResourceList(bool srv, DXBC::DXBCFile *dxbc, const vectorm_Type) { - case D3D11_ShaderType_Pixel: refl->Stage = ShaderStage::Pixel; break; - case D3D11_ShaderType_Vertex: refl->Stage = ShaderStage::Vertex; break; - case D3D11_ShaderType_Geometry: refl->Stage = ShaderStage::Geometry; break; - case D3D11_ShaderType_Hull: refl->Stage = ShaderStage::Hull; break; - case D3D11_ShaderType_Domain: refl->Stage = ShaderStage::Domain; break; - case D3D11_ShaderType_Compute: refl->Stage = ShaderStage::Compute; break; + case D3D11_ShaderType_Pixel: refl->stage = ShaderStage::Pixel; break; + case D3D11_ShaderType_Vertex: refl->stage = ShaderStage::Vertex; break; + case D3D11_ShaderType_Geometry: refl->stage = ShaderStage::Geometry; break; + case D3D11_ShaderType_Hull: refl->stage = ShaderStage::Hull; break; + case D3D11_ShaderType_Domain: refl->stage = ShaderStage::Domain; break; + case D3D11_ShaderType_Compute: refl->stage = ShaderStage::Compute; break; default: RDCERR("Unexpected DXBC shader type %u", dxbc->m_Type); - refl->Stage = ShaderStage::Vertex; + refl->stage = ShaderStage::Vertex; break; } - refl->EntryPoint = "main"; + refl->entryPoint = "main"; if(dxbc->m_DebugInfo) { - refl->EntryPoint = dxbc->m_DebugInfo->GetEntryFunction(); + refl->entryPoint = dxbc->m_DebugInfo->GetEntryFunction(); - refl->DebugInfo.compileFlags = DXBC::EncodeFlags(dxbc->m_DebugInfo); + refl->debugInfo.compileFlags = DXBC::EncodeFlags(dxbc->m_DebugInfo); - refl->DebugInfo.files.resize(dxbc->m_DebugInfo->Files.size()); + refl->debugInfo.files.resize(dxbc->m_DebugInfo->Files.size()); for(size_t i = 0; i < dxbc->m_DebugInfo->Files.size(); i++) { - refl->DebugInfo.files[i].Filename = dxbc->m_DebugInfo->Files[i].first; - refl->DebugInfo.files[i].Contents = dxbc->m_DebugInfo->Files[i].second; + refl->debugInfo.files[i].filename = dxbc->m_DebugInfo->Files[i].first; + refl->debugInfo.files[i].contents = dxbc->m_DebugInfo->Files[i].second; } string entry = dxbc->m_DebugInfo->GetEntryFunction(); @@ -243,16 +243,16 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl, // one file. // This isn't a perfect search - it will match entry_point() anywhere in the file, even if it's // in a comment or disabled preprocessor definition. This is just best-effort - if(refl->DebugInfo.files.count() > 1) + if(refl->debugInfo.files.count() > 1) { // search from 0 up. If we find a match, we swap it into [0]. If we don't find a match then // we can't rearrange anything. This is a no-op for 0 since it's already in first place, but // since our search isn't perfect we might have multiple matches with some being false // positives, and so we want to bias towards leaving [0] in place. - for(size_t i = 0; i < refl->DebugInfo.files.size(); i++) + for(size_t i = 0; i < refl->debugInfo.files.size(); i++) { - const char *c = strstr(refl->DebugInfo.files[i].Contents.c_str(), entry.c_str()); - const char *end = refl->DebugInfo.files[i].Contents.end(); + const char *c = strstr(refl->debugInfo.files[i].contents.c_str(), entry.c_str()); + const char *end = refl->debugInfo.files[i].contents.end(); // no substring match? continue if(c == NULL) @@ -281,7 +281,7 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl, { // only do anything if we're looking at a later file if(i > 0) - std::swap(refl->DebugInfo.files[0], refl->DebugInfo.files[i]); + std::swap(refl->debugInfo.files[0], refl->debugInfo.files[i]); break; } @@ -289,37 +289,37 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl, } } - refl->RawBytes = dxbc->m_ShaderBlob; + refl->rawBytes = dxbc->m_ShaderBlob; - refl->DispatchThreadsDimension[0] = dxbc->DispatchThreadsDimension[0]; - refl->DispatchThreadsDimension[1] = dxbc->DispatchThreadsDimension[1]; - refl->DispatchThreadsDimension[2] = dxbc->DispatchThreadsDimension[2]; + refl->dispatchThreadsDimension[0] = dxbc->DispatchThreadsDimension[0]; + refl->dispatchThreadsDimension[1] = dxbc->DispatchThreadsDimension[1]; + refl->dispatchThreadsDimension[2] = dxbc->DispatchThreadsDimension[2]; - refl->InputSig = dxbc->m_InputSig; - refl->OutputSig = dxbc->m_OutputSig; + refl->inputSignature = dxbc->m_InputSig; + refl->outputSignature = dxbc->m_OutputSig; - mapping->InputAttributes.resize(D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT); + mapping->inputAttributes.resize(D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT); for(int s = 0; s < D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; s++) - mapping->InputAttributes[s] = s; + mapping->inputAttributes[s] = s; - mapping->ConstantBlocks.resize(dxbc->m_CBuffers.size()); - refl->ConstantBlocks.resize(dxbc->m_CBuffers.size()); + mapping->constantBlocks.resize(dxbc->m_CBuffers.size()); + refl->constantBlocks.resize(dxbc->m_CBuffers.size()); for(size_t i = 0; i < dxbc->m_CBuffers.size(); i++) { - ConstantBlock &cb = refl->ConstantBlocks[i]; + ConstantBlock &cb = refl->constantBlocks[i]; cb.name = dxbc->m_CBuffers[i].name; cb.bufferBacked = true; cb.byteSize = dxbc->m_CBuffers[i].descriptor.byteSize; cb.bindPoint = (int32_t)i; - BindpointMap map; + Bindpoint map; map.arraySize = 1; map.bindset = dxbc->m_CBuffers[i].space; map.bind = dxbc->m_CBuffers[i].reg; map.used = true; - mapping->ConstantBlocks[i] = map; + mapping->constantBlocks[i] = map; cb.variables.reserve(dxbc->m_CBuffers[i].variables.size()); for(size_t v = 0; v < dxbc->m_CBuffers[i].variables.size(); v++) @@ -329,38 +329,38 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl, } } - mapping->Samplers.resize(dxbc->m_Samplers.size()); - refl->Samplers.resize(dxbc->m_Samplers.size()); + mapping->samplers.resize(dxbc->m_Samplers.size()); + refl->samplers.resize(dxbc->m_Samplers.size()); for(size_t i = 0; i < dxbc->m_Samplers.size(); i++) { - ShaderSampler &s = refl->Samplers[i]; + ShaderSampler &s = refl->samplers[i]; s.name = dxbc->m_Samplers[i].name; s.bindPoint = (int32_t)i; - BindpointMap map; + Bindpoint map; map.arraySize = 1; map.bindset = dxbc->m_Samplers[i].space; map.bind = dxbc->m_Samplers[i].reg; map.used = true; - mapping->Samplers[i] = map; + mapping->samplers[i] = map; } - mapping->ReadOnlyResources.resize(dxbc->m_SRVs.size()); - refl->ReadOnlyResources.resize(dxbc->m_SRVs.size()); - MakeResourceList(true, dxbc, dxbc->m_SRVs, mapping->ReadOnlyResources, refl->ReadOnlyResources); + mapping->readOnlyResources.resize(dxbc->m_SRVs.size()); + refl->readOnlyResources.resize(dxbc->m_SRVs.size()); + MakeResourceList(true, dxbc, dxbc->m_SRVs, mapping->readOnlyResources, refl->readOnlyResources); - mapping->ReadWriteResources.resize(dxbc->m_UAVs.size()); - refl->ReadWriteResources.resize(dxbc->m_UAVs.size()); - MakeResourceList(true, dxbc, dxbc->m_UAVs, mapping->ReadWriteResources, refl->ReadWriteResources); + mapping->readWriteResources.resize(dxbc->m_UAVs.size()); + refl->readWriteResources.resize(dxbc->m_UAVs.size()); + MakeResourceList(true, dxbc, dxbc->m_UAVs, mapping->readWriteResources, refl->readWriteResources); uint32_t numInterfaces = 0; for(size_t i = 0; i < dxbc->m_Interfaces.variables.size(); i++) numInterfaces = RDCMAX(dxbc->m_Interfaces.variables[i].descriptor.offset + 1, numInterfaces); - refl->Interfaces.resize(numInterfaces); + refl->interfaces.resize(numInterfaces); for(size_t i = 0; i < dxbc->m_Interfaces.variables.size(); i++) - refl->Interfaces[dxbc->m_Interfaces.variables[i].descriptor.offset] = + refl->interfaces[dxbc->m_Interfaces.variables[i].descriptor.offset] = dxbc->m_Interfaces.variables[i].name; } diff --git a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp index 66b05d9f9..67cdec769 100644 --- a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp @@ -3464,7 +3464,7 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons } outConst.type.descriptor.elements = 1; - outConst.type.descriptor.arrayStride = 0; + outConst.type.descriptor.arrayByteStride = 0; if(type->type == SPVTypeData::eArray) { @@ -3483,7 +3483,7 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons { if(decorations[d].decoration == spv::DecorationArrayStride) { - outConst.type.descriptor.arrayStride = decorations[d].val; + outConst.type.descriptor.arrayByteStride = decorations[d].val; foundArrayStride = true; break; } @@ -3493,7 +3493,7 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons { if((*type->decorations)[d].decoration == spv::DecorationArrayStride) { - outConst.type.descriptor.arrayStride = (*type->decorations)[d].val; + outConst.type.descriptor.arrayByteStride = (*type->decorations)[d].val; break; } } @@ -3526,12 +3526,12 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons if(type->type == SPVTypeData::eMatrix) { outConst.type.descriptor.rows = (uint8_t)type->vectorSize; - outConst.type.descriptor.cols = (uint8_t)type->matrixSize; + outConst.type.descriptor.columns = (uint8_t)type->matrixSize; } else { outConst.type.descriptor.rows = 1; - outConst.type.descriptor.cols = (uint8_t)type->vectorSize; + outConst.type.descriptor.columns = (uint8_t)type->vectorSize; } outConst.type.descriptor.name = type->GetName(); @@ -3549,7 +3549,7 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons outConst.type.descriptor.rowMajorStorage = false; outConst.type.descriptor.rows = 1; - outConst.type.descriptor.cols = 1; + outConst.type.descriptor.columns = 1; outConst.type.descriptor.name = type->GetName(); } @@ -3558,7 +3558,7 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons outConst.type.descriptor.type = VarType::Float; outConst.type.descriptor.rowMajorStorage = false; outConst.type.descriptor.rows = 0; - outConst.type.descriptor.cols = 0; + outConst.type.descriptor.columns = 0; outConst.type.descriptor.name = type->GetName(); @@ -3591,8 +3591,8 @@ uint32_t CalculateMinimumByteSize(const rdcarray &variables) uint32_t byteOffset = last.reg.vec * sizeof(Vec4f) + last.reg.comp * sizeof(float); // arrays are easy - if(last.type.descriptor.arrayStride > 0) - return byteOffset + last.type.descriptor.arrayStride * last.type.descriptor.elements; + if(last.type.descriptor.arrayByteStride > 0) + return byteOffset + last.type.descriptor.arrayByteStride * last.type.descriptor.elements; if(last.type.members.empty()) { @@ -3606,7 +3606,7 @@ uint32_t CalculateMinimumByteSize(const rdcarray &variables) basicTypeSize = 8; uint32_t rows = last.type.descriptor.rows; - uint32_t cols = last.type.descriptor.cols; + uint32_t cols = last.type.descriptor.columns; // vectors are also easy if(rows == 1) @@ -3678,10 +3678,10 @@ ShaderBuiltin BuiltInToSystemAttribute(ShaderStage stage, const spv::BuiltIn el) template struct bindpair { - BindpointMap map; + Bindpoint map; T bindres; - bindpair(const BindpointMap &m, const T &res) : map(m), bindres(res) {} + bindpair(const Bindpoint &m, const T &res) : map(m), bindres(res) {} bool operator<(const bindpair &o) const { if(map.bindset != o.map.bindset) @@ -3921,25 +3921,25 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, vector samplers, roresources, rwresources; // VKTODOLOW filter to only functions/resources used by entryPoint - reflection.EntryPoint = entryPoint; - reflection.Stage = stage; + reflection.entryPoint = entryPoint; + reflection.stage = stage; // TODO sort these so that the entry point is in the first file if(!sourceFiles.empty()) { - reflection.DebugInfo.files.resize(sourceFiles.size()); + reflection.debugInfo.files.resize(sourceFiles.size()); for(size_t i = 0; i < sourceFiles.size(); i++) { - reflection.DebugInfo.files[i].Filename = sourceFiles[i].first; - reflection.DebugInfo.files[i].Contents = sourceFiles[i].second; + reflection.debugInfo.files[i].filename = sourceFiles[i].first; + reflection.debugInfo.files[i].contents = sourceFiles[i].second; } } // TODO need to fetch these - reflection.DispatchThreadsDimension[0] = 0; - reflection.DispatchThreadsDimension[1] = 0; - reflection.DispatchThreadsDimension[2] = 0; + reflection.dispatchThreadsDimension[0] = 0; + reflection.dispatchThreadsDimension[1] = 0; + reflection.dispatchThreadsDimension[2] = 0; for(size_t i = 0; i < globals.size(); i++) { @@ -4123,7 +4123,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, cblock.name = StringFormat::Fmt("uniforms%u", inst->id); cblock.bufferBacked = !pushConst; - BindpointMap bindmap; + Bindpoint bindmap; // set can be implicitly 0, but the binding must be set explicitly. // If no binding is found, we set -1 and sort to the end of the resources // list as it's not bound anywhere (most likely, declared but not used) @@ -4153,12 +4153,12 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, if(ssbo) { - res.IsReadOnly = false; - res.IsTexture = false; + res.isReadOnly = false; + res.isTexture = false; res.name = cblock.name; - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; - res.variableType.descriptor.cols = 0; + res.variableType.descriptor.columns = 0; res.variableType.descriptor.rows = 0; res.variableType.descriptor.rowMajorStorage = false; res.variableType.descriptor.rows = 0; @@ -4212,33 +4212,33 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, res.name = inst->str.empty() ? StringFormat::Fmt("res%u", inst->id) : inst->str; if(type->multisampled) - res.resType = type->arrayed ? TextureDim::Texture2DMSArray : TextureDim::Texture2DMS; + res.resType = type->arrayed ? TextureType::Texture2DMSArray : TextureType::Texture2DMS; else if(type->texdim == spv::Dim1D) - res.resType = type->arrayed ? TextureDim::Texture1DArray : TextureDim::Texture1D; + res.resType = type->arrayed ? TextureType::Texture1DArray : TextureType::Texture1D; else if(type->texdim == spv::Dim2D) - res.resType = type->arrayed ? TextureDim::Texture2DArray : TextureDim::Texture2D; + res.resType = type->arrayed ? TextureType::Texture2DArray : TextureType::Texture2D; else if(type->texdim == spv::DimCube) - res.resType = type->arrayed ? TextureDim::TextureCubeArray : TextureDim::TextureCube; + res.resType = type->arrayed ? TextureType::TextureCubeArray : TextureType::TextureCube; else if(type->texdim == spv::Dim3D) - res.resType = TextureDim::Texture3D; + res.resType = TextureType::Texture3D; else if(type->texdim == spv::DimRect) - res.resType = TextureDim::TextureRect; + res.resType = TextureType::TextureRect; else if(type->texdim == spv::DimBuffer) - res.resType = TextureDim::Buffer; + res.resType = TextureType::Buffer; bool sepSampler = (type->type == SPVTypeData::eSampler); - res.IsTexture = res.resType != TextureDim::Buffer && type->type != SPVTypeData::eSampler; - res.IsReadOnly = true; + res.isTexture = res.resType != TextureType::Buffer && type->type != SPVTypeData::eSampler; + res.isReadOnly = true; SPVTypeData *sampledType = type->baseType; if(type->type == SPVTypeData::eSampler) { - res.resType = TextureDim::Unknown; + res.resType = TextureType::Unknown; } else if(type->texdim == spv::DimSubpassData) { - res.resType = TextureDim::Texture2D; + res.resType = TextureType::Texture2D; if(sampledType->type == SPVTypeData::eFloat) res.variableType.descriptor.type = VarType::Float; @@ -4263,7 +4263,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, isrw = (type->sampled == 2); } - res.IsReadOnly = !isrw; + res.isReadOnly = !isrw; if(sampledType->type == SPVTypeData::eFloat) res.variableType.descriptor.type = VarType::Float; @@ -4276,12 +4276,12 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, } res.variableType.descriptor.rows = 1; - res.variableType.descriptor.cols = 1; + res.variableType.descriptor.columns = 1; res.variableType.descriptor.elements = 1; res.variableType.descriptor.rowMajorStorage = false; res.variableType.descriptor.rowMajorStorage = false; - BindpointMap bindmap; + Bindpoint bindmap; // set can be implicitly 0, but the binding must be set explicitly. // If no binding is found, we set -1 and sort to the end of the resources // list as it's not bound anywhere (most likely, declared but not used) @@ -4320,7 +4320,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, if(sepSampler) samplers.push_back(shaderrespair(bindmap, res)); - else if(res.IsReadOnly) + else if(res.isReadOnly) roresources.push_back(shaderrespair(bindmap, res)); else rwresources.push_back(shaderrespair(bindmap, res)); @@ -4346,7 +4346,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, cblock.bufferBacked = false; cblock.byteSize = 0; - BindpointMap bindmap; + Bindpoint bindmap; // set something crazy so this doesn't overlap with a real buffer binding // also identify this as specialization constant data @@ -4428,9 +4428,9 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, std::sort(indices.begin(), indices.end(), sig_param_sort(inputs)); - reflection.InputSig.reserve(inputs.size()); + reflection.inputSignature.reserve(inputs.size()); for(size_t i = 0; i < inputs.size(); i++) - reflection.InputSig.push_back(inputs[indices[i]]); + reflection.inputSignature.push_back(inputs[indices[i]]); } { @@ -4440,9 +4440,9 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, std::sort(indices.begin(), indices.end(), sig_param_sort(outputs)); - reflection.OutputSig.reserve(outputs.size()); + reflection.outputSignature.reserve(outputs.size()); for(size_t i = 0; i < outputs.size(); i++) - reflection.OutputSig.push_back(outputs[indices[i]]); + reflection.outputSignature.push_back(outputs[indices[i]]); std::vector outPatch = patchData.outputs; for(size_t i = 0; i < outputs.size(); i++) @@ -4451,81 +4451,81 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint, size_t numInputs = 16; - for(size_t i = 0; i < reflection.InputSig.size(); i++) - if(reflection.InputSig[i].systemValue == ShaderBuiltin::Undefined) - numInputs = RDCMAX(numInputs, (size_t)reflection.InputSig[i].regIndex + 1); + for(size_t i = 0; i < reflection.inputSignature.size(); i++) + if(reflection.inputSignature[i].systemValue == ShaderBuiltin::Undefined) + numInputs = RDCMAX(numInputs, (size_t)reflection.inputSignature[i].regIndex + 1); - mapping.InputAttributes.resize(numInputs); + mapping.inputAttributes.resize(numInputs); for(size_t i = 0; i < numInputs; i++) - mapping.InputAttributes[i] = -1; + mapping.inputAttributes[i] = -1; - for(size_t i = 0; i < reflection.InputSig.size(); i++) - if(reflection.InputSig[i].systemValue == ShaderBuiltin::Undefined) - mapping.InputAttributes[reflection.InputSig[i].regIndex] = (int32_t)i; + for(size_t i = 0; i < reflection.inputSignature.size(); i++) + if(reflection.inputSignature[i].systemValue == ShaderBuiltin::Undefined) + mapping.inputAttributes[reflection.inputSignature[i].regIndex] = (int32_t)i; std::sort(cblocks.begin(), cblocks.end()); std::sort(samplers.begin(), samplers.end()); std::sort(roresources.begin(), roresources.end()); std::sort(rwresources.begin(), rwresources.end()); - mapping.ConstantBlocks.resize(cblocks.size()); - reflection.ConstantBlocks.resize(cblocks.size()); + mapping.constantBlocks.resize(cblocks.size()); + reflection.constantBlocks.resize(cblocks.size()); - mapping.Samplers.resize(samplers.size()); - reflection.Samplers.resize(samplers.size()); + mapping.samplers.resize(samplers.size()); + reflection.samplers.resize(samplers.size()); - mapping.ReadOnlyResources.resize(roresources.size()); - reflection.ReadOnlyResources.resize(roresources.size()); + mapping.readOnlyResources.resize(roresources.size()); + reflection.readOnlyResources.resize(roresources.size()); - mapping.ReadWriteResources.resize(rwresources.size()); - reflection.ReadWriteResources.resize(rwresources.size()); + mapping.readWriteResources.resize(rwresources.size()); + reflection.readWriteResources.resize(rwresources.size()); for(size_t i = 0; i < cblocks.size(); i++) { - mapping.ConstantBlocks[i] = cblocks[i].map; + mapping.constantBlocks[i] = cblocks[i].map; // fix up any bind points marked with -1. They were sorted to the end // but from here on we want to just be able to index with the bind point // without any special casing. - if(mapping.ConstantBlocks[i].bind == -1) - mapping.ConstantBlocks[i].bind = 0; - reflection.ConstantBlocks[i] = cblocks[i].bindres; - reflection.ConstantBlocks[i].bindPoint = (int32_t)i; + if(mapping.constantBlocks[i].bind == -1) + mapping.constantBlocks[i].bind = 0; + reflection.constantBlocks[i] = cblocks[i].bindres; + reflection.constantBlocks[i].bindPoint = (int32_t)i; } for(size_t i = 0; i < samplers.size(); i++) { - mapping.Samplers[i] = samplers[i].map; + mapping.samplers[i] = samplers[i].map; // fix up any bind points marked with -1. They were sorted to the end // but from here on we want to just be able to index with the bind point // without any special casing. - if(mapping.Samplers[i].bind == -1) - mapping.Samplers[i].bind = 0; - reflection.Samplers[i].name = samplers[i].bindres.name; - reflection.Samplers[i].bindPoint = (int32_t)i; + if(mapping.samplers[i].bind == -1) + mapping.samplers[i].bind = 0; + reflection.samplers[i].name = samplers[i].bindres.name; + reflection.samplers[i].bindPoint = (int32_t)i; } for(size_t i = 0; i < roresources.size(); i++) { - mapping.ReadOnlyResources[i] = roresources[i].map; + mapping.readOnlyResources[i] = roresources[i].map; // fix up any bind points marked with -1. They were sorted to the end // but from here on we want to just be able to index with the bind point // without any special casing. - if(mapping.ReadOnlyResources[i].bind == -1) - mapping.ReadOnlyResources[i].bind = 0; - reflection.ReadOnlyResources[i] = roresources[i].bindres; - reflection.ReadOnlyResources[i].bindPoint = (int32_t)i; + if(mapping.readOnlyResources[i].bind == -1) + mapping.readOnlyResources[i].bind = 0; + reflection.readOnlyResources[i] = roresources[i].bindres; + reflection.readOnlyResources[i].bindPoint = (int32_t)i; } for(size_t i = 0; i < rwresources.size(); i++) { - mapping.ReadWriteResources[i] = rwresources[i].map; + mapping.readWriteResources[i] = rwresources[i].map; // fix up any bind points marked with -1. They were sorted to the end // but from here on we want to just be able to index with the bind point // without any special casing. - if(mapping.ReadWriteResources[i].bind == -1) - mapping.ReadWriteResources[i].bind = 0; - reflection.ReadWriteResources[i] = rwresources[i].bindres; - reflection.ReadWriteResources[i].bindPoint = (int32_t)i; + if(mapping.readWriteResources[i].bind == -1) + mapping.readWriteResources[i].bind = 0; + reflection.readWriteResources[i] = rwresources[i].bindres; + reflection.readWriteResources[i].bindPoint = (int32_t)i; } } diff --git a/renderdoc/driver/vulkan/vk_common.cpp b/renderdoc/driver/vulkan/vk_common.cpp index 53daa2b30..66968b8c4 100644 --- a/renderdoc/driver/vulkan/vk_common.cpp +++ b/renderdoc/driver/vulkan/vk_common.cpp @@ -1298,22 +1298,22 @@ void MakeBorderColor(VkBorderColor border, FloatVector *BorderColor) } } -CompareFunc MakeCompareFunc(VkCompareOp func) +CompareFunction MakeCompareFunc(VkCompareOp func) { switch(func) { - case VK_COMPARE_OP_NEVER: return CompareFunc::Never; - case VK_COMPARE_OP_LESS: return CompareFunc::Less; - case VK_COMPARE_OP_EQUAL: return CompareFunc::Equal; - case VK_COMPARE_OP_LESS_OR_EQUAL: return CompareFunc::LessEqual; - case VK_COMPARE_OP_GREATER: return CompareFunc::Greater; - case VK_COMPARE_OP_NOT_EQUAL: return CompareFunc::NotEqual; - case VK_COMPARE_OP_GREATER_OR_EQUAL: return CompareFunc::GreaterEqual; - case VK_COMPARE_OP_ALWAYS: return CompareFunc::AlwaysTrue; + case VK_COMPARE_OP_NEVER: return CompareFunction::Never; + case VK_COMPARE_OP_LESS: return CompareFunction::Less; + case VK_COMPARE_OP_EQUAL: return CompareFunction::Equal; + case VK_COMPARE_OP_LESS_OR_EQUAL: return CompareFunction::LessEqual; + case VK_COMPARE_OP_GREATER: return CompareFunction::Greater; + case VK_COMPARE_OP_NOT_EQUAL: return CompareFunction::NotEqual; + case VK_COMPARE_OP_GREATER_OR_EQUAL: return CompareFunction::GreaterEqual; + case VK_COMPARE_OP_ALWAYS: return CompareFunction::AlwaysTrue; default: break; } - return CompareFunc::AlwaysTrue; + return CompareFunction::AlwaysTrue; } static FilterMode MakeFilterMode(VkFilter f) @@ -1356,35 +1356,35 @@ TextureFilter MakeFilter(VkFilter minFilter, VkFilter magFilter, VkSamplerMipmap ret.magnify = MakeFilterMode(magFilter); ret.mip = MakeFilterMode(mipmapMode); } - ret.func = compareEnable ? FilterFunc::Comparison : FilterFunc::Normal; + ret.filter = compareEnable ? FilterFunction::Comparison : FilterFunction::Normal; return ret; } -LogicOp MakeLogicOp(VkLogicOp op) +LogicOperation MakeLogicOp(VkLogicOp op) { switch(op) { - case VK_LOGIC_OP_CLEAR: return LogicOp::Clear; - case VK_LOGIC_OP_AND: return LogicOp::And; - case VK_LOGIC_OP_AND_REVERSE: return LogicOp::AndReverse; - case VK_LOGIC_OP_COPY: return LogicOp::Copy; - case VK_LOGIC_OP_AND_INVERTED: return LogicOp::AndInverted; - case VK_LOGIC_OP_NO_OP: return LogicOp::NoOp; - case VK_LOGIC_OP_XOR: return LogicOp::Xor; - case VK_LOGIC_OP_OR: return LogicOp::Or; - case VK_LOGIC_OP_NOR: return LogicOp::Nor; - case VK_LOGIC_OP_EQUIVALENT: return LogicOp::Equivalent; - case VK_LOGIC_OP_INVERT: return LogicOp::Invert; - case VK_LOGIC_OP_OR_REVERSE: return LogicOp::OrReverse; - case VK_LOGIC_OP_COPY_INVERTED: return LogicOp::CopyInverted; - case VK_LOGIC_OP_OR_INVERTED: return LogicOp::OrInverted; - case VK_LOGIC_OP_NAND: return LogicOp::Nand; - case VK_LOGIC_OP_SET: return LogicOp::Set; + case VK_LOGIC_OP_CLEAR: return LogicOperation::Clear; + case VK_LOGIC_OP_AND: return LogicOperation::And; + case VK_LOGIC_OP_AND_REVERSE: return LogicOperation::AndReverse; + case VK_LOGIC_OP_COPY: return LogicOperation::Copy; + case VK_LOGIC_OP_AND_INVERTED: return LogicOperation::AndInverted; + case VK_LOGIC_OP_NO_OP: return LogicOperation::NoOp; + case VK_LOGIC_OP_XOR: return LogicOperation::Xor; + case VK_LOGIC_OP_OR: return LogicOperation::Or; + case VK_LOGIC_OP_NOR: return LogicOperation::Nor; + case VK_LOGIC_OP_EQUIVALENT: return LogicOperation::Equivalent; + case VK_LOGIC_OP_INVERT: return LogicOperation::Invert; + case VK_LOGIC_OP_OR_REVERSE: return LogicOperation::OrReverse; + case VK_LOGIC_OP_COPY_INVERTED: return LogicOperation::CopyInverted; + case VK_LOGIC_OP_OR_INVERTED: return LogicOperation::OrInverted; + case VK_LOGIC_OP_NAND: return LogicOperation::Nand; + case VK_LOGIC_OP_SET: return LogicOperation::Set; default: break; } - return LogicOp::NoOp; + return LogicOperation::NoOp; } BlendMultiplier MakeBlendMultiplier(VkBlendFactor blend) @@ -1416,38 +1416,38 @@ BlendMultiplier MakeBlendMultiplier(VkBlendFactor blend) return BlendMultiplier::One; } -BlendOp MakeBlendOp(VkBlendOp op) +BlendOperation MakeBlendOp(VkBlendOp op) { // Need to update this when we support VK_EXT_blend_operation_advanced switch(op) { - case VK_BLEND_OP_ADD: return BlendOp::Add; - case VK_BLEND_OP_SUBTRACT: return BlendOp::Subtract; - case VK_BLEND_OP_REVERSE_SUBTRACT: return BlendOp::ReversedSubtract; - case VK_BLEND_OP_MIN: return BlendOp::Minimum; - case VK_BLEND_OP_MAX: return BlendOp::Maximum; + case VK_BLEND_OP_ADD: return BlendOperation::Add; + case VK_BLEND_OP_SUBTRACT: return BlendOperation::Subtract; + case VK_BLEND_OP_REVERSE_SUBTRACT: return BlendOperation::ReversedSubtract; + case VK_BLEND_OP_MIN: return BlendOperation::Minimum; + case VK_BLEND_OP_MAX: return BlendOperation::Maximum; default: break; } - return BlendOp::Add; + return BlendOperation::Add; } -StencilOp MakeStencilOp(VkStencilOp op) +StencilOperation MakeStencilOp(VkStencilOp op) { switch(op) { - case VK_STENCIL_OP_KEEP: return StencilOp::Keep; - case VK_STENCIL_OP_ZERO: return StencilOp::Zero; - case VK_STENCIL_OP_REPLACE: return StencilOp::Replace; - case VK_STENCIL_OP_INCREMENT_AND_CLAMP: return StencilOp::IncSat; - case VK_STENCIL_OP_DECREMENT_AND_CLAMP: return StencilOp::DecSat; - case VK_STENCIL_OP_INVERT: return StencilOp::Invert; - case VK_STENCIL_OP_INCREMENT_AND_WRAP: return StencilOp::IncWrap; - case VK_STENCIL_OP_DECREMENT_AND_WRAP: return StencilOp::DecWrap; + case VK_STENCIL_OP_KEEP: return StencilOperation::Keep; + case VK_STENCIL_OP_ZERO: return StencilOperation::Zero; + case VK_STENCIL_OP_REPLACE: return StencilOperation::Replace; + case VK_STENCIL_OP_INCREMENT_AND_CLAMP: return StencilOperation::IncSat; + case VK_STENCIL_OP_DECREMENT_AND_CLAMP: return StencilOperation::DecSat; + case VK_STENCIL_OP_INVERT: return StencilOperation::Invert; + case VK_STENCIL_OP_INCREMENT_AND_WRAP: return StencilOperation::IncWrap; + case VK_STENCIL_OP_DECREMENT_AND_WRAP: return StencilOperation::DecWrap; default: break; } - return StencilOp::Keep; + return StencilOperation::Keep; } template diff --git a/renderdoc/driver/vulkan/vk_common.h b/renderdoc/driver/vulkan/vk_common.h index eaf006b11..afc24747c 100644 --- a/renderdoc/driver/vulkan/vk_common.h +++ b/renderdoc/driver/vulkan/vk_common.h @@ -82,13 +82,13 @@ Topology MakePrimitiveTopology(VkPrimitiveTopology Topo, uint32_t patchControlPo VkPrimitiveTopology MakeVkPrimitiveTopology(Topology Topo); AddressMode MakeAddressMode(VkSamplerAddressMode addr); void MakeBorderColor(VkBorderColor border, FloatVector *BorderColor); -CompareFunc MakeCompareFunc(VkCompareOp func); +CompareFunction MakeCompareFunc(VkCompareOp func); TextureFilter MakeFilter(VkFilter minFilter, VkFilter magFilter, VkSamplerMipmapMode mipmapMode, bool anisoEnable, bool compareEnable); -LogicOp MakeLogicOp(VkLogicOp op); +LogicOperation MakeLogicOp(VkLogicOp op); BlendMultiplier MakeBlendMultiplier(VkBlendFactor blend); -BlendOp MakeBlendOp(VkBlendOp op); -StencilOp MakeStencilOp(VkStencilOp op); +BlendOperation MakeBlendOp(VkBlendOp op); +StencilOperation MakeStencilOp(VkStencilOp op); // set conservative access bits for this image layout VkAccessFlags MakeAccessMask(VkImageLayout layout); diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 9085900d3..7ff3129df 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -352,33 +352,33 @@ uint32_t WrappedVulkan::HandlePreCallback(VkCommandBuffer commandBuffer, DrawFla return 0; } - uint32_t eventID = it->eventID; + uint32_t eventId = it->eventId; - RDCASSERT(eventID != 0); + RDCASSERT(eventId != 0); // handle all aliases of this drawcall as long as it's not a multidraw - const DrawcallDescription *draw = GetDrawcall(eventID); + const DrawcallDescription *draw = GetDrawcall(eventId); if(draw == NULL || !(draw->flags & DrawFlags::MultiDraw)) { ++it; while(it != m_DrawcallUses.end() && it->fileOffset == m_CurChunkOffset) { - m_DrawcallCallback->AliasEvent(eventID, it->eventID); + m_DrawcallCallback->AliasEvent(eventId, it->eventId); ++it; } } - eventID += multiDrawOffset; + eventId += multiDrawOffset; if(type == DrawFlags::Drawcall) - m_DrawcallCallback->PreDraw(eventID, commandBuffer); + m_DrawcallCallback->PreDraw(eventId, commandBuffer); else if(type == DrawFlags::Dispatch) - m_DrawcallCallback->PreDispatch(eventID, commandBuffer); + m_DrawcallCallback->PreDispatch(eventId, commandBuffer); else - m_DrawcallCallback->PreMisc(eventID, type, commandBuffer); + m_DrawcallCallback->PreMisc(eventId, type, commandBuffer); - return eventID; + return eventId; } std::string WrappedVulkan::GetChunkName(uint32_t idx) @@ -454,7 +454,7 @@ WriteSerialiser &WrappedVulkan::GetThreadSerialiser() uint32_t flags = WriteSerialiser::ChunkDuration | WriteSerialiser::ChunkTimestamp | WriteSerialiser::ChunkThreadID; - if(RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks) + if(RenderDoc::Inst().GetCaptureOptions().captureCallstacks) flags |= WriteSerialiser::ChunkCallstack; ser->SetChunkMetadataRecording(flags); @@ -1539,7 +1539,7 @@ ReplayStatus WrappedVulkan::ReadLogInitialisation(RDCFile *rdc, bool storeStruct #endif // steal the structured data for ourselves - m_StructuredFile->swap(m_StoredStructuredData); + m_StructuredFile->Swap(m_StoredStructuredData); // and in future use this file. m_StructuredFile = &m_StoredStructuredData; @@ -1580,7 +1580,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta { ser.ConfigureStructuredExport(&GetChunkName, IsStructuredExporting(m_State)); - ser.GetStructuredFile().swap(*m_StructuredFile); + ser.GetStructuredFile().Swap(*m_StructuredFile); m_StructuredFile = &ser.GetStructuredFile(); } @@ -1613,7 +1613,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta if(IsActiveReplaying(m_State)) { APIEvent ev = GetEvent(startEventID); - m_RootEventID = ev.eventID; + m_RootEventID = ev.eventId; // if not partial, we need to be sure to replay // past the command buffer records, so can't @@ -1705,7 +1705,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta // swap the structure back now that we've accumulated the frame as well. if(IsLoading(m_State) || IsStructuredExporting(m_State)) - ser.GetStructuredFile().swap(*prevFile); + ser.GetStructuredFile().Swap(*prevFile); m_StructuredFile = prevFile; @@ -1718,7 +1718,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta struct SortEID { - bool operator()(const APIEvent &a, const APIEvent &b) { return a.eventID < b.eventID; } + bool operator()(const APIEvent &a, const APIEvent &b) { return a.eventId < b.eventId; } }; std::sort(m_Events.begin(), m_Events.end(), SortEID()); @@ -2402,7 +2402,7 @@ void WrappedVulkan::AddDebugMessage(MessageCategory c, MessageSeverity sv, Messa std::string d) { DebugMessage msg; - msg.eventID = 0; + msg.eventId = 0; if(IsActiveReplaying(m_State)) { // look up the EID this drawcall came from @@ -2410,7 +2410,7 @@ void WrappedVulkan::AddDebugMessage(MessageCategory c, MessageSeverity sv, Messa auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); if(it != m_DrawcallUses.end()) - msg.eventID = it->eventID; + msg.eventId = it->eventId; else RDCERR("Couldn't locate drawcall use for current chunk offset %llu", m_CurChunkOffset); } @@ -2463,7 +2463,7 @@ VkBool32 WrappedVulkan::DebugCallback(VkDebugReportFlagsEXT flags, { DebugMessage msg; - msg.eventID = 0; + msg.eventId = 0; msg.category = MessageCategory::Miscellaneous; msg.description = pMessage; msg.severity = MessageSeverity::Low; @@ -2598,10 +2598,10 @@ void WrappedVulkan::AddDrawcall(const DrawcallDescription &d, bool hasEvents) m_AddedDrawcall = true; DrawcallDescription draw = d; - draw.eventID = m_LastCmdBufferID != ResourceId() + draw.eventId = m_LastCmdBufferID != ResourceId() ? m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID : m_RootEventID; - draw.drawcallID = m_LastCmdBufferID != ResourceId() + draw.drawcallId = m_LastCmdBufferID != ResourceId() ? m_BakedCmdBufferInfo[m_LastCmdBufferID].drawCount : m_RootDrawcallID; @@ -2696,7 +2696,7 @@ void WrappedVulkan::AddUsage(VulkanDrawcallTreeNode &drawNode, vector &a, ResourceUsage u) : bindmap(a), usage(u) {} - rdcarray &bindmap; + ResUsageType(rdcarray &a, ResourceUsage u) : bindmap(a), usage(u) {} + rdcarray &bindmap; ResourceUsage usage; }; ResUsageType types[] = { - ResUsageType(sh.mapping->ReadOnlyResources, ResourceUsage::VS_Resource), - ResUsageType(sh.mapping->ReadWriteResources, ResourceUsage::VS_RWResource), - ResUsageType(sh.mapping->ConstantBlocks, ResourceUsage::VS_Constants), + ResUsageType(sh.mapping->readOnlyResources, ResourceUsage::VS_Resource), + ResUsageType(sh.mapping->readWriteResources, ResourceUsage::VS_RWResource), + ResUsageType(sh.mapping->constantBlocks, ResourceUsage::VS_Constants), }; DebugMessage msg; - msg.eventID = e; + msg.eventId = e; msg.category = MessageCategory::Execution; msg.messageID = 0; msg.source = MessageSource::IncorrectAPIUse; @@ -2759,7 +2759,7 @@ void WrappedVulkan::AddUsage(VulkanDrawcallTreeNode &drawNode, vectorConstantBlocks[i].bufferBacked) + if(t == 2 && !sh.refl->constantBlocks[i].bufferBacked) continue; int32_t bindset = types[t].bindmap[i].bindset; @@ -2897,7 +2897,7 @@ void WrappedVulkan::AddEvent() APIEvent apievent; apievent.fileOffset = m_CurChunkOffset; - apievent.eventID = m_LastCmdBufferID != ResourceId() + apievent.eventId = m_LastCmdBufferID != ResourceId() ? m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID : m_RootEventID; @@ -2906,7 +2906,7 @@ void WrappedVulkan::AddEvent() apievent.callstack = m_ChunkMetadata.callstack; for(size_t i = 0; i < m_EventMessages.size(); i++) - m_EventMessages[i].eventID = apievent.eventID; + m_EventMessages[i].eventId = apievent.eventId; if(m_LastCmdBufferID != ResourceId()) { @@ -2927,23 +2927,23 @@ void WrappedVulkan::AddEvent() m_EventMessages.clear(); } -const APIEvent &WrappedVulkan::GetEvent(uint32_t eventID) +const APIEvent &WrappedVulkan::GetEvent(uint32_t eventId) { for(const APIEvent &e : m_Events) { - if(e.eventID >= eventID) + if(e.eventId >= eventId) return e; } return m_Events.back(); } -const DrawcallDescription *WrappedVulkan::GetDrawcall(uint32_t eventID) +const DrawcallDescription *WrappedVulkan::GetDrawcall(uint32_t eventId) { - if(eventID >= m_Drawcalls.size()) + if(eventId >= m_Drawcalls.size()) return NULL; - return m_Drawcalls[eventID]; + return m_Drawcalls[eventId]; } #if ENABLED(ENABLE_UNIT_TESTS) diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index 465330938..90e2d4311 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -82,7 +82,7 @@ struct VulkanDrawcallTreeNode for(size_t i = 0; i < child.resourceUsage.size(); i++) { resourceUsage.push_back(child.resourceUsage[i]); - resourceUsage.back().second.eventID += baseEventID; + resourceUsage.back().second.eventId += baseEventID; } children.reserve(child.children.size()); @@ -95,14 +95,14 @@ struct VulkanDrawcallTreeNode void UpdateIDs(uint32_t baseEventID, uint32_t baseDrawID) { - draw.eventID += baseEventID; - draw.drawcallID += baseDrawID; + draw.eventId += baseEventID; + draw.drawcallId += baseDrawID; for(APIEvent &ev : draw.events) - ev.eventID += baseEventID; + ev.eventId += baseEventID; for(size_t i = 0; i < resourceUsage.size(); i++) - resourceUsage[i].second.eventID += baseEventID; + resourceUsage[i].second.eventId += baseEventID; for(size_t i = 0; i < children.size(); i++) children[i].UpdateIDs(baseEventID, baseDrawID); @@ -276,7 +276,7 @@ private: void AddResourceCurChunk(ResourceDescription &descr); void AddResourceCurChunk(ResourceId id); - // util function to handle fetching the right eventID, calling any + // util function to handle fetching the right eventId, calling any // aliases then calling PreDraw/PreDispatch. uint32_t HandlePreCallback(VkCommandBuffer commandBuffer, DrawFlags type = DrawFlags::Drawcall, uint32_t multiDrawOffset = 0); @@ -469,14 +469,14 @@ private: // the first one being the 'primary' struct DrawcallUse { - DrawcallUse(uint64_t offs, uint32_t eid) : fileOffset(offs), eventID(eid) {} + DrawcallUse(uint64_t offs, uint32_t eid) : fileOffset(offs), eventId(eid) {} uint64_t fileOffset; - uint32_t eventID; + uint32_t eventId; bool operator<(const DrawcallUse &o) const { if(fileOffset != o.fileOffset) return fileOffset < o.fileOffset; - return eventID < o.eventID; + return eventId < o.eventId; } }; vector m_DrawcallUses; @@ -761,9 +761,9 @@ public: SDFile &GetStructuredFile() { return *m_StructuredFile; } FrameRecord &GetFrameRecord() { return m_FrameRecord; } - const APIEvent &GetEvent(uint32_t eventID); - uint32_t GetMaxEID() { return m_Events.back().eventID; } - const DrawcallDescription *GetDrawcall(uint32_t eventID); + const APIEvent &GetEvent(uint32_t eventId); + uint32_t GetMaxEID() { return m_Events.back().eventId; } + const DrawcallDescription *GetDrawcall(uint32_t eventId); ResourceId GetDescLayoutForDescSet(ResourceId descSet) { diff --git a/renderdoc/driver/vulkan/vk_counters.cpp b/renderdoc/driver/vulkan/vk_counters.cpp index b05889fd4..3ffc96a89 100644 --- a/renderdoc/driver/vulkan/vk_counters.cpp +++ b/renderdoc/driver/vulkan/vk_counters.cpp @@ -77,7 +77,7 @@ vector VulkanReplay::EnumerateCounters() CounterDescription VulkanReplay::DescribeCounter(GPUCounter counterID) { CounterDescription desc = {}; - desc.counterID = counterID; + desc.counter = counterID; // 6839CB5B-FBD2-4550-B606-8C65157C684C desc.uuid.words[0] = 0x6839CB5B; desc.uuid.words[1] = 0xFBD24550; @@ -396,8 +396,8 @@ vector VulkanReplay::FetchCounters(const vector &coun { CounterResult result; - result.eventID = cb.m_Results[i]; - result.counterID = counters[c]; + result.eventId = cb.m_Results[i]; + result.counter = counters[c]; switch(counters[c]) { @@ -436,8 +436,8 @@ vector VulkanReplay::FetchCounters(const vector &coun for(size_t c = 0; c < counters.size(); c++) { CounterResult search; - search.counterID = counters[c]; - search.eventID = cb.m_AliasEvents[i].first; + search.counter = counters[c]; + search.eventId = cb.m_AliasEvents[i].first; // find the result we're aliasing auto it = std::find(ret.begin(), ret.end(), search); @@ -445,13 +445,13 @@ vector VulkanReplay::FetchCounters(const vector &coun { // duplicate the result and append CounterResult aliased = *it; - aliased.eventID = cb.m_AliasEvents[i].second; + aliased.eventId = cb.m_AliasEvents[i].second; ret.push_back(aliased); } else { RDCERR("Expected to find alias-target result for EID %u counter %u, but didn't", - search.eventID, search.counterID); + search.eventId, search.counter); } } } diff --git a/renderdoc/driver/vulkan/vk_debug.cpp b/renderdoc/driver/vulkan/vk_debug.cpp index 448c58a91..9afc9ee8f 100644 --- a/renderdoc/driver/vulkan/vk_debug.cpp +++ b/renderdoc/driver/vulkan/vk_debug.cpp @@ -3926,7 +3926,7 @@ void VulkanDebugManager::CopyDepthArrayToTex2DMS(VkImage destMS, VkImage srcArra } // TODO: Point meshes don't pick correctly -uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, +uint32_t VulkanDebugManager::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { VkDevice dev = m_pDriver->GetDev(); @@ -4007,11 +4007,11 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg ubo->rayPos = rayPos; ubo->rayDir = rayDir; - ubo->use_indices = cfg.position.idxByteWidth ? 1U : 0U; - ubo->numVerts = cfg.position.numVerts; + ubo->use_indices = cfg.position.indexByteStride ? 1U : 0U; + ubo->numVerts = cfg.position.numIndices; bool isTriangleMesh = true; - switch(cfg.position.topo) + switch(cfg.position.topology) { case Topology::TriangleList: { @@ -4055,8 +4055,8 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg bytebuf idxs; - if(cfg.position.idxByteWidth && cfg.position.idxbuf != ResourceId()) - GetBufferData(cfg.position.idxbuf, cfg.position.idxoffs, 0, idxs); + if(cfg.position.indexByteStride && cfg.position.indexResourceId != ResourceId()) + GetBufferData(cfg.position.indexResourceId, cfg.position.indexByteOffset, 0, idxs); // We copy into our own buffers to promote to the target type (uint32) that the // shader expects. Most IBs will be 16-bit indices, most VBs will not be float4. @@ -4064,7 +4064,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg if(!idxs.empty()) { // resize up on demand - if(m_MeshPickIBSize < cfg.position.numVerts * sizeof(uint32_t)) + if(m_MeshPickIBSize < cfg.position.numIndices * sizeof(uint32_t)) { if(m_MeshPickIBSize > 0) { @@ -4072,7 +4072,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg m_MeshPickIBUpload.Destroy(); } - m_MeshPickIBSize = cfg.position.numVerts * sizeof(uint32_t); + m_MeshPickIBSize = cfg.position.numIndices * sizeof(uint32_t); m_MeshPickIB.Create(m_pDriver, dev, m_MeshPickIBSize, 1, GPUBuffer::eGPUBufferGPULocal | GPUBuffer::eGPUBufferSSBO); @@ -4088,24 +4088,24 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg // if indices are 16-bit, manually upcast them so the shader only // has to deal with one type - if(cfg.position.idxByteWidth == 2) + if(cfg.position.indexByteStride == 2) { size_t bufsize = idxs.size() / 2; - for(uint32_t i = 0; i < bufsize && i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < bufsize && i < cfg.position.numIndices; i++) outidxs[i] = idxs16[i]; } else { size_t bufsize = idxs.size() / 4; - memcpy(outidxs, idxs32, RDCMIN(bufsize, cfg.position.numVerts * sizeof(uint32_t))); + memcpy(outidxs, idxs32, RDCMIN(bufsize, cfg.position.numIndices * sizeof(uint32_t))); } m_MeshPickIBUpload.Unmap(); } - if(m_MeshPickVBSize < cfg.position.numVerts * sizeof(FloatVector)) + if(m_MeshPickVBSize < cfg.position.numIndices * sizeof(FloatVector)) { if(m_MeshPickVBSize > 0) { @@ -4113,7 +4113,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg m_MeshPickVBUpload.Destroy(); } - m_MeshPickVBSize = cfg.position.numVerts * sizeof(FloatVector); + m_MeshPickVBSize = cfg.position.numIndices * sizeof(FloatVector); m_MeshPickVB.Create(m_pDriver, dev, m_MeshPickVBSize, 1, GPUBuffer::eGPUBufferGPULocal | GPUBuffer::eGPUBufferSSBO); @@ -4123,7 +4123,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg // unpack and linearise the data { bytebuf oldData; - GetBufferData(cfg.position.buf, cfg.position.offset, 0, oldData); + GetBufferData(cfg.position.vertexResourceId, cfg.position.vertexByteOffset, 0, oldData); byte *data = &oldData[0]; byte *dataEnd = data + oldData.size(); @@ -4136,7 +4136,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg if(cfg.position.baseVertex < 0) idxclamp = uint32_t(-cfg.position.baseVertex); - for(uint32_t i = 0; i < cfg.position.numVerts; i++) + for(uint32_t i = 0; i < cfg.position.numIndices; i++) { uint32_t idx = i; @@ -4241,7 +4241,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_COMPUTE, Unwrap(m_MeshPickLayout), 0, 1, UnwrapPtr(m_MeshPickDescSet), 0, NULL); - uint32_t workgroupx = uint32_t(cfg.position.numVerts / 128 + 1); + uint32_t workgroupx = uint32_t(cfg.position.numIndices / 128 + 1); vt->CmdDispatch(Unwrap(cmd), workgroupx, 1, 1); // wait for shader to finish writing before transferring to readback buffer @@ -5041,7 +5041,7 @@ struct VulkanQuadOverdrawCallback : public VulkanDrawcallCallback }; ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { const VkLayerDispatchTable *vt = ObjDisp(m_Device); @@ -5221,7 +5221,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over VkImageSubresourceRange subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}; - const DrawcallDescription *mainDraw = m_pDriver->GetDrawcall(eventID); + const DrawcallDescription *mainDraw = m_pDriver->GetDrawcall(eventId); // Secondary commands can't have render passes if((mainDraw && !(mainDraw->flags & DrawFlags::Drawcall)) || @@ -5433,7 +5433,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over if(overlay == DebugOverlay::Wireframe) m_pDriver->m_RenderState.lineWidth = 1.0f; - m_pDriver->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_OnlyDraw); // submit & flush so that we don't have to keep pipeline around for a while m_pDriver->SubmitCmds(); @@ -5720,11 +5720,11 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over m_pDriver->m_RenderState.scissors[i].extent.height = 16384; } - m_pDriver->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_OnlyDraw); m_pDriver->m_RenderState.graphics.pipeline = GetResID(pipe[1]); - m_pDriver->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_OnlyDraw); // submit & flush so that we don't have to keep pipeline around for a while m_pDriver->SubmitCmds(); @@ -5990,7 +5990,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over m_pDriver->m_RenderState.scissors[i].extent.height = 16384; } - m_pDriver->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_OnlyDraw); m_pDriver->m_RenderState.graphics.pipeline = GetResID(pipe[1]); if(depthRP != VK_NULL_HANDLE) @@ -5999,7 +5999,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over m_pDriver->m_RenderState.framebuffer = GetResID(depthFB); } - m_pDriver->ReplayLog(0, eventID, eReplay_OnlyDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_OnlyDraw); // submit & flush so that we don't have to keep pipeline around for a while m_pDriver->SubmitCmds(); @@ -6057,7 +6057,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over if(overlay == DebugOverlay::ClearBeforeDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); { vkr = vt->EndCommandBuffer(Unwrap(cmd)); @@ -6185,7 +6185,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over if(overlay == DebugOverlay::QuadOverdrawDraw) events.clear(); - events.push_back(eventID); + events.push_back(eventId); VkImage quadImg; VkDeviceMemory quadImgMem; @@ -6364,7 +6364,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over } // restore back to normal - m_pDriver->ReplayLog(0, eventID, eReplay_WithoutDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_WithoutDraw); cmd = m_pDriver->GetNextCmd(); @@ -6427,7 +6427,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over break; } - events.push_back(eventID); + events.push_back(eventId); m_pDriver->ReplayLog(0, events[0], eReplay_WithoutDraw); @@ -6663,16 +6663,16 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) { MeshFormat fmt = GetPostVSBuffers(events[i], inst, MeshDataStage::GSOut); - if(fmt.buf == ResourceId()) + if(fmt.vertexResourceId == ResourceId()) fmt = GetPostVSBuffers(events[i], inst, MeshDataStage::VSOut); - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { - ia.topology = MakeVkPrimitiveTopology(fmt.topo); + ia.topology = MakeVkPrimitiveTopology(fmt.topology); - binds[0].stride = binds[1].stride = fmt.stride; + binds[0].stride = binds[1].stride = fmt.vertexByteStride; - PipeKey key = std::make_pair(fmt.stride, fmt.topo); + PipeKey key = std::make_pair(fmt.vertexByteStride, fmt.topology); VkPipeline pipe = pipes[key]; if(pipe == VK_NULL_HANDLE) @@ -6682,9 +6682,10 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over RDCASSERTEQUAL(vkr, VK_SUCCESS); } - VkBuffer vb = m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.buf); + VkBuffer vb = + m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.vertexResourceId); - VkDeviceSize offs = fmt.offset; + VkDeviceSize offs = fmt.vertexByteOffset; vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(vb), &offs); pipes[key] = pipe; @@ -6746,23 +6747,24 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over } } - if(fmt.idxByteWidth) + if(fmt.indexByteStride) { VkIndexType idxtype = VK_INDEX_TYPE_UINT16; - if(fmt.idxByteWidth == 4) + if(fmt.indexByteStride == 4) idxtype = VK_INDEX_TYPE_UINT32; - if(fmt.idxbuf != ResourceId()) + if(fmt.indexResourceId != ResourceId()) { - VkBuffer ib = m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.idxbuf); + VkBuffer ib = + m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.indexResourceId); - vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), fmt.idxoffs, idxtype); - vt->CmdDrawIndexed(Unwrap(cmd), fmt.numVerts, 1, 0, fmt.baseVertex, 0); + vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), fmt.indexByteOffset, idxtype); + vt->CmdDrawIndexed(Unwrap(cmd), fmt.numIndices, 1, 0, fmt.baseVertex, 0); } } else { - vt->CmdDraw(Unwrap(cmd), fmt.numVerts, 1, 0, 0); + vt->CmdDraw(Unwrap(cmd), fmt.numIndices, 1, 0, 0); } } } @@ -6785,7 +6787,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, DebugOverlay over } // restore back to normal - m_pDriver->ReplayLog(0, eventID, eReplay_WithoutDraw); + m_pDriver->ReplayLog(0, eventId, eReplay_WithoutDraw); // restore state m_pDriver->m_RenderState = prevstate; @@ -6814,17 +6816,18 @@ MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(const MeshFor uint64_t bit = 0; - if(primary.idxByteWidth == 4) + if(primary.indexByteStride == 4) key |= 1ULL << bit; bit++; - RDCASSERT((uint32_t)primary.topo < 64); - key |= uint64_t((uint32_t)primary.topo & 0x3f) << bit; + RDCASSERT((uint32_t)primary.topology < 64); + key |= uint64_t((uint32_t)primary.topology & 0x3f) << bit; bit += 6; - VkFormat primaryFmt = MakeVkFormat(primary.fmt); - VkFormat secondaryFmt = - secondary.buf == ResourceId() ? VK_FORMAT_UNDEFINED : MakeVkFormat(secondary.fmt); + VkFormat primaryFmt = MakeVkFormat(primary.format); + VkFormat secondaryFmt = secondary.vertexResourceId == ResourceId() + ? VK_FORMAT_UNDEFINED + : MakeVkFormat(secondary.format); RDCCOMPILE_ASSERT(VK_FORMAT_RANGE_SIZE <= 255, "Mesh pipeline cache key needs an extra bit for format"); @@ -6835,14 +6838,14 @@ MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(const MeshFor key |= uint64_t((uint32_t)secondaryFmt & 0xff) << bit; bit += 8; - RDCASSERT(primary.stride <= 0xffff); - key |= uint64_t((uint32_t)primary.stride & 0xffff) << bit; + RDCASSERT(primary.vertexByteStride <= 0xffff); + key |= uint64_t((uint32_t)primary.vertexByteStride & 0xffff) << bit; bit += 16; - if(secondary.buf != ResourceId()) + if(secondary.vertexResourceId != ResourceId()) { - RDCASSERT(secondary.stride <= 0xffff); - key |= uint64_t((uint32_t)secondary.stride & 0xffff) << bit; + RDCASSERT(secondary.vertexByteStride <= 0xffff); + key |= uint64_t((uint32_t)secondary.vertexByteStride & 0xffff) << bit; } bit += 16; @@ -6857,10 +6860,11 @@ MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(const MeshFor // should we try and evict old pipelines from the cache here? // or just keep them forever - VkVertexInputBindingDescription binds[] = {// primary - {0, primary.stride, VK_VERTEX_INPUT_RATE_VERTEX}, - // secondary - {1, secondary.stride, VK_VERTEX_INPUT_RATE_VERTEX}}; + VkVertexInputBindingDescription binds[] = { + // primary + {0, primary.vertexByteStride, VK_VERTEX_INPUT_RATE_VERTEX}, + // secondary + {1, secondary.vertexByteStride, VK_VERTEX_INPUT_RATE_VERTEX}}; RDCASSERT(primaryFmt != VK_FORMAT_UNDEFINED); @@ -6890,8 +6894,8 @@ MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(const MeshFor VkPipelineInputAssemblyStateCreateInfo ia = { VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, NULL, 0, - primary.topo >= Topology::PatchList ? VK_PRIMITIVE_TOPOLOGY_POINT_LIST - : MakeVkPrimitiveTopology(primary.topo), + primary.topology >= Topology::PatchList ? VK_PRIMITIVE_TOPOLOGY_POINT_LIST + : MakeVkPrimitiveTopology(primary.topology), false, }; @@ -7070,7 +7074,7 @@ MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(const MeshFor &cache.pipes[MeshDisplayPipelines::ePipe_SolidDepth]); RDCASSERTEQUAL(vkr, VK_SUCCESS); - if(secondary.buf != ResourceId()) + if(secondary.vertexResourceId != ResourceId()) { // pull secondary information from second vertex buffer vertAttrs[1].binding = 1; @@ -7122,7 +7126,7 @@ static void AddOutputDumping(const ShaderReflection &refl, const SPIRVPatchData uint32_t *spirv = &modSpirv[0]; size_t spirvLength = modSpirv.size(); - int numOutputs = refl.OutputSig.count(); + int numOutputs = refl.outputSignature.count(); RDCASSERT(numOutputs > 0); @@ -7231,36 +7235,37 @@ static void AddOutputDumping(const ShaderReflection &refl, const SPIRVPatchData if(outs[i].basetypeID == 0) { - if(refl.OutputSig[i].compCount > 1 && opcode == spv::OpTypeVector) + if(refl.outputSignature[i].compCount > 1 && opcode == spv::OpTypeVector) { uint32_t baseID = 0; - if(refl.OutputSig[i].compType == CompType::UInt) + if(refl.outputSignature[i].compType == CompType::UInt) baseID = uint32ID; - else if(refl.OutputSig[i].compType == CompType::SInt) + else if(refl.outputSignature[i].compType == CompType::SInt) baseID = sint32ID; - else if(refl.OutputSig[i].compType == CompType::Float) + else if(refl.outputSignature[i].compType == CompType::Float) baseID = floatID; - else if(refl.OutputSig[i].compType == CompType::Double) + else if(refl.outputSignature[i].compType == CompType::Double) baseID = doubleID; else RDCERR("Unexpected component type for output signature element"); // if we have the base type, see if this is the right sized vector of that type - if(baseID != 0 && spirv[it + 2] == baseID && spirv[it + 3] == refl.OutputSig[i].compCount) + if(baseID != 0 && spirv[it + 2] == baseID && + spirv[it + 3] == refl.outputSignature[i].compCount) outs[i].basetypeID = spirv[it + 1]; } // handle non-vectors - if(refl.OutputSig[i].compCount == 1) + if(refl.outputSignature[i].compCount == 1) { - if(refl.OutputSig[i].compType == CompType::UInt) + if(refl.outputSignature[i].compType == CompType::UInt) outs[i].basetypeID = uint32ID; - else if(refl.OutputSig[i].compType == CompType::SInt) + else if(refl.outputSignature[i].compType == CompType::SInt) outs[i].basetypeID = sint32ID; - else if(refl.OutputSig[i].compType == CompType::Float) + else if(refl.outputSignature[i].compType == CompType::Float) outs[i].basetypeID = floatID; - else if(refl.OutputSig[i].compType == CompType::Double) + else if(refl.outputSignature[i].compType == CompType::Double) outs[i].basetypeID = doubleID; } } @@ -7522,8 +7527,8 @@ static void AddOutputDumping(const ShaderReflection &refl, const SPIRVPatchData if(!patchData.outputs[i].isMatrix) { RDCERR("No output pointer ID found for non-matrix output %d: %s (%u %u)", i, - refl.OutputSig[i].varName.c_str(), refl.OutputSig[i].compType, - refl.OutputSig[i].compCount); + refl.outputSignature[i].varName.c_str(), refl.outputSignature[i].compType, + refl.outputSignature[i].compCount); } outs[i].outputPtrID = idBound++; @@ -7680,16 +7685,16 @@ static void AddOutputDumping(const ShaderReflection &refl, const SPIRVPatchData for(int o = 0; o < numOutputs; o++) { uint32_t elemSize = 0; - if(refl.OutputSig[o].compType == CompType::Double) + if(refl.outputSignature[o].compType == CompType::Double) elemSize = 8; - else if(refl.OutputSig[o].compType == CompType::SInt || - refl.OutputSig[o].compType == CompType::UInt || - refl.OutputSig[o].compType == CompType::Float) + else if(refl.outputSignature[o].compType == CompType::SInt || + refl.outputSignature[o].compType == CompType::UInt || + refl.outputSignature[o].compType == CompType::Float) elemSize = 4; else RDCERR("Unexpected component type for output signature element"); - uint32_t numComps = refl.OutputSig[o].compCount; + uint32_t numComps = refl.outputSignature[o].compCount; // ensure member is std430 packed (vec4 alignment for vec3/vec4) if(numComps == 2) @@ -7703,7 +7708,7 @@ static void AddOutputDumping(const ShaderReflection &refl, const SPIRVPatchData decorations.push_back(spv::DecorationOffset); decorations.push_back(memberOffset); - memberOffset += elemSize * refl.OutputSig[o].compCount; + memberOffset += elemSize * refl.outputSignature[o].compCount; } // align to 16 bytes (vec4) since we will almost certainly have @@ -7912,13 +7917,13 @@ void VulkanDebugManager::ClearPostVSCache() m_PostVSData.clear(); } -void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) +void VulkanDebugManager::InitPostVSBuffers(uint32_t eventId) { // go through any aliasing - if(m_PostVSAlias.find(eventID) != m_PostVSAlias.end()) - eventID = m_PostVSAlias[eventID]; + if(m_PostVSAlias.find(eventId) != m_PostVSAlias.end()) + eventId = m_PostVSAlias[eventId]; - if(m_PostVSData.find(eventID) != m_PostVSData.end()) + if(m_PostVSData.find(eventId) != m_PostVSData.end()) return; if(!m_pDriver->GetDeviceFeatures().vertexPipelineStoresAndAtomics) @@ -7942,25 +7947,25 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) // no outputs from this shader? unexpected but theoretically possible (dummy VS before // tessellation maybe). Just fill out an empty data set - if(refl->OutputSig.empty()) + if(refl->outputSignature.empty()) { // empty vertex output signature - m_PostVSData[eventID].vsin.topo = pipeInfo.topology; - m_PostVSData[eventID].vsout.buf = VK_NULL_HANDLE; - m_PostVSData[eventID].vsout.instStride = 0; - m_PostVSData[eventID].vsout.vertStride = 0; - m_PostVSData[eventID].vsout.nearPlane = 0.0f; - m_PostVSData[eventID].vsout.farPlane = 0.0f; - m_PostVSData[eventID].vsout.useIndices = false; - m_PostVSData[eventID].vsout.hasPosOut = false; - m_PostVSData[eventID].vsout.idxBuf = VK_NULL_HANDLE; + m_PostVSData[eventId].vsin.topo = pipeInfo.topology; + m_PostVSData[eventId].vsout.buf = VK_NULL_HANDLE; + m_PostVSData[eventId].vsout.instStride = 0; + m_PostVSData[eventId].vsout.vertStride = 0; + m_PostVSData[eventId].vsout.nearPlane = 0.0f; + m_PostVSData[eventId].vsout.farPlane = 0.0f; + m_PostVSData[eventId].vsout.useIndices = false; + m_PostVSData[eventId].vsout.hasPosOut = false; + m_PostVSData[eventId].vsout.idxBuf = VK_NULL_HANDLE; - m_PostVSData[eventID].vsout.topo = pipeInfo.topology; + m_PostVSData[eventId].vsout.topo = pipeInfo.topology; return; } - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventID); + const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); if(drawcall == NULL || drawcall->numIndices == 0 || drawcall->numInstances == 0) return; @@ -8575,7 +8580,8 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) // expect position at the start of the buffer, as system values are sorted first // and position is the first value - for(uint32_t i = 1; refl->OutputSig[0].systemValue == ShaderBuiltin::Position && i < numVerts; i++) + for(uint32_t i = 1; + refl->outputSignature[0].systemValue == ShaderBuiltin::Position && i < numVerts; i++) { ////////////////////////////////////////////////////////////////////////////////// // derive near/far, assuming a standard perspective matrix @@ -8643,32 +8649,33 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) } // fill out m_PostVSData - m_PostVSData[eventID].vsin.topo = topo; - m_PostVSData[eventID].vsout.topo = topo; - m_PostVSData[eventID].vsout.buf = meshBuffer; - m_PostVSData[eventID].vsout.bufmem = meshMem; + m_PostVSData[eventId].vsin.topo = topo; + m_PostVSData[eventId].vsout.topo = topo; + m_PostVSData[eventId].vsout.buf = meshBuffer; + m_PostVSData[eventId].vsout.bufmem = meshMem; - m_PostVSData[eventID].vsout.vertStride = bufStride; - m_PostVSData[eventID].vsout.nearPlane = nearp; - m_PostVSData[eventID].vsout.farPlane = farp; + m_PostVSData[eventId].vsout.vertStride = bufStride; + m_PostVSData[eventId].vsout.nearPlane = nearp; + m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventID].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); - m_PostVSData[eventID].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::UseIBuffer); + m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; - m_PostVSData[eventID].vsout.instStride = 0; + m_PostVSData[eventId].vsout.instStride = 0; if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventID].vsout.instStride = uint32_t(bufSize / drawcall->numInstances); + m_PostVSData[eventId].vsout.instStride = uint32_t(bufSize / drawcall->numInstances); - m_PostVSData[eventID].vsout.idxBuf = VK_NULL_HANDLE; - if(m_PostVSData[eventID].vsout.useIndices && idxBuf != VK_NULL_HANDLE) + m_PostVSData[eventId].vsout.idxBuf = VK_NULL_HANDLE; + if(m_PostVSData[eventId].vsout.useIndices && idxBuf != VK_NULL_HANDLE) { - m_PostVSData[eventID].vsout.idxBuf = idxBuf; - m_PostVSData[eventID].vsout.idxBufMem = idxBufMem; - m_PostVSData[eventID].vsout.idxFmt = + m_PostVSData[eventId].vsout.idxBuf = idxBuf; + m_PostVSData[eventId].vsout.idxBufMem = idxBufMem; + m_PostVSData[eventId].vsout.idxFmt = state.ibuffer.bytewidth == 2 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32; } - m_PostVSData[eventID].vsout.hasPosOut = refl->OutputSig[0].systemValue == ShaderBuiltin::Position; + m_PostVSData[eventId].vsout.hasPosOut = + refl->outputSignature[0].systemValue == ShaderBuiltin::Position; // delete pipeline layout m_pDriver->vkDestroyPipelineLayout(dev, pipeLayout, NULL); @@ -8680,17 +8687,17 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) m_pDriver->vkDestroyShaderModule(dev, module, NULL); } -MeshFormat VulkanDebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat VulkanDebugManager::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { // go through any aliasing - if(m_PostVSAlias.find(eventID) != m_PostVSAlias.end()) - eventID = m_PostVSAlias[eventID]; + if(m_PostVSAlias.find(eventId) != m_PostVSAlias.end()) + eventId = m_PostVSAlias[eventId]; VulkanPostVSData postvs; RDCEraseEl(postvs); - if(m_PostVSData.find(eventID) != m_PostVSData.end()) - postvs = m_PostVSData[eventID]; + if(m_PostVSData.find(eventId) != m_PostVSData.end()) + postvs = m_PostVSData[eventId]; VulkanPostVSData::StageData s = postvs.GetStage(stage); @@ -8698,35 +8705,35 @@ MeshFormat VulkanDebugManager::GetPostVSBuffers(uint32_t eventID, uint32_t instI if(s.useIndices && s.idxBuf != VK_NULL_HANDLE) { - ret.idxbuf = GetResID(s.idxBuf); - ret.idxByteWidth = s.idxFmt == VK_INDEX_TYPE_UINT16 ? 2 : 4; + ret.indexResourceId = GetResID(s.idxBuf); + ret.indexByteStride = s.idxFmt == VK_INDEX_TYPE_UINT16 ? 2 : 4; } else { - ret.idxbuf = ResourceId(); - ret.idxByteWidth = 0; + ret.indexResourceId = ResourceId(); + ret.indexByteStride = 0; } - ret.idxoffs = 0; + ret.indexByteOffset = 0; ret.baseVertex = 0; if(s.buf != VK_NULL_HANDLE) - ret.buf = GetResID(s.buf); + ret.vertexResourceId = GetResID(s.buf); else - ret.buf = ResourceId(); + ret.vertexResourceId = ResourceId(); - ret.offset = s.instStride * instID; - ret.stride = s.vertStride; + ret.vertexByteOffset = s.instStride * instID; + ret.vertexByteStride = s.vertStride; - ret.fmt.compCount = 4; - ret.fmt.compByteWidth = 4; - ret.fmt.compType = CompType::Float; - ret.fmt.type = ResourceFormatType::Regular; - ret.fmt.bgraOrder = false; + ret.format.compCount = 4; + ret.format.compByteWidth = 4; + ret.format.compType = CompType::Float; + ret.format.type = ResourceFormatType::Regular; + ret.format.bgraOrder = false; ret.showAlpha = false; - ret.topo = MakePrimitiveTopology(s.topo, 1); - ret.numVerts = s.numVerts; + ret.topology = MakePrimitiveTopology(s.topo, 1); + ret.numIndices = s.numVerts; ret.unproject = s.hasPosOut; ret.nearPlane = s.nearPlane; diff --git a/renderdoc/driver/vulkan/vk_debug.h b/renderdoc/driver/vulkan/vk_debug.h index 0582f1cf2..7cce3aeb8 100644 --- a/renderdoc/driver/vulkan/vk_debug.h +++ b/renderdoc/driver/vulkan/vk_debug.h @@ -112,19 +112,19 @@ public: void RenderText(const TextPrintState &textstate, float x, float y, const char *fmt, ...); void EndText(const TextPrintState &textstate); - ResourceId RenderOverlay(ResourceId texid, DebugOverlay overlay, uint32_t eventID, + ResourceId RenderOverlay(ResourceId texid, DebugOverlay overlay, uint32_t eventId, const vector &passEvents); - void InitPostVSBuffers(uint32_t eventID); + void InitPostVSBuffers(uint32_t eventId); - // indicates that EID alias is the same as eventID - void AliasPostVSBuffers(uint32_t eventID, uint32_t alias) { m_PostVSAlias[alias] = eventID; } - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + // indicates that EID alias is the same as eventId + void AliasPostVSBuffers(uint32_t eventId, uint32_t alias) { m_PostVSAlias[alias] = eventId; } + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void ClearPostVSCache(); void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &ret); - uint32_t PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y, uint32_t w, + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y, uint32_t w, uint32_t h); void CopyTex2DMSToArray(VkImage destArray, VkImage srcMS, VkExtent3D extent, uint32_t layers, diff --git a/renderdoc/driver/vulkan/vk_info.cpp b/renderdoc/driver/vulkan/vk_info.cpp index 73cd8731c..aa8f0f57f 100644 --- a/renderdoc/driver/vulkan/vk_info.cpp +++ b/renderdoc/driver/vulkan/vk_info.cpp @@ -146,12 +146,12 @@ void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, Vulk reflData.entryPoint = shad.entryPoint; reflData.stage = stageIndex; - reflData.refl.ID = resourceMan->GetOriginalID(id); + reflData.refl.resourceId = resourceMan->GetOriginalID(id); if(!spv.spirv.empty()) { const std::vector &spirv = spv.spirv; - reflData.refl.RawBytes.assign((byte *)spirv.data(), spirv.size() * sizeof(uint32_t)); + reflData.refl.rawBytes.assign((byte *)spirv.data(), spirv.size() * sizeof(uint32_t)); } } @@ -370,12 +370,12 @@ void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, Vulk SPVModule &spv = info.m_ShaderModule[id].spirv; spv.MakeReflection(ShaderStage::Compute, shad.entryPoint, reflData.refl, reflData.mapping, reflData.patchData); - reflData.refl.ID = resourceMan->GetOriginalID(id); + reflData.refl.resourceId = resourceMan->GetOriginalID(id); if(!spv.spirv.empty()) { const vector &spirv = spv.spirv; - reflData.refl.RawBytes.assign((byte *)spirv.data(), spirv.size() * sizeof(uint32_t)); + reflData.refl.rawBytes.assign((byte *)spirv.data(), spirv.size() * sizeof(uint32_t)); } } diff --git a/renderdoc/driver/vulkan/vk_layer.cpp b/renderdoc/driver/vulkan/vk_layer.cpp index f9f74da45..8b0a113eb 100644 --- a/renderdoc/driver/vulkan/vk_layer.cpp +++ b/renderdoc/driver/vulkan/vk_layer.cpp @@ -71,7 +71,7 @@ class VulkanHook : LibraryHook void OptionsUpdated(const char *libName) { - if(RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(RenderDoc::Inst().GetCaptureOptions().apiValidation) { Process::RegisterEnvironmentModification( EnvironmentModification(EnvMod::Append, EnvSep::Platform, "VK_INSTANCE_LAYERS", diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index bfc982471..a1ffefc1b 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -708,11 +708,11 @@ const SDFile &VulkanReplay::GetStructuredFile() return m_pDriver->GetStructuredFile(); } -vector VulkanReplay::GetPassEvents(uint32_t eventID) +vector VulkanReplay::GetPassEvents(uint32_t eventId) { vector passEvents; - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventID); + const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); if(!draw) return passEvents; @@ -761,7 +761,7 @@ vector VulkanReplay::GetPassEvents(uint32_t eventID) // but it's useful to have the first part of the pass as part // of the list if(start->flags & (DrawFlags::Drawcall | DrawFlags::PassBoundary)) - passEvents.push_back(start->eventID); + passEvents.push_back(start->eventId); start = m_pDriver->GetDrawcall((uint32_t)start->next); } @@ -793,7 +793,7 @@ ResourceDescription &VulkanReplay::GetResourceDesc(ResourceId id) { m_ResourceIdx[id] = m_Resources.size(); m_Resources.push_back(ResourceDescription()); - m_Resources.back().ID = id; + m_Resources.back().resourceId = id; return m_Resources.back(); } @@ -843,7 +843,7 @@ TextureDescription VulkanReplay::GetTexture(ResourceId id) VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[id]; TextureDescription ret = {}; - ret.ID = m_pDriver->GetResourceManager()->GetOriginalID(id); + ret.resourceId = m_pDriver->GetResourceManager()->GetOriginalID(id); ret.arraysize = iminfo.arrayLayers; ret.creationFlags = iminfo.creationFlags; ret.cubemap = iminfo.cube; @@ -865,20 +865,20 @@ TextureDescription VulkanReplay::GetTexture(ResourceId id) switch(iminfo.type) { case VK_IMAGE_TYPE_1D: - ret.resType = iminfo.arrayLayers > 1 ? TextureDim::Texture1DArray : TextureDim::Texture1D; + ret.type = iminfo.arrayLayers > 1 ? TextureType::Texture1DArray : TextureType::Texture1D; ret.dimension = 1; break; case VK_IMAGE_TYPE_2D: if(ret.msSamp > 1) - ret.resType = iminfo.arrayLayers > 1 ? TextureDim::Texture2DMSArray : TextureDim::Texture2DMS; + ret.type = iminfo.arrayLayers > 1 ? TextureType::Texture2DMSArray : TextureType::Texture2DMS; else if(ret.cubemap) - ret.resType = iminfo.arrayLayers > 6 ? TextureDim::TextureCubeArray : TextureDim::TextureCube; + ret.type = iminfo.arrayLayers > 6 ? TextureType::TextureCubeArray : TextureType::TextureCube; else - ret.resType = iminfo.arrayLayers > 1 ? TextureDim::Texture2DArray : TextureDim::Texture2D; + ret.type = iminfo.arrayLayers > 1 ? TextureType::Texture2DArray : TextureType::Texture2D; ret.dimension = 2; break; case VK_IMAGE_TYPE_3D: - ret.resType = TextureDim::Texture3D; + ret.type = TextureType::Texture3D; ret.dimension = 3; break; default: @@ -895,7 +895,7 @@ BufferDescription VulkanReplay::GetBuffer(ResourceId id) VulkanCreationInfo::Buffer &bufinfo = m_pDriver->m_CreationInfo.m_Buffer[id]; BufferDescription ret; - ret.ID = m_pDriver->GetResourceManager()->GetOriginalID(id); + ret.resourceId = m_pDriver->GetResourceManager()->GetOriginalID(id); ret.length = bufinfo.size; ret.creationFlags = BufferCategory::NoFlags; @@ -967,17 +967,18 @@ vector VulkanReplay::GetDisassemblyTargets() string VulkanReplay::DisassembleShader(ResourceId pipeline, const ShaderReflection *refl, const string &target) { - auto it = m_pDriver->m_CreationInfo.m_ShaderModule.find(GetResourceManager()->GetLiveID(refl->ID)); + auto it = m_pDriver->m_CreationInfo.m_ShaderModule.find( + GetResourceManager()->GetLiveID(refl->resourceId)); if(it == m_pDriver->m_CreationInfo.m_ShaderModule.end()) return "Invalid Shader Specified"; if(target == "SPIR-V (RenderDoc)" || target.empty()) { - std::string &disasm = it->second.m_Reflections[refl->EntryPoint.c_str()].disassembly; + std::string &disasm = it->second.m_Reflections[refl->entryPoint.c_str()].disassembly; if(disasm.empty()) - disasm = it->second.spirv.Disassemble(refl->EntryPoint.c_str()); + disasm = it->second.spirv.Disassemble(refl->entryPoint.c_str()); return disasm; } @@ -996,7 +997,7 @@ string VulkanReplay::DisassembleShader(ResourceId pipeline, const ShaderReflecti VkPipeline pipe = m_pDriver->GetResourceManager()->GetLiveHandle(pipeline); VkShaderStageFlagBits stageBit = - VkShaderStageFlagBits(1 << it->second.m_Reflections[refl->EntryPoint.c_str()].stage); + VkShaderStageFlagBits(1 << it->second.m_Reflections[refl->entryPoint.c_str()].stage); size_t size; vt->GetShaderInfoAMD(Unwrap(dev), Unwrap(pipe), stageBit, VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD, @@ -1010,7 +1011,7 @@ string VulkanReplay::DisassembleShader(ResourceId pipeline, const ShaderReflecti return disasm; } - return GCNISA::Disassemble(&it->second.spirv, refl->EntryPoint.c_str(), target); + return GCNISA::Disassemble(&it->second.spirv, refl->entryPoint.c_str(), target); } void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sliceFace, @@ -1031,29 +1032,29 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_ { TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = true; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = sample; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = sliceFace; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.rangemin = 0.0f; - texDisplay.rangemax = 1.0f; + texDisplay.rangeMin = 0.0f; + texDisplay.rangeMax = 1.0f; texDisplay.scale = 1.0f; - texDisplay.texid = texture; + texDisplay.resourceId = texture; texDisplay.typeHint = typeHint; - texDisplay.rawoutput = true; - texDisplay.offx = -float(x); - texDisplay.offy = -float(y); + texDisplay.rawOutput = true; + texDisplay.xOffset = -float(x); + texDisplay.yOffset = -float(y); // only render green (stencil) in second pass if(pass == 1) { - texDisplay.Green = true; - texDisplay.Red = texDisplay.Blue = texDisplay.Alpha = false; + texDisplay.green = true; + texDisplay.red = texDisplay.blue = texDisplay.alpha = false; } VkClearValue clearval = {}; @@ -1158,9 +1159,9 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_ m_DebugHeight = oldH; } -uint32_t VulkanReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) +uint32_t VulkanReplay::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) { - return GetDebugManager()->PickVertex(eventID, cfg, x, y, m_DebugWidth, m_DebugHeight); + return GetDebugManager()->PickVertex(eventId, cfg, x, y, m_DebugWidth, m_DebugHeight); } bool VulkanReplay::RenderTexture(TextureDisplay cfg) @@ -1206,9 +1207,9 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn VkCommandBuffer cmd = m_pDriver->GetNextCmd(); const VkLayerDispatchTable *vt = ObjDisp(dev); - ImageLayouts &layouts = m_pDriver->m_ImageLayouts[cfg.texid]; - VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[cfg.texid]; - VkImage liveIm = m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.texid); + ImageLayouts &layouts = m_pDriver->m_ImageLayouts[cfg.resourceId]; + VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[cfg.resourceId]; + VkImage liveIm = m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.resourceId); VkImageAspectFlags aspectFlags = VK_IMAGE_ASPECT_COLOR_BIT; @@ -1237,15 +1238,15 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn else if(IsDepthOrStencilFormat(layouts.format)) { aspectFlags = VK_IMAGE_ASPECT_DEPTH_BIT; - if(layouts.format == VK_FORMAT_S8_UINT || (!cfg.Red && cfg.Green)) + if(layouts.format == VK_FORMAT_S8_UINT || (!cfg.red && cfg.green)) { aspectFlags = VK_IMAGE_ASPECT_STENCIL_BIT; descSetBinding = 10; displayformat |= TEXDISPLAY_UINT_TEX; // rescale the range so that stencil seems to fit to 0-1 - cfg.rangemin *= 255.0f; - cfg.rangemax *= 255.0f; + cfg.rangeMin *= 255.0f; + cfg.rangeMax *= 255.0f; } } @@ -1262,8 +1263,8 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn data->Padding = 0; - float x = cfg.offx; - float y = cfg.offy; + float x = cfg.xOffset; + float y = cfg.yOffset; data->Position.x = x; data->Position.y = y; @@ -1293,18 +1294,18 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn } } - data->Channels.x = cfg.Red ? 1.0f : 0.0f; - data->Channels.y = cfg.Green ? 1.0f : 0.0f; - data->Channels.z = cfg.Blue ? 1.0f : 0.0f; - data->Channels.w = cfg.Alpha ? 1.0f : 0.0f; + data->Channels.x = cfg.red ? 1.0f : 0.0f; + data->Channels.y = cfg.green ? 1.0f : 0.0f; + data->Channels.z = cfg.blue ? 1.0f : 0.0f; + data->Channels.w = cfg.alpha ? 1.0f : 0.0f; - if(cfg.rangemax <= cfg.rangemin) - cfg.rangemax += 0.00001f; + if(cfg.rangeMax <= cfg.rangeMin) + cfg.rangeMax += 0.00001f; - data->RangeMinimum = cfg.rangemin; - data->InverseRangeSize = 1.0f / (cfg.rangemax - cfg.rangemin); + data->RangeMinimum = cfg.rangeMin; + data->InverseRangeSize = 1.0f / (cfg.rangeMax - cfg.rangeMin); - data->FlipY = cfg.FlipY ? 1 : 0; + data->FlipY = cfg.flipY ? 1 : 0; data->MipLevel = (int)cfg.mip; data->Slice = 0; @@ -1364,9 +1365,9 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn data->OutputDisplayFormat = displayformat; - data->RawOutput = cfg.rawoutput ? 1 : 0; + data->RawOutput = cfg.rawOutput ? 1 : 0; - if(cfg.CustomShader != ResourceId()) + if(cfg.customShaderId != ResourceId()) { // must match struct declared in user shader (see documentation / Shader Viewer window helper // menus) @@ -1469,9 +1470,9 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn VkPipeline pipe = GetDebugManager()->m_TexDisplayPipeline; - if(cfg.CustomShader != ResourceId()) + if(cfg.customShaderId != ResourceId()) { - GetDebugManager()->CreateCustomShaderPipeline(cfg.CustomShader); + GetDebugManager()->CreateCustomShaderPipeline(cfg.customShaderId); pipe = GetDebugManager()->m_CustomTexPipeline; } else if(f16render) @@ -1482,7 +1483,7 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn { pipe = GetDebugManager()->m_TexDisplayF32Pipeline; } - else if(!cfg.rawoutput && blendAlpha && cfg.CustomShader == ResourceId()) + else if(!cfg.rawOutput && blendAlpha && cfg.customShaderId == ResourceId()) { pipe = GetDebugManager()->m_TexDisplayBlendPipeline; } @@ -1756,15 +1757,15 @@ void VulkanReplay::RenderHighlightBox(float w, float h, float scale) } ResourceId VulkanReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) + uint32_t eventId, const vector &passEvents) { - return GetDebugManager()->RenderOverlay(texid, overlay, eventID, passEvents); + return GetDebugManager()->RenderOverlay(texid, overlay, eventId, passEvents); } -void VulkanReplay::RenderMesh(uint32_t eventID, const vector &secondaryDraws, +void VulkanReplay::RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) { - if(cfg.position.buf == ResourceId() || cfg.position.numVerts == 0) + if(cfg.position.vertexResourceId == ResourceId() || cfg.position.numIndices == 0) return; auto it = m_OutputWindows.find(m_ActiveWinID); @@ -1843,7 +1844,7 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second { const MeshFormat &fmt = secondaryDraws[i]; - if(fmt.buf != ResourceId()) + if(fmt.vertexResourceId != ResourceId()) { // TODO should move the color to a push constant so we don't have to map all the time uint32_t uboOffs = 0; @@ -1892,28 +1893,30 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(secondaryCache.pipes[MeshDisplayPipelines::ePipe_WireDepth])); - VkBuffer vb = m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.buf); + VkBuffer vb = + m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.vertexResourceId); - VkDeviceSize offs = fmt.offset; + VkDeviceSize offs = fmt.vertexByteOffset; vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(vb), &offs); - if(fmt.idxByteWidth) + if(fmt.indexByteStride) { VkIndexType idxtype = VK_INDEX_TYPE_UINT16; - if(fmt.idxByteWidth == 4) + if(fmt.indexByteStride == 4) idxtype = VK_INDEX_TYPE_UINT32; - if(fmt.idxbuf != ResourceId()) + if(fmt.indexResourceId != ResourceId()) { - VkBuffer ib = m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.idxbuf); + VkBuffer ib = + m_pDriver->GetResourceManager()->GetCurrentHandle(fmt.indexResourceId); - vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), fmt.idxoffs, idxtype); + vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), fmt.indexByteOffset, idxtype); } - vt->CmdDrawIndexed(Unwrap(cmd), fmt.numVerts, 1, 0, fmt.baseVertex, 0); + vt->CmdDrawIndexed(Unwrap(cmd), fmt.numIndices, 1, 0, fmt.baseVertex, 0); } else { - vt->CmdDraw(Unwrap(cmd), fmt.numVerts, 1, 0, 0); + vt->CmdDraw(Unwrap(cmd), fmt.numIndices, 1, 0, 0); } } } @@ -1940,30 +1943,32 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second MeshDisplayPipelines cache = GetDebugManager()->CacheMeshDisplayPipelines(cfg.position, cfg.second); - if(cfg.position.buf != ResourceId()) + if(cfg.position.vertexResourceId != ResourceId()) { - VkBuffer vb = m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.position.buf); + VkBuffer vb = + m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.position.vertexResourceId); - VkDeviceSize offs = cfg.position.offset; + VkDeviceSize offs = cfg.position.vertexByteOffset; vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(vb), &offs); } SolidShade solidShadeMode = cfg.solidShadeMode; // can't support secondary shading without a buffer - no pipeline will have been created - if(solidShadeMode == SolidShade::Secondary && cfg.second.buf == ResourceId()) + if(solidShadeMode == SolidShade::Secondary && cfg.second.vertexResourceId == ResourceId()) solidShadeMode = SolidShade::NoSolid; if(solidShadeMode == SolidShade::Secondary) { - VkBuffer vb = m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.second.buf); + VkBuffer vb = + m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.second.vertexResourceId); - VkDeviceSize offs = cfg.second.offset; + VkDeviceSize offs = cfg.second.vertexByteOffset; vt->CmdBindVertexBuffers(Unwrap(cmd), 1, 1, UnwrapPtr(vb), &offs); } // solid render - if(solidShadeMode != SolidShade::NoSolid && cfg.position.topo < Topology::PatchList) + if(solidShadeMode != SolidShade::NoSolid && cfg.position.topology < Topology::PatchList) { VkPipeline pipe = VK_NULL_HANDLE; switch(solidShadeMode) @@ -1998,30 +2003,30 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(pipe)); - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) { VkIndexType idxtype = VK_INDEX_TYPE_UINT16; - if(cfg.position.idxByteWidth == 4) + if(cfg.position.indexByteStride == 4) idxtype = VK_INDEX_TYPE_UINT32; - if(cfg.position.idxbuf != ResourceId()) + if(cfg.position.indexResourceId != ResourceId()) { VkBuffer ib = - m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.position.idxbuf); + m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.position.indexResourceId); - vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), cfg.position.idxoffs, idxtype); + vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), cfg.position.indexByteOffset, idxtype); } - vt->CmdDrawIndexed(Unwrap(cmd), cfg.position.numVerts, 1, 0, cfg.position.baseVertex, 0); + vt->CmdDrawIndexed(Unwrap(cmd), cfg.position.numIndices, 1, 0, cfg.position.baseVertex, 0); } else { - vt->CmdDraw(Unwrap(cmd), cfg.position.numVerts, 1, 0, 0); + vt->CmdDraw(Unwrap(cmd), cfg.position.numIndices, 1, 0, 0); } } // wireframe render if(solidShadeMode == SolidShade::NoSolid || cfg.wireframeDraw || - cfg.position.topo >= Topology::PatchList) + cfg.position.topology >= Topology::PatchList) { Vec4f wireCol = Vec4f(cfg.position.meshColor.x, cfg.position.meshColor.y, cfg.position.meshColor.z, 1.0f); @@ -2045,37 +2050,37 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_WireDepth])); - if(cfg.position.idxByteWidth) + if(cfg.position.indexByteStride) { VkIndexType idxtype = VK_INDEX_TYPE_UINT16; - if(cfg.position.idxByteWidth == 4) + if(cfg.position.indexByteStride == 4) idxtype = VK_INDEX_TYPE_UINT32; - if(cfg.position.idxbuf != ResourceId()) + if(cfg.position.indexResourceId != ResourceId()) { VkBuffer ib = - m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.position.idxbuf); + m_pDriver->GetResourceManager()->GetCurrentHandle(cfg.position.indexResourceId); - vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), cfg.position.idxoffs, idxtype); + vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), cfg.position.indexByteOffset, idxtype); } - vt->CmdDrawIndexed(Unwrap(cmd), cfg.position.numVerts, 1, 0, cfg.position.baseVertex, 0); + vt->CmdDrawIndexed(Unwrap(cmd), cfg.position.numIndices, 1, 0, cfg.position.baseVertex, 0); } else { - vt->CmdDraw(Unwrap(cmd), cfg.position.numVerts, 1, 0, 0); + vt->CmdDraw(Unwrap(cmd), cfg.position.numIndices, 1, 0, 0); } } MeshFormat helper; - helper.idxByteWidth = 2; - helper.topo = Topology::LineList; + helper.indexByteStride = 2; + helper.topology = Topology::LineList; - helper.fmt.type = ResourceFormatType::Regular; - helper.fmt.compByteWidth = 4; - helper.fmt.compCount = 4; - helper.fmt.compType = CompType::Float; + helper.format.type = ResourceFormatType::Regular; + helper.format.compByteWidth = 4; + helper.format.compCount = 4; + helper.format.compType = CompType::Float; - helper.stride = sizeof(Vec4f); + helper.vertexByteStride = sizeof(Vec4f); // cache pipelines for use in drawing wireframe helpers cache = GetDebugManager()->CacheMeshDisplayPipelines(helper, helper); @@ -2243,7 +2248,7 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second #endif } - m_HighlightCache.CacheHighlightingData(eventID, cfg); + m_HighlightCache.CacheHighlightingData(eventId, cfg); { // get a new cmdbuffer and begin it @@ -2256,7 +2261,7 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport); } - Topology meshtopo = cfg.position.topo; + Topology meshtopo = cfg.position.topology; /////////////////////////////////////////////////////////////// // vectors to be set from buffers, depending on topology @@ -2276,19 +2281,19 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second // will be N*M long, N adjacent prims of M verts each. M = primSize below vector adjacentPrimVertices; - helper.topo = Topology::TriangleList; + helper.topology = Topology::TriangleList; uint32_t primSize = 3; // number of verts per primitive if(meshtopo == Topology::LineList || meshtopo == Topology::LineStrip || meshtopo == Topology::LineList_Adj || meshtopo == Topology::LineStrip_Adj) { primSize = 2; - helper.topo = Topology::LineList; + helper.topology = Topology::LineList; } else { // update the cache, as it's currently linelist - helper.topo = Topology::TriangleList; + helper.topology = Topology::TriangleList; cache = GetDebugManager()->CacheMeshDisplayPipelines(helper, helper); } @@ -2397,7 +2402,7 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector &second UnwrapPtr(GetDebugManager()->m_MeshDescSet), 1, &uboOffs); // vertices are drawn with tri strips - helper.topo = Topology::TriangleStrip; + helper.topology = Topology::TriangleStrip; cache = GetDebugManager()->CacheMeshDisplayPipelines(helper, helper); FloatVector vertSprite[4] = { @@ -2917,9 +2922,9 @@ void VulkanReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bool VulkanReplay::IsRenderOutput(ResourceId id) { - for(const VKPipe::Attachment &att : m_VulkanPipelineState.Pass.framebuffer.attachments) + for(const VKPipe::Attachment &att : m_VulkanPipelineState.currentPass.framebuffer.attachments) { - if(att.view == id || att.img == id) + if(att.viewResourceId == id || att.imageResourceId == id) return true; } @@ -2941,32 +2946,34 @@ void VulkanReplay::SavePipelineState() m_VulkanPipelineState = VKPipe::State(); // General pipeline properties - m_VulkanPipelineState.compute.obj = rm->GetOriginalID(state.compute.pipeline); - m_VulkanPipelineState.graphics.obj = rm->GetOriginalID(state.graphics.pipeline); + m_VulkanPipelineState.compute.pipelineResourceId = rm->GetOriginalID(state.compute.pipeline); + m_VulkanPipelineState.graphics.pipelineResourceId = rm->GetOriginalID(state.graphics.pipeline); if(state.compute.pipeline != ResourceId()) { const VulkanCreationInfo::Pipeline &p = c.m_Pipeline[state.compute.pipeline]; + m_VulkanPipelineState.compute.pipelineLayoutResourceId = rm->GetOriginalID(p.layout); + m_VulkanPipelineState.compute.flags = p.flags; - VKPipe::Shader &stage = m_VulkanPipelineState.m_CS; + VKPipe::Shader &stage = m_VulkanPipelineState.computeShader; int i = 5; // 5 is the CS idx (VS, TCS, TES, GS, FS, CS) { - stage.Object = rm->GetOriginalID(p.shaders[i].module); + stage.resourceId = rm->GetOriginalID(p.shaders[i].module); stage.entryPoint = p.shaders[i].entryPoint; stage.stage = ShaderStage::Compute; if(p.shaders[i].mapping) - stage.BindpointMapping = *p.shaders[i].mapping; + stage.bindpointMapping = *p.shaders[i].mapping; if(p.shaders[i].refl) - stage.ShaderDetails = p.shaders[i].refl; + stage.reflection = p.shaders[i].refl; stage.specialization.resize(p.shaders[i].specialization.size()); for(size_t s = 0; s < p.shaders[i].specialization.size(); s++) { - stage.specialization[s].specID = p.shaders[i].specialization[s].specID; + stage.specialization[s].specializationId = p.shaders[i].specialization[s].specID; stage.specialization[s].data.assign(p.shaders[i].specialization[s].data, p.shaders[i].specialization[s].size); } @@ -2977,226 +2984,256 @@ void VulkanReplay::SavePipelineState() { const VulkanCreationInfo::Pipeline &p = c.m_Pipeline[state.graphics.pipeline]; + m_VulkanPipelineState.graphics.pipelineLayoutResourceId = rm->GetOriginalID(p.layout); + m_VulkanPipelineState.graphics.flags = p.flags; // Input Assembly - m_VulkanPipelineState.IA.ibuffer.buf = rm->GetOriginalID(state.ibuffer.buf); - m_VulkanPipelineState.IA.ibuffer.offs = state.ibuffer.offs; - m_VulkanPipelineState.IA.primitiveRestartEnable = p.primitiveRestartEnable; + m_VulkanPipelineState.inputAssembly.indexBuffer.resourceId = + rm->GetOriginalID(state.ibuffer.buf); + m_VulkanPipelineState.inputAssembly.indexBuffer.byteOffset = state.ibuffer.offs; + m_VulkanPipelineState.inputAssembly.primitiveRestartEnable = p.primitiveRestartEnable; // Vertex Input - m_VulkanPipelineState.VI.attrs.resize(p.vertexAttrs.size()); + m_VulkanPipelineState.vertexInput.attributes.resize(p.vertexAttrs.size()); for(size_t i = 0; i < p.vertexAttrs.size(); i++) { - m_VulkanPipelineState.VI.attrs[i].location = p.vertexAttrs[i].location; - m_VulkanPipelineState.VI.attrs[i].binding = p.vertexAttrs[i].binding; - m_VulkanPipelineState.VI.attrs[i].byteoffset = p.vertexAttrs[i].byteoffset; - m_VulkanPipelineState.VI.attrs[i].format = MakeResourceFormat(p.vertexAttrs[i].format); + m_VulkanPipelineState.vertexInput.attributes[i].location = p.vertexAttrs[i].location; + m_VulkanPipelineState.vertexInput.attributes[i].binding = p.vertexAttrs[i].binding; + m_VulkanPipelineState.vertexInput.attributes[i].byteOffset = p.vertexAttrs[i].byteoffset; + m_VulkanPipelineState.vertexInput.attributes[i].format = + MakeResourceFormat(p.vertexAttrs[i].format); } - m_VulkanPipelineState.VI.binds.resize(p.vertexBindings.size()); + m_VulkanPipelineState.vertexInput.bindings.resize(p.vertexBindings.size()); for(size_t i = 0; i < p.vertexBindings.size(); i++) { - m_VulkanPipelineState.VI.binds[i].bytestride = p.vertexBindings[i].bytestride; - m_VulkanPipelineState.VI.binds[i].vbufferBinding = p.vertexBindings[i].vbufferBinding; - m_VulkanPipelineState.VI.binds[i].perInstance = p.vertexBindings[i].perInstance; + m_VulkanPipelineState.vertexInput.bindings[i].byteStride = p.vertexBindings[i].bytestride; + m_VulkanPipelineState.vertexInput.bindings[i].vertexBufferBinding = + p.vertexBindings[i].vbufferBinding; + m_VulkanPipelineState.vertexInput.bindings[i].perInstance = p.vertexBindings[i].perInstance; } - m_VulkanPipelineState.VI.vbuffers.resize(state.vbuffers.size()); + m_VulkanPipelineState.vertexInput.vertexBuffers.resize(state.vbuffers.size()); for(size_t i = 0; i < state.vbuffers.size(); i++) { - m_VulkanPipelineState.VI.vbuffers[i].buffer = rm->GetOriginalID(state.vbuffers[i].buf); - m_VulkanPipelineState.VI.vbuffers[i].offset = state.vbuffers[i].offs; + m_VulkanPipelineState.vertexInput.vertexBuffers[i].resourceId = + rm->GetOriginalID(state.vbuffers[i].buf); + m_VulkanPipelineState.vertexInput.vertexBuffers[i].byteOffset = state.vbuffers[i].offs; } // Shader Stages VKPipe::Shader *stages[] = { - &m_VulkanPipelineState.m_VS, &m_VulkanPipelineState.m_TCS, &m_VulkanPipelineState.m_TES, - &m_VulkanPipelineState.m_GS, &m_VulkanPipelineState.m_FS, + &m_VulkanPipelineState.vertexShader, &m_VulkanPipelineState.tessControlShader, + &m_VulkanPipelineState.tessEvalShader, &m_VulkanPipelineState.geometryShader, + &m_VulkanPipelineState.fragmentShader, }; for(size_t i = 0; i < ARRAY_COUNT(stages); i++) { - stages[i]->Object = rm->GetOriginalID(p.shaders[i].module); + stages[i]->resourceId = rm->GetOriginalID(p.shaders[i].module); stages[i]->entryPoint = p.shaders[i].entryPoint; stages[i]->stage = StageFromIndex(i); if(p.shaders[i].mapping) - stages[i]->BindpointMapping = *p.shaders[i].mapping; + stages[i]->bindpointMapping = *p.shaders[i].mapping; if(p.shaders[i].refl) - stages[i]->ShaderDetails = p.shaders[i].refl; + stages[i]->reflection = p.shaders[i].refl; stages[i]->specialization.resize(p.shaders[i].specialization.size()); for(size_t s = 0; s < p.shaders[i].specialization.size(); s++) { - stages[i]->specialization[s].specID = p.shaders[i].specialization[s].specID; + stages[i]->specialization[s].specializationId = p.shaders[i].specialization[s].specID; stages[i]->specialization[s].data.assign(p.shaders[i].specialization[s].data, p.shaders[i].specialization[s].size); } } // Tessellation - m_VulkanPipelineState.Tess.numControlPoints = p.patchControlPoints; + m_VulkanPipelineState.tessellation.numControlPoints = p.patchControlPoints; // Viewport/Scissors size_t numViewScissors = p.viewportCount; - m_VulkanPipelineState.VP.viewportScissors.resize(numViewScissors); + m_VulkanPipelineState.viewportScissor.viewportScissors.resize(numViewScissors); for(size_t i = 0; i < numViewScissors; i++) { if(i < state.views.size()) { - m_VulkanPipelineState.VP.viewportScissors[i].vp.x = state.views[i].x; - m_VulkanPipelineState.VP.viewportScissors[i].vp.y = state.views[i].y; - m_VulkanPipelineState.VP.viewportScissors[i].vp.width = state.views[i].width; - m_VulkanPipelineState.VP.viewportScissors[i].vp.height = state.views[i].height; - m_VulkanPipelineState.VP.viewportScissors[i].vp.minDepth = state.views[i].minDepth; - m_VulkanPipelineState.VP.viewportScissors[i].vp.maxDepth = state.views[i].maxDepth; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp.x = state.views[i].x; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp.y = state.views[i].y; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp.width = state.views[i].width; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp.height = state.views[i].height; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp.minDepth = + state.views[i].minDepth; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp.maxDepth = + state.views[i].maxDepth; } else { - RDCEraseEl(m_VulkanPipelineState.VP.viewportScissors[i].vp); + RDCEraseEl(m_VulkanPipelineState.viewportScissor.viewportScissors[i].vp); } if(i < state.scissors.size()) { - m_VulkanPipelineState.VP.viewportScissors[i].scissor.x = state.scissors[i].offset.x; - m_VulkanPipelineState.VP.viewportScissors[i].scissor.y = state.scissors[i].offset.y; - m_VulkanPipelineState.VP.viewportScissors[i].scissor.width = state.scissors[i].extent.width; - m_VulkanPipelineState.VP.viewportScissors[i].scissor.height = + m_VulkanPipelineState.viewportScissor.viewportScissors[i].scissor.x = + state.scissors[i].offset.x; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].scissor.y = + state.scissors[i].offset.y; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].scissor.width = + state.scissors[i].extent.width; + m_VulkanPipelineState.viewportScissor.viewportScissors[i].scissor.height = state.scissors[i].extent.height; } else { - RDCEraseEl(m_VulkanPipelineState.VP.viewportScissors[i].scissor); + RDCEraseEl(m_VulkanPipelineState.viewportScissor.viewportScissors[i].scissor); } } // Rasterizer - m_VulkanPipelineState.RS.depthClampEnable = p.depthClampEnable; - m_VulkanPipelineState.RS.rasterizerDiscardEnable = p.rasterizerDiscardEnable; - m_VulkanPipelineState.RS.FrontCCW = p.frontFace == VK_FRONT_FACE_COUNTER_CLOCKWISE; + m_VulkanPipelineState.rasterizer.depthClampEnable = p.depthClampEnable; + m_VulkanPipelineState.rasterizer.rasterizerDiscardEnable = p.rasterizerDiscardEnable; + m_VulkanPipelineState.rasterizer.frontCCW = p.frontFace == VK_FRONT_FACE_COUNTER_CLOCKWISE; switch(p.polygonMode) { - case VK_POLYGON_MODE_POINT: m_VulkanPipelineState.RS.fillMode = FillMode::Point; break; - case VK_POLYGON_MODE_LINE: m_VulkanPipelineState.RS.fillMode = FillMode::Wireframe; break; - case VK_POLYGON_MODE_FILL: m_VulkanPipelineState.RS.fillMode = FillMode::Solid; break; + case VK_POLYGON_MODE_POINT: + m_VulkanPipelineState.rasterizer.fillMode = FillMode::Point; + break; + case VK_POLYGON_MODE_LINE: + m_VulkanPipelineState.rasterizer.fillMode = FillMode::Wireframe; + break; + case VK_POLYGON_MODE_FILL: + m_VulkanPipelineState.rasterizer.fillMode = FillMode::Solid; + break; default: - m_VulkanPipelineState.RS.fillMode = FillMode::Solid; + m_VulkanPipelineState.rasterizer.fillMode = FillMode::Solid; RDCERR("Unexpected value for FillMode %x", p.polygonMode); break; } switch(p.cullMode) { - case VK_CULL_MODE_NONE: m_VulkanPipelineState.RS.cullMode = CullMode::NoCull; break; - case VK_CULL_MODE_FRONT_BIT: m_VulkanPipelineState.RS.cullMode = CullMode::Front; break; - case VK_CULL_MODE_BACK_BIT: m_VulkanPipelineState.RS.cullMode = CullMode::Back; break; + case VK_CULL_MODE_NONE: m_VulkanPipelineState.rasterizer.cullMode = CullMode::NoCull; break; + case VK_CULL_MODE_FRONT_BIT: + m_VulkanPipelineState.rasterizer.cullMode = CullMode::Front; + break; + case VK_CULL_MODE_BACK_BIT: + m_VulkanPipelineState.rasterizer.cullMode = CullMode::Back; + break; case VK_CULL_MODE_FRONT_AND_BACK: - m_VulkanPipelineState.RS.cullMode = CullMode::FrontAndBack; + m_VulkanPipelineState.rasterizer.cullMode = CullMode::FrontAndBack; break; default: - m_VulkanPipelineState.RS.cullMode = CullMode::NoCull; + m_VulkanPipelineState.rasterizer.cullMode = CullMode::NoCull; RDCERR("Unexpected value for CullMode %x", p.cullMode); break; } - m_VulkanPipelineState.RS.depthBias = state.bias.depth; - m_VulkanPipelineState.RS.depthBiasClamp = state.bias.biasclamp; - m_VulkanPipelineState.RS.slopeScaledDepthBias = state.bias.slope; - m_VulkanPipelineState.RS.lineWidth = state.lineWidth; + m_VulkanPipelineState.rasterizer.depthBias = state.bias.depth; + m_VulkanPipelineState.rasterizer.depthBiasClamp = state.bias.biasclamp; + m_VulkanPipelineState.rasterizer.slopeScaledDepthBias = state.bias.slope; + m_VulkanPipelineState.rasterizer.lineWidth = state.lineWidth; // MSAA - m_VulkanPipelineState.MSAA.rasterSamples = p.rasterizationSamples; - m_VulkanPipelineState.MSAA.sampleShadingEnable = p.sampleShadingEnable; - m_VulkanPipelineState.MSAA.minSampleShading = p.minSampleShading; - m_VulkanPipelineState.MSAA.sampleMask = p.sampleMask; + m_VulkanPipelineState.multisample.rasterSamples = p.rasterizationSamples; + m_VulkanPipelineState.multisample.sampleShadingEnable = p.sampleShadingEnable; + m_VulkanPipelineState.multisample.minSampleShading = p.minSampleShading; + m_VulkanPipelineState.multisample.sampleMask = p.sampleMask; // Color Blend - m_VulkanPipelineState.CB.logicOpEnable = p.logicOpEnable; - m_VulkanPipelineState.CB.alphaToCoverageEnable = p.alphaToCoverageEnable; - m_VulkanPipelineState.CB.alphaToOneEnable = p.alphaToOneEnable; - m_VulkanPipelineState.CB.logic = MakeLogicOp(p.logicOp); + m_VulkanPipelineState.colorBlend.alphaToCoverageEnable = p.alphaToCoverageEnable; + m_VulkanPipelineState.colorBlend.alphaToOneEnable = p.alphaToOneEnable; - m_VulkanPipelineState.CB.attachments.resize(p.attachments.size()); + m_VulkanPipelineState.colorBlend.blends.resize(p.attachments.size()); for(size_t i = 0; i < p.attachments.size(); i++) { - m_VulkanPipelineState.CB.attachments[i].blendEnable = p.attachments[i].blendEnable; + m_VulkanPipelineState.colorBlend.blends[i].enabled = p.attachments[i].blendEnable; - m_VulkanPipelineState.CB.attachments[i].blend.Source = + // due to shared structs, this is slightly duplicated - Vulkan doesn't have separate states + // for logic operations + m_VulkanPipelineState.colorBlend.blends[i].logicOperationEnabled = p.logicOpEnable; + m_VulkanPipelineState.colorBlend.blends[i].logicOperation = MakeLogicOp(p.logicOp); + + m_VulkanPipelineState.colorBlend.blends[i].colorBlend.source = MakeBlendMultiplier(p.attachments[i].blend.Source); - m_VulkanPipelineState.CB.attachments[i].blend.Destination = + m_VulkanPipelineState.colorBlend.blends[i].colorBlend.destination = MakeBlendMultiplier(p.attachments[i].blend.Destination); - m_VulkanPipelineState.CB.attachments[i].blend.Operation = + m_VulkanPipelineState.colorBlend.blends[i].colorBlend.operation = MakeBlendOp(p.attachments[i].blend.Operation); - m_VulkanPipelineState.CB.attachments[i].alphaBlend.Source = + m_VulkanPipelineState.colorBlend.blends[i].alphaBlend.source = MakeBlendMultiplier(p.attachments[i].alphaBlend.Source); - m_VulkanPipelineState.CB.attachments[i].alphaBlend.Destination = + m_VulkanPipelineState.colorBlend.blends[i].alphaBlend.destination = MakeBlendMultiplier(p.attachments[i].alphaBlend.Destination); - m_VulkanPipelineState.CB.attachments[i].alphaBlend.Operation = + m_VulkanPipelineState.colorBlend.blends[i].alphaBlend.operation = MakeBlendOp(p.attachments[i].alphaBlend.Operation); - m_VulkanPipelineState.CB.attachments[i].writeMask = p.attachments[i].channelWriteMask; + m_VulkanPipelineState.colorBlend.blends[i].writeMask = p.attachments[i].channelWriteMask; } - memcpy(m_VulkanPipelineState.CB.blendConst, state.blendConst, sizeof(float) * 4); + memcpy(m_VulkanPipelineState.colorBlend.blendFactor, state.blendConst, sizeof(float) * 4); // Depth Stencil - m_VulkanPipelineState.DS.depthTestEnable = p.depthTestEnable; - m_VulkanPipelineState.DS.depthWriteEnable = p.depthWriteEnable; - m_VulkanPipelineState.DS.depthBoundsEnable = p.depthBoundsEnable; - m_VulkanPipelineState.DS.depthCompareOp = MakeCompareFunc(p.depthCompareOp); - m_VulkanPipelineState.DS.stencilTestEnable = p.stencilTestEnable; + m_VulkanPipelineState.depthStencil.depthTestEnable = p.depthTestEnable; + m_VulkanPipelineState.depthStencil.depthWriteEnable = p.depthWriteEnable; + m_VulkanPipelineState.depthStencil.depthBoundsEnable = p.depthBoundsEnable; + m_VulkanPipelineState.depthStencil.depthFunction = MakeCompareFunc(p.depthCompareOp); + m_VulkanPipelineState.depthStencil.stencilTestEnable = p.stencilTestEnable; - m_VulkanPipelineState.DS.front.PassOp = MakeStencilOp(p.front.passOp); - m_VulkanPipelineState.DS.front.FailOp = MakeStencilOp(p.front.failOp); - m_VulkanPipelineState.DS.front.DepthFailOp = MakeStencilOp(p.front.depthFailOp); - m_VulkanPipelineState.DS.front.Func = MakeCompareFunc(p.front.compareOp); + m_VulkanPipelineState.depthStencil.frontFace.passOperation = MakeStencilOp(p.front.passOp); + m_VulkanPipelineState.depthStencil.frontFace.failOperation = MakeStencilOp(p.front.failOp); + m_VulkanPipelineState.depthStencil.frontFace.depthFailOperation = + MakeStencilOp(p.front.depthFailOp); + m_VulkanPipelineState.depthStencil.frontFace.function = MakeCompareFunc(p.front.compareOp); - m_VulkanPipelineState.DS.back.PassOp = MakeStencilOp(p.back.passOp); - m_VulkanPipelineState.DS.back.FailOp = MakeStencilOp(p.back.failOp); - m_VulkanPipelineState.DS.back.DepthFailOp = MakeStencilOp(p.back.depthFailOp); - m_VulkanPipelineState.DS.back.Func = MakeCompareFunc(p.back.compareOp); + m_VulkanPipelineState.depthStencil.backFace.passOperation = MakeStencilOp(p.back.passOp); + m_VulkanPipelineState.depthStencil.backFace.failOperation = MakeStencilOp(p.back.failOp); + m_VulkanPipelineState.depthStencil.backFace.depthFailOperation = + MakeStencilOp(p.back.depthFailOp); + m_VulkanPipelineState.depthStencil.backFace.function = MakeCompareFunc(p.back.compareOp); - m_VulkanPipelineState.DS.minDepthBounds = state.mindepth; - m_VulkanPipelineState.DS.maxDepthBounds = state.maxdepth; + m_VulkanPipelineState.depthStencil.minDepthBounds = state.mindepth; + m_VulkanPipelineState.depthStencil.maxDepthBounds = state.maxdepth; - m_VulkanPipelineState.DS.front.ref = state.front.ref; - m_VulkanPipelineState.DS.front.compareMask = state.front.compare; - m_VulkanPipelineState.DS.front.writeMask = state.front.write; + m_VulkanPipelineState.depthStencil.frontFace.reference = state.front.ref; + m_VulkanPipelineState.depthStencil.frontFace.compareMask = state.front.compare; + m_VulkanPipelineState.depthStencil.frontFace.writeMask = state.front.write; - m_VulkanPipelineState.DS.back.ref = state.back.ref; - m_VulkanPipelineState.DS.back.compareMask = state.back.compare; - m_VulkanPipelineState.DS.back.writeMask = state.back.write; + m_VulkanPipelineState.depthStencil.backFace.reference = state.back.ref; + m_VulkanPipelineState.depthStencil.backFace.compareMask = state.back.compare; + m_VulkanPipelineState.depthStencil.backFace.writeMask = state.back.write; } if(state.renderPass != ResourceId()) { // Renderpass - m_VulkanPipelineState.Pass.renderpass.obj = rm->GetOriginalID(state.renderPass); - m_VulkanPipelineState.Pass.renderpass.subpass = state.subpass; + m_VulkanPipelineState.currentPass.renderpass.resourceId = rm->GetOriginalID(state.renderPass); + m_VulkanPipelineState.currentPass.renderpass.subpass = state.subpass; if(state.renderPass != ResourceId()) { - m_VulkanPipelineState.Pass.renderpass.inputAttachments = + m_VulkanPipelineState.currentPass.renderpass.inputAttachments = c.m_RenderPass[state.renderPass].subpasses[state.subpass].inputAttachments; - m_VulkanPipelineState.Pass.renderpass.colorAttachments = + m_VulkanPipelineState.currentPass.renderpass.colorAttachments = c.m_RenderPass[state.renderPass].subpasses[state.subpass].colorAttachments; - m_VulkanPipelineState.Pass.renderpass.resolveAttachments = + m_VulkanPipelineState.currentPass.renderpass.resolveAttachments = c.m_RenderPass[state.renderPass].subpasses[state.subpass].resolveAttachments; - m_VulkanPipelineState.Pass.renderpass.depthstencilAttachment = + m_VulkanPipelineState.currentPass.renderpass.depthstencilAttachment = c.m_RenderPass[state.renderPass].subpasses[state.subpass].depthstencilAttachment; } - m_VulkanPipelineState.Pass.framebuffer.obj = rm->GetOriginalID(state.framebuffer); + m_VulkanPipelineState.currentPass.framebuffer.resourceId = rm->GetOriginalID(state.framebuffer); if(state.framebuffer != ResourceId()) { - m_VulkanPipelineState.Pass.framebuffer.width = c.m_Framebuffer[state.framebuffer].width; - m_VulkanPipelineState.Pass.framebuffer.height = c.m_Framebuffer[state.framebuffer].height; - m_VulkanPipelineState.Pass.framebuffer.layers = c.m_Framebuffer[state.framebuffer].layers; + m_VulkanPipelineState.currentPass.framebuffer.width = + c.m_Framebuffer[state.framebuffer].width; + m_VulkanPipelineState.currentPass.framebuffer.height = + c.m_Framebuffer[state.framebuffer].height; + m_VulkanPipelineState.currentPass.framebuffer.layers = + c.m_Framebuffer[state.framebuffer].layers; - m_VulkanPipelineState.Pass.framebuffer.attachments.resize( + m_VulkanPipelineState.currentPass.framebuffer.attachments.resize( c.m_Framebuffer[state.framebuffer].attachments.size()); for(size_t i = 0; i < c.m_Framebuffer[state.framebuffer].attachments.size(); i++) { @@ -3204,56 +3241,60 @@ void VulkanReplay::SavePipelineState() if(viewid != ResourceId()) { - m_VulkanPipelineState.Pass.framebuffer.attachments[i].view = rm->GetOriginalID(viewid); - m_VulkanPipelineState.Pass.framebuffer.attachments[i].img = + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].viewResourceId = + rm->GetOriginalID(viewid); + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].imageResourceId = rm->GetOriginalID(c.m_ImageView[viewid].image); - m_VulkanPipelineState.Pass.framebuffer.attachments[i].viewfmt = + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].viewFormat = MakeResourceFormat(c.m_ImageView[viewid].format); - m_VulkanPipelineState.Pass.framebuffer.attachments[i].baseMip = + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].firstMip = c.m_ImageView[viewid].range.baseMipLevel; - m_VulkanPipelineState.Pass.framebuffer.attachments[i].baseLayer = + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].firstSlice = c.m_ImageView[viewid].range.baseArrayLayer; - m_VulkanPipelineState.Pass.framebuffer.attachments[i].numMip = + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].numMips = c.m_ImageView[viewid].range.levelCount; - m_VulkanPipelineState.Pass.framebuffer.attachments[i].numLayer = + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].numSlices = c.m_ImageView[viewid].range.layerCount; - memcpy(m_VulkanPipelineState.Pass.framebuffer.attachments[i].swizzle, + memcpy(m_VulkanPipelineState.currentPass.framebuffer.attachments[i].swizzle, c.m_ImageView[viewid].swizzle, sizeof(TextureSwizzle) * 4); } else { - m_VulkanPipelineState.Pass.framebuffer.attachments[i].view = ResourceId(); - m_VulkanPipelineState.Pass.framebuffer.attachments[i].img = ResourceId(); + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].viewResourceId = + ResourceId(); + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].imageResourceId = + ResourceId(); - m_VulkanPipelineState.Pass.framebuffer.attachments[i].baseMip = 0; - m_VulkanPipelineState.Pass.framebuffer.attachments[i].baseLayer = 0; - m_VulkanPipelineState.Pass.framebuffer.attachments[i].numMip = 1; - m_VulkanPipelineState.Pass.framebuffer.attachments[i].numLayer = 1; + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].firstMip = 0; + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].firstSlice = 0; + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].numMips = 1; + m_VulkanPipelineState.currentPass.framebuffer.attachments[i].numSlices = 1; } } } else { - m_VulkanPipelineState.Pass.framebuffer.width = 0; - m_VulkanPipelineState.Pass.framebuffer.height = 0; - m_VulkanPipelineState.Pass.framebuffer.layers = 0; + m_VulkanPipelineState.currentPass.framebuffer.width = 0; + m_VulkanPipelineState.currentPass.framebuffer.height = 0; + m_VulkanPipelineState.currentPass.framebuffer.layers = 0; } - m_VulkanPipelineState.Pass.renderArea.x = state.renderArea.offset.x; - m_VulkanPipelineState.Pass.renderArea.y = state.renderArea.offset.y; - m_VulkanPipelineState.Pass.renderArea.width = state.renderArea.extent.width; - m_VulkanPipelineState.Pass.renderArea.height = state.renderArea.extent.height; + m_VulkanPipelineState.currentPass.renderArea.x = state.renderArea.offset.x; + m_VulkanPipelineState.currentPass.renderArea.y = state.renderArea.offset.y; + m_VulkanPipelineState.currentPass.renderArea.width = state.renderArea.extent.width; + m_VulkanPipelineState.currentPass.renderArea.height = state.renderArea.extent.height; } // Descriptor sets - m_VulkanPipelineState.graphics.DescSets.resize(state.graphics.descSets.size()); - m_VulkanPipelineState.compute.DescSets.resize(state.compute.descSets.size()); + m_VulkanPipelineState.graphics.descriptorSets.resize(state.graphics.descSets.size()); + m_VulkanPipelineState.compute.descriptorSets.resize(state.compute.descSets.size()); { rdcarray *dsts[] = { - &m_VulkanPipelineState.graphics.DescSets, &m_VulkanPipelineState.compute.DescSets, + &m_VulkanPipelineState.graphics.descriptorSets, + &m_VulkanPipelineState.compute.descriptorSets, }; const vector *srcs[] = { @@ -3269,8 +3310,8 @@ void VulkanReplay::SavePipelineState() ResourceId layoutId = m_pDriver->m_DescriptorSetState[src].layout; - dst.descset = rm->GetOriginalID(src); - dst.layout = rm->GetOriginalID(layoutId); + dst.descriptorSetResourceId = rm->GetOriginalID(src); + dst.layoutResourceId = rm->GetOriginalID(layoutId); dst.bindings.resize(m_pDriver->m_DescriptorSetState[src].currentBindings.size()); for(size_t b = 0; b < m_pDriver->m_DescriptorSetState[src].currentBindings.size(); b++) { @@ -3329,35 +3370,35 @@ void VulkanReplay::SavePipelineState() { if(layoutBind.immutableSampler) { - dst.bindings[b].binds[a].sampler = layoutBind.immutableSampler[a]; + dst.bindings[b].binds[a].samplerResourceId = layoutBind.immutableSampler[a]; dst.bindings[b].binds[a].immutableSampler = true; } else if(info[a].imageInfo.sampler != VK_NULL_HANDLE) { - dst.bindings[b].binds[a].sampler = GetResID(info[a].imageInfo.sampler); + dst.bindings[b].binds[a].samplerResourceId = GetResID(info[a].imageInfo.sampler); } - if(dst.bindings[b].binds[a].sampler != ResourceId()) + if(dst.bindings[b].binds[a].samplerResourceId != ResourceId()) { VKPipe::BindingElement &el = dst.bindings[b].binds[a]; - const VulkanCreationInfo::Sampler &sampl = c.m_Sampler[el.sampler]; + const VulkanCreationInfo::Sampler &sampl = c.m_Sampler[el.samplerResourceId]; - ResourceId liveId = el.sampler; + ResourceId liveId = el.samplerResourceId; - el.sampler = rm->GetOriginalID(el.sampler); + el.samplerResourceId = rm->GetOriginalID(el.samplerResourceId); // sampler info - el.Filter = MakeFilter(sampl.minFilter, sampl.magFilter, sampl.mipmapMode, + el.filter = MakeFilter(sampl.minFilter, sampl.magFilter, sampl.mipmapMode, sampl.maxAnisotropy > 1.0f, sampl.compareEnable); - el.AddressU = MakeAddressMode(sampl.address[0]); - el.AddressV = MakeAddressMode(sampl.address[1]); - el.AddressW = MakeAddressMode(sampl.address[2]); + el.addressU = MakeAddressMode(sampl.address[0]); + el.addressV = MakeAddressMode(sampl.address[1]); + el.addressW = MakeAddressMode(sampl.address[2]); el.mipBias = sampl.mipLodBias; - el.maxAniso = sampl.maxAnisotropy; - el.comparison = MakeCompareFunc(sampl.compareOp); - el.minlod = sampl.minLod; - el.maxlod = sampl.maxLod; - MakeBorderColor(sampl.borderColor, (FloatVector *)el.BorderColor); + el.maxAnisotropy = sampl.maxAnisotropy; + el.compareFunction = MakeCompareFunc(sampl.compareOp); + el.minLOD = sampl.minLod; + el.maxLOD = sampl.maxLod; + MakeBorderColor(sampl.borderColor, (FloatVector *)el.borderColor); el.unnormalized = sampl.unnormalizedCoordinates; } } @@ -3373,25 +3414,27 @@ void VulkanReplay::SavePipelineState() { ResourceId viewid = GetResID(view); - dst.bindings[b].binds[a].view = rm->GetOriginalID(viewid); - dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_ImageView[viewid].image); - dst.bindings[b].binds[a].viewfmt = MakeResourceFormat(c.m_ImageView[viewid].format); + dst.bindings[b].binds[a].viewResourceId = rm->GetOriginalID(viewid); + dst.bindings[b].binds[a].resourceResourceId = + rm->GetOriginalID(c.m_ImageView[viewid].image); + dst.bindings[b].binds[a].viewFormat = + MakeResourceFormat(c.m_ImageView[viewid].format); memcpy(dst.bindings[b].binds[a].swizzle, c.m_ImageView[viewid].swizzle, sizeof(TextureSwizzle) * 4); - dst.bindings[b].binds[a].baseMip = c.m_ImageView[viewid].range.baseMipLevel; - dst.bindings[b].binds[a].baseLayer = c.m_ImageView[viewid].range.baseArrayLayer; - dst.bindings[b].binds[a].numMip = c.m_ImageView[viewid].range.levelCount; - dst.bindings[b].binds[a].numLayer = c.m_ImageView[viewid].range.layerCount; + dst.bindings[b].binds[a].firstMip = c.m_ImageView[viewid].range.baseMipLevel; + dst.bindings[b].binds[a].firstSlice = c.m_ImageView[viewid].range.baseArrayLayer; + dst.bindings[b].binds[a].numMips = c.m_ImageView[viewid].range.levelCount; + dst.bindings[b].binds[a].numSlices = c.m_ImageView[viewid].range.layerCount; } else { - dst.bindings[b].binds[a].view = ResourceId(); - dst.bindings[b].binds[a].res = ResourceId(); - dst.bindings[b].binds[a].baseMip = 0; - dst.bindings[b].binds[a].baseLayer = 0; - dst.bindings[b].binds[a].numMip = 1; - dst.bindings[b].binds[a].numLayer = 1; + dst.bindings[b].binds[a].viewResourceId = ResourceId(); + dst.bindings[b].binds[a].resourceResourceId = ResourceId(); + dst.bindings[b].binds[a].firstMip = 0; + dst.bindings[b].binds[a].firstSlice = 0; + dst.bindings[b].binds[a].numMips = 1; + dst.bindings[b].binds[a].numSlices = 1; } } if(layoutBind.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER || @@ -3403,9 +3446,10 @@ void VulkanReplay::SavePipelineState() { ResourceId viewid = GetResID(view); - dst.bindings[b].binds[a].view = rm->GetOriginalID(viewid); - dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_BufferView[viewid].buffer); - dst.bindings[b].binds[a].offset = c.m_BufferView[viewid].offset; + dst.bindings[b].binds[a].viewResourceId = rm->GetOriginalID(viewid); + dst.bindings[b].binds[a].resourceResourceId = + rm->GetOriginalID(c.m_BufferView[viewid].buffer); + dst.bindings[b].binds[a].byteOffset = c.m_BufferView[viewid].offset; if(dynamicOffset) { union @@ -3419,16 +3463,16 @@ void VulkanReplay::SavePipelineState() offs.l = info[a].imageInfo.imageLayout; - dst.bindings[b].binds[a].offset += offs.u; + dst.bindings[b].binds[a].byteOffset += offs.u; } - dst.bindings[b].binds[a].size = c.m_BufferView[viewid].size; + dst.bindings[b].binds[a].byteSize = c.m_BufferView[viewid].size; } else { - dst.bindings[b].binds[a].view = ResourceId(); - dst.bindings[b].binds[a].res = ResourceId(); - dst.bindings[b].binds[a].offset = 0; - dst.bindings[b].binds[a].size = 0; + dst.bindings[b].binds[a].viewResourceId = ResourceId(); + dst.bindings[b].binds[a].resourceResourceId = ResourceId(); + dst.bindings[b].binds[a].byteOffset = 0; + dst.bindings[b].binds[a].byteSize = 0; } } if(layoutBind.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || @@ -3436,13 +3480,13 @@ void VulkanReplay::SavePipelineState() layoutBind.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || layoutBind.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) { - dst.bindings[b].binds[a].view = ResourceId(); + dst.bindings[b].binds[a].viewResourceId = ResourceId(); if(info[a].bufferInfo.buffer != VK_NULL_HANDLE) - dst.bindings[b].binds[a].res = + dst.bindings[b].binds[a].resourceResourceId = rm->GetOriginalID(GetResID(info[a].bufferInfo.buffer)); - dst.bindings[b].binds[a].offset = info[a].bufferInfo.offset; + dst.bindings[b].binds[a].byteOffset = info[a].bufferInfo.offset; if(dynamicOffset) { union @@ -3456,10 +3500,10 @@ void VulkanReplay::SavePipelineState() offs.l = info[a].imageInfo.imageLayout; - dst.bindings[b].binds[a].offset += offs.u; + dst.bindings[b].binds[a].byteOffset += offs.u; } - dst.bindings[b].binds[a].size = info[a].bufferInfo.range; + dst.bindings[b].binds[a].byteSize = info[a].bufferInfo.range; } } } @@ -3475,7 +3519,7 @@ void VulkanReplay::SavePipelineState() { VKPipe::ImageData &img = m_VulkanPipelineState.images[i]; - img.image = rm->GetOriginalID(it->first); + img.resourceId = rm->GetOriginalID(it->first); img.layouts.resize(it->second.subresourceStates.size()); for(size_t l = 0; l < it->second.subresourceStates.size(); l++) @@ -3502,7 +3546,7 @@ void VulkanReplay::FillCBufferVariables(rdcarray invars, std::string basename = invars[v].name; uint32_t rows = invars[v].type.descriptor.rows; - uint32_t cols = invars[v].type.descriptor.cols; + uint32_t cols = invars[v].type.descriptor.columns; uint32_t elems = RDCMAX(1U, invars[v].type.descriptor.elements); bool rowMajor = invars[v].type.descriptor.rowMajorStorage != 0; bool isArray = elems > 1; @@ -3532,7 +3576,7 @@ void VulkanReplay::FillCBufferVariables(rdcarray invars, FillCBufferVariables(invars[v].type.members, mems, data, dataOffset); - dataOffset += invars[v].type.descriptor.arrayStride; + dataOffset += invars[v].type.descriptor.arrayByteStride; vr.isStruct = true; @@ -3646,7 +3690,7 @@ void VulkanReplay::FillCBufferVariables(rdcarray invars, size_t rowDataOffset = dataOffset; - dataOffset += invars[v].type.descriptor.arrayStride; + dataOffset += invars[v].type.descriptor.arrayByteStride; if(rowDataOffset < data.size()) { @@ -3702,13 +3746,13 @@ void VulkanReplay::FillCBufferVariables(ResourceId shader, string entryPoint, ui ShaderReflection &refl = it->second.m_Reflections[entryPoint].refl; ShaderBindpointMapping &mapping = it->second.m_Reflections[entryPoint].mapping; - if(cbufSlot >= (uint32_t)refl.ConstantBlocks.count()) + if(cbufSlot >= (uint32_t)refl.constantBlocks.count()) { RDCERR("Invalid cbuffer slot"); return; } - ConstantBlock &c = refl.ConstantBlocks[cbufSlot]; + ConstantBlock &c = refl.constantBlocks[cbufSlot]; if(c.bufferBacked) { @@ -3718,13 +3762,13 @@ void VulkanReplay::FillCBufferVariables(ResourceId shader, string entryPoint, ui { // very specialised (and rather ugly) path to display specialization constants // magic constant here matches the one generated in SPVModule::MakeReflection( - if(mapping.ConstantBlocks[c.bindPoint].bindset == 123456) + if(mapping.constantBlocks[c.bindPoint].bindset == 123456) { outvars.resize(c.variables.size()); for(size_t v = 0; v < c.variables.size(); v++) { outvars[v].rows = c.variables[v].type.descriptor.rows; - outvars[v].columns = c.variables[v].type.descriptor.cols; + outvars[v].columns = c.variables[v].type.descriptor.columns; outvars[v].isStruct = !c.variables[v].type.members.empty(); RDCASSERT(!outvars[v].isStruct); outvars[v].name = c.variables[v].name; @@ -4266,9 +4310,9 @@ bool VulkanReplay::GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t m return true; } -void VulkanReplay::InitPostVSBuffers(uint32_t eventID) +void VulkanReplay::InitPostVSBuffers(uint32_t eventId) { - GetDebugManager()->InitPostVSBuffers(eventID); + GetDebugManager()->InitPostVSBuffers(eventId); } struct VulkanInitPostVSCallback : public VulkanDrawcallCallback @@ -4325,9 +4369,9 @@ vector VulkanReplay::GetUsage(ResourceId id) return m_pDriver->GetUsage(id); } -MeshFormat VulkanReplay::GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) +MeshFormat VulkanReplay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) { - return GetDebugManager()->GetPostVSBuffers(eventID, instID, stage); + return GetDebugManager()->GetPostVSBuffers(eventId, instID, stage); } void VulkanReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, @@ -4536,23 +4580,23 @@ void VulkanReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mi TextureDisplay texDisplay; - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.HDRMul = -1.0f; + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.hdrMultiplier = -1.0f; texDisplay.linearDisplayAsGamma = false; texDisplay.overlay = DebugOverlay::NoOverlay; - texDisplay.FlipY = false; + texDisplay.flipY = false; texDisplay.mip = mip; texDisplay.sampleIdx = imInfo.type == VK_IMAGE_TYPE_3D ? 0 : (params.resolve ? ~0U : arrayIdx); - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = imInfo.type == VK_IMAGE_TYPE_3D ? i : arrayIdx; - texDisplay.rangemin = params.blackPoint; - texDisplay.rangemax = params.whitePoint; + texDisplay.rangeMin = params.blackPoint; + texDisplay.rangeMax = params.whitePoint; texDisplay.scale = 1.0f; - texDisplay.texid = tex; + texDisplay.resourceId = tex; texDisplay.typeHint = CompType::Typeless; - texDisplay.rawoutput = false; - texDisplay.offx = 0; - texDisplay.offy = 0; + texDisplay.rawOutput = false; + texDisplay.xOffset = 0; + texDisplay.yOffset = 0; VkImageViewCreateInfo viewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, @@ -5212,21 +5256,21 @@ ResourceId VulkanReplay::ApplyCustomShader(ResourceId shader, ResourceId texid, m_DebugHeight = RDCMAX(1U, iminfo.extent.height >> mip); TextureDisplay disp; - disp.Red = disp.Green = disp.Blue = disp.Alpha = true; - disp.FlipY = false; - disp.offx = 0.0f; - disp.offy = 0.0f; - disp.CustomShader = shader; - disp.texid = texid; + disp.red = disp.green = disp.blue = disp.alpha = true; + disp.flipY = false; + disp.xOffset = 0.0f; + disp.yOffset = 0.0f; + disp.customShaderId = shader; + disp.resourceId = texid; disp.typeHint = typeHint; - disp.HDRMul = -1.0f; + disp.hdrMultiplier = -1.0f; disp.linearDisplayAsGamma = false; disp.mip = mip; disp.sampleIdx = sampleIdx; disp.overlay = DebugOverlay::NoOverlay; - disp.rangemin = 0.0f; - disp.rangemax = 1.0f; - disp.rawoutput = false; + disp.rangeMin = 0.0f; + disp.rangeMax = 1.0f; + disp.rawOutput = false; disp.scale = 1.0f; disp.sliceFace = arrayIdx; @@ -5331,21 +5375,21 @@ vector VulkanReplay::PixelHistory(vector events, return vector(); } -ShaderDebugTrace VulkanReplay::DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, +ShaderDebugTrace VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset) { VULKANNOTIMP("DebugVertex"); return ShaderDebugTrace(); } -ShaderDebugTrace VulkanReplay::DebugPixel(uint32_t eventID, uint32_t x, uint32_t y, uint32_t sample, +ShaderDebugTrace VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) { VULKANNOTIMP("DebugPixel"); return ShaderDebugTrace(); } -ShaderDebugTrace VulkanReplay::DebugThread(uint32_t eventID, const uint32_t groupid[3], +ShaderDebugTrace VulkanReplay::DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) { VULKANNOTIMP("DebugThread"); @@ -5497,7 +5541,7 @@ void Vulkan_ProcessStructured(RDCFile *rdc, SDFile &output) ReplayStatus status = vulkan.ReadLogInitialisation(rdc, true); if(status == ReplayStatus::Succeeded) - vulkan.GetStructuredFile().swap(output); + vulkan.GetStructuredFile().Swap(output); } static StructuredProcessRegistration VulkanProcessRegistration(RDC_Vulkan, &Vulkan_ProcessStructured); \ No newline at end of file diff --git a/renderdoc/driver/vulkan/vk_replay.h b/renderdoc/driver/vulkan/vk_replay.h index 39929004b..78cce303e 100644 --- a/renderdoc/driver/vulkan/vk_replay.h +++ b/renderdoc/driver/vulkan/vk_replay.h @@ -167,7 +167,7 @@ public: void ReplayLog(uint32_t endEventID, ReplayLogType replayType); const SDFile &GetStructuredFile(); - vector GetPassEvents(uint32_t eventID); + vector GetPassEvents(uint32_t eventId); vector GetSupportedWindowSystems(); @@ -181,7 +181,7 @@ public: bool IsOutputWindowVisible(uint64_t id); void FlipOutputWindow(uint64_t id); - void InitPostVSBuffers(uint32_t eventID); + void InitPostVSBuffers(uint32_t eventId); void InitPostVSBuffers(const vector &passEvents); ResourceId GetLiveID(ResourceId id); @@ -196,7 +196,7 @@ public: CompType typeHint, float minval, float maxval, bool channels[4], vector &histogram); - MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage); + MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage); void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData); void GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, @@ -205,7 +205,7 @@ public: void ReplaceResource(ResourceId from, ResourceId to); void RemoveReplacement(ResourceId id); - void RenderMesh(uint32_t eventID, const vector &secondaryDraws, const MeshDisplay &cfg); + void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg); void BuildTargetShader(string source, string entry, const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId *id, string *errors); @@ -225,18 +225,18 @@ public: vector PixelHistory(vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint); - ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, uint32_t idx, + 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, + ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive); - ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + 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 PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y); + uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y); ResourceId RenderOverlay(ResourceId cfg, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents); + uint32_t eventId, const vector &passEvents); ResourceId ApplyCustomShader(ResourceId shader, ResourceId texid, uint32_t mip, uint32_t arrayIdx, uint32_t sampleIdx, CompType typeHint); diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index c910a0648..1e0593dcb 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -2485,7 +2485,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman for(size_t i = 0; i < cmdBufInfo.debugMessages.size(); i++) { parentCmdBufInfo.debugMessages.push_back(cmdBufInfo.debugMessages[i]); - parentCmdBufInfo.debugMessages.back().eventID += parentCmdBufInfo.curEventID; + parentCmdBufInfo.debugMessages.back().eventId += parentCmdBufInfo.curEventID; } // only primary command buffers can be submitted diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index 53fd901ce..dd13e7d3b 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -352,7 +352,7 @@ VkResult WrappedVulkan::vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo for(uint32_t i = 0; i < modifiedCreateInfo.enabledExtensionCount; i++) addedExts[i] = modifiedCreateInfo.ppEnabledExtensionNames[i]; - if(RenderDoc::Inst().GetCaptureOptions().APIValidation) + if(RenderDoc::Inst().GetCaptureOptions().apiValidation) addedExts[modifiedCreateInfo.enabledExtensionCount++] = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; modifiedCreateInfo.ppEnabledExtensionNames = addedExts; @@ -400,7 +400,7 @@ VkResult WrappedVulkan::vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo m_Queue = VK_NULL_HANDLE; m_InternalCmds.Reset(); - if(RenderDoc::Inst().GetCaptureOptions().APIValidation && + if(RenderDoc::Inst().GetCaptureOptions().apiValidation && ObjDisp(m_Instance)->CreateDebugReportCallbackEXT) { VkDebugReportCallbackCreateInfoEXT debugInfo = {}; diff --git a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp index 202ff3e81..3747561d3 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp @@ -75,17 +75,17 @@ bool WrappedVulkan::Serialise_vkCmdDraw(SerialiserType &ser, VkCommandBuffer com { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer); + uint32_t eventId = HandlePreCallback(commandBuffer); ObjDisp(commandBuffer) ->CmdDraw(Unwrap(commandBuffer), vertexCount, instanceCount, firstVertex, firstInstance); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDraw(Unwrap(commandBuffer), vertexCount, instanceCount, firstVertex, firstInstance); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } } } @@ -173,18 +173,18 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexed(SerialiserType &ser, VkCommandBuf { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer); + uint32_t eventId = HandlePreCallback(commandBuffer); ObjDisp(commandBuffer) ->CmdDrawIndexed(Unwrap(commandBuffer), indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexed(Unwrap(commandBuffer), indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } } } @@ -280,16 +280,16 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer); + uint32_t eventId = HandlePreCallback(commandBuffer); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } } } @@ -320,23 +320,23 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu } else { - uint32_t baseEventID = it->eventID; + uint32_t baseEventID = it->eventId; // when we have a callback, submit every drawcall individually to the callback if(m_DrawcallCallback && IsDrawInRenderPass()) { for(uint32_t i = 0; i < count; i++) { - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } offset += stride; @@ -371,16 +371,16 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu if(IsDrawInRenderPass()) { - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } } } @@ -444,7 +444,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(buffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); return true; } @@ -458,7 +458,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(buffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; @@ -565,17 +565,17 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer); + uint32_t eventId = HandlePreCallback(commandBuffer); ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } } } @@ -606,25 +606,25 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, } else { - uint32_t baseEventID = it->eventID; + uint32_t baseEventID = it->eventId; // when we have a callback, submit every drawcall individually to the callback if(m_DrawcallCallback && IsDrawInRenderPass()) { for(uint32_t i = 0; i < count; i++) { - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } offset += stride; @@ -659,16 +659,16 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, if(IsDrawInRenderPass()) { - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventID && m_DrawcallCallback->PostDraw(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventID, commandBuffer); + m_DrawcallCallback->PostRedraw(eventId, commandBuffer); } } } @@ -734,7 +734,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(buffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); return true; } @@ -748,7 +748,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(buffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; @@ -846,14 +846,14 @@ bool WrappedVulkan::Serialise_vkCmdDispatch(SerialiserType &ser, VkCommandBuffer { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); ObjDisp(commandBuffer)->CmdDispatch(Unwrap(commandBuffer), x, y, z); - if(eventID && m_DrawcallCallback->PostDispatch(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDispatch(eventId, commandBuffer)) { ObjDisp(commandBuffer)->CmdDispatch(Unwrap(commandBuffer), x, y, z); - m_DrawcallCallback->PostRedispatch(eventID, commandBuffer); + m_DrawcallCallback->PostRedispatch(eventId, commandBuffer); } } } @@ -923,14 +923,14 @@ bool WrappedVulkan::Serialise_vkCmdDispatchIndirect(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); ObjDisp(commandBuffer)->CmdDispatchIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset); - if(eventID && m_DrawcallCallback->PostDispatch(eventID, commandBuffer)) + if(eventId && m_DrawcallCallback->PostDispatch(eventId, commandBuffer)) { ObjDisp(commandBuffer)->CmdDispatchIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset); - m_DrawcallCallback->PostRedispatch(eventID, commandBuffer); + m_DrawcallCallback->PostRedispatch(eventId, commandBuffer); } } } @@ -967,7 +967,7 @@ bool WrappedVulkan::Serialise_vkCmdDispatchIndirect(SerialiserType &ser, VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(buffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Indirect))); + GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); } } } @@ -1031,19 +1031,19 @@ bool WrappedVulkan::Serialise_vkCmdBlitImage(SerialiserType &ser, VkCommandBuffe { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Resolve); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Resolve); ObjDisp(commandBuffer) ->CmdBlitImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions, filter); - if(eventID && m_DrawcallCallback->PostMisc(eventID, DrawFlags::Resolve, commandBuffer)) + if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Resolve, commandBuffer)) { ObjDisp(commandBuffer) ->CmdBlitImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions, filter); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags::Resolve, commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Resolve, commandBuffer); } } } @@ -1074,14 +1074,14 @@ bool WrappedVulkan::Serialise_vkCmdBlitImage(SerialiserType &ser, VkCommandBuffe if(srcImage == destImage) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::Resolve))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::ResolveSrc))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(destImage), EventUsage(drawNode.draw.eventID, ResourceUsage::ResolveSrc))); + GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); } } } @@ -1154,19 +1154,19 @@ bool WrappedVulkan::Serialise_vkCmdResolveImage(SerialiserType &ser, VkCommandBu { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Resolve); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Resolve); ObjDisp(commandBuffer) ->CmdResolveImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - if(eventID && m_DrawcallCallback->PostMisc(eventID, DrawFlags::Resolve, commandBuffer)) + if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Resolve, commandBuffer)) { ObjDisp(commandBuffer) ->CmdResolveImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags::Resolve, commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Resolve, commandBuffer); } } } @@ -1197,14 +1197,14 @@ bool WrappedVulkan::Serialise_vkCmdResolveImage(SerialiserType &ser, VkCommandBu if(srcImage == destImage) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::Resolve))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::ResolveSrc))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(destImage), EventUsage(drawNode.draw.eventID, ResourceUsage::ResolveDst))); + GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); } } } @@ -1277,19 +1277,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyImage(SerialiserType &ser, VkCommandBuffe { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - if(eventID && m_DrawcallCallback->PostMisc(eventID, DrawFlags::Copy, commandBuffer)) + if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags::Copy, commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); } } } @@ -1320,14 +1320,14 @@ bool WrappedVulkan::Serialise_vkCmdCopyImage(SerialiserType &ser, VkCommandBuffe if(srcImage == destImage) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::Copy))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(destImage), EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -1396,19 +1396,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyBufferToImage( { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyBufferToImage(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destImage), destImageLayout, regionCount, pRegions); - if(eventID && m_DrawcallCallback->PostMisc(eventID, DrawFlags::Copy, commandBuffer)) + if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyBufferToImage(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destImage), destImageLayout, regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags::Copy, commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); } } } @@ -1437,9 +1437,9 @@ bool WrappedVulkan::Serialise_vkCmdCopyBufferToImage( VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + GetResID(srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(destImage), EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -1510,19 +1510,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyImageToBuffer(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyImageToBuffer(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destBuffer), regionCount, pRegions); - if(eventID && m_DrawcallCallback->PostMisc(eventID, DrawFlags::Copy, commandBuffer)) + if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyImageToBuffer(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destBuffer), regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags::Copy, commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); } } } @@ -1551,9 +1551,9 @@ bool WrappedVulkan::Serialise_vkCmdCopyImageToBuffer(SerialiserType &ser, VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcImage), EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(destBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + GetResID(destBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -1625,19 +1625,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyBuffer(SerialiserType &ser, VkCommandBuff { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyBuffer(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destBuffer), regionCount, pRegions); - if(eventID && m_DrawcallCallback->PostMisc(eventID, DrawFlags::Copy, commandBuffer)) + if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyBuffer(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destBuffer), regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags::Copy, commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); } } } @@ -1668,14 +1668,14 @@ bool WrappedVulkan::Serialise_vkCmdCopyBuffer(SerialiserType &ser, VkCommandBuff if(srcBuffer == destBuffer) { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::Copy))); + GetResID(srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); } else { drawNode.resourceUsage.push_back(std::make_pair( - GetResID(srcBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::CopySrc))); + GetResID(srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(destBuffer), EventUsage(drawNode.draw.eventID, ResourceUsage::CopyDst))); + GetResID(destBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); } } } @@ -1749,23 +1749,23 @@ bool WrappedVulkan::Serialise_vkCmdClearColorImage(SerialiserType &ser, VkComman { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor)); ObjDisp(commandBuffer) ->CmdClearColorImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &Color, rangeCount, pRanges); - if(eventID && + if(eventId && m_DrawcallCallback->PostMisc( - eventID, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor), commandBuffer)) + eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor), commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearColorImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &Color, rangeCount, pRanges); m_DrawcallCallback->PostRemisc( - eventID, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor), commandBuffer); + eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor), commandBuffer); } } } @@ -1789,7 +1789,7 @@ bool WrappedVulkan::Serialise_vkCmdClearColorImage(SerialiserType &ser, VkComman VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(image), EventUsage(drawNode.draw.eventID, ResourceUsage::Clear))); + GetResID(image), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); } } } @@ -1852,23 +1852,23 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage( { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback( + uint32_t eventId = HandlePreCallback( commandBuffer, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil)); ObjDisp(commandBuffer) ->CmdClearDepthStencilImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &DepthStencil, rangeCount, pRanges); - if(eventID && + if(eventId && m_DrawcallCallback->PostMisc( - eventID, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil), commandBuffer)) + eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil), commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearDepthStencilImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &DepthStencil, rangeCount, pRanges); m_DrawcallCallback->PostRemisc( - eventID, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil), commandBuffer); + eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil), commandBuffer); } } } @@ -1892,7 +1892,7 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage( VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); drawNode.resourceUsage.push_back(std::make_pair( - GetResID(image), EventUsage(drawNode.draw.eventID, ResourceUsage::Clear))); + GetResID(image), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); } } } @@ -1957,20 +1957,20 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventID = HandlePreCallback(commandBuffer, DrawFlags(DrawFlags::Clear)); + uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags(DrawFlags::Clear)); ObjDisp(commandBuffer) ->CmdClearAttachments(Unwrap(commandBuffer), attachmentCount, pAttachments, rectCount, pRects); - if(eventID && - m_DrawcallCallback->PostMisc(eventID, DrawFlags(DrawFlags::Clear), commandBuffer)) + if(eventId && + m_DrawcallCallback->PostMisc(eventId, DrawFlags(DrawFlags::Clear), commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearAttachments(Unwrap(commandBuffer), attachmentCount, pAttachments, rectCount, pRects); - m_DrawcallCallback->PostRemisc(eventID, DrawFlags(DrawFlags::Clear), commandBuffer); + m_DrawcallCallback->PostRemisc(eventId, DrawFlags(DrawFlags::Clear), commandBuffer); } } } @@ -2023,7 +2023,7 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, att = rp.subpasses[state.subpass].colorAttachments[att]; drawNode.resourceUsage.push_back( std::make_pair(m_CreationInfo.m_ImageView[fb.attachments[att].view].image, - EventUsage(drawNode.draw.eventID, ResourceUsage::Clear, + EventUsage(drawNode.draw.eventId, ResourceUsage::Clear, fb.attachments[att].view))); } } @@ -2034,7 +2034,7 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, att = (uint32_t)rp.subpasses[state.subpass].depthstencilAttachment; drawNode.resourceUsage.push_back( std::make_pair(m_CreationInfo.m_ImageView[fb.attachments[att].view].image, - EventUsage(drawNode.draw.eventID, ResourceUsage::Clear, + EventUsage(drawNode.draw.eventId, ResourceUsage::Clear, fb.attachments[att].view))); } } diff --git a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp index c226260fa..b4017fdd8 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp @@ -1015,7 +1015,7 @@ VkBool32 VKAPI_PTR UserDebugCallback(VkDebugReportFlagsEXT flags, { UserDebugCallbackData *user = (UserDebugCallbackData *)pUserData; - if(RenderDoc::Inst().GetCaptureOptions().DebugOutputMute) + if(RenderDoc::Inst().GetCaptureOptions().debugOutputMute) { if(user->muteWarned) return false; diff --git a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp index a15421bdb..0a238ffd4 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp @@ -215,7 +215,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(SerialiserType &ser, VkQueue queue, for(size_t i = 0; i < cmdBufInfo.debugMessages.size(); i++) { m_DebugMessages.push_back(cmdBufInfo.debugMessages[i]); - m_DebugMessages.back().eventID += m_RootEventID; + m_DebugMessages.back().eventId += m_RootEventID; } // only primary command buffers can be submitted @@ -364,16 +364,16 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(vector &cmd } VulkanDrawcallTreeNode n = cmdBufNodes[i]; - n.draw.eventID += m_RootEventID; - n.draw.drawcallID += m_RootDrawcallID; + n.draw.eventId += m_RootEventID; + n.draw.drawcallId += m_RootDrawcallID; for(APIEvent &ev : n.draw.events) { - ev.eventID += m_RootEventID; + ev.eventId += m_RootEventID; m_Events.push_back(ev); } - DrawcallUse use(m_Events.back().fileOffset, n.draw.eventID); + DrawcallUse use(m_Events.back().fileOffset, n.draw.eventId); // insert in sorted location auto drawit = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); @@ -384,7 +384,7 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(vector &cmd for(auto it = n.resourceUsage.begin(); it != n.resourceUsage.end(); ++it) { EventUsage u = it->second; - u.eventID += m_RootEventID; + u.eventId += m_RootEventID; m_ResourceUses[it->first].push_back(u); } diff --git a/renderdoc/os/win32/sys_win32_hooks.cpp b/renderdoc/os/win32/sys_win32_hooks.cpp index e39ba9047..f271444a3 100644 --- a/renderdoc/os/win32/sys_win32_hooks.cpp +++ b/renderdoc/os/win32/sys_win32_hooks.cpp @@ -276,7 +276,7 @@ private: static bool ShouldInject(LPCWSTR lpApplicationName, LPCWSTR lpCommandLine) { - if(!RenderDoc::Inst().GetCaptureOptions().HookIntoChildren) + if(!RenderDoc::Inst().GetCaptureOptions().hookIntoChildren) return false; bool inject = true; @@ -310,7 +310,7 @@ private: static bool ShouldInject(LPCSTR lpApplicationName, LPCSTR lpCommandLine) { - if(!RenderDoc::Inst().GetCaptureOptions().HookIntoChildren) + if(!RenderDoc::Inst().GetCaptureOptions().hookIntoChildren) return false; return ShouldInject(lpApplicationName ? StringFormat::UTF82Wide(lpApplicationName).c_str() : NULL, diff --git a/renderdoc/os/win32/win32_process.cpp b/renderdoc/os/win32/win32_process.cpp index ab5f1a07d..dae4e1f3b 100644 --- a/renderdoc/os/win32/win32_process.cpp +++ b/renderdoc/os/win32/win32_process.cpp @@ -508,7 +508,7 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const rdcarray 0) + if(opts.delayForDebugger > 0) { RDCDEBUG("Waiting for debugger attach to %lu", pid); uint32_t timeout = 0; @@ -522,14 +522,14 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const rdcarray opts.DelayForDebugger * 1000) + if(timeout > opts.delayForDebugger * 1000) break; } if(debuggerAttached) RDCDEBUG("Debugger attach detected after %.2f s", float(timeout) / 1000.0f); else - RDCDEBUG("Timed out waiting for debugger, gave up after %u s", opts.DelayForDebugger); + RDCDEBUG("Timed out waiting for debugger, gave up after %u s", opts.delayForDebugger); } RDCLOG("Injecting renderdoc into process %lu", pid); diff --git a/renderdoc/renderdoc.vcxproj b/renderdoc/renderdoc.vcxproj index 345c55d55..4a86c7f96 100644 --- a/renderdoc/renderdoc.vcxproj +++ b/renderdoc/renderdoc.vcxproj @@ -135,6 +135,7 @@ + diff --git a/renderdoc/renderdoc.vcxproj.filters b/renderdoc/renderdoc.vcxproj.filters index 2650c2155..d90b6f331 100644 --- a/renderdoc/renderdoc.vcxproj.filters +++ b/renderdoc/renderdoc.vcxproj.filters @@ -369,6 +369,9 @@ API\Replay + + API\Replay + diff --git a/renderdoc/replay/capture_options.cpp b/renderdoc/replay/capture_options.cpp index f6fc2d361..ce6c1efa6 100644 --- a/renderdoc/replay/capture_options.cpp +++ b/renderdoc/replay/capture_options.cpp @@ -34,20 +34,20 @@ int RENDERDOC_CC SetCaptureOptionU32(RENDERDOC_CaptureOption opt, uint32_t val) switch(opt) { - case eRENDERDOC_Option_AllowVSync: opts.AllowVSync = (val != 0); break; - case eRENDERDOC_Option_AllowFullscreen: opts.AllowFullscreen = (val != 0); break; - case eRENDERDOC_Option_APIValidation: opts.APIValidation = (val != 0); break; - case eRENDERDOC_Option_CaptureCallstacks: opts.CaptureCallstacks = (val != 0); break; + case eRENDERDOC_Option_AllowVSync: opts.allowVSync = (val != 0); break; + case eRENDERDOC_Option_AllowFullscreen: opts.allowFullscreen = (val != 0); break; + case eRENDERDOC_Option_APIValidation: opts.apiValidation = (val != 0); break; + case eRENDERDOC_Option_CaptureCallstacks: opts.captureCallstacks = (val != 0); break; case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - opts.CaptureCallstacksOnlyDraws = (val != 0); + opts.captureCallstacksOnlyDraws = (val != 0); break; - case eRENDERDOC_Option_DelayForDebugger: opts.DelayForDebugger = val; break; - case eRENDERDOC_Option_VerifyMapWrites: opts.VerifyMapWrites = (val != 0); break; - case eRENDERDOC_Option_HookIntoChildren: opts.HookIntoChildren = (val != 0); break; - case eRENDERDOC_Option_RefAllResources: opts.RefAllResources = (val != 0); break; - case eRENDERDOC_Option_SaveAllInitials: opts.SaveAllInitials = (val != 0); break; - case eRENDERDOC_Option_CaptureAllCmdLists: opts.CaptureAllCmdLists = (val != 0); break; - case eRENDERDOC_Option_DebugOutputMute: opts.DebugOutputMute = (val != 0); break; + case eRENDERDOC_Option_DelayForDebugger: opts.delayForDebugger = val; break; + case eRENDERDOC_Option_VerifyMapWrites: opts.verifyMapWrites = (val != 0); break; + case eRENDERDOC_Option_HookIntoChildren: opts.hookIntoChildren = (val != 0); break; + case eRENDERDOC_Option_RefAllResources: opts.refAllResources = (val != 0); break; + case eRENDERDOC_Option_SaveAllInitials: opts.saveAllInitials = (val != 0); break; + case eRENDERDOC_Option_CaptureAllCmdLists: opts.captureAllCmdLists = (val != 0); break; + case eRENDERDOC_Option_DebugOutputMute: opts.debugOutputMute = (val != 0); break; default: RDCLOG("Unrecognised capture option '%d'", opt); return 0; } @@ -61,20 +61,20 @@ int RENDERDOC_CC SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val) switch(opt) { - case eRENDERDOC_Option_AllowVSync: opts.AllowVSync = (val != 0.0f); break; - case eRENDERDOC_Option_AllowFullscreen: opts.AllowFullscreen = (val != 0.0f); break; - case eRENDERDOC_Option_APIValidation: opts.APIValidation = (val != 0.0f); break; - case eRENDERDOC_Option_CaptureCallstacks: opts.CaptureCallstacks = (val != 0.0f); break; + case eRENDERDOC_Option_AllowVSync: opts.allowVSync = (val != 0.0f); break; + case eRENDERDOC_Option_AllowFullscreen: opts.allowFullscreen = (val != 0.0f); break; + case eRENDERDOC_Option_APIValidation: opts.apiValidation = (val != 0.0f); break; + case eRENDERDOC_Option_CaptureCallstacks: opts.captureCallstacks = (val != 0.0f); break; case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - opts.CaptureCallstacksOnlyDraws = (val != 0.0f); + opts.captureCallstacksOnlyDraws = (val != 0.0f); break; - case eRENDERDOC_Option_DelayForDebugger: opts.DelayForDebugger = (uint32_t)val; break; - case eRENDERDOC_Option_VerifyMapWrites: opts.VerifyMapWrites = (val != 0.0f); break; - case eRENDERDOC_Option_HookIntoChildren: opts.HookIntoChildren = (val != 0.0f); break; - case eRENDERDOC_Option_RefAllResources: opts.RefAllResources = (val != 0.0f); break; - case eRENDERDOC_Option_SaveAllInitials: opts.SaveAllInitials = (val != 0.0f); break; - case eRENDERDOC_Option_CaptureAllCmdLists: opts.CaptureAllCmdLists = (val != 0.0f); break; - case eRENDERDOC_Option_DebugOutputMute: opts.DebugOutputMute = (val != 0.0f); break; + case eRENDERDOC_Option_DelayForDebugger: opts.delayForDebugger = (uint32_t)val; break; + case eRENDERDOC_Option_VerifyMapWrites: opts.verifyMapWrites = (val != 0.0f); break; + case eRENDERDOC_Option_HookIntoChildren: opts.hookIntoChildren = (val != 0.0f); break; + case eRENDERDOC_Option_RefAllResources: opts.refAllResources = (val != 0.0f); break; + case eRENDERDOC_Option_SaveAllInitials: opts.saveAllInitials = (val != 0.0f); break; + case eRENDERDOC_Option_CaptureAllCmdLists: opts.captureAllCmdLists = (val != 0.0f); break; + case eRENDERDOC_Option_DebugOutputMute: opts.debugOutputMute = (val != 0.0f); break; default: RDCLOG("Unrecognised capture option '%d'", opt); return 0; } @@ -87,29 +87,29 @@ uint32_t RENDERDOC_CC GetCaptureOptionU32(RENDERDOC_CaptureOption opt) switch(opt) { case eRENDERDOC_Option_AllowVSync: - return (RenderDoc::Inst().GetCaptureOptions().AllowVSync ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().allowVSync ? 1 : 0); case eRENDERDOC_Option_AllowFullscreen: - return (RenderDoc::Inst().GetCaptureOptions().AllowFullscreen ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().allowFullscreen ? 1 : 0); case eRENDERDOC_Option_APIValidation: - return (RenderDoc::Inst().GetCaptureOptions().APIValidation ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().apiValidation ? 1 : 0); case eRENDERDOC_Option_CaptureCallstacks: - return (RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().captureCallstacks ? 1 : 0); case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - return (RenderDoc::Inst().GetCaptureOptions().CaptureCallstacksOnlyDraws ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyDraws ? 1 : 0); case eRENDERDOC_Option_DelayForDebugger: - return (RenderDoc::Inst().GetCaptureOptions().DelayForDebugger); + return (RenderDoc::Inst().GetCaptureOptions().delayForDebugger); case eRENDERDOC_Option_VerifyMapWrites: - return (RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().verifyMapWrites ? 1 : 0); case eRENDERDOC_Option_HookIntoChildren: - return (RenderDoc::Inst().GetCaptureOptions().HookIntoChildren ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().hookIntoChildren ? 1 : 0); case eRENDERDOC_Option_RefAllResources: - return (RenderDoc::Inst().GetCaptureOptions().RefAllResources ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().refAllResources ? 1 : 0); case eRENDERDOC_Option_SaveAllInitials: - return (RenderDoc::Inst().GetCaptureOptions().SaveAllInitials ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().saveAllInitials ? 1 : 0); case eRENDERDOC_Option_CaptureAllCmdLists: - return (RenderDoc::Inst().GetCaptureOptions().CaptureAllCmdLists ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().captureAllCmdLists ? 1 : 0); case eRENDERDOC_Option_DebugOutputMute: - return (RenderDoc::Inst().GetCaptureOptions().DebugOutputMute ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().debugOutputMute ? 1 : 0); default: break; } @@ -122,29 +122,29 @@ float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt) switch(opt) { case eRENDERDOC_Option_AllowVSync: - return (RenderDoc::Inst().GetCaptureOptions().AllowVSync ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().allowVSync ? 1.0f : 0.0f); case eRENDERDOC_Option_AllowFullscreen: - return (RenderDoc::Inst().GetCaptureOptions().AllowFullscreen ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().allowFullscreen ? 1.0f : 0.0f); case eRENDERDOC_Option_APIValidation: - return (RenderDoc::Inst().GetCaptureOptions().APIValidation ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().apiValidation ? 1.0f : 0.0f); case eRENDERDOC_Option_CaptureCallstacks: - return (RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().captureCallstacks ? 1.0f : 0.0f); case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - return (RenderDoc::Inst().GetCaptureOptions().CaptureCallstacksOnlyDraws ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyDraws ? 1.0f : 0.0f); case eRENDERDOC_Option_DelayForDebugger: - return (RenderDoc::Inst().GetCaptureOptions().DelayForDebugger * 1.0f); + return (RenderDoc::Inst().GetCaptureOptions().delayForDebugger * 1.0f); case eRENDERDOC_Option_VerifyMapWrites: - return (RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().verifyMapWrites ? 1.0f : 0.0f); case eRENDERDOC_Option_HookIntoChildren: - return (RenderDoc::Inst().GetCaptureOptions().HookIntoChildren ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().hookIntoChildren ? 1.0f : 0.0f); case eRENDERDOC_Option_RefAllResources: - return (RenderDoc::Inst().GetCaptureOptions().RefAllResources ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().refAllResources ? 1.0f : 0.0f); case eRENDERDOC_Option_SaveAllInitials: - return (RenderDoc::Inst().GetCaptureOptions().SaveAllInitials ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().saveAllInitials ? 1.0f : 0.0f); case eRENDERDOC_Option_CaptureAllCmdLists: - return (RenderDoc::Inst().GetCaptureOptions().CaptureAllCmdLists ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().captureAllCmdLists ? 1.0f : 0.0f); case eRENDERDOC_Option_DebugOutputMute: - return (RenderDoc::Inst().GetCaptureOptions().DebugOutputMute ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().debugOutputMute ? 1.0f : 0.0f); default: break; } @@ -154,16 +154,16 @@ float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt) CaptureOptions::CaptureOptions() { - AllowVSync = true; - AllowFullscreen = true; - APIValidation = false; - CaptureCallstacks = false; - CaptureCallstacksOnlyDraws = false; - DelayForDebugger = 0; - VerifyMapWrites = false; - HookIntoChildren = false; - RefAllResources = false; - SaveAllInitials = false; - CaptureAllCmdLists = false; - DebugOutputMute = true; + allowVSync = true; + allowFullscreen = true; + apiValidation = false; + captureCallstacks = false; + captureCallstacksOnlyDraws = false; + delayForDebugger = 0; + verifyMapWrites = false; + hookIntoChildren = false; + refAllResources = false; + saveAllInitials = false; + captureAllCmdLists = false; + debugOutputMute = true; } diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl index e10faf142..1c8295db6 100644 --- a/renderdoc/replay/renderdoc_serialise.inl +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -91,18 +91,18 @@ void DoSerialise(SerialiserType &ser, EnvironmentModification &el) template void DoSerialise(SerialiserType &ser, CaptureOptions &el) { - SERIALISE_MEMBER(AllowVSync); - SERIALISE_MEMBER(AllowFullscreen); - SERIALISE_MEMBER(APIValidation); - SERIALISE_MEMBER(CaptureCallstacks); - SERIALISE_MEMBER(CaptureCallstacksOnlyDraws); - SERIALISE_MEMBER(DelayForDebugger); - SERIALISE_MEMBER(VerifyMapWrites); - SERIALISE_MEMBER(HookIntoChildren); - SERIALISE_MEMBER(RefAllResources); - SERIALISE_MEMBER(SaveAllInitials); - SERIALISE_MEMBER(CaptureAllCmdLists); - SERIALISE_MEMBER(DebugOutputMute); + SERIALISE_MEMBER(allowVSync); + SERIALISE_MEMBER(allowFullscreen); + SERIALISE_MEMBER(apiValidation); + SERIALISE_MEMBER(captureCallstacks); + SERIALISE_MEMBER(captureCallstacksOnlyDraws); + SERIALISE_MEMBER(delayForDebugger); + SERIALISE_MEMBER(verifyMapWrites); + SERIALISE_MEMBER(hookIntoChildren); + SERIALISE_MEMBER(refAllResources); + SERIALISE_MEMBER(saveAllInitials); + SERIALISE_MEMBER(captureAllCmdLists); + SERIALISE_MEMBER(debugOutputMute); SIZE_CHECK(20); } @@ -121,7 +121,7 @@ void DoSerialise(SerialiserType &ser, ResourceFormat &el) } template -void DoSerialise(SerialiserType &ser, BindpointMap &el) +void DoSerialise(SerialiserType &ser, Bindpoint &el) { SERIALISE_MEMBER(bindset); SERIALISE_MEMBER(bind); @@ -134,11 +134,11 @@ void DoSerialise(SerialiserType &ser, BindpointMap &el) template void DoSerialise(SerialiserType &ser, ShaderBindpointMapping &el) { - SERIALISE_MEMBER(InputAttributes); - SERIALISE_MEMBER(ConstantBlocks); - SERIALISE_MEMBER(Samplers); - SERIALISE_MEMBER(ReadOnlyResources); - SERIALISE_MEMBER(ReadWriteResources); + SERIALISE_MEMBER(inputAttributes); + SERIALISE_MEMBER(constantBlocks); + SERIALISE_MEMBER(samplers); + SERIALISE_MEMBER(readOnlyResources); + SERIALISE_MEMBER(readWriteResources); SIZE_CHECK(80); } @@ -163,27 +163,43 @@ void DoSerialise(SerialiserType &ser, SigParameter &el) SIZE_CHECK(80); } +template +void DoSerialise(SerialiserType &ser, ShaderVariableDescriptor &el) +{ + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(type); + SERIALISE_MEMBER(rows); + SERIALISE_MEMBER(columns); + SERIALISE_MEMBER(elements); + SERIALISE_MEMBER(rowMajorStorage); + SERIALISE_MEMBER(arrayByteStride); + + SIZE_CHECK(32); +} + template void DoSerialise(SerialiserType &ser, ShaderVariableType &el) { - SERIALISE_MEMBER(descriptor.name); - SERIALISE_MEMBER(descriptor.type); - SERIALISE_MEMBER(descriptor.rows); - SERIALISE_MEMBER(descriptor.cols); - SERIALISE_MEMBER(descriptor.elements); - SERIALISE_MEMBER(descriptor.rowMajorStorage); - SERIALISE_MEMBER(descriptor.arrayStride); + SERIALISE_MEMBER(descriptor); SERIALISE_MEMBER(members); SIZE_CHECK(48); } +template +void DoSerialise(SerialiserType &ser, ShaderRegister &el) +{ + SERIALISE_MEMBER(vec); + SERIALISE_MEMBER(comp); + + SIZE_CHECK(8); +} + template void DoSerialise(SerialiserType &ser, ShaderConstant &el) { SERIALISE_MEMBER(name); - SERIALISE_MEMBER(reg.vec); - SERIALISE_MEMBER(reg.comp); + SERIALISE_MEMBER(reg); SERIALISE_MEMBER(defaultValue); SERIALISE_MEMBER(type); @@ -214,8 +230,8 @@ void DoSerialise(SerialiserType &ser, ShaderSampler &el) template void DoSerialise(SerialiserType &ser, ShaderResource &el) { - SERIALISE_MEMBER(IsTexture); - SERIALISE_MEMBER(IsReadOnly); + SERIALISE_MEMBER(isTexture); + SERIALISE_MEMBER(isReadOnly); SERIALISE_MEMBER(resType); SERIALISE_MEMBER(name); SERIALISE_MEMBER(variableType); @@ -236,8 +252,8 @@ void DoSerialise(SerialiserType &ser, ShaderEntryPoint &el) template void DoSerialise(SerialiserType &ser, ShaderCompileFlag &el) { - SERIALISE_MEMBER(Name); - SERIALISE_MEMBER(Value); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(value); SIZE_CHECK(32); } @@ -253,14 +269,14 @@ void DoSerialise(SerialiserType &ser, ShaderCompileFlags &el) template void DoSerialise(SerialiserType &ser, ShaderSourceFile &el) { - SERIALISE_MEMBER(Filename); - SERIALISE_MEMBER(Contents); + SERIALISE_MEMBER(filename); + SERIALISE_MEMBER(contents); SIZE_CHECK(32); } template -void DoSerialise(SerialiserType &ser, ShaderDebugChunk &el) +void DoSerialise(SerialiserType &ser, ShaderDebugInfo &el) { SERIALISE_MEMBER(compileFlags); SERIALISE_MEMBER(files); @@ -271,28 +287,28 @@ void DoSerialise(SerialiserType &ser, ShaderDebugChunk &el) template void DoSerialise(SerialiserType &ser, ShaderReflection &el) { - SERIALISE_MEMBER(ID); - SERIALISE_MEMBER(EntryPoint); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(entryPoint); - SERIALISE_MEMBER(Stage); + SERIALISE_MEMBER(stage); - SERIALISE_MEMBER(DebugInfo); + SERIALISE_MEMBER(debugInfo); - SERIALISE_MEMBER(DispatchThreadsDimension); + SERIALISE_MEMBER(dispatchThreadsDimension); - SERIALISE_MEMBER(RawBytes); + SERIALISE_MEMBER(rawBytes); - SERIALISE_MEMBER(InputSig); - SERIALISE_MEMBER(OutputSig); + SERIALISE_MEMBER(inputSignature); + SERIALISE_MEMBER(outputSignature); - SERIALISE_MEMBER(ConstantBlocks); + SERIALISE_MEMBER(constantBlocks); - SERIALISE_MEMBER(Samplers); + SERIALISE_MEMBER(samplers); - SERIALISE_MEMBER(ReadOnlyResources); - SERIALISE_MEMBER(ReadWriteResources); + SERIALISE_MEMBER(readOnlyResources); + SERIALISE_MEMBER(readWriteResources); - SERIALISE_MEMBER(Interfaces); + SERIALISE_MEMBER(interfaces); SIZE_CHECK(208); } @@ -330,7 +346,7 @@ template void DoSerialise(SerialiserType &ser, ShaderDebugTrace &el) { SERIALISE_MEMBER(inputs); - SERIALISE_MEMBER(cbuffers); + SERIALISE_MEMBER(constantBlocks); SERIALISE_MEMBER(states); SIZE_CHECK(48); @@ -342,7 +358,7 @@ void DoSerialise(SerialiserType &ser, TextureFilter &el) SERIALISE_MEMBER(minify); SERIALISE_MEMBER(magnify); SERIALISE_MEMBER(mip); - SERIALISE_MEMBER(func); + SERIALISE_MEMBER(filter); SIZE_CHECK(16); } @@ -350,7 +366,7 @@ void DoSerialise(SerialiserType &ser, TextureFilter &el) template void DoSerialise(SerialiserType &ser, ResourceDescription &el) { - SERIALISE_MEMBER(ID); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(type); SERIALISE_MEMBER(name); SERIALISE_MEMBER(autogeneratedName); @@ -366,11 +382,11 @@ void DoSerialise(SerialiserType &ser, TextureDescription &el) { SERIALISE_MEMBER(format); SERIALISE_MEMBER(dimension); - SERIALISE_MEMBER(resType); + SERIALISE_MEMBER(type); SERIALISE_MEMBER(width); SERIALISE_MEMBER(height); SERIALISE_MEMBER(depth); - SERIALISE_MEMBER(ID); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(cubemap); SERIALISE_MEMBER(mips); SERIALISE_MEMBER(arraysize); @@ -385,7 +401,7 @@ void DoSerialise(SerialiserType &ser, TextureDescription &el) template void DoSerialise(SerialiserType &ser, BufferDescription &el) { - SERIALISE_MEMBER(ID); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(creationFlags); SERIALISE_MEMBER(length); @@ -411,7 +427,7 @@ void DoSerialise(SerialiserType &ser, APIProperties &el) template void DoSerialise(SerialiserType &ser, DebugMessage &el) { - SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(eventId); SERIALISE_MEMBER(category); SERIALISE_MEMBER(severity); SERIALISE_MEMBER(source); @@ -424,7 +440,7 @@ void DoSerialise(SerialiserType &ser, DebugMessage &el) template void DoSerialise(SerialiserType &ser, APIEvent &el) { - SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(eventId); SERIALISE_MEMBER(callstack); SERIALISE_MEMBER(chunkIndex); SERIALISE_MEMBER(fileOffset); @@ -435,8 +451,8 @@ void DoSerialise(SerialiserType &ser, APIEvent &el) template void DoSerialise(SerialiserType &ser, DrawcallDescription &el) { - SERIALISE_MEMBER(eventID); - SERIALISE_MEMBER(drawcallID); + SERIALISE_MEMBER(eventId); + SERIALISE_MEMBER(drawcallId); SERIALISE_MEMBER(name); @@ -678,18 +694,18 @@ void DoSerialise(SerialiserType &ser, FrameRecord &el) template void DoSerialise(SerialiserType &ser, MeshFormat &el) { - SERIALISE_MEMBER(idxbuf); - SERIALISE_MEMBER(idxoffs); - SERIALISE_MEMBER(idxByteWidth); + SERIALISE_MEMBER(indexResourceId); + SERIALISE_MEMBER(indexByteOffset); + SERIALISE_MEMBER(indexByteStride); SERIALISE_MEMBER(baseVertex); - SERIALISE_MEMBER(buf); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(stride); - SERIALISE_MEMBER(fmt); + SERIALISE_MEMBER(vertexResourceId); + SERIALISE_MEMBER(vertexByteOffset); + SERIALISE_MEMBER(vertexByteStride); + SERIALISE_MEMBER(format); SERIALISE_MEMBER(meshColor); SERIALISE_MEMBER(showAlpha); - SERIALISE_MEMBER(topo); - SERIALISE_MEMBER(numVerts); + SERIALISE_MEMBER(topology); + SERIALISE_MEMBER(numIndices); SERIALISE_MEMBER(unproject); SERIALISE_MEMBER(nearPlane); SERIALISE_MEMBER(farPlane); @@ -719,7 +735,7 @@ void DoSerialise(SerialiserType &ser, Uuid &el) template void DoSerialise(SerialiserType &ser, CounterDescription &el) { - SERIALISE_MEMBER(counterID); + SERIALISE_MEMBER(counter); SERIALISE_MEMBER(name); SERIALISE_MEMBER(description); SERIALISE_MEMBER(resultType); @@ -734,15 +750,25 @@ void DoSerialise(SerialiserType &ser, CounterDescription &el) template void DoSerialise(SerialiserType &ser, PixelValue &el) { - SERIALISE_MEMBER(value_u); + SERIALISE_MEMBER(uintValue); SIZE_CHECK(16); } +template +void DoSerialise(SerialiserType &ser, ModificationValue &el) +{ + SERIALISE_MEMBER(col.uintValue); + SERIALISE_MEMBER(depth); + SERIALISE_MEMBER(stencil); + + SIZE_CHECK(24); +} + template void DoSerialise(SerialiserType &ser, PixelModification &el) { - SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(eventId); SERIALISE_MEMBER(directShaderWrite); SERIALISE_MEMBER(unboundPS); @@ -750,15 +776,9 @@ void DoSerialise(SerialiserType &ser, PixelModification &el) SERIALISE_MEMBER(fragIndex); SERIALISE_MEMBER(primitiveID); - SERIALISE_MEMBER(preMod.col.value_u); - SERIALISE_MEMBER(preMod.depth); - SERIALISE_MEMBER(preMod.stencil); - SERIALISE_MEMBER(shaderOut.col.value_u); - SERIALISE_MEMBER(shaderOut.depth); - SERIALISE_MEMBER(shaderOut.stencil); - SERIALISE_MEMBER(postMod.col.value_u); - SERIALISE_MEMBER(postMod.depth); - SERIALISE_MEMBER(postMod.stencil); + SERIALISE_MEMBER(preMod); + SERIALISE_MEMBER(shaderOut); + SERIALISE_MEMBER(postMod); SERIALISE_MEMBER(sampleMasked); SERIALISE_MEMBER(backfaceCulled); @@ -776,7 +796,7 @@ void DoSerialise(SerialiserType &ser, PixelModification &el) template void DoSerialise(SerialiserType &ser, EventUsage &el) { - SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(eventId); SERIALISE_MEMBER(usage); SERIALISE_MEMBER(view); @@ -786,8 +806,8 @@ void DoSerialise(SerialiserType &ser, EventUsage &el) template void DoSerialise(SerialiserType &ser, CounterResult &el) { - SERIALISE_MEMBER(eventID); - SERIALISE_MEMBER(counterID); + SERIALISE_MEMBER(eventId); + SERIALISE_MEMBER(counter); SERIALISE_MEMBER(value); SIZE_CHECK(16); @@ -801,51 +821,120 @@ void DoSerialise(SerialiserType &ser, CounterValue &el) SIZE_CHECK(8); } +#pragma region Common pipeline state + +template +void DoSerialise(SerialiserType &ser, Viewport &el) +{ + SERIALISE_MEMBER(x); + SERIALISE_MEMBER(y); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + SERIALISE_MEMBER(minDepth); + SERIALISE_MEMBER(maxDepth); + SERIALISE_MEMBER(enabled); + + SIZE_CHECK(28); +} + +template +void DoSerialise(SerialiserType &ser, Scissor &el) +{ + SERIALISE_MEMBER(x); + SERIALISE_MEMBER(y); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + SERIALISE_MEMBER(enabled); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, BlendEquation &el) +{ + SERIALISE_MEMBER(source); + SERIALISE_MEMBER(destination); + SERIALISE_MEMBER(operation); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, ColorBlend &el) +{ + SERIALISE_MEMBER(colorBlend); + SERIALISE_MEMBER(alphaBlend); + + SERIALISE_MEMBER(logicOperation); + + SERIALISE_MEMBER(enabled); + SERIALISE_MEMBER(logicOperationEnabled); + SERIALISE_MEMBER(writeMask); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, StencilFace &el) +{ + SERIALISE_MEMBER(failOperation); + SERIALISE_MEMBER(depthFailOperation); + SERIALISE_MEMBER(passOperation); + SERIALISE_MEMBER(function); + SERIALISE_MEMBER(reference); + SERIALISE_MEMBER(compareMask); + SERIALISE_MEMBER(writeMask); + + SIZE_CHECK(28); +} + +#pragma endregion + #pragma region D3D11 pipeline state template void DoSerialise(SerialiserType &ser, D3D11Pipe::Layout &el) { - SERIALISE_MEMBER(SemanticName); - SERIALISE_MEMBER(SemanticIndex); - SERIALISE_MEMBER(Format); - SERIALISE_MEMBER(InputSlot); - SERIALISE_MEMBER(ByteOffset); - SERIALISE_MEMBER(PerInstance); - SERIALISE_MEMBER(InstanceDataStepRate); + SERIALISE_MEMBER(semanticName); + SERIALISE_MEMBER(semanticIndex); + SERIALISE_MEMBER(format); + SERIALISE_MEMBER(inputSlot); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(perInstance); + SERIALISE_MEMBER(instanceDataStepRate); SIZE_CHECK(48); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::VB &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::VertexBuffer &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Stride); - SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteStride); SIZE_CHECK(16); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::IB &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::IndexBuffer &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); SIZE_CHECK(16); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::IA &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::InputAssembly &el) { SERIALISE_MEMBER(layouts); - SERIALISE_MEMBER(layout); - SERIALISE_MEMBER(vbuffers); - SERIALISE_MEMBER(ibuffer); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(vertexBuffers); + SERIALISE_MEMBER(indexBuffer); if(ser.IsReading()) - el.Bytecode = NULL; + el.bytecode = NULL; SIZE_CHECK(64); } @@ -853,21 +942,21 @@ void DoSerialise(SerialiserType &ser, D3D11Pipe::IA &el) template void DoSerialise(SerialiserType &ser, D3D11Pipe::View &el) { - SERIALISE_MEMBER(Object); - SERIALISE_MEMBER(Resource); - SERIALISE_MEMBER(Type); - SERIALISE_MEMBER(Format); + SERIALISE_MEMBER(viewResourceId); + SERIALISE_MEMBER(resourceResourceId); + SERIALISE_MEMBER(type); + SERIALISE_MEMBER(viewFormat); - SERIALISE_MEMBER(Structured); - SERIALISE_MEMBER(BufferStructCount); - SERIALISE_MEMBER(FirstElement); - SERIALISE_MEMBER(NumElements); + SERIALISE_MEMBER(structured); + SERIALISE_MEMBER(bufferStructCount); + SERIALISE_MEMBER(firstElement); + SERIALISE_MEMBER(numElements); - SERIALISE_MEMBER(Flags); - SERIALISE_MEMBER(HighestMip); - SERIALISE_MEMBER(NumMipLevels); - SERIALISE_MEMBER(ArraySize); - SERIALISE_MEMBER(FirstArraySlice); + SERIALISE_MEMBER(bufferFlags); + SERIALISE_MEMBER(firstMip); + SERIALISE_MEMBER(numMips); + SERIALISE_MEMBER(firstSlice); + SERIALISE_MEMBER(numSlices); SIZE_CHECK(64); } @@ -875,27 +964,27 @@ void DoSerialise(SerialiserType &ser, D3D11Pipe::View &el) template void DoSerialise(SerialiserType &ser, D3D11Pipe::Sampler &el) { - SERIALISE_MEMBER(Samp); - SERIALISE_MEMBER(AddressU); - SERIALISE_MEMBER(AddressV); - SERIALISE_MEMBER(AddressW); - SERIALISE_MEMBER(BorderColor); - SERIALISE_MEMBER(Comparison); - SERIALISE_MEMBER(Filter); - SERIALISE_MEMBER(MaxAniso); - SERIALISE_MEMBER(MaxLOD); - SERIALISE_MEMBER(MinLOD); - SERIALISE_MEMBER(MipLODBias); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(addressU); + SERIALISE_MEMBER(addressV); + SERIALISE_MEMBER(addressW); + SERIALISE_MEMBER(borderColor); + SERIALISE_MEMBER(compareFunction); + SERIALISE_MEMBER(filter); + SERIALISE_MEMBER(maxAnisotropy); + SERIALISE_MEMBER(maxLOD); + SERIALISE_MEMBER(minLOD); + SERIALISE_MEMBER(mipLODBias); SIZE_CHECK(72); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::CBuffer &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::ConstantBuffer &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(VecOffset); - SERIALISE_MEMBER(VecCount); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(vecOffset); + SERIALISE_MEMBER(vecCount); SIZE_CHECK(16); } @@ -903,80 +992,54 @@ void DoSerialise(SerialiserType &ser, D3D11Pipe::CBuffer &el) template void DoSerialise(SerialiserType &ser, D3D11Pipe::Shader &el) { - SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(stage); - SERIALISE_MEMBER(SRVs); - SERIALISE_MEMBER(UAVs); - SERIALISE_MEMBER(Samplers); - SERIALISE_MEMBER(ConstantBuffers); - SERIALISE_MEMBER(ClassInstances); + SERIALISE_MEMBER(srvs); + SERIALISE_MEMBER(uavs); + SERIALISE_MEMBER(samplers); + SERIALISE_MEMBER(constantBuffers); + SERIALISE_MEMBER(classInstances); if(ser.IsReading()) - el.ShaderDetails = NULL; - SERIALISE_MEMBER(BindpointMapping); + el.reflection = NULL; + SERIALISE_MEMBER(bindpointMapping); SIZE_CHECK(184); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::SOBind &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::StreamOutBind &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); SIZE_CHECK(16); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::SO &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::StreamOut &el) { - SERIALISE_MEMBER(Outputs); + SERIALISE_MEMBER(outputs); SIZE_CHECK(16); } -template -void DoSerialise(SerialiserType &ser, D3D11Pipe::Viewport &el) -{ - SERIALISE_MEMBER(X); - SERIALISE_MEMBER(Y); - SERIALISE_MEMBER(Width); - SERIALISE_MEMBER(Height); - SERIALISE_MEMBER(MinDepth); - SERIALISE_MEMBER(MaxDepth); - SERIALISE_MEMBER(Enabled); - - SIZE_CHECK(28); -} - -template -void DoSerialise(SerialiserType &ser, D3D11Pipe::Scissor &el) -{ - SERIALISE_MEMBER(left); - SERIALISE_MEMBER(top); - SERIALISE_MEMBER(right); - SERIALISE_MEMBER(bottom); - SERIALISE_MEMBER(Enabled); - - SIZE_CHECK(20); -} - template void DoSerialise(SerialiserType &ser, D3D11Pipe::RasterizerState &el) { - SERIALISE_MEMBER(State); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(fillMode); SERIALISE_MEMBER(cullMode); - SERIALISE_MEMBER(FrontCCW); - SERIALISE_MEMBER(DepthBias); - SERIALISE_MEMBER(DepthBiasClamp); - SERIALISE_MEMBER(SlopeScaledDepthBias); - SERIALISE_MEMBER(DepthClip); - SERIALISE_MEMBER(ScissorEnable); - SERIALISE_MEMBER(MultisampleEnable); - SERIALISE_MEMBER(AntialiasedLineEnable); - SERIALISE_MEMBER(ForcedSampleCount); - SERIALISE_MEMBER(ConservativeRasterization); + SERIALISE_MEMBER(frontCCW); + SERIALISE_MEMBER(depthBias); + SERIALISE_MEMBER(depthBiasClamp); + SERIALISE_MEMBER(slopeScaledDepthBias); + SERIALISE_MEMBER(depthClip); + SERIALISE_MEMBER(scissorEnable); + SERIALISE_MEMBER(multisampleEnable); + SERIALISE_MEMBER(antialiasedLines); + SERIALISE_MEMBER(forcedSampleCount); + SERIALISE_MEMBER(conservativeRasterization); SIZE_CHECK(48); } @@ -984,101 +1047,62 @@ void DoSerialise(SerialiserType &ser, D3D11Pipe::RasterizerState &el) template void DoSerialise(SerialiserType &ser, D3D11Pipe::Rasterizer &el) { - SERIALISE_MEMBER(Viewports); - SERIALISE_MEMBER(Scissors); - SERIALISE_MEMBER(m_State); + SERIALISE_MEMBER(viewports); + SERIALISE_MEMBER(scissors); + SERIALISE_MEMBER(state); SIZE_CHECK(80); } -template -void DoSerialise(SerialiserType &ser, D3D11Pipe::StencilFace &el) -{ - SERIALISE_MEMBER(FailOp); - SERIALISE_MEMBER(DepthFailOp); - SERIALISE_MEMBER(PassOp); - SERIALISE_MEMBER(Func); - - SIZE_CHECK(16); -} - template void DoSerialise(SerialiserType &ser, D3D11Pipe::DepthStencilState &el) { - SERIALISE_MEMBER(State); - SERIALISE_MEMBER(DepthEnable); - SERIALISE_MEMBER(DepthFunc); - SERIALISE_MEMBER(DepthWrites); - SERIALISE_MEMBER(StencilEnable); - SERIALISE_MEMBER(StencilReadMask); - SERIALISE_MEMBER(StencilWriteMask); - SERIALISE_MEMBER(m_FrontFace); - SERIALISE_MEMBER(m_BackFace); - SERIALISE_MEMBER(StencilRef); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(depthEnable); + SERIALISE_MEMBER(depthFunction); + SERIALISE_MEMBER(depthWrites); + SERIALISE_MEMBER(stencilEnable); + SERIALISE_MEMBER(frontFace); + SERIALISE_MEMBER(backFace); - SIZE_CHECK(56); -} - -template -void DoSerialise(SerialiserType &ser, D3D11Pipe::BlendEquation &el) -{ - SERIALISE_MEMBER(Source); - SERIALISE_MEMBER(Destination); - SERIALISE_MEMBER(Operation); - - SIZE_CHECK(12); -} - -template -void DoSerialise(SerialiserType &ser, D3D11Pipe::Blend &el) -{ - SERIALISE_MEMBER(m_Blend); - SERIALISE_MEMBER(m_AlphaBlend); - - SERIALISE_MEMBER(Logic); - - SERIALISE_MEMBER(Enabled); - SERIALISE_MEMBER(LogicEnabled); - SERIALISE_MEMBER(WriteMask); - - SIZE_CHECK(32); + SIZE_CHECK(80); } template void DoSerialise(SerialiserType &ser, D3D11Pipe::BlendState &el) { - SERIALISE_MEMBER(State); - SERIALISE_MEMBER(AlphaToCoverage); - SERIALISE_MEMBER(IndependentBlend); - SERIALISE_MEMBER(Blends); - SERIALISE_MEMBER(BlendFactor); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(alphaToCoverage); + SERIALISE_MEMBER(independentBlend); + SERIALISE_MEMBER(blends); + SERIALISE_MEMBER(blendFactor); - SERIALISE_MEMBER(SampleMask); + SERIALISE_MEMBER(sampleMask); SIZE_CHECK(56); } template -void DoSerialise(SerialiserType &ser, D3D11Pipe::OM &el) +void DoSerialise(SerialiserType &ser, D3D11Pipe::OutputMerger &el) { - SERIALISE_MEMBER(m_State); - SERIALISE_MEMBER(m_BlendState); - SERIALISE_MEMBER(RenderTargets); - SERIALISE_MEMBER(UAVStartSlot); - SERIALISE_MEMBER(UAVs); - SERIALISE_MEMBER(DepthTarget); - SERIALISE_MEMBER(DepthReadOnly); - SERIALISE_MEMBER(StencilReadOnly); + SERIALISE_MEMBER(depthStencilState); + SERIALISE_MEMBER(blendState); + SERIALISE_MEMBER(renderTargets); + SERIALISE_MEMBER(uavStartSlot); + SERIALISE_MEMBER(uavs); + SERIALISE_MEMBER(depthTarget); + SERIALISE_MEMBER(depthReadOnly); + SERIALISE_MEMBER(stencilReadOnly); - SIZE_CHECK(224); + SIZE_CHECK(248); } template void DoSerialise(SerialiserType &ser, D3D11Pipe::Predication &el) { - SERIALISE_MEMBER(Obj); - SERIALISE_MEMBER(Value); - SERIALISE_MEMBER(Passing); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(value); + SERIALISE_MEMBER(isPassing); SIZE_CHECK(16); } @@ -1086,23 +1110,23 @@ void DoSerialise(SerialiserType &ser, D3D11Pipe::Predication &el) template void DoSerialise(SerialiserType &ser, D3D11Pipe::State &el) { - SERIALISE_MEMBER(m_IA); + SERIALISE_MEMBER(inputAssembly); - SERIALISE_MEMBER(m_VS); - SERIALISE_MEMBER(m_HS); - SERIALISE_MEMBER(m_DS); - SERIALISE_MEMBER(m_GS); - SERIALISE_MEMBER(m_PS); - SERIALISE_MEMBER(m_CS); + SERIALISE_MEMBER(vertexShader); + SERIALISE_MEMBER(hullShader); + SERIALISE_MEMBER(domainShader); + SERIALISE_MEMBER(geometryShader); + SERIALISE_MEMBER(pixelShader); + SERIALISE_MEMBER(computeShader); - SERIALISE_MEMBER(m_SO); + SERIALISE_MEMBER(streamOut); - SERIALISE_MEMBER(m_RS); - SERIALISE_MEMBER(m_OM); + SERIALISE_MEMBER(rasterizer); + SERIALISE_MEMBER(outputMerger); - SERIALISE_MEMBER(m_Predicate); + SERIALISE_MEMBER(predication); - SIZE_CHECK(1504); + SIZE_CHECK(1528); } #pragma endregion D3D11 pipeline state @@ -1112,44 +1136,44 @@ void DoSerialise(SerialiserType &ser, D3D11Pipe::State &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::Layout &el) { - SERIALISE_MEMBER(SemanticName); - SERIALISE_MEMBER(SemanticIndex); - SERIALISE_MEMBER(Format); - SERIALISE_MEMBER(InputSlot); - SERIALISE_MEMBER(ByteOffset); - SERIALISE_MEMBER(PerInstance); - SERIALISE_MEMBER(InstanceDataStepRate); + SERIALISE_MEMBER(semanticName); + SERIALISE_MEMBER(semanticIndex); + SERIALISE_MEMBER(format); + SERIALISE_MEMBER(inputSlot); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(perInstance); + SERIALISE_MEMBER(instanceDataStepRate); SIZE_CHECK(48); } template -void DoSerialise(SerialiserType &ser, D3D12Pipe::VB &el) +void DoSerialise(SerialiserType &ser, D3D12Pipe::VertexBuffer &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(Size); - SERIALISE_MEMBER(Stride); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); + SERIALISE_MEMBER(byteStride); SIZE_CHECK(24); } template -void DoSerialise(SerialiserType &ser, D3D12Pipe::IB &el) +void DoSerialise(SerialiserType &ser, D3D12Pipe::IndexBuffer &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(Size); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); SIZE_CHECK(24); } template -void DoSerialise(SerialiserType &ser, D3D12Pipe::IA &el) +void DoSerialise(SerialiserType &ser, D3D12Pipe::InputAssembly &el) { SERIALISE_MEMBER(layouts); - SERIALISE_MEMBER(vbuffers); - SERIALISE_MEMBER(ibuffer); + SERIALISE_MEMBER(vertexBuffers); + SERIALISE_MEMBER(indexBuffer); SERIALISE_MEMBER(indexStripCutValue); @@ -1159,29 +1183,29 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::IA &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::View &el) { - SERIALISE_MEMBER(Immediate); - SERIALISE_MEMBER(RootElement); - SERIALISE_MEMBER(TableIndex); - SERIALISE_MEMBER(Resource); - SERIALISE_MEMBER(Type); - SERIALISE_MEMBER(Format); + SERIALISE_MEMBER(immediate); + SERIALISE_MEMBER(rootElement); + SERIALISE_MEMBER(tableIndex); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(type); + SERIALISE_MEMBER(viewFormat); SERIALISE_MEMBER(swizzle); - SERIALISE_MEMBER(BufferFlags); - SERIALISE_MEMBER(BufferStructCount); - SERIALISE_MEMBER(ElementSize); - SERIALISE_MEMBER(FirstElement); - SERIALISE_MEMBER(NumElements); + SERIALISE_MEMBER(bufferFlags); + SERIALISE_MEMBER(bufferStructCount); + SERIALISE_MEMBER(elementByteSize); + SERIALISE_MEMBER(firstElement); + SERIALISE_MEMBER(numElements); - SERIALISE_MEMBER(CounterResource); - SERIALISE_MEMBER(CounterByteOffset); + SERIALISE_MEMBER(counterResourceId); + SERIALISE_MEMBER(counterByteOffset); - SERIALISE_MEMBER(HighestMip); - SERIALISE_MEMBER(NumMipLevels); - SERIALISE_MEMBER(ArraySize); - SERIALISE_MEMBER(FirstArraySlice); + SERIALISE_MEMBER(firstMip); + SERIALISE_MEMBER(numMips); + SERIALISE_MEMBER(firstSlice); + SERIALISE_MEMBER(numSlices); - SERIALISE_MEMBER(MinLODClamp); + SERIALISE_MEMBER(minLODClamp); SIZE_CHECK(120); } @@ -1189,33 +1213,33 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::View &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::Sampler &el) { - SERIALISE_MEMBER(Immediate); - SERIALISE_MEMBER(RootElement); - SERIALISE_MEMBER(TableIndex); - SERIALISE_MEMBER(AddressU); - SERIALISE_MEMBER(AddressV); - SERIALISE_MEMBER(AddressW); - SERIALISE_MEMBER(BorderColor); - SERIALISE_MEMBER(Comparison); - SERIALISE_MEMBER(Filter); - SERIALISE_MEMBER(MaxAniso); - SERIALISE_MEMBER(MaxLOD); - SERIALISE_MEMBER(MinLOD); - SERIALISE_MEMBER(MipLODBias); + SERIALISE_MEMBER(immediate); + SERIALISE_MEMBER(rootElement); + SERIALISE_MEMBER(tableIndex); + SERIALISE_MEMBER(addressU); + SERIALISE_MEMBER(addressV); + SERIALISE_MEMBER(addressW); + SERIALISE_MEMBER(borderColor); + SERIALISE_MEMBER(compareFunction); + SERIALISE_MEMBER(filter); + SERIALISE_MEMBER(maxAnisotropy); + SERIALISE_MEMBER(maxLOD); + SERIALISE_MEMBER(minLOD); + SERIALISE_MEMBER(mipLODBias); SIZE_CHECK(76); } template -void DoSerialise(SerialiserType &ser, D3D12Pipe::CBuffer &el) +void DoSerialise(SerialiserType &ser, D3D12Pipe::ConstantBuffer &el) { - SERIALISE_MEMBER(Immediate); - SERIALISE_MEMBER(RootElement); - SERIALISE_MEMBER(TableIndex); - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(ByteSize); - SERIALISE_MEMBER(RootValues); + SERIALISE_MEMBER(immediate); + SERIALISE_MEMBER(rootElement); + SERIALISE_MEMBER(tableIndex); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); + SERIALISE_MEMBER(rootValues); SIZE_CHECK(56); } @@ -1223,10 +1247,10 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::CBuffer &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::RegisterSpace &el) { - SERIALISE_MEMBER(ConstantBuffers); - SERIALISE_MEMBER(Samplers); - SERIALISE_MEMBER(SRVs); - SERIALISE_MEMBER(UAVs); + SERIALISE_MEMBER(constantBuffers); + SERIALISE_MEMBER(samplers); + SERIALISE_MEMBER(srvs); + SERIALISE_MEMBER(uavs); SIZE_CHECK(64); } @@ -1234,57 +1258,33 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::RegisterSpace &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::Shader &el) { - SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(stage); - SERIALISE_MEMBER(Spaces); + SERIALISE_MEMBER(spaces); if(ser.IsReading()) - el.ShaderDetails = NULL; - SERIALISE_MEMBER(BindpointMapping); + el.reflection = NULL; + SERIALISE_MEMBER(bindpointMapping); SIZE_CHECK(120); } template -void DoSerialise(SerialiserType &ser, D3D12Pipe::SOBind &el) +void DoSerialise(SerialiserType &ser, D3D12Pipe::StreamOutBind &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(Size); - SERIALISE_MEMBER(WrittenCountBuffer); - SERIALISE_MEMBER(WrittenCountOffset); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); + SERIALISE_MEMBER(writtenCountResourceId); + SERIALISE_MEMBER(writtenCountByteOffset); SIZE_CHECK(40); } template -void DoSerialise(SerialiserType &ser, D3D12Pipe::Streamout &el) +void DoSerialise(SerialiserType &ser, D3D12Pipe::StreamOut &el) { - SERIALISE_MEMBER(Outputs); - - SIZE_CHECK(16); -} - -template -void DoSerialise(SerialiserType &ser, D3D12Pipe::Viewport &el) -{ - SERIALISE_MEMBER(X); - SERIALISE_MEMBER(Y); - SERIALISE_MEMBER(Width); - SERIALISE_MEMBER(Height); - SERIALISE_MEMBER(MinDepth); - SERIALISE_MEMBER(MaxDepth); - - SIZE_CHECK(24); -} - -template -void DoSerialise(SerialiserType &ser, D3D12Pipe::Scissor &el) -{ - SERIALISE_MEMBER(left); - SERIALISE_MEMBER(top); - SERIALISE_MEMBER(right); - SERIALISE_MEMBER(bottom); + SERIALISE_MEMBER(outputs); SIZE_CHECK(16); } @@ -1294,15 +1294,15 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::RasterizerState &el) { SERIALISE_MEMBER(fillMode); SERIALISE_MEMBER(cullMode); - SERIALISE_MEMBER(FrontCCW); - SERIALISE_MEMBER(DepthBias); - SERIALISE_MEMBER(DepthBiasClamp); - SERIALISE_MEMBER(SlopeScaledDepthBias); - SERIALISE_MEMBER(DepthClip); - SERIALISE_MEMBER(MultisampleEnable); - SERIALISE_MEMBER(AntialiasedLineEnable); - SERIALISE_MEMBER(ForcedSampleCount); - SERIALISE_MEMBER(ConservativeRasterization); + SERIALISE_MEMBER(frontCCW); + SERIALISE_MEMBER(depthBias); + SERIALISE_MEMBER(depthBiasClamp); + SERIALISE_MEMBER(slopeScaledDepthBias); + SERIALISE_MEMBER(depthClip); + SERIALISE_MEMBER(multisampleEnable); + SERIALISE_MEMBER(antialiasedLines); + SERIALISE_MEMBER(forcedSampleCount); + SERIALISE_MEMBER(conservativeRasterization); SIZE_CHECK(36); } @@ -1310,73 +1310,34 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::RasterizerState &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::Rasterizer &el) { - SERIALISE_MEMBER(SampleMask); - SERIALISE_MEMBER(Viewports); - SERIALISE_MEMBER(Scissors); - SERIALISE_MEMBER(m_State); + SERIALISE_MEMBER(sampleMask); + SERIALISE_MEMBER(viewports); + SERIALISE_MEMBER(scissors); + SERIALISE_MEMBER(state); SIZE_CHECK(80); } -template -void DoSerialise(SerialiserType &ser, D3D12Pipe::StencilFace &el) -{ - SERIALISE_MEMBER(FailOp); - SERIALISE_MEMBER(DepthFailOp); - SERIALISE_MEMBER(PassOp); - SERIALISE_MEMBER(Func); - - SIZE_CHECK(16); -} - template void DoSerialise(SerialiserType &ser, D3D12Pipe::DepthStencilState &el) { - SERIALISE_MEMBER(DepthEnable); - SERIALISE_MEMBER(DepthWrites); - SERIALISE_MEMBER(DepthFunc); - SERIALISE_MEMBER(StencilEnable); - SERIALISE_MEMBER(StencilReadMask); - SERIALISE_MEMBER(StencilWriteMask); - SERIALISE_MEMBER(m_FrontFace); - SERIALISE_MEMBER(m_BackFace); - SERIALISE_MEMBER(StencilRef); + SERIALISE_MEMBER(depthEnable); + SERIALISE_MEMBER(depthWrites); + SERIALISE_MEMBER(depthFunction); + SERIALISE_MEMBER(stencilEnable); + SERIALISE_MEMBER(frontFace); + SERIALISE_MEMBER(backFace); - SIZE_CHECK(48); -} - -template -void DoSerialise(SerialiserType &ser, D3D12Pipe::BlendEquation &el) -{ - SERIALISE_MEMBER(Source); - SERIALISE_MEMBER(Destination); - SERIALISE_MEMBER(Operation); - - SIZE_CHECK(12); -} - -template -void DoSerialise(SerialiserType &ser, D3D12Pipe::Blend &el) -{ - SERIALISE_MEMBER(m_Blend); - SERIALISE_MEMBER(m_AlphaBlend); - - SERIALISE_MEMBER(Logic); - - SERIALISE_MEMBER(Enabled); - SERIALISE_MEMBER(LogicEnabled); - SERIALISE_MEMBER(WriteMask); - - SIZE_CHECK(32); + SIZE_CHECK(68); } template void DoSerialise(SerialiserType &ser, D3D12Pipe::BlendState &el) { - SERIALISE_MEMBER(AlphaToCoverage); - SERIALISE_MEMBER(IndependentBlend); - SERIALISE_MEMBER(Blends); - SERIALISE_MEMBER(BlendFactor); + SERIALISE_MEMBER(alphaToCoverage); + SERIALISE_MEMBER(independentBlend); + SERIALISE_MEMBER(blends); + SERIALISE_MEMBER(blendFactor); SIZE_CHECK(40); } @@ -1384,18 +1345,18 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::BlendState &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::OM &el) { - SERIALISE_MEMBER(m_State); - SERIALISE_MEMBER(m_BlendState); + SERIALISE_MEMBER(depthStencilState); + SERIALISE_MEMBER(blendState); - SERIALISE_MEMBER(RenderTargets); - SERIALISE_MEMBER(DepthTarget); - SERIALISE_MEMBER(DepthReadOnly); - SERIALISE_MEMBER(StencilReadOnly); + SERIALISE_MEMBER(renderTargets); + SERIALISE_MEMBER(depthTarget); + SERIALISE_MEMBER(depthReadOnly); + SERIALISE_MEMBER(stencilReadOnly); SERIALISE_MEMBER(multiSampleCount); SERIALISE_MEMBER(multiSampleQuality); - SIZE_CHECK(240); + SIZE_CHECK(264); } template @@ -1409,7 +1370,7 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::ResourceState &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::ResourceData &el) { - SERIALISE_MEMBER(id); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(states); SIZE_CHECK(24); @@ -1418,27 +1379,27 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::ResourceData &el) template void DoSerialise(SerialiserType &ser, D3D12Pipe::State &el) { - SERIALISE_MEMBER(pipeline); - SERIALISE_MEMBER(rootSig); + SERIALISE_MEMBER(pipelineResourceId); + SERIALISE_MEMBER(rootSignatureResourceId); - SERIALISE_MEMBER(m_IA); + SERIALISE_MEMBER(inputAssembly); - SERIALISE_MEMBER(m_VS); - SERIALISE_MEMBER(m_HS); - SERIALISE_MEMBER(m_DS); - SERIALISE_MEMBER(m_GS); - SERIALISE_MEMBER(m_PS); - SERIALISE_MEMBER(m_CS); + SERIALISE_MEMBER(vertexShader); + SERIALISE_MEMBER(hullShader); + SERIALISE_MEMBER(domainShader); + SERIALISE_MEMBER(geometryShader); + SERIALISE_MEMBER(pixelShader); + SERIALISE_MEMBER(computeShader); - SERIALISE_MEMBER(m_SO); + SERIALISE_MEMBER(streamOut); - SERIALISE_MEMBER(m_RS); + SERIALISE_MEMBER(rasterizer); - SERIALISE_MEMBER(m_OM); + SERIALISE_MEMBER(outputMerger); - SERIALISE_MEMBER(Resources); + SERIALISE_MEMBER(resourceStates); - SIZE_CHECK(1152); + SIZE_CHECK(1176); } #pragma endregion D3D12 pipeline state @@ -1448,22 +1409,22 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::State &el) template void DoSerialise(SerialiserType &ser, GLPipe::VertexAttribute &el) { - SERIALISE_MEMBER(Enabled); - SERIALISE_MEMBER(Format); - SERIALISE_MEMBER(GenericValue); - SERIALISE_MEMBER(BufferSlot); - SERIALISE_MEMBER(RelativeOffset); + SERIALISE_MEMBER(enabled); + SERIALISE_MEMBER(format); + SERIALISE_MEMBER(genericValue); + SERIALISE_MEMBER(vertexBufferSlot); + SERIALISE_MEMBER(byteOffset); SIZE_CHECK(32); } template -void DoSerialise(SerialiserType &ser, GLPipe::VB &el) +void DoSerialise(SerialiserType &ser, GLPipe::VertexBuffer &el) { - SERIALISE_MEMBER(Buffer); - SERIALISE_MEMBER(Stride); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(Divisor); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteStride); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(instanceDivisor); SIZE_CHECK(24); } @@ -1472,8 +1433,8 @@ template void DoSerialise(SerialiserType &ser, GLPipe::VertexInput &el) { SERIALISE_MEMBER(attributes); - SERIALISE_MEMBER(vbuffers); - SERIALISE_MEMBER(ibuffer); + SERIALISE_MEMBER(vertexBuffers); + SERIALISE_MEMBER(indexBuffer); SERIALISE_MEMBER(primitiveRestart); SERIALISE_MEMBER(restartIndex); SERIALISE_MEMBER(provokingVertexLast); @@ -1484,15 +1445,15 @@ void DoSerialise(SerialiserType &ser, GLPipe::VertexInput &el) template void DoSerialise(SerialiserType &ser, GLPipe::Shader &el) { - SERIALISE_MEMBER(Object); - SERIALISE_MEMBER(Program); + SERIALISE_MEMBER(shaderResourceId); + SERIALISE_MEMBER(programResourceId); SERIALISE_MEMBER(stage); - SERIALISE_MEMBER(Subroutines); + SERIALISE_MEMBER(subroutines); if(ser.IsReading()) - el.ShaderDetails = NULL; - SERIALISE_MEMBER(BindpointMapping); + el.reflection = NULL; + SERIALISE_MEMBER(bindpointMapping); SIZE_CHECK(128); } @@ -1513,12 +1474,12 @@ void DoSerialise(SerialiserType &ser, GLPipe::FixedVertexProcessing &el) template void DoSerialise(SerialiserType &ser, GLPipe::Texture &el) { - SERIALISE_MEMBER(Resource); - SERIALISE_MEMBER(FirstSlice); - SERIALISE_MEMBER(HighestMip); - SERIALISE_MEMBER(ResType); - SERIALISE_MEMBER(Swizzle); - SERIALISE_MEMBER(DepthReadChannel); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(firstSlice); + SERIALISE_MEMBER(firstMip); + SERIALISE_MEMBER(type); + SERIALISE_MEMBER(swizzle); + SERIALISE_MEMBER(depthReadChannel); SIZE_CHECK(40); } @@ -1526,18 +1487,18 @@ void DoSerialise(SerialiserType &ser, GLPipe::Texture &el) template void DoSerialise(SerialiserType &ser, GLPipe::Sampler &el) { - SERIALISE_MEMBER(Samp); - SERIALISE_MEMBER(AddressS); - SERIALISE_MEMBER(AddressT); - SERIALISE_MEMBER(AddressR); - SERIALISE_MEMBER(BorderColor); - SERIALISE_MEMBER(Comparison); - SERIALISE_MEMBER(Filter); - SERIALISE_MEMBER(SeamlessCube); - SERIALISE_MEMBER(MaxAniso); - SERIALISE_MEMBER(MaxLOD); - SERIALISE_MEMBER(MinLOD); - SERIALISE_MEMBER(MipLODBias); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(addressS); + SERIALISE_MEMBER(addressT); + SERIALISE_MEMBER(addressR); + SERIALISE_MEMBER(borderColor); + SERIALISE_MEMBER(compareFunction); + SERIALISE_MEMBER(filter); + SERIALISE_MEMBER(seamlessCubeMap); + SERIALISE_MEMBER(maxAnisotropy); + SERIALISE_MEMBER(maxLOD); + SERIALISE_MEMBER(minLOD); + SERIALISE_MEMBER(mipLODBias); SIZE_CHECK(80); } @@ -1545,9 +1506,9 @@ void DoSerialise(SerialiserType &ser, GLPipe::Sampler &el) template void DoSerialise(SerialiserType &ser, GLPipe::Buffer &el) { - SERIALISE_MEMBER(Resource); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(Size); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); SIZE_CHECK(24); } @@ -1555,14 +1516,14 @@ void DoSerialise(SerialiserType &ser, GLPipe::Buffer &el) template void DoSerialise(SerialiserType &ser, GLPipe::ImageLoadStore &el) { - SERIALISE_MEMBER(Resource); - SERIALISE_MEMBER(Level); - SERIALISE_MEMBER(Layered); - SERIALISE_MEMBER(Layer); - SERIALISE_MEMBER(ResType); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(mipLevel); + SERIALISE_MEMBER(layered); + SERIALISE_MEMBER(slice); + SERIALISE_MEMBER(type); SERIALISE_MEMBER(readAllowed); SERIALISE_MEMBER(writeAllowed); - SERIALISE_MEMBER(Format); + SERIALISE_MEMBER(imageFormat); SIZE_CHECK(32); } @@ -1570,68 +1531,43 @@ void DoSerialise(SerialiserType &ser, GLPipe::ImageLoadStore &el) template void DoSerialise(SerialiserType &ser, GLPipe::Feedback &el) { - SERIALISE_MEMBER(Obj); - SERIALISE_MEMBER(BufferBinding); - SERIALISE_MEMBER(Offset); - SERIALISE_MEMBER(Size); - SERIALISE_MEMBER(Active); - SERIALISE_MEMBER(Paused); + SERIALISE_MEMBER(feedbackResourceId); + SERIALISE_MEMBER(bufferResourceId); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); + SERIALISE_MEMBER(active); + SERIALISE_MEMBER(paused); SIZE_CHECK(112); } -template -void DoSerialise(SerialiserType &ser, GLPipe::Viewport &el) -{ - SERIALISE_MEMBER(Left); - SERIALISE_MEMBER(Bottom); - SERIALISE_MEMBER(Width); - SERIALISE_MEMBER(Height); - SERIALISE_MEMBER(MinDepth); - SERIALISE_MEMBER(MaxDepth); - - SIZE_CHECK(32); -} - -template -void DoSerialise(SerialiserType &ser, GLPipe::Scissor &el) -{ - SERIALISE_MEMBER(Left); - SERIALISE_MEMBER(Bottom); - SERIALISE_MEMBER(Width); - SERIALISE_MEMBER(Height); - SERIALISE_MEMBER(Enabled); - - SIZE_CHECK(20); -} - template void DoSerialise(SerialiserType &ser, GLPipe::RasterizerState &el) { SERIALISE_MEMBER(fillMode); SERIALISE_MEMBER(cullMode); - SERIALISE_MEMBER(FrontCCW); - SERIALISE_MEMBER(DepthBias); - SERIALISE_MEMBER(SlopeScaledDepthBias); - SERIALISE_MEMBER(OffsetClamp); - SERIALISE_MEMBER(DepthClamp); + SERIALISE_MEMBER(frontCCW); + SERIALISE_MEMBER(depthBias); + SERIALISE_MEMBER(slopeScaledDepthBias); + SERIALISE_MEMBER(offsetClamp); + SERIALISE_MEMBER(depthClamp); - SERIALISE_MEMBER(MultisampleEnable); - SERIALISE_MEMBER(SampleShading); - SERIALISE_MEMBER(SampleMask); - SERIALISE_MEMBER(SampleMaskValue); - SERIALISE_MEMBER(SampleCoverage); - SERIALISE_MEMBER(SampleCoverageInvert); - SERIALISE_MEMBER(SampleCoverageValue); - SERIALISE_MEMBER(SampleAlphaToCoverage); - SERIALISE_MEMBER(SampleAlphaToOne); - SERIALISE_MEMBER(MinSampleShadingRate); + SERIALISE_MEMBER(multisampleEnable); + SERIALISE_MEMBER(sampleShading); + SERIALISE_MEMBER(sampleMask); + SERIALISE_MEMBER(sampleMaskValue); + SERIALISE_MEMBER(sampleCoverage); + SERIALISE_MEMBER(sampleCoverageInvert); + SERIALISE_MEMBER(sampleCoverageValue); + SERIALISE_MEMBER(alphaToCoverage); + SERIALISE_MEMBER(alphaToOne); + SERIALISE_MEMBER(minSampleShadingRate); - SERIALISE_MEMBER(ProgrammablePointSize); - SERIALISE_MEMBER(PointSize); - SERIALISE_MEMBER(LineWidth); - SERIALISE_MEMBER(PointFadeThreshold); - SERIALISE_MEMBER(PointOriginUpperLeft); + SERIALISE_MEMBER(programmablePointSize); + SERIALISE_MEMBER(pointSize); + SERIALISE_MEMBER(lineWidth); + SERIALISE_MEMBER(pointFadeThreshold); + SERIALISE_MEMBER(pointOriginUpperLeft); SIZE_CHECK(68); } @@ -1639,9 +1575,9 @@ void DoSerialise(SerialiserType &ser, GLPipe::RasterizerState &el) template void DoSerialise(SerialiserType &ser, GLPipe::Rasterizer &el) { - SERIALISE_MEMBER(Viewports); - SERIALISE_MEMBER(Scissors); - SERIALISE_MEMBER(m_State); + SERIALISE_MEMBER(viewports); + SERIALISE_MEMBER(scissors); + SERIALISE_MEMBER(state); SIZE_CHECK(104); } @@ -1649,47 +1585,33 @@ void DoSerialise(SerialiserType &ser, GLPipe::Rasterizer &el) template void DoSerialise(SerialiserType &ser, GLPipe::DepthState &el) { - SERIALISE_MEMBER(DepthEnable); - SERIALISE_MEMBER(DepthFunc); - SERIALISE_MEMBER(DepthWrites); - SERIALISE_MEMBER(DepthBounds); - SERIALISE_MEMBER(NearBound); - SERIALISE_MEMBER(FarBound); + SERIALISE_MEMBER(depthEnable); + SERIALISE_MEMBER(depthFunction); + SERIALISE_MEMBER(depthWrites); + SERIALISE_MEMBER(depthBounds); + SERIALISE_MEMBER(nearBound); + SERIALISE_MEMBER(farBound); SIZE_CHECK(32); } -template -void DoSerialise(SerialiserType &ser, GLPipe::StencilFace &el) -{ - SERIALISE_MEMBER(FailOp); - SERIALISE_MEMBER(DepthFailOp); - SERIALISE_MEMBER(PassOp); - SERIALISE_MEMBER(Func); - SERIALISE_MEMBER(Ref); - SERIALISE_MEMBER(ValueMask); - SERIALISE_MEMBER(WriteMask); - - SIZE_CHECK(20); -} - template void DoSerialise(SerialiserType &ser, GLPipe::StencilState &el) { - SERIALISE_MEMBER(StencilEnable); - SERIALISE_MEMBER(m_FrontFace); - SERIALISE_MEMBER(m_BackFace); + SERIALISE_MEMBER(stencilEnable); + SERIALISE_MEMBER(frontFace); + SERIALISE_MEMBER(backFace); - SIZE_CHECK(44); + SIZE_CHECK(60); } template void DoSerialise(SerialiserType &ser, GLPipe::Attachment &el) { - SERIALISE_MEMBER(Obj); - SERIALISE_MEMBER(Layer); - SERIALISE_MEMBER(Mip); - SERIALISE_MEMBER(Swizzle); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(slice); + SERIALISE_MEMBER(mipLevel); + SERIALISE_MEMBER(swizzle); SIZE_CHECK(32); } @@ -1697,43 +1619,21 @@ void DoSerialise(SerialiserType &ser, GLPipe::Attachment &el) template void DoSerialise(SerialiserType &ser, GLPipe::FBO &el) { - SERIALISE_MEMBER(Obj); - SERIALISE_MEMBER(Color); - SERIALISE_MEMBER(Depth); - SERIALISE_MEMBER(Stencil); - SERIALISE_MEMBER(DrawBuffers); - SERIALISE_MEMBER(ReadBuffer); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(colorAttachments); + SERIALISE_MEMBER(depthAttachment); + SERIALISE_MEMBER(stencilAttachment); + SERIALISE_MEMBER(drawBuffers); + SERIALISE_MEMBER(readBuffer); SIZE_CHECK(112); } -template -void DoSerialise(SerialiserType &ser, GLPipe::BlendEquation &el) -{ - SERIALISE_MEMBER(Source); - SERIALISE_MEMBER(Destination); - SERIALISE_MEMBER(Operation); - - SIZE_CHECK(12); -} - -template -void DoSerialise(SerialiserType &ser, GLPipe::Blend &el) -{ - SERIALISE_MEMBER(m_Blend); - SERIALISE_MEMBER(m_AlphaBlend); - SERIALISE_MEMBER(Logic); - SERIALISE_MEMBER(Enabled); - SERIALISE_MEMBER(WriteMask); - - SIZE_CHECK(32); -} - template void DoSerialise(SerialiserType &ser, GLPipe::BlendState &el) { - SERIALISE_MEMBER(BlendFactor); - SERIALISE_MEMBER(Blends); + SERIALISE_MEMBER(blendFactor); + SERIALISE_MEMBER(blends); SIZE_CHECK(32); } @@ -1741,11 +1641,11 @@ void DoSerialise(SerialiserType &ser, GLPipe::BlendState &el) template void DoSerialise(SerialiserType &ser, GLPipe::FrameBuffer &el) { - SERIALISE_MEMBER(FramebufferSRGB); - SERIALISE_MEMBER(Dither); - SERIALISE_MEMBER(m_DrawFBO); - SERIALISE_MEMBER(m_ReadFBO); - SERIALISE_MEMBER(m_Blending); + SERIALISE_MEMBER(framebufferSRGB); + SERIALISE_MEMBER(dither); + SERIALISE_MEMBER(drawFBO); + SERIALISE_MEMBER(readFBO); + SERIALISE_MEMBER(blendState); SIZE_CHECK(264); } @@ -1753,12 +1653,12 @@ void DoSerialise(SerialiserType &ser, GLPipe::FrameBuffer &el) template void DoSerialise(SerialiserType &ser, GLPipe::Hints &el) { - SERIALISE_MEMBER(Derivatives); - SERIALISE_MEMBER(LineSmooth); - SERIALISE_MEMBER(PolySmooth); - SERIALISE_MEMBER(TexCompression); - SERIALISE_MEMBER(LineSmoothEnabled); - SERIALISE_MEMBER(PolySmoothEnabled); + SERIALISE_MEMBER(derivatives); + SERIALISE_MEMBER(lineSmoothing); + SERIALISE_MEMBER(polySmoothing); + SERIALISE_MEMBER(textureCompression); + SERIALISE_MEMBER(lineSmoothingEnabled); + SERIALISE_MEMBER(polySmoothingEnabled); SIZE_CHECK(20); } @@ -1766,37 +1666,37 @@ void DoSerialise(SerialiserType &ser, GLPipe::Hints &el) template void DoSerialise(SerialiserType &ser, GLPipe::State &el) { - SERIALISE_MEMBER(m_VtxIn); + SERIALISE_MEMBER(vertexInput); - SERIALISE_MEMBER(m_VS); - SERIALISE_MEMBER(m_TCS); - SERIALISE_MEMBER(m_TES); - SERIALISE_MEMBER(m_GS); - SERIALISE_MEMBER(m_FS); - SERIALISE_MEMBER(m_CS); + SERIALISE_MEMBER(vertexShader); + SERIALISE_MEMBER(tessControlShader); + SERIALISE_MEMBER(tessEvalShader); + SERIALISE_MEMBER(geometryShader); + SERIALISE_MEMBER(fragmentShader); + SERIALISE_MEMBER(computeShader); - SERIALISE_MEMBER(Pipeline); + SERIALISE_MEMBER(pipelineResourceId); - SERIALISE_MEMBER(m_VtxProcess); + SERIALISE_MEMBER(vertexProcessing); - SERIALISE_MEMBER(Textures); - SERIALISE_MEMBER(Samplers); - SERIALISE_MEMBER(AtomicBuffers); - SERIALISE_MEMBER(UniformBuffers); - SERIALISE_MEMBER(ShaderStorageBuffers); - SERIALISE_MEMBER(Images); + SERIALISE_MEMBER(textures); + SERIALISE_MEMBER(samplers); + SERIALISE_MEMBER(atomicBuffers); + SERIALISE_MEMBER(uniformBuffers); + SERIALISE_MEMBER(shaderStorageBuffers); + SERIALISE_MEMBER(images); - SERIALISE_MEMBER(m_Feedback); + SERIALISE_MEMBER(transformFeedback); - SERIALISE_MEMBER(m_Rasterizer); - SERIALISE_MEMBER(m_DepthState); - SERIALISE_MEMBER(m_StencilState); + SERIALISE_MEMBER(rasterizer); + SERIALISE_MEMBER(depthState); + SERIALISE_MEMBER(stencilState); - SERIALISE_MEMBER(m_FB); + SERIALISE_MEMBER(framebuffer); - SERIALISE_MEMBER(m_Hints); + SERIALISE_MEMBER(hints); - SIZE_CHECK(1552); + SIZE_CHECK(1568); } #pragma endregion OpenGL pipeline state @@ -1806,30 +1706,30 @@ void DoSerialise(SerialiserType &ser, GLPipe::State &el) template void DoSerialise(SerialiserType &ser, VKPipe::BindingElement &el) { - SERIALISE_MEMBER(view); - SERIALISE_MEMBER(res); - SERIALISE_MEMBER(sampler); + SERIALISE_MEMBER(viewResourceId); + SERIALISE_MEMBER(resourceResourceId); + SERIALISE_MEMBER(samplerResourceId); SERIALISE_MEMBER(immutableSampler); - SERIALISE_MEMBER(viewfmt); + SERIALISE_MEMBER(viewFormat); SERIALISE_MEMBER(swizzle); - SERIALISE_MEMBER(baseMip); - SERIALISE_MEMBER(baseLayer); - SERIALISE_MEMBER(numMip); - SERIALISE_MEMBER(numLayer); + SERIALISE_MEMBER(firstMip); + SERIALISE_MEMBER(firstSlice); + SERIALISE_MEMBER(numMips); + SERIALISE_MEMBER(numSlices); - SERIALISE_MEMBER(offset); - SERIALISE_MEMBER(size); + SERIALISE_MEMBER(byteOffset); + SERIALISE_MEMBER(byteSize); - SERIALISE_MEMBER(Filter); - SERIALISE_MEMBER(AddressU); - SERIALISE_MEMBER(AddressV); - SERIALISE_MEMBER(AddressW); + SERIALISE_MEMBER(filter); + SERIALISE_MEMBER(addressU); + SERIALISE_MEMBER(addressV); + SERIALISE_MEMBER(addressW); SERIALISE_MEMBER(mipBias); - SERIALISE_MEMBER(maxAniso); - SERIALISE_MEMBER(comparison); - SERIALISE_MEMBER(minlod); - SERIALISE_MEMBER(maxlod); - SERIALISE_MEMBER(BorderColor); + SERIALISE_MEMBER(maxAnisotropy); + SERIALISE_MEMBER(compareFunction); + SERIALISE_MEMBER(minLOD); + SERIALISE_MEMBER(maxLOD); + SERIALISE_MEMBER(borderColor); SERIALISE_MEMBER(unnormalized); SIZE_CHECK(152); @@ -1850,8 +1750,8 @@ void DoSerialise(SerialiserType &ser, VKPipe::DescriptorBinding &el) template void DoSerialise(SerialiserType &ser, VKPipe::DescriptorSet &el) { - SERIALISE_MEMBER(layout); - SERIALISE_MEMBER(descset); + SERIALISE_MEMBER(layoutResourceId); + SERIALISE_MEMBER(descriptorSetResourceId); SERIALISE_MEMBER(bindings); @@ -1861,19 +1761,20 @@ void DoSerialise(SerialiserType &ser, VKPipe::DescriptorSet &el) template void DoSerialise(SerialiserType &ser, VKPipe::Pipeline &el) { - SERIALISE_MEMBER(obj); + SERIALISE_MEMBER(pipelineResourceId); + SERIALISE_MEMBER(pipelineLayoutResourceId); SERIALISE_MEMBER(flags); - SERIALISE_MEMBER(DescSets); + SERIALISE_MEMBER(descriptorSets); - SIZE_CHECK(32); + SIZE_CHECK(40); } template -void DoSerialise(SerialiserType &ser, VKPipe::IB &el) +void DoSerialise(SerialiserType &ser, VKPipe::IndexBuffer &el) { - SERIALISE_MEMBER(buf); - SERIALISE_MEMBER(offs); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); SIZE_CHECK(16); } @@ -1882,7 +1783,7 @@ template void DoSerialise(SerialiserType &ser, VKPipe::InputAssembly &el) { SERIALISE_MEMBER(primitiveRestartEnable); - SERIALISE_MEMBER(ibuffer); + SERIALISE_MEMBER(indexBuffer); SIZE_CHECK(24); } @@ -1893,7 +1794,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::VertexAttribute &el) SERIALISE_MEMBER(location); SERIALISE_MEMBER(binding); SERIALISE_MEMBER(format); - SERIALISE_MEMBER(byteoffset); + SERIALISE_MEMBER(byteOffset); SIZE_CHECK(20); } @@ -1901,18 +1802,18 @@ void DoSerialise(SerialiserType &ser, VKPipe::VertexAttribute &el) template void DoSerialise(SerialiserType &ser, VKPipe::VertexBinding &el) { - SERIALISE_MEMBER(vbufferBinding); - SERIALISE_MEMBER(bytestride); + SERIALISE_MEMBER(vertexBufferBinding); + SERIALISE_MEMBER(byteStride); SERIALISE_MEMBER(perInstance); SIZE_CHECK(12); } template -void DoSerialise(SerialiserType &ser, VKPipe::VB &el) +void DoSerialise(SerialiserType &ser, VKPipe::VertexBuffer &el) { - SERIALISE_MEMBER(buffer); - SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(resourceId); + SERIALISE_MEMBER(byteOffset); SIZE_CHECK(16); } @@ -1920,17 +1821,17 @@ void DoSerialise(SerialiserType &ser, VKPipe::VB &el) template void DoSerialise(SerialiserType &ser, VKPipe::VertexInput &el) { - SERIALISE_MEMBER(attrs); - SERIALISE_MEMBER(binds); - SERIALISE_MEMBER(vbuffers); + SERIALISE_MEMBER(attributes); + SERIALISE_MEMBER(bindings); + SERIALISE_MEMBER(vertexBuffers); SIZE_CHECK(48); } template -void DoSerialise(SerialiserType &ser, VKPipe::SpecInfo &el) +void DoSerialise(SerialiserType &ser, VKPipe::SpecializationConstant &el) { - SERIALISE_MEMBER(specID); + SERIALISE_MEMBER(specializationId); SERIALISE_MEMBER(data); SIZE_CHECK(24); @@ -1939,15 +1840,15 @@ void DoSerialise(SerialiserType &ser, VKPipe::SpecInfo &el) template void DoSerialise(SerialiserType &ser, VKPipe::Shader &el) { - SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(entryPoint); SERIALISE_MEMBER(stage); SERIALISE_MEMBER(specialization); if(ser.IsReading()) - el.ShaderDetails = NULL; - SERIALISE_MEMBER(BindpointMapping); + el.reflection = NULL; + SERIALISE_MEMBER(bindpointMapping); SIZE_CHECK(136); } @@ -1960,37 +1861,13 @@ void DoSerialise(SerialiserType &ser, VKPipe::Tessellation &el) SIZE_CHECK(4); } -template -void DoSerialise(SerialiserType &ser, VKPipe::Viewport &el) -{ - SERIALISE_MEMBER(x); - SERIALISE_MEMBER(y); - SERIALISE_MEMBER(width); - SERIALISE_MEMBER(height); - SERIALISE_MEMBER(minDepth); - SERIALISE_MEMBER(maxDepth); - - SIZE_CHECK(24); -} - -template -void DoSerialise(SerialiserType &ser, VKPipe::Scissor &el) -{ - SERIALISE_MEMBER(x); - SERIALISE_MEMBER(y); - SERIALISE_MEMBER(width); - SERIALISE_MEMBER(height); - - SIZE_CHECK(16); -} - template void DoSerialise(SerialiserType &ser, VKPipe::ViewportScissor &el) { SERIALISE_MEMBER(vp); SERIALISE_MEMBER(scissor); - SIZE_CHECK(40); + SIZE_CHECK(48); } template @@ -2002,11 +1879,11 @@ void DoSerialise(SerialiserType &ser, VKPipe::ViewState &el) } template -void DoSerialise(SerialiserType &ser, VKPipe::Raster &el) +void DoSerialise(SerialiserType &ser, VKPipe::Rasterizer &el) { SERIALISE_MEMBER(depthClampEnable); SERIALISE_MEMBER(rasterizerDiscardEnable); - SERIALISE_MEMBER(FrontCCW); + SERIALISE_MEMBER(frontCCW); SERIALISE_MEMBER(fillMode); SERIALISE_MEMBER(cullMode); @@ -2030,67 +1907,30 @@ void DoSerialise(SerialiserType &ser, VKPipe::MultiSample &el) } template -void DoSerialise(SerialiserType &ser, VKPipe::BlendEquation &el) -{ - SERIALISE_MEMBER(Source); - SERIALISE_MEMBER(Destination); - SERIALISE_MEMBER(Operation); - - SIZE_CHECK(12); -} - -template -void DoSerialise(SerialiserType &ser, VKPipe::Blend &el) -{ - SERIALISE_MEMBER(blendEnable); - SERIALISE_MEMBER(blend); - SERIALISE_MEMBER(alphaBlend); - SERIALISE_MEMBER(writeMask); - - SIZE_CHECK(28); -} - -template -void DoSerialise(SerialiserType &ser, VKPipe::ColorBlend &el) +void DoSerialise(SerialiserType &ser, VKPipe::ColorBlendState &el) { SERIALISE_MEMBER(alphaToCoverageEnable); SERIALISE_MEMBER(alphaToOneEnable); - SERIALISE_MEMBER(logicOpEnable); - SERIALISE_MEMBER(logic); - SERIALISE_MEMBER(attachments); + SERIALISE_MEMBER(blends); - SERIALISE_MEMBER(blendConst); + SERIALISE_MEMBER(blendFactor); SIZE_CHECK(40); } -template -void DoSerialise(SerialiserType &ser, VKPipe::StencilFace &el) -{ - SERIALISE_MEMBER(FailOp); - SERIALISE_MEMBER(DepthFailOp); - SERIALISE_MEMBER(PassOp); - SERIALISE_MEMBER(Func); - SERIALISE_MEMBER(ref); - SERIALISE_MEMBER(compareMask); - SERIALISE_MEMBER(writeMask); - - SIZE_CHECK(28); -} - template void DoSerialise(SerialiserType &ser, VKPipe::DepthStencil &el) { SERIALISE_MEMBER(depthTestEnable); SERIALISE_MEMBER(depthWriteEnable); SERIALISE_MEMBER(depthBoundsEnable); - SERIALISE_MEMBER(depthCompareOp); + SERIALISE_MEMBER(depthFunction); SERIALISE_MEMBER(stencilTestEnable); - SERIALISE_MEMBER(front); - SERIALISE_MEMBER(back); + SERIALISE_MEMBER(frontFace); + SERIALISE_MEMBER(backFace); SERIALISE_MEMBER(minDepthBounds); SERIALISE_MEMBER(maxDepthBounds); @@ -2101,7 +1941,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::DepthStencil &el) template void DoSerialise(SerialiserType &ser, VKPipe::RenderPass &el) { - SERIALISE_MEMBER(obj); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(subpass); SERIALISE_MEMBER(inputAttachments); SERIALISE_MEMBER(colorAttachments); @@ -2114,16 +1954,16 @@ void DoSerialise(SerialiserType &ser, VKPipe::RenderPass &el) template void DoSerialise(SerialiserType &ser, VKPipe::Attachment &el) { - SERIALISE_MEMBER(view); - SERIALISE_MEMBER(img); + SERIALISE_MEMBER(viewResourceId); + SERIALISE_MEMBER(imageResourceId); - SERIALISE_MEMBER(viewfmt); + SERIALISE_MEMBER(viewFormat); SERIALISE_MEMBER(swizzle); - SERIALISE_MEMBER(baseMip); - SERIALISE_MEMBER(baseLayer); - SERIALISE_MEMBER(numMip); - SERIALISE_MEMBER(numLayer); + SERIALISE_MEMBER(firstMip); + SERIALISE_MEMBER(firstSlice); + SERIALISE_MEMBER(numMips); + SERIALISE_MEMBER(numSlices); SIZE_CHECK(56); } @@ -2131,7 +1971,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::Attachment &el) template void DoSerialise(SerialiserType &ser, VKPipe::Framebuffer &el) { - SERIALISE_MEMBER(obj); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(attachments); SERIALISE_MEMBER(width); SERIALISE_MEMBER(height); @@ -2176,7 +2016,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::ImageLayout &el) template void DoSerialise(SerialiserType &ser, VKPipe::ImageData &el) { - SERIALISE_MEMBER(image); + SERIALISE_MEMBER(resourceId); SERIALISE_MEMBER(layouts); SIZE_CHECK(24); @@ -2188,28 +2028,28 @@ void DoSerialise(SerialiserType &ser, VKPipe::State &el) SERIALISE_MEMBER(compute); SERIALISE_MEMBER(graphics); - SERIALISE_MEMBER(IA); - SERIALISE_MEMBER(VI); + SERIALISE_MEMBER(inputAssembly); + SERIALISE_MEMBER(vertexInput); - SERIALISE_MEMBER(m_VS); - SERIALISE_MEMBER(m_TCS); - SERIALISE_MEMBER(m_TES); - SERIALISE_MEMBER(m_GS); - SERIALISE_MEMBER(m_FS); - SERIALISE_MEMBER(m_CS); + SERIALISE_MEMBER(vertexShader); + SERIALISE_MEMBER(tessControlShader); + SERIALISE_MEMBER(tessEvalShader); + SERIALISE_MEMBER(geometryShader); + SERIALISE_MEMBER(fragmentShader); + SERIALISE_MEMBER(computeShader); - SERIALISE_MEMBER(Tess); + SERIALISE_MEMBER(tessellation); - SERIALISE_MEMBER(VP); - SERIALISE_MEMBER(RS); - SERIALISE_MEMBER(MSAA); - SERIALISE_MEMBER(CB); - SERIALISE_MEMBER(DS); - SERIALISE_MEMBER(Pass); + SERIALISE_MEMBER(viewportScissor); + SERIALISE_MEMBER(rasterizer); + SERIALISE_MEMBER(multisample); + SERIALISE_MEMBER(colorBlend); + SERIALISE_MEMBER(depthStencil); + SERIALISE_MEMBER(currentPass); SERIALISE_MEMBER(images); - SIZE_CHECK(1288); + SIZE_CHECK(1304); } #pragma endregion Vulkan pipeline state @@ -2219,7 +2059,7 @@ INSTANTIATE_SERIALISE_TYPE(SectionProperties) INSTANTIATE_SERIALISE_TYPE(EnvironmentModification) INSTANTIATE_SERIALISE_TYPE(CaptureOptions) INSTANTIATE_SERIALISE_TYPE(ResourceFormat) -INSTANTIATE_SERIALISE_TYPE(BindpointMap) +INSTANTIATE_SERIALISE_TYPE(Bindpoint) INSTANTIATE_SERIALISE_TYPE(ShaderBindpointMapping) INSTANTIATE_SERIALISE_TYPE(SigParameter) INSTANTIATE_SERIALISE_TYPE(ShaderVariableType) @@ -2229,7 +2069,7 @@ INSTANTIATE_SERIALISE_TYPE(ShaderSampler) INSTANTIATE_SERIALISE_TYPE(ShaderResource) INSTANTIATE_SERIALISE_TYPE(ShaderEntryPoint) INSTANTIATE_SERIALISE_TYPE(ShaderCompileFlags) -INSTANTIATE_SERIALISE_TYPE(ShaderDebugChunk) +INSTANTIATE_SERIALISE_TYPE(ShaderDebugInfo) INSTANTIATE_SERIALISE_TYPE(ShaderReflection) INSTANTIATE_SERIALISE_TYPE(ShaderVariable) INSTANTIATE_SERIALISE_TYPE(ShaderDebugState) @@ -2267,23 +2107,21 @@ INSTANTIATE_SERIALISE_TYPE(EventUsage) INSTANTIATE_SERIALISE_TYPE(CounterResult) INSTANTIATE_SERIALISE_TYPE(CounterValue) INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Layout) -INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::IA) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::InputAssembly) INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::View) INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Sampler) INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Shader) INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Rasterizer) -INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Blend) -INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::OM) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::OutputMerger) INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::State) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Layout) -INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::IA) -INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::CBuffer) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::InputAssembly) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::ConstantBuffer) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Sampler) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::View) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::RegisterSpace) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Shader) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Rasterizer) -INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Blend) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::OM) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::ResourceState) INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::ResourceData) @@ -2296,7 +2134,6 @@ INSTANTIATE_SERIALISE_TYPE(GLPipe::ImageLoadStore) INSTANTIATE_SERIALISE_TYPE(GLPipe::Rasterizer) INSTANTIATE_SERIALISE_TYPE(GLPipe::DepthState) INSTANTIATE_SERIALISE_TYPE(GLPipe::StencilState) -INSTANTIATE_SERIALISE_TYPE(GLPipe::Blend) INSTANTIATE_SERIALISE_TYPE(GLPipe::BlendState) INSTANTIATE_SERIALISE_TYPE(GLPipe::Attachment) INSTANTIATE_SERIALISE_TYPE(GLPipe::FrameBuffer) @@ -2307,11 +2144,10 @@ INSTANTIATE_SERIALISE_TYPE(VKPipe::DescriptorSet) INSTANTIATE_SERIALISE_TYPE(VKPipe::Pipeline) INSTANTIATE_SERIALISE_TYPE(VKPipe::VertexAttribute) INSTANTIATE_SERIALISE_TYPE(VKPipe::VertexInput) -INSTANTIATE_SERIALISE_TYPE(VKPipe::SpecInfo) +INSTANTIATE_SERIALISE_TYPE(VKPipe::SpecializationConstant) INSTANTIATE_SERIALISE_TYPE(VKPipe::Shader) INSTANTIATE_SERIALISE_TYPE(VKPipe::ViewState) -INSTANTIATE_SERIALISE_TYPE(VKPipe::Blend) -INSTANTIATE_SERIALISE_TYPE(VKPipe::ColorBlend) +INSTANTIATE_SERIALISE_TYPE(VKPipe::ColorBlendState) INSTANTIATE_SERIALISE_TYPE(VKPipe::Attachment) INSTANTIATE_SERIALISE_TYPE(VKPipe::DepthStencil) INSTANTIATE_SERIALISE_TYPE(VKPipe::CurrentPass) diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp index 5715ab20c..c9b2aa860 100644 --- a/renderdoc/replay/replay_controller.cpp +++ b/renderdoc/replay/replay_controller.cpp @@ -202,18 +202,18 @@ ReplayController::~ReplayController() m_pDevice = NULL; } -void ReplayController::SetFrameEvent(uint32_t eventID, bool force) +void ReplayController::SetFrameEvent(uint32_t eventId, bool force) { - if(eventID != m_EventID || force) + if(eventId != m_EventID || force) { - m_EventID = eventID; + m_EventID = eventId; - m_pDevice->ReplayLog(eventID, eReplay_WithoutDraw); + m_pDevice->ReplayLog(eventId, eReplay_WithoutDraw); for(size_t i = 0; i < m_Outputs.size(); i++) - m_Outputs[i]->SetFrameEvent(eventID); + m_Outputs[i]->SetFrameEvent(eventId); - m_pDevice->ReplayLog(eventID, eReplay_OnlyDraw); + m_pDevice->ReplayLog(eventId, eReplay_OnlyDraw); FetchPipelineState(); } @@ -268,12 +268,12 @@ const SDFile &ReplayController::GetStructuredFile() return m_pDevice->GetStructuredFile(); } -DrawcallDescription *ReplayController::GetDrawcallByEID(uint32_t eventID) +DrawcallDescription *ReplayController::GetDrawcallByEID(uint32_t eventId) { - if(eventID >= m_Drawcalls.size()) + if(eventId >= m_Drawcalls.size()) return NULL; - return m_Drawcalls[eventID]; + return m_Drawcalls[eventId]; } rdcarray ReplayController::GetDrawcalls() @@ -348,7 +348,7 @@ MeshFormat ReplayController::GetPostVSData(uint32_t instID, MeshDataStage stage) instID = RDCMIN(instID, draw->numInstances - 1); - return m_pDevice->GetPostVSBuffers(draw->eventID, instID, stage); + return m_pDevice->GetPostVSBuffers(draw->eventId, instID, stage); } bytebuf ReplayController::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len) @@ -1218,7 +1218,7 @@ rdcarray ReplayController::PixelHistory(ResourceId target, ui for(size_t t = 0; t < m_Textures.size(); t++) { - if(m_Textures[t].ID == target) + if(m_Textures[t].resourceId == target) { if(x >= m_Textures[t].width || y >= m_Textures[t].height) { @@ -1248,7 +1248,7 @@ rdcarray ReplayController::PixelHistory(ResourceId target, ui for(size_t i = 0; i < usage.size(); i++) { - if(usage[i].eventID > m_EventID) + if(usage[i].eventId > m_EventID) continue; switch(usage[i].usage) @@ -1390,23 +1390,23 @@ void ReplayController::ReplayLoop(WindowingSystem system, void *data, ResourceId ReplayOutput *output = CreateOutput(system, data, ReplayOutputType::Texture); TextureDisplay d; - d.texid = texid; + d.resourceId = texid; d.mip = 0; d.sampleIdx = ~0U; d.overlay = DebugOverlay::NoOverlay; d.typeHint = CompType::Typeless; - d.HDRMul = -1.0f; + d.hdrMultiplier = -1.0f; d.linearDisplayAsGamma = true; - d.FlipY = false; - d.rangemin = 0.0f; - d.rangemax = 1.0f; + d.flipY = false; + d.rangeMin = 0.0f; + d.rangeMax = 1.0f; d.scale = 1.0f; - d.offx = 0.0f; - d.offy = 0.0f; + d.xOffset = 0.0f; + d.yOffset = 0.0f; d.sliceFace = 0; - d.rawoutput = false; - d.Red = d.Green = d.Blue = true; - d.Alpha = false; + d.rawOutput = false; + d.red = d.green = d.blue = true; + d.alpha = false; output->SetTextureDisplay(d); m_ReplayLoopCancel = 0; diff --git a/renderdoc/replay/replay_controller.h b/renderdoc/replay/replay_controller.h index 11a888143..f4ec2f606 100644 --- a/renderdoc/replay/replay_controller.h +++ b/renderdoc/replay/replay_controller.h @@ -58,13 +58,13 @@ public: ResourceId GetDebugOverlayTexID() { return m_OverlayResourceId; } PixelValue PickPixel(ResourceId texID, bool customShader, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip, uint32_t sample); - rdcpair PickVertex(uint32_t eventID, uint32_t x, uint32_t y); + rdcpair PickVertex(uint32_t eventId, uint32_t x, uint32_t y); private: ReplayOutput(ReplayController *parent, WindowingSystem system, void *data, ReplayOutputType type); virtual ~ReplayOutput(); - void SetFrameEvent(int eventID); + void SetFrameEvent(int eventId); void RefreshOverlay(); @@ -132,7 +132,7 @@ public: void FileChanged(); - void SetFrameEvent(uint32_t eventID, bool force); + void SetFrameEvent(uint32_t eventId, bool force); void FetchPipelineState(); @@ -204,7 +204,7 @@ public: private: ReplayStatus PostCreateInit(IReplayDriver *device, RDCFile *rdc); - DrawcallDescription *GetDrawcallByEID(uint32_t eventID); + DrawcallDescription *GetDrawcallByEID(uint32_t eventId); IReplayDriver *GetDevice() { return m_pDevice; } FrameRecord m_FrameRecord; diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp index 19705350c..aa8e312c0 100644 --- a/renderdoc/replay/replay_driver.cpp +++ b/renderdoc/replay/replay_driver.cpp @@ -64,15 +64,15 @@ DrawcallDescription *SetupDrawcallPointers(vector *drawca { DrawcallDescription *draw = &draws[i]; - draw->parent = parent ? parent->eventID : 0; + draw->parent = parent ? parent->eventId : 0; if(!draw->children.empty()) { if(drawcallTable) { - RDCASSERT(drawcallTable->empty() || draw->eventID > drawcallTable->back()->eventID); - drawcallTable->resize(RDCMAX(drawcallTable->size(), size_t(draw->eventID + 1))); - (*drawcallTable)[draw->eventID] = draw; + RDCASSERT(drawcallTable->empty() || draw->eventId > drawcallTable->back()->eventId); + drawcallTable->resize(RDCMAX(drawcallTable->size(), size_t(draw->eventId + 1))); + (*drawcallTable)[draw->eventId] = draw; } ret = SetupDrawcallPointers(drawcallTable, draw->children, draw, previous); @@ -85,22 +85,22 @@ DrawcallDescription *SetupDrawcallPointers(vector *drawca if(drawcallTable) { - RDCASSERT(drawcallTable->empty() || draw->eventID > drawcallTable->back()->eventID); - drawcallTable->resize(RDCMAX(drawcallTable->size(), size_t(draw->eventID + 1))); - (*drawcallTable)[draw->eventID] = draw; + RDCASSERT(drawcallTable->empty() || draw->eventId > drawcallTable->back()->eventId); + drawcallTable->resize(RDCMAX(drawcallTable->size(), size_t(draw->eventId + 1))); + (*drawcallTable)[draw->eventId] = draw; } } else { if(previous != NULL) - previous->next = draw->eventID; - draw->previous = previous ? previous->eventID : 0; + previous->next = draw->eventId; + draw->previous = previous ? previous->eventId : 0; if(drawcallTable) { - RDCASSERT(drawcallTable->empty() || draw->eventID > drawcallTable->back()->eventID); - drawcallTable->resize(RDCMAX(drawcallTable->size(), size_t(draw->eventID + 1))); - (*drawcallTable)[draw->eventID] = draw; + RDCASSERT(drawcallTable->empty() || draw->eventId > drawcallTable->back()->eventId); + drawcallTable->resize(RDCMAX(drawcallTable->size(), size_t(draw->eventId + 1))); + (*drawcallTable)[draw->eventId] = draw; } ret = previous = draw; @@ -134,11 +134,11 @@ FloatVector HighlightCache::InterpretVertex(byte *data, uint32_t vert, const Mes { FloatVector ret(0.0f, 0.0f, 0.0f, 1.0f); - data += vert * cfg.position.stride; + data += vert * cfg.position.vertexByteStride; float *out = &ret.x; - const ResourceFormat &fmt = cfg.position.fmt; + const ResourceFormat &fmt = cfg.position.format; if(fmt.type == ResourceFormatType::R10G10B10A2) { @@ -197,19 +197,20 @@ FloatVector HighlightCache::InterpretVertex(byte *data, uint32_t vert, const Mes return ret; } -void HighlightCache::CacheHighlightingData(uint32_t eventID, const MeshDisplay &cfg) +void HighlightCache::CacheHighlightingData(uint32_t eventId, const MeshDisplay &cfg) { - if(EID != eventID || cfg.type != stage || cfg.position.buf != buf || cfg.position.offset != offs) + if(EID != eventId || cfg.type != stage || cfg.position.vertexResourceId != buf || + cfg.position.vertexByteOffset != offs) { - EID = eventID; - buf = cfg.position.buf; - offs = cfg.position.offset; + EID = eventId; + buf = cfg.position.vertexResourceId; + offs = cfg.position.vertexByteOffset; stage = cfg.type; - uint32_t bytesize = cfg.position.idxByteWidth; - uint64_t maxIndex = cfg.position.numVerts - 1; + uint32_t bytesize = cfg.position.indexByteStride; + uint64_t maxIndex = cfg.position.numIndices - 1; - if(cfg.position.idxByteWidth == 0 || stage == MeshDataStage::GSOut) + if(cfg.position.indexByteStride == 0 || stage == MeshDataStage::GSOut) { indices.clear(); idxData = false; @@ -219,15 +220,15 @@ void HighlightCache::CacheHighlightingData(uint32_t eventID, const MeshDisplay & idxData = true; bytebuf idxdata; - if(cfg.position.idxbuf != ResourceId()) - driver->GetBufferData(cfg.position.idxbuf, cfg.position.idxoffs, - cfg.position.numVerts * bytesize, idxdata); + if(cfg.position.indexResourceId != ResourceId()) + driver->GetBufferData(cfg.position.indexResourceId, cfg.position.indexByteOffset, + cfg.position.numIndices * bytesize, idxdata); uint8_t *idx8 = (uint8_t *)&idxdata[0]; uint16_t *idx16 = (uint16_t *)&idxdata[0]; uint32_t *idx32 = (uint32_t *)&idxdata[0]; - uint32_t numIndices = RDCMIN(cfg.position.numVerts, uint32_t(idxdata.size() / bytesize)); + uint32_t numIndices = RDCMIN(cfg.position.numIndices, uint32_t(idxdata.size() / bytesize)); indices.resize(numIndices); @@ -278,8 +279,8 @@ void HighlightCache::CacheHighlightingData(uint32_t eventID, const MeshDisplay & } } - driver->GetBufferData(cfg.position.buf, cfg.position.offset, - (maxIndex + 1) * cfg.position.stride, vertexData); + driver->GetBufferData(cfg.position.vertexResourceId, cfg.position.vertexByteOffset, + (maxIndex + 1) * cfg.position.vertexByteStride, vertexData); } } @@ -294,16 +295,16 @@ bool HighlightCache::FetchHighlightPositions(const MeshDisplay &cfg, FloatVector byte *dataEnd = data + vertexData.size(); uint32_t idx = cfg.highlightVert; - Topology meshtopo = cfg.position.topo; + Topology meshtopo = cfg.position.topology; activeVertex = InterpretVertex(data, idx, cfg, dataEnd, true, valid); uint32_t primRestart = 0; if(IsStrip(meshtopo)) { - if(cfg.position.idxByteWidth == 1) + if(cfg.position.indexByteStride == 1) primRestart = 0xff; - else if(cfg.position.idxByteWidth == 2) + else if(cfg.position.indexByteStride == 2) primRestart = 0xffff; else primRestart = 0xffffffff; @@ -453,7 +454,7 @@ bool HighlightCache::FetchHighlightPositions(const MeshDisplay &cfg, FloatVector // Triangle strip with adjacency is the most complex topology, as // we need to handle the ends separately where the pattern breaks. - uint32_t numidx = cfg.position.numVerts; + uint32_t numidx = cfg.position.numIndices; if(numidx < 6) { @@ -590,7 +591,7 @@ bool HighlightCache::FetchHighlightPositions(const MeshDisplay &cfg, FloatVector } else if(meshtopo >= Topology::PatchList) { - uint32_t dim = PatchList_Count(cfg.position.topo); + uint32_t dim = PatchList_Count(cfg.position.topology); uint32_t v0 = uint32_t(idx / dim) * dim; diff --git a/renderdoc/replay/replay_driver.h b/renderdoc/replay/replay_driver.h index ac5d8bf82..ac8f30176 100644 --- a/renderdoc/replay/replay_driver.h +++ b/renderdoc/replay/replay_driver.h @@ -121,14 +121,14 @@ public: virtual void ReplayLog(uint32_t endEventID, ReplayLogType replayType) = 0; virtual const SDFile &GetStructuredFile() = 0; - virtual vector GetPassEvents(uint32_t eventID) = 0; + virtual vector GetPassEvents(uint32_t eventId) = 0; - virtual void InitPostVSBuffers(uint32_t eventID) = 0; + virtual void InitPostVSBuffers(uint32_t eventId) = 0; virtual void InitPostVSBuffers(const vector &passEvents) = 0; virtual ResourceId GetLiveID(ResourceId id) = 0; - virtual MeshFormat GetPostVSBuffers(uint32_t eventID, uint32_t instID, MeshDataStage stage) = 0; + virtual MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, MeshDataStage stage) = 0; virtual void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &retData) = 0; virtual void GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, @@ -150,15 +150,15 @@ public: virtual vector PixelHistory(vector events, ResourceId target, uint32_t x, uint32_t y, uint32_t slice, uint32_t mip, uint32_t sampleIdx, CompType typeHint) = 0; - virtual ShaderDebugTrace DebugVertex(uint32_t eventID, uint32_t vertid, uint32_t instid, + 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, + virtual ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive) = 0; - virtual ShaderDebugTrace DebugThread(uint32_t eventID, const uint32_t groupid[3], + virtual ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3], const uint32_t threadid[3]) = 0; virtual ResourceId RenderOverlay(ResourceId texid, CompType typeHint, DebugOverlay overlay, - uint32_t eventID, const vector &passEvents) = 0; + uint32_t eventId, const vector &passEvents) = 0; virtual bool IsRenderOutput(ResourceId id) = 0; @@ -198,7 +198,7 @@ public: virtual ResourceId CreateProxyBuffer(const BufferDescription &templateBuf) = 0; virtual void SetProxyBufferData(ResourceId bufid, byte *data, size_t dataSize) = 0; - virtual void RenderMesh(uint32_t eventID, const vector &secondaryDraws, + virtual void RenderMesh(uint32_t eventId, const vector &secondaryDraws, const MeshDisplay &cfg) = 0; virtual bool RenderTexture(TextureDisplay cfg) = 0; @@ -214,7 +214,7 @@ public: 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; - virtual uint32_t PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t x, uint32_t y) = 0; + virtual uint32_t PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint32_t x, uint32_t y) = 0; }; // utility functions useful in any driver implementation @@ -240,7 +240,7 @@ struct HighlightCache bytebuf vertexData; std::vector indices; - void CacheHighlightingData(uint32_t eventID, const MeshDisplay &cfg); + void CacheHighlightingData(uint32_t eventId, const MeshDisplay &cfg); bool FetchHighlightPositions(const MeshDisplay &cfg, FloatVector &activeVertex, vector &activePrim, diff --git a/renderdoc/replay/replay_output.cpp b/renderdoc/replay/replay_output.cpp index 1c3c99162..829b8577f 100644 --- a/renderdoc/replay/replay_output.cpp +++ b/renderdoc/replay/replay_output.cpp @@ -124,8 +124,8 @@ void ReplayOutput::Shutdown() void ReplayOutput::SetTextureDisplay(const TextureDisplay &o) { - if(o.overlay != m_RenderData.texDisplay.overlay || - o.typeHint != m_RenderData.texDisplay.typeHint || o.texid != m_RenderData.texDisplay.texid) + if(o.overlay != m_RenderData.texDisplay.overlay || o.typeHint != m_RenderData.texDisplay.typeHint || + o.resourceId != m_RenderData.texDisplay.resourceId) { if(m_RenderData.texDisplay.overlay == DebugOverlay::ClearBeforeDraw || m_RenderData.texDisplay.overlay == DebugOverlay::ClearBeforePass) @@ -149,9 +149,9 @@ void ReplayOutput::SetMeshDisplay(const MeshDisplay &o) m_MainOutput.dirty = true; } -void ReplayOutput::SetFrameEvent(int eventID) +void ReplayOutput::SetFrameEvent(int eventId) { - m_EventID = eventID; + m_EventID = eventId; m_OverlayDirty = true; m_MainOutput.dirty = true; @@ -191,7 +191,7 @@ void ReplayOutput::RefreshOverlay() if(draw != NULL && (draw->flags & DrawFlags::Drawcall)) { - m_pDevice->InitPostVSBuffers(draw->eventID); + m_pDevice->InitPostVSBuffers(draw->eventId); if(postVSWholePass && !passEvents.empty()) { @@ -204,11 +204,11 @@ void ReplayOutput::RefreshOverlay() if(m_Type == ReplayOutputType::Texture && m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay) { - if(draw && m_pDevice->IsRenderOutput(m_RenderData.texDisplay.texid)) + if(draw && m_pDevice->IsRenderOutput(m_RenderData.texDisplay.resourceId)) { m_OverlayResourceId = m_pDevice->RenderOverlay( - m_pDevice->GetLiveID(m_RenderData.texDisplay.texid), m_RenderData.texDisplay.typeHint, - m_RenderData.texDisplay.overlay, m_EventID, passEvents); + m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId), + m_RenderData.texDisplay.typeHint, m_RenderData.texDisplay.overlay, m_EventID, passEvents); m_OverlayDirty = false; } else @@ -248,7 +248,7 @@ bool ReplayOutput::AddThumbnail(WindowingSystem system, void *data, ResourceId t for(size_t t = 0; t < m_pRenderer->m_Textures.size(); t++) { - if(m_pRenderer->m_Textures[t].ID == texID) + if(m_pRenderer->m_Textures[t].resourceId == texID) { depthMode = (m_pRenderer->m_Textures[t].creationFlags & TextureCategory::DepthTarget) || (m_pRenderer->m_Textures[t].format.compType == CompType::Depth); @@ -291,14 +291,15 @@ rdcpair ReplayOutput::GetMinMax() PixelValue minval; PixelValue maxval; - ResourceId tex = m_pDevice->GetLiveID(m_RenderData.texDisplay.texid); + ResourceId tex = m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId); CompType typeHint = m_RenderData.texDisplay.typeHint; uint32_t slice = m_RenderData.texDisplay.sliceFace; uint32_t mip = m_RenderData.texDisplay.mip; uint32_t sample = m_RenderData.texDisplay.sampleIdx; - if(m_RenderData.texDisplay.CustomShader != ResourceId() && m_CustomShaderResourceId != ResourceId()) + if(m_RenderData.texDisplay.customShaderId != ResourceId() && + m_CustomShaderResourceId != ResourceId()) { tex = m_CustomShaderResourceId; typeHint = CompType::Typeless; @@ -306,7 +307,8 @@ rdcpair ReplayOutput::GetMinMax() sample = 0; } - m_pDevice->GetMinMax(tex, slice, mip, sample, typeHint, &minval.value_f[0], &maxval.value_f[0]); + m_pDevice->GetMinMax(tex, slice, mip, sample, typeHint, &minval.floatValue[0], + &maxval.floatValue[0]); return make_rdcpair(minval, maxval); } @@ -315,14 +317,15 @@ rdcarray ReplayOutput::GetHistogram(float minval, float maxval, bool c { vector hist; - ResourceId tex = m_pDevice->GetLiveID(m_RenderData.texDisplay.texid); + ResourceId tex = m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId); CompType typeHint = m_RenderData.texDisplay.typeHint; uint32_t slice = m_RenderData.texDisplay.sliceFace; uint32_t mip = m_RenderData.texDisplay.mip; uint32_t sample = m_RenderData.texDisplay.sampleIdx; - if(m_RenderData.texDisplay.CustomShader != ResourceId() && m_CustomShaderResourceId != ResourceId()) + if(m_RenderData.texDisplay.customShaderId != ResourceId() && + m_CustomShaderResourceId != ResourceId()) { tex = m_CustomShaderResourceId; typeHint = CompType::Typeless; @@ -340,7 +343,7 @@ PixelValue ReplayOutput::PickPixel(ResourceId tex, bool customShader, uint32_t x { PixelValue ret; - RDCEraseEl(ret.value_f); + RDCEraseEl(ret.floatValue); if(tex == ResourceId()) return ret; @@ -349,7 +352,7 @@ PixelValue ReplayOutput::PickPixel(ResourceId tex, bool customShader, uint32_t x CompType typeHint = m_RenderData.texDisplay.typeHint; - if(customShader && m_RenderData.texDisplay.CustomShader != ResourceId() && + if(customShader && m_RenderData.texDisplay.customShaderId != ResourceId() && m_CustomShaderResourceId != ResourceId()) { tex = m_CustomShaderResourceId; @@ -367,20 +370,20 @@ PixelValue ReplayOutput::PickPixel(ResourceId tex, bool customShader, uint32_t x } m_pDevice->PickPixel(m_pDevice->GetLiveID(tex), x, y, sliceFace, mip, sample, typeHint, - ret.value_f); + ret.floatValue); if(decodeRamp) { for(size_t c = 0; c < ARRAY_COUNT(overdrawRamp); c++) { - if(fabs(ret.value_f[0] - overdrawRamp[c].x) < 0.00005f && - fabs(ret.value_f[1] - overdrawRamp[c].y) < 0.00005f && - fabs(ret.value_f[2] - overdrawRamp[c].z) < 0.00005f) + if(fabs(ret.floatValue[0] - overdrawRamp[c].x) < 0.00005f && + fabs(ret.floatValue[1] - overdrawRamp[c].y) < 0.00005f && + fabs(ret.floatValue[2] - overdrawRamp[c].z) < 0.00005f) { - ret.value_i[0] = (int32_t)c; - ret.value_i[1] = 0; - ret.value_i[2] = 0; - ret.value_i[3] = 0; + ret.intValue[0] = (int32_t)c; + ret.intValue[1] = 0; + ret.intValue[2] = 0; + ret.intValue[3] = 0; break; } } @@ -389,24 +392,24 @@ PixelValue ReplayOutput::PickPixel(ResourceId tex, bool customShader, uint32_t x if(m_RenderData.texDisplay.overlay == DebugOverlay::TriangleSizePass || m_RenderData.texDisplay.overlay == DebugOverlay::TriangleSizeDraw) { - float bucket = (float)ret.value_i[0]; + float bucket = (float)ret.intValue[0]; // decode bucket into approximate triangle area if(bucket <= 0.5f) - ret.value_f[0] = 0.0f; + ret.floatValue[0] = 0.0f; else if(bucket < 2.0f) - ret.value_f[0] = 16.0f; + ret.floatValue[0] = 16.0f; else - ret.value_f[0] = -2.5f * logf(1.0f + (bucket - 22.0f) / 20.1f); + ret.floatValue[0] = -2.5f * logf(1.0f + (bucket - 22.0f) / 20.1f); } } return ret; } -rdcpair ReplayOutput::PickVertex(uint32_t eventID, uint32_t x, uint32_t y) +rdcpair ReplayOutput::PickVertex(uint32_t eventId, uint32_t x, uint32_t y) { - DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(eventID); + DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(eventId); const rdcpair errorReturn = make_rdcpair(~0U, ~0U); @@ -419,13 +422,13 @@ rdcpair ReplayOutput::PickVertex(uint32_t eventID, uint32_t MeshDisplay cfg = m_RenderData.meshDisplay; - if(cfg.position.buf == ResourceId()) + if(cfg.position.vertexResourceId == ResourceId()) return errorReturn; - cfg.position.buf = m_pDevice->GetLiveID(cfg.position.buf); - cfg.position.idxbuf = m_pDevice->GetLiveID(cfg.position.idxbuf); - cfg.second.buf = m_pDevice->GetLiveID(cfg.second.buf); - cfg.second.idxbuf = m_pDevice->GetLiveID(cfg.second.idxbuf); + cfg.position.vertexResourceId = m_pDevice->GetLiveID(cfg.position.vertexResourceId); + cfg.position.indexResourceId = m_pDevice->GetLiveID(cfg.position.indexResourceId); + cfg.second.vertexResourceId = m_pDevice->GetLiveID(cfg.second.vertexResourceId); + cfg.second.indexResourceId = m_pDevice->GetLiveID(cfg.second.indexResourceId); // input data either doesn't vary with instance, or is trivial (all verts the same for that // element), so only care about fetching the right instance for post-VS stages @@ -450,15 +453,15 @@ rdcpair ReplayOutput::PickVertex(uint32_t eventID, uint32_t // used for post-VS output, calculate the offset of the element we're using as position, // relative to 0 MeshFormat fmt = m_pDevice->GetPostVSBuffers( - draw->eventID, m_RenderData.meshDisplay.curInstance, m_RenderData.meshDisplay.type); - uint64_t elemOffset = cfg.position.offset - fmt.offset; + draw->eventId, m_RenderData.meshDisplay.curInstance, m_RenderData.meshDisplay.type); + uint64_t elemOffset = cfg.position.vertexByteOffset - fmt.vertexByteOffset; for(uint32_t inst = firstInst; inst < maxInst; inst++) { // find the start of this buffer, and apply the element offset, then pick in that instance - fmt = m_pDevice->GetPostVSBuffers(draw->eventID, inst, m_RenderData.meshDisplay.type); - if(fmt.buf != ResourceId()) - cfg.position.offset = fmt.offset + elemOffset; + fmt = m_pDevice->GetPostVSBuffers(draw->eventId, inst, m_RenderData.meshDisplay.type); + if(fmt.vertexResourceId != ResourceId()) + cfg.position.vertexByteOffset = fmt.vertexByteOffset + elemOffset; uint32_t vert = m_pDevice->PickVertex(m_EventID, cfg, x, y); if(vert != ~0U) @@ -510,25 +513,25 @@ void ReplayOutput::DisplayContext() ClearBackground(m_PixelContext.outputID, m_RenderData.texDisplay.backgroundColor); if((m_Type != ReplayOutputType::Texture) || (m_ContextX < 0.0f && m_ContextY < 0.0f) || - (m_RenderData.texDisplay.texid == ResourceId())) + (m_RenderData.texDisplay.resourceId == ResourceId())) { m_pDevice->FlipOutputWindow(m_PixelContext.outputID); return; } TextureDisplay disp = m_RenderData.texDisplay; - disp.rawoutput = false; - disp.CustomShader = ResourceId(); + disp.rawOutput = false; + disp.customShaderId = ResourceId(); - if(m_RenderData.texDisplay.CustomShader != ResourceId()) - disp.texid = m_CustomShaderResourceId; + if(m_RenderData.texDisplay.customShaderId != ResourceId()) + disp.resourceId = m_CustomShaderResourceId; if((m_RenderData.texDisplay.overlay == DebugOverlay::QuadOverdrawDraw || m_RenderData.texDisplay.overlay == DebugOverlay::QuadOverdrawPass || m_RenderData.texDisplay.overlay == DebugOverlay::TriangleSizeDraw || m_RenderData.texDisplay.overlay == DebugOverlay::TriangleSizePass) && m_OverlayResourceId != ResourceId()) - disp.texid = m_OverlayResourceId; + disp.resourceId = m_OverlayResourceId; const float contextZoom = 8.0f; @@ -549,13 +552,13 @@ void ReplayOutput::DisplayContext() y >>= disp.mip; y <<= disp.mip; - disp.offx = -(float)x * disp.scale; - disp.offy = -(float)y * disp.scale; + disp.xOffset = -(float)x * disp.scale; + disp.yOffset = -(float)y * disp.scale; - disp.offx += w / 2.0f; - disp.offy += h / 2.0f; + disp.xOffset += w / 2.0f; + disp.yOffset += h / 2.0f; - disp.texid = m_pDevice->GetLiveID(disp.texid); + disp.resourceId = m_pDevice->GetLiveID(disp.resourceId); m_pDevice->RenderTexture(disp); @@ -638,30 +641,30 @@ void ReplayOutput::Display() TextureDisplay disp; - disp.Red = disp.Green = disp.Blue = true; - disp.Alpha = false; - disp.HDRMul = -1.0f; + disp.red = disp.green = disp.blue = true; + disp.alpha = false; + disp.hdrMultiplier = -1.0f; disp.linearDisplayAsGamma = true; - disp.FlipY = false; + disp.flipY = false; disp.mip = 0; disp.sampleIdx = ~0U; - disp.CustomShader = ResourceId(); - disp.texid = m_pDevice->GetLiveID(m_Thumbnails[i].texture); + disp.customShaderId = ResourceId(); + disp.resourceId = m_pDevice->GetLiveID(m_Thumbnails[i].texture); disp.typeHint = m_Thumbnails[i].typeHint; disp.scale = -1.0f; - disp.rangemin = 0.0f; - disp.rangemax = 1.0f; + disp.rangeMin = 0.0f; + disp.rangeMax = 1.0f; disp.sliceFace = 0; - disp.offx = 0.0f; - disp.offy = 0.0f; - disp.rawoutput = false; + disp.xOffset = 0.0f; + disp.yOffset = 0.0f; + disp.rawOutput = false; disp.overlay = DebugOverlay::NoOverlay; if(m_Thumbnails[i].typeHint == CompType::SNorm) - disp.rangemin = -1.0f; + disp.rangeMin = -1.0f; if(m_Thumbnails[i].depthMode) - disp.Green = disp.Blue = false; + disp.green = disp.blue = false; m_pDevice->RenderTexture(disp); @@ -677,7 +680,7 @@ void ReplayOutput::DisplayTex() if(m_MainOutput.outputID == 0) return; - if(m_RenderData.texDisplay.texid == ResourceId()) + if(m_RenderData.texDisplay.resourceId == ResourceId()) { FloatVector color; m_pDevice->BindOutputWindow(m_MainOutput.outputID, false); @@ -688,8 +691,8 @@ void ReplayOutput::DisplayTex() return; TextureDisplay texDisplay = m_RenderData.texDisplay; - texDisplay.rawoutput = false; - texDisplay.texid = m_pDevice->GetLiveID(texDisplay.texid); + texDisplay.rawOutput = false; + texDisplay.resourceId = m_pDevice->GetLiveID(texDisplay.resourceId); if(m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay && draw) { @@ -706,15 +709,15 @@ void ReplayOutput::DisplayTex() m_pDevice->ReplayLog(m_EventID, eReplay_Full); } - if(m_RenderData.texDisplay.CustomShader != ResourceId()) + if(m_RenderData.texDisplay.customShaderId != ResourceId()) { m_CustomShaderResourceId = m_pDevice->ApplyCustomShader( - m_RenderData.texDisplay.CustomShader, texDisplay.texid, texDisplay.mip, + m_RenderData.texDisplay.customShaderId, texDisplay.resourceId, texDisplay.mip, texDisplay.sliceFace, texDisplay.sampleIdx, texDisplay.typeHint); - texDisplay.texid = m_pDevice->GetLiveID(m_CustomShaderResourceId); + texDisplay.resourceId = m_pDevice->GetLiveID(m_CustomShaderResourceId); texDisplay.typeHint = CompType::Typeless; - texDisplay.CustomShader = ResourceId(); + texDisplay.customShaderId = ResourceId(); texDisplay.sliceFace = 0; } @@ -728,20 +731,20 @@ void ReplayOutput::DisplayTex() m_pDevice->RenderTexture(texDisplay); if(m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay && draw && - m_pDevice->IsRenderOutput(m_RenderData.texDisplay.texid) && + m_pDevice->IsRenderOutput(m_RenderData.texDisplay.resourceId) && m_RenderData.texDisplay.overlay != DebugOverlay::NaN && m_RenderData.texDisplay.overlay != DebugOverlay::Clipping) { RDCASSERT(m_OverlayResourceId != ResourceId()); - texDisplay.texid = m_pDevice->GetLiveID(m_OverlayResourceId); - texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true; - texDisplay.rawoutput = false; - texDisplay.CustomShader = ResourceId(); + texDisplay.resourceId = m_pDevice->GetLiveID(m_OverlayResourceId); + texDisplay.red = texDisplay.green = texDisplay.blue = texDisplay.alpha = true; + texDisplay.rawOutput = false; + texDisplay.customShaderId = ResourceId(); texDisplay.scale = m_RenderData.texDisplay.scale; - texDisplay.HDRMul = -1.0f; - texDisplay.FlipY = m_RenderData.texDisplay.FlipY; - texDisplay.rangemin = 0.0f; - texDisplay.rangemax = 1.0f; + texDisplay.hdrMultiplier = -1.0f; + texDisplay.flipY = m_RenderData.texDisplay.flipY; + texDisplay.rangeMin = 0.0f; + texDisplay.rangeMax = 1.0f; m_pDevice->RenderTexture(texDisplay); } @@ -779,10 +782,10 @@ void ReplayOutput::DisplayMesh() m_pDevice->ClearOutputWindowDepth(m_MainOutput.outputID, 1.0f, 0); MeshDisplay mesh = m_RenderData.meshDisplay; - mesh.position.buf = m_pDevice->GetLiveID(mesh.position.buf); - mesh.position.idxbuf = m_pDevice->GetLiveID(mesh.position.idxbuf); - mesh.second.buf = m_pDevice->GetLiveID(mesh.second.buf); - mesh.second.idxbuf = m_pDevice->GetLiveID(mesh.second.idxbuf); + mesh.position.vertexResourceId = m_pDevice->GetLiveID(mesh.position.vertexResourceId); + mesh.position.indexResourceId = m_pDevice->GetLiveID(mesh.position.indexResourceId); + mesh.second.vertexResourceId = m_pDevice->GetLiveID(mesh.second.vertexResourceId); + mesh.second.indexResourceId = m_pDevice->GetLiveID(mesh.second.indexResourceId); vector secondaryDraws; @@ -819,7 +822,7 @@ void ReplayOutput::DisplayMesh() { // get the 'most final' stage MeshFormat fmt = m_pDevice->GetPostVSBuffers(passEvents[i], inst, MeshDataStage::GSOut); - if(fmt.buf == ResourceId()) + if(fmt.vertexResourceId == ResourceId()) fmt = m_pDevice->GetPostVSBuffers(passEvents[i], inst, MeshDataStage::VSOut); fmt.meshColor = passDraws; @@ -843,9 +846,9 @@ void ReplayOutput::DisplayMesh() for(uint32_t inst = 0; inst < maxInst; inst++) { // get the 'most final' stage - MeshFormat fmt = m_pDevice->GetPostVSBuffers(draw->eventID, inst, MeshDataStage::GSOut); - if(fmt.buf == ResourceId()) - fmt = m_pDevice->GetPostVSBuffers(draw->eventID, inst, MeshDataStage::VSOut); + MeshFormat fmt = m_pDevice->GetPostVSBuffers(draw->eventId, inst, MeshDataStage::GSOut); + if(fmt.vertexResourceId == ResourceId()) + fmt = m_pDevice->GetPostVSBuffers(draw->eventId, inst, MeshDataStage::VSOut); fmt.meshColor = otherInstances; diff --git a/renderdoc/serialise/serialiser.cpp b/renderdoc/serialise/serialiser.cpp index 9aaaefc51..86efce242 100644 --- a/renderdoc/serialise/serialiser.cpp +++ b/renderdoc/serialise/serialiser.cpp @@ -276,9 +276,9 @@ uint32_t Serialiser::BeginChunk(uint32_t chunkID, uint3 { if(m_ChunkMetadata.callstack.empty()) { - bool collect = RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks; + bool collect = RenderDoc::Inst().GetCaptureOptions().captureCallstacks; - if(RenderDoc::Inst().GetCaptureOptions().CaptureCallstacksOnlyDraws) + if(RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyDraws) collect = collect && m_DrawChunk; if(collect) diff --git a/renderdoccmd/renderdoccmd.cpp b/renderdoccmd/renderdoccmd.cpp index 39b4a67a1..15649c19a 100644 --- a/renderdoccmd/renderdoccmd.cpp +++ b/renderdoccmd/renderdoccmd.cpp @@ -79,25 +79,25 @@ void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_ d.sampleIdx = ~0U; d.overlay = DebugOverlay::NoOverlay; d.typeHint = CompType::Typeless; - d.CustomShader = ResourceId(); - d.HDRMul = -1.0f; + d.customShaderId = ResourceId(); + d.hdrMultiplier = -1.0f; d.linearDisplayAsGamma = true; - d.FlipY = false; - d.rangemin = 0.0f; - d.rangemax = 1.0f; + d.flipY = false; + d.rangeMin = 0.0f; + d.rangeMax = 1.0f; d.scale = 1.0f; - d.offx = 0.0f; - d.offy = 0.0f; + d.xOffset = 0.0f; + d.yOffset = 0.0f; d.sliceFace = 0; - d.rawoutput = false; - d.Red = d.Green = d.Blue = true; - d.Alpha = false; + d.rawOutput = false; + d.red = d.green = d.blue = true; + d.alpha = false; for(const TextureDescription &desc : texs) { if(desc.creationFlags & TextureCategory::SwapBuffer) { - d.texid = desc.ID; + d.resourceId = desc.resourceId; break; } } @@ -108,7 +108,7 @@ void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_ { ResourceId id = draws.back().copyDestination; if(id != ResourceId()) - d.texid = id; + d.resourceId = id; } DisplayRendererPreview(renderer, d, width, height); @@ -1208,29 +1208,29 @@ int renderdoccmd(const GlobalEnvironment &env, std::vector &argv) if(it->second->IsCaptureCommand()) { if(cmd.exist("opt-disallow-vsync")) - opts.AllowVSync = false; + opts.allowVSync = false; if(cmd.exist("opt-disallow-fullscreen")) - opts.AllowFullscreen = false; + opts.allowFullscreen = false; if(cmd.exist("opt-api-validation")) - opts.APIValidation = true; + opts.apiValidation = true; if(cmd.exist("opt-api-validation-unmute")) - opts.DebugOutputMute = false; + opts.debugOutputMute = false; if(cmd.exist("opt-capture-callstacks")) - opts.CaptureCallstacks = true; + opts.captureCallstacks = true; if(cmd.exist("opt-capture-callstacks-only-draws")) - opts.CaptureCallstacksOnlyDraws = true; + opts.captureCallstacksOnlyDraws = true; if(cmd.exist("opt-verify-map-writes")) - opts.VerifyMapWrites = true; + opts.verifyMapWrites = true; if(cmd.exist("opt-hook-children")) - opts.HookIntoChildren = true; + opts.hookIntoChildren = true; if(cmd.exist("opt-ref-all-resources")) - opts.RefAllResources = true; + opts.refAllResources = true; if(cmd.exist("opt-save-all-initials")) - opts.SaveAllInitials = true; + opts.saveAllInitials = true; if(cmd.exist("opt-capture-all-cmd-lists")) - opts.CaptureAllCmdLists = true; + opts.captureAllCmdLists = true; - opts.DelayForDebugger = (uint32_t)cmd.get("opt-delay-for-debugger"); + opts.delayForDebugger = (uint32_t)cmd.get("opt-delay-for-debugger"); } if(cmd.exist("help"))