Remove std::vector/std::string use from D3D11 driver

This commit is contained in:
baldurk
2019-12-16 18:10:32 +00:00
parent 667f1cf8d1
commit b850abdfa0
24 changed files with 143 additions and 151 deletions
+3 -3
View File
@@ -32,7 +32,7 @@
WrappedID3D11Device *D3D11MarkerRegion::device;
D3D11MarkerRegion::D3D11MarkerRegion(const std::string &marker)
D3D11MarkerRegion::D3D11MarkerRegion(const rdcstr &marker)
{
D3D11MarkerRegion::Begin(marker);
}
@@ -42,7 +42,7 @@ D3D11MarkerRegion::~D3D11MarkerRegion()
D3D11MarkerRegion::End();
}
void D3D11MarkerRegion::Set(const std::string &marker)
void D3D11MarkerRegion::Set(const rdcstr &marker)
{
if(device == NULL)
return;
@@ -53,7 +53,7 @@ void D3D11MarkerRegion::Set(const std::string &marker)
annot->SetMarker(StringFormat::UTF82Wide(marker).c_str());
}
void D3D11MarkerRegion::Begin(const std::string &marker)
void D3D11MarkerRegion::Begin(const rdcstr &marker)
{
if(device == NULL)
return;
+6 -6
View File
@@ -39,10 +39,10 @@ struct D3D11RenderState;
// replay only class for handling marker regions
struct D3D11MarkerRegion
{
D3D11MarkerRegion(const std::string &marker);
D3D11MarkerRegion(const rdcstr &marker);
~D3D11MarkerRegion();
static void Set(const std::string &marker);
static void Begin(const std::string &marker);
static void Set(const rdcstr &marker);
static void Begin(const rdcstr &marker);
static void End();
static WrappedID3D11Device *device;
@@ -186,7 +186,7 @@ inline void SetDebugName(T *pObj, const char *name)
}
template <class T>
inline std::string GetDebugName(T *pObj)
inline rdcstr GetDebugName(T *pObj)
{
static const UINT DEBUG_NAME_SIZE = 1024;
static wchar_t tmpBuf[DEBUG_NAME_SIZE] = {0}; // Used for both char and wchar_t
@@ -197,7 +197,7 @@ inline std::string GetDebugName(T *pObj)
HRESULT hr = pObj->GetPrivateData(WKPDID_D3DDebugObjectName, &size, (char *)tmpBuf);
if(SUCCEEDED(hr))
{
return std::string((char *)tmpBuf, size);
return rdcstr((char *)tmpBuf, size);
}
// Try wchar_t
@@ -211,7 +211,7 @@ inline std::string GetDebugName(T *pObj)
}
}
return std::string();
return rdcstr();
}
class RefCounter
+3 -3
View File
@@ -297,7 +297,7 @@ bool WrappedID3D11DeviceContext::Serialise_BeginCaptureFrame(SerialiserType &ser
// used for a DrawAuto(). If the stream-out happens in frame we don't need to worry,
// but if it references a buffer from before we need to have that counter available
// on replay to 'fake' the DrawAuto() just as a Draw() with known values
std::vector<HiddenCounter> HiddenStreamOutCounters;
rdcarray<HiddenCounter> HiddenStreamOutCounters;
if(ser.IsWriting())
{
@@ -1250,9 +1250,9 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32
// we don't have duplicate uses
for(auto it = m_ResourceUses.begin(); it != m_ResourceUses.end(); ++it)
{
std::vector<EventUsage> &v = it->second;
rdcarray<EventUsage> &v = it->second;
std::sort(v.begin(), v.end());
v.erase(std::unique(v.begin(), v.end()), v.end());
v.erase(std::unique(v.begin(), v.end()) - v.begin(), ~0U);
#if CHECK_UNUSED_INITIAL_STATES
ResourceId resid = m_pDevice->GetResourceManager()->GetOriginalID(it->first);
+5 -6
View File
@@ -25,7 +25,6 @@
#pragma once
#include <list>
#include <map>
#include "core/core.h"
#include "d3d11_common.h"
@@ -133,7 +132,7 @@ private:
std::map<ResourceId, StreamOutData> m_StreamOutCounters;
std::map<ResourceId, std::vector<EventUsage> > m_ResourceUses;
std::map<ResourceId, rdcarray<EventUsage> > m_ResourceUses;
WrappedID3D11Device *m_pDevice;
ID3D11DeviceContext *m_pRealContext;
@@ -182,7 +181,7 @@ private:
D3D11RenderState *m_DeferredSavedState;
std::vector<APIEvent> m_CurEvents, m_Events;
rdcarray<APIEvent> m_CurEvents, m_Events;
bool m_AddedDrawcall;
bool HasNonMarkerEvents();
@@ -201,7 +200,7 @@ private:
uint32_t m_Col;
rdcstr m_Name;
};
std::vector<Annotation> m_AnnotationQueue;
rdcarray<Annotation> m_AnnotationQueue;
Threading::CriticalSection m_AnnotLock;
SDFile *m_StructuredFile = NULL;
@@ -216,7 +215,7 @@ private:
DrawcallDescription m_ParentDrawcall;
std::map<ResourceId, DrawcallDescription> m_CmdLists;
std::list<DrawcallDescription *> m_DrawcallStack;
rdcarray<DrawcallDescription *> m_DrawcallStack;
D3D11ResourceManager *GetResourceManager();
static rdcstr GetChunkName(uint32_t idx);
@@ -314,7 +313,7 @@ public:
void SetFrameReader(StreamReader *reader) { m_FrameReader = reader; }
void MarkResourceReferenced(ResourceId id, FrameRefType refType);
std::vector<EventUsage> GetUsage(ResourceId id) { return m_ResourceUses[id]; }
rdcarray<EventUsage> GetUsage(ResourceId id) { return m_ResourceUses[id]; }
void ClearMaps();
uint32_t GetEventID() { return m_CurEventID; }
@@ -248,7 +248,7 @@ void WrappedID3D11DeviceContext::DrainAnnotationQueue()
return;
}
std::vector<Annotation> annotations;
rdcarray<Annotation> annotations;
annotations.swap(m_AnnotationQueue);
m_AnnotLock.Unlock();
@@ -3755,7 +3755,7 @@ void WrappedID3D11DeviceContext::OMSetDepthStencilState(ID3D11DepthStencilState
template <typename SerialiserType>
void WrappedID3D11DeviceContext::Serialise_DebugMessages(SerialiserType &ser)
{
std::vector<DebugMessage> DebugMessages;
rdcarray<DebugMessage> DebugMessages;
m_EmptyCommandList = false;
@@ -4203,7 +4203,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexedInstancedIndirect(Serialis
DrawcallDescription draw;
std::string name = "DrawIndexedInstancedIndirect(-, -)";
rdcstr name = "DrawIndexedInstancedIndirect(-, -)";
if(pBufferForArgs)
{
@@ -4334,7 +4334,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawInstancedIndirect(SerialiserType
DrawcallDescription draw;
std::string name = "DrawInstancedIndirect(-, -)";
rdcstr name = "DrawInstancedIndirect(-, -)";
if(pBufferForArgs)
{
@@ -5046,7 +5046,7 @@ bool WrappedID3D11DeviceContext::Serialise_DispatchIndirect(SerialiserType &ser,
DrawcallDescription draw;
std::string name = "DispatchIndirect(-, -, -)";
rdcstr name = "DispatchIndirect(-, -, -)";
if(pBufferForArgs)
{
struct DispatchArgs
@@ -7724,7 +7724,7 @@ bool WrappedID3D11DeviceContext::Serialise_Unmap(SerialiserType &ser, ID3D11Reso
{
if(!record->VerifyShadowStorage(ctxMapID))
{
std::string msg = StringFormat::Fmt(
rdcstr msg = StringFormat::Fmt(
"Overwrite of %llu byte Map()'d buffer detected\n"
"Breakpoint now to see callstack,\nor click 'Yes' to debugbreak.",
record->Length);
+16 -16
View File
@@ -135,8 +135,8 @@ void D3D11DebugManager::InitCommonResources()
D3D11ShaderCache *shaderCache = m_pDevice->GetShaderCache();
D3D11ResourceManager *rm = m_pDevice->GetResourceManager();
std::string multisamplehlsl = GetEmbeddedResource(multisample_hlsl);
std::string hlsl = GetEmbeddedResource(misc_hlsl);
rdcstr multisamplehlsl = GetEmbeddedResource(multisample_hlsl);
rdcstr hlsl = GetEmbeddedResource(misc_hlsl);
if(m_pDevice->GetFeatureLevel() >= D3D_FEATURE_LEVEL_11_0)
{
@@ -205,7 +205,7 @@ void D3D11DebugManager::InitReplayResources()
HRESULT hr = S_OK;
{
std::string hlsl = GetEmbeddedResource(pixelhistory_hlsl);
rdcstr hlsl = GetEmbeddedResource(pixelhistory_hlsl);
PixelHistoryUnusedCS =
shaderCache->MakeCShader(hlsl.c_str(), "RENDERDOC_PixelHistoryUnused", "cs_5_0");
@@ -456,7 +456,7 @@ void D3D11Replay::GeneralMisc::Init(WrappedID3D11Device *device)
RDCERR("Failed to create scissoring rasterizer state HRESULT: %s", ToStr(hr).c_str());
{
std::string hlsl = GetEmbeddedResource(misc_hlsl);
rdcstr hlsl = GetEmbeddedResource(misc_hlsl);
FullscreenVS = shaderCache->MakeVShader(hlsl.c_str(), "RENDERDOC_FullscreenVS", "vs_4_0");
@@ -482,14 +482,14 @@ void D3D11Replay::TextureRendering::Init(WrappedID3D11Device *device)
HRESULT hr = S_OK;
{
std::string hlsl = GetEmbeddedResource(texdisplay_hlsl);
rdcstr hlsl = GetEmbeddedResource(texdisplay_hlsl);
TexDisplayVS = shaderCache->MakeVShader(hlsl.c_str(), "RENDERDOC_TexDisplayVS", "vs_4_0");
TexDisplayPS = shaderCache->MakePShader(hlsl.c_str(), "RENDERDOC_TexDisplayPS", "ps_5_0");
}
{
std::string hlsl = GetEmbeddedResource(texremap_hlsl);
rdcstr hlsl = GetEmbeddedResource(texremap_hlsl);
TexRemapPS[0] = shaderCache->MakePShader(hlsl.c_str(), "RENDERDOC_TexRemapFloat", "ps_5_0");
TexRemapPS[1] = shaderCache->MakePShader(hlsl.c_str(), "RENDERDOC_TexRemapUInt", "ps_5_0");
@@ -564,7 +564,7 @@ void D3D11Replay::OverlayRendering::Init(WrappedID3D11Device *device)
D3D11ShaderCache *shaderCache = device->GetShaderCache();
{
std::string hlsl = GetEmbeddedResource(misc_hlsl);
rdcstr hlsl = GetEmbeddedResource(misc_hlsl);
FullscreenVS = shaderCache->MakeVShader(hlsl.c_str(), "RENDERDOC_FullscreenVS", "vs_4_0");
@@ -575,7 +575,7 @@ void D3D11Replay::OverlayRendering::Init(WrappedID3D11Device *device)
}
{
std::string meshhlsl = GetEmbeddedResource(mesh_hlsl);
rdcstr meshhlsl = GetEmbeddedResource(mesh_hlsl);
TriangleSizeGS =
shaderCache->MakeGShader(meshhlsl.c_str(), "RENDERDOC_TriangleSizeGS", "gs_4_0");
@@ -682,9 +682,9 @@ void D3D11Replay::MeshRendering::Init(WrappedID3D11Device *device)
{"pos", 0, DXGI_FORMAT_R32G32B32A32_FLOAT}, {"sec", 0, DXGI_FORMAT_R8G8B8A8_UNORM},
};
std::string meshhlsl = GetEmbeddedResource(mesh_hlsl);
rdcstr meshhlsl = GetEmbeddedResource(mesh_hlsl);
std::vector<byte> bytecode;
rdcarray<byte> bytecode;
MeshVS = shaderCache->MakeVShader(meshhlsl.c_str(), "RENDERDOC_MeshVS", "vs_4_0", 2,
inputDescSecondary, &GenericLayout, &bytecode);
@@ -799,7 +799,7 @@ void D3D11Replay::VertexPicking::Init(WrappedID3D11Device *device)
HRESULT hr = S_OK;
std::string meshhlsl = GetEmbeddedResource(mesh_hlsl);
rdcstr meshhlsl = GetEmbeddedResource(mesh_hlsl);
MeshPickCS = shaderCache->MakeCShader(meshhlsl.c_str(), "RENDERDOC_MeshPickCS", "cs_5_0");
@@ -1031,7 +1031,7 @@ void D3D11Replay::HistogramMinMax::Init(WrappedID3D11Device *device)
if(FAILED(hr))
RDCERR("Failed to create result UAV 2 HRESULT: %s", ToStr(hr).c_str());
std::string histogramhlsl = GetEmbeddedResource(histogram_hlsl);
rdcstr histogramhlsl = GetEmbeddedResource(histogram_hlsl);
for(int t = eTexType_1D; t < eTexType_Max; t++)
{
@@ -1041,9 +1041,9 @@ void D3D11Replay::HistogramMinMax::Init(WrappedID3D11Device *device)
// float, uint, sint
for(int i = 0; i < 3; i++)
{
std::string hlsl = std::string("#define SHADER_RESTYPE ") + ToStr(t) + "\n";
hlsl += std::string("#define UINT_TEX ") + (i == 1 ? "1" : "0") + "\n";
hlsl += std::string("#define SINT_TEX ") + (i == 2 ? "1" : "0") + "\n";
rdcstr hlsl = rdcstr("#define SHADER_RESTYPE ") + ToStr(t) + "\n";
hlsl += rdcstr("#define UINT_TEX ") + (i == 1 ? "1" : "0") + "\n";
hlsl += rdcstr("#define SINT_TEX ") + (i == 2 ? "1" : "0") + "\n";
hlsl += histogramhlsl;
TileMinMaxCS[t][i] =
@@ -1174,7 +1174,7 @@ void D3D11Replay::PixelHistory::Init(WrappedID3D11Device *device)
}
{
std::string hlsl = GetEmbeddedResource(pixelhistory_hlsl);
rdcstr hlsl = GetEmbeddedResource(pixelhistory_hlsl);
PrimitiveIDPS = shaderCache->MakePShader(hlsl.c_str(), "RENDERDOC_PrimitiveIDPS", "ps_5_0");
}
+1 -2
View File
@@ -25,7 +25,6 @@
#pragma once
#include <list>
#include <map>
#include "driver/dx/official/d3d11_4.h"
#include "replay/replay_driver.h"
@@ -176,7 +175,7 @@ private:
static const int NUM_CACHED_SRVS = 64;
static const uint32_t STAGE_BUFFER_BYTE_SIZE = 4 * 1024 * 1024;
std::list<CacheElem> m_ShaderItemCache;
rdcarray<CacheElem> m_ShaderItemCache;
std::map<ResourceId, ID3D11UnorderedAccessView *> m_CounterBufferToUAV;
std::map<ID3D11UnorderedAccessView *, ResourceId> m_UAVToCounterBuffer;
+7 -8
View File
@@ -168,7 +168,7 @@ WrappedID3D11Device::WrappedID3D11Device(ID3D11Device *realDevice, D3D11InitPara
m_InitParams.AdapterDesc = desc;
GPUVendor vendor = GPUVendorFromPCIVendor(desc.VendorId);
std::string descString = GetDriverVersion(desc);
rdcstr descString = GetDriverVersion(desc);
RDCLOG("New D3D11 device created: %s / %s", ToStr(vendor).c_str(), descString.c_str());
@@ -790,7 +790,7 @@ rdcstr WrappedID3D11Device::GetChunkName(uint32_t idx)
}
void WrappedID3D11Device::AddDebugMessage(MessageCategory c, MessageSeverity sv, MessageSource src,
std::string d)
rdcstr d)
{
// Only add runtime warnings while executing.
// While reading, add the messages from the log, and while writing add messages
@@ -815,9 +815,9 @@ void WrappedID3D11Device::AddDebugMessage(DebugMessage msg)
m_DebugMessages.push_back(msg);
}
std::vector<DebugMessage> WrappedID3D11Device::GetDebugMessages()
rdcarray<DebugMessage> WrappedID3D11Device::GetDebugMessages()
{
std::vector<DebugMessage> ret;
rdcarray<DebugMessage> ret;
if(IsActiveReplaying(m_State))
{
@@ -902,7 +902,7 @@ std::vector<DebugMessage> WrappedID3D11Device::GetDebugMessages()
}
msg.messageID = (uint32_t)message->ID;
msg.description = std::string(message->pDescription);
msg.description = rdcstr(message->pDescription);
ret.push_back(msg);
@@ -1208,7 +1208,7 @@ ReplayStatus WrappedID3D11Device::ReadLogInitialisation(RDCFile *rdc, bool store
if(!IsStructuredExporting(m_State))
{
std::vector<DebugMessage> savedDebugMessages;
rdcarray<DebugMessage> savedDebugMessages;
// save any debug messages we built up
savedDebugMessages.swap(m_DebugMessages);
@@ -2247,8 +2247,7 @@ HRESULT WrappedID3D11Device::Present(IDXGISwapper *swapper, UINT SyncInterval, U
m_TextRenderer->SetOutputWindow(swapper->GetHWND());
int flags = activeWindow ? RenderDoc::eOverlay_ActiveWindow : 0;
std::string overlayText =
RenderDoc::Inst().GetOverlayText(RDCDriver::D3D11, m_FrameCounter, flags);
rdcstr overlayText = RenderDoc::Inst().GetOverlayText(RDCDriver::D3D11, m_FrameCounter, flags);
if(activeWindow && m_FailedFrame > 0)
{
+7 -7
View File
@@ -367,7 +367,7 @@ private:
void CachedObjectsGarbageCollect();
std::set<WrappedID3D11DeviceContext *> m_DeferredContexts;
std::map<ID3D11InputLayout *, std::vector<D3D11_INPUT_ELEMENT_DESC> > m_LayoutDescs;
std::map<ID3D11InputLayout *, rdcarray<D3D11_INPUT_ELEMENT_DESC> > m_LayoutDescs;
std::map<ID3D11InputLayout *, WrappedShader *> m_LayoutShaders;
static WrappedID3D11Device *m_pCurrentWrappedDevice;
@@ -384,9 +384,9 @@ private:
SDFile *m_StructuredFile = NULL;
SDFile m_StoredStructuredData;
std::vector<DebugMessage> m_DebugMessages;
rdcarray<DebugMessage> m_DebugMessages;
std::vector<FrameDescription> m_CapturedFrames;
rdcarray<FrameDescription> m_CapturedFrames;
rdcarray<DrawcallDescription *> m_Drawcalls;
public:
@@ -446,10 +446,10 @@ public:
SDFile &GetStructuredFile() { return *m_StructuredFile; }
void FirstFrame(IDXGISwapper *swapper);
std::vector<DebugMessage> GetDebugMessages();
rdcarray<DebugMessage> GetDebugMessages();
void AddDebugMessage(DebugMessage msg);
void AddDebugMessage(MessageCategory c, MessageSeverity sv, MessageSource src, std::string d);
const std::vector<D3D11_INPUT_ELEMENT_DESC> &GetLayoutDesc(ID3D11InputLayout *layout)
void AddDebugMessage(MessageCategory c, MessageSeverity sv, MessageSource src, rdcstr d);
const rdcarray<D3D11_INPUT_ELEMENT_DESC> &GetLayoutDesc(ID3D11InputLayout *layout)
{
return m_LayoutDescs[layout];
}
@@ -607,7 +607,7 @@ public:
}
template <typename SerialiserType>
std::vector<D3D11_SUBRESOURCE_DATA> Serialise_CreateTextureData(
rdcarray<D3D11_SUBRESOURCE_DATA> Serialise_CreateTextureData(
SerialiserType &ser, ID3D11Resource *tex, ResourceId id, const D3D11_SUBRESOURCE_DATA *data,
UINT w, UINT h, UINT d, DXGI_FORMAT fmt, UINT mips, UINT arr, bool HasData);
@@ -51,7 +51,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture2D1(SerialiserType &ser,
SERIALISE_ELEMENT_LOCAL(pTexture, GetIDForResource(*ppTexture2D))
.TypedAs("ID3D11Texture2D *"_lit);
std::vector<D3D11_SUBRESOURCE_DATA> descs =
rdcarray<D3D11_SUBRESOURCE_DATA> descs =
Serialise_CreateTextureData(ser, ppTexture2D ? *ppTexture2D : NULL, pTexture, pInitialData,
Descriptor.Width, Descriptor.Height, 1, Descriptor.Format,
Descriptor.MipLevels, Descriptor.ArraySize, pInitialData != NULL);
@@ -191,7 +191,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture3D1(SerialiserType &ser,
SERIALISE_ELEMENT_LOCAL(pTexture, GetIDForResource(*ppTexture3D))
.TypedAs("ID3D11Texture3D *"_lit);
std::vector<D3D11_SUBRESOURCE_DATA> descs =
rdcarray<D3D11_SUBRESOURCE_DATA> descs =
Serialise_CreateTextureData(ser, ppTexture3D ? *ppTexture3D : NULL, pTexture, pInitialData,
Descriptor.Width, Descriptor.Height, Descriptor.Depth,
Descriptor.Format, Descriptor.MipLevels, 1, pInitialData != NULL);
+6 -7
View File
@@ -243,7 +243,7 @@ HRESULT WrappedID3D11Device::CreateBuffer(const D3D11_BUFFER_DESC *pDesc,
}
template <typename SerialiserType>
std::vector<D3D11_SUBRESOURCE_DATA> WrappedID3D11Device::Serialise_CreateTextureData(
rdcarray<D3D11_SUBRESOURCE_DATA> WrappedID3D11Device::Serialise_CreateTextureData(
SerialiserType &ser, ID3D11Resource *tex, ResourceId id, const D3D11_SUBRESOURCE_DATA *data,
UINT w, UINT h, UINT d, DXGI_FORMAT fmt, UINT mips, UINT arr, bool HasData)
{
@@ -255,7 +255,7 @@ std::vector<D3D11_SUBRESOURCE_DATA> WrappedID3D11Device::Serialise_CreateTexture
numSubresources *= arr;
std::vector<D3D11_SUBRESOURCE_DATA> descs;
rdcarray<D3D11_SUBRESOURCE_DATA> descs;
if(IsReplayingAndReading() && HasData)
descs.resize(numSubresources);
@@ -384,7 +384,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture1D(SerialiserType &ser,
SERIALISE_ELEMENT_LOCAL(pTexture, GetIDForResource(*ppTexture1D))
.TypedAs("ID3D11Texture1D *"_lit);
std::vector<D3D11_SUBRESOURCE_DATA> descs = Serialise_CreateTextureData(
rdcarray<D3D11_SUBRESOURCE_DATA> descs = Serialise_CreateTextureData(
ser, ppTexture1D ? *ppTexture1D : NULL, pTexture, pInitialData, Descriptor.Width, 1, 1,
Descriptor.Format, Descriptor.MipLevels, Descriptor.ArraySize, pInitialData != NULL);
@@ -518,7 +518,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture2D(SerialiserType &ser,
SERIALISE_ELEMENT_LOCAL(pTexture, GetIDForResource(*ppTexture2D))
.TypedAs("ID3D11Texture2D *"_lit);
std::vector<D3D11_SUBRESOURCE_DATA> descs =
rdcarray<D3D11_SUBRESOURCE_DATA> descs =
Serialise_CreateTextureData(ser, ppTexture2D ? *ppTexture2D : NULL, pTexture, pInitialData,
Descriptor.Width, Descriptor.Height, 1, Descriptor.Format,
Descriptor.MipLevels, Descriptor.ArraySize, pInitialData != NULL);
@@ -652,7 +652,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture3D(SerialiserType &ser,
SERIALISE_ELEMENT_LOCAL(pTexture, GetIDForResource(*ppTexture3D))
.TypedAs("ID3D11Texture3D *"_lit);
std::vector<D3D11_SUBRESOURCE_DATA> descs =
rdcarray<D3D11_SUBRESOURCE_DATA> descs =
Serialise_CreateTextureData(ser, ppTexture3D ? *ppTexture3D : NULL, pTexture, pInitialData,
Descriptor.Width, Descriptor.Height, Descriptor.Depth,
Descriptor.Format, Descriptor.MipLevels, 1, pInitialData != NULL);
@@ -1340,8 +1340,7 @@ bool WrappedID3D11Device::Serialise_CreateInputLayout(
AddResource(pInputLayout, ResourceType::StateObject, "Input Layout");
if(NumElements > 0)
m_LayoutDescs[ret] = std::vector<D3D11_INPUT_ELEMENT_DESC>(pInputElementDescs,
pInputElementDescs + NumElements);
m_LayoutDescs[ret] = rdcarray<D3D11_INPUT_ELEMENT_DESC>(pInputElementDescs, NumElements);
if(BytecodeLength > 0 && pShaderBytecodeWithInputSignature)
m_LayoutShaders[ret] = new WrappedShader(this, pInputLayout, GetIDForResource(ret),
+1 -1
View File
@@ -234,7 +234,7 @@ private:
ShadowPointerData ImmediateShadow;
Threading::CriticalSection DeferredShadowLock;
std::vector<ShadowPointerData> DeferredShadow;
rdcarray<ShadowPointerData> DeferredShadow;
};
struct D3D11InitialContents
@@ -335,7 +335,7 @@ rdcarray<PixelModification> D3D11Replay::PixelHistory(rdcarray<EventUsage> event
(uint32_t)events.size());
// these occlusion queries are run with every test possible disabled
std::vector<ID3D11Query *> occl;
rdcarray<ID3D11Query *> occl;
occl.reserve(events.size());
ID3D11Query *testQueries[6] = {0}; // one query for each test we do per-drawcall
@@ -656,7 +656,7 @@ rdcarray<PixelModification> D3D11Replay::PixelHistory(rdcarray<EventUsage> event
// while issuing the above queries we can check to see which tests are enabled so we don't
// bother checking if depth testing failed if the depth test was disabled
std::vector<uint32_t> flags(events.size());
rdcarray<uint32_t> flags(events.size());
enum
{
TestEnabled_BackfaceCulling = 1 << 0,
+9 -9
View File
@@ -245,7 +245,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId)
RDCASSERT(dxbcDS);
}
std::vector<D3D11_SO_DECLARATION_ENTRY> sodecls;
rdcarray<D3D11_SO_DECLARATION_ENTRY> sodecls;
UINT stride = 0;
int posidx = -1;
@@ -284,8 +284,8 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId)
if(posidx > 0)
{
D3D11_SO_DECLARATION_ENTRY pos = sodecls[posidx];
sodecls.erase(sodecls.begin() + posidx);
sodecls.insert(sodecls.begin(), pos);
sodecls.erase(posidx);
sodecls.insert(0, pos);
}
HRESULT hr = m_pDevice->CreateGeometryShaderWithStreamOutput(
@@ -357,7 +357,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId)
SAFE_RELEASE(idxBuf);
std::vector<uint32_t> indices;
rdcarray<uint32_t> indices;
uint16_t *idx16 = (uint16_t *)&idxdata[0];
uint32_t *idx32 = (uint32_t *)&idxdata[0];
@@ -388,13 +388,13 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId)
if(it != indices.end() && *it == i32)
continue;
indices.insert(it, i32);
indices.insert(it - indices.begin(), i32);
}
// if we read out of bounds, we'll also have a 0 index being referenced
// (as 0 is read). Don't insert 0 if we already have 0 though
if(numIndices < drawcall->numIndices && (indices.empty() || indices[0] != 0))
indices.insert(indices.begin(), 0);
indices.insert(0, 0);
// An index buffer could be something like: 500, 501, 502, 501, 503, 502
// in which case we can't use the existing index buffer without filling 499 slots of vertex
@@ -700,8 +700,8 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId)
if(posidx > 0)
{
D3D11_SO_DECLARATION_ENTRY pos = sodecls[posidx];
sodecls.erase(sodecls.begin() + posidx);
sodecls.insert(sodecls.begin(), pos);
sodecls.erase(posidx);
sodecls.insert(0, pos);
}
streamoutGS = NULL;
@@ -845,7 +845,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId)
m_pImmediateContext->CopyResource(m_SOStagingBuffer, m_SOBuffer);
std::vector<D3D11PostVSData::InstData> instData;
rdcarray<D3D11PostVSData::InstData> instData;
if((drawcall->flags & DrawFlags::Instanced) && drawcall->numInstances > 1)
{
+1 -1
View File
@@ -1163,7 +1163,7 @@ bool D3D11RenderState::InputAssembler::Used_VB(WrappedID3D11Device *device, uint
if(Layout == NULL)
return false;
const std::vector<D3D11_INPUT_ELEMENT_DESC> &vec = device->GetLayoutDesc(Layout);
const rdcarray<D3D11_INPUT_ELEMENT_DESC> &vec = device->GetLayoutDesc(Layout);
for(size_t i = 0; i < vec.size(); i++)
if(vec[i].InputSlot == slot)
+2 -2
View File
@@ -107,7 +107,7 @@ D3D11TextRenderer::D3D11TextRenderer(WrappedID3D11Device *wrapper)
desc.SampleDesc.Count = 1;
desc.Usage = D3D11_USAGE_DEFAULT;
std::string font = GetEmbeddedResource(sourcecodepro_ttf);
rdcstr font = GetEmbeddedResource(sourcecodepro_ttf);
byte *ttfdata = (byte *)font.c_str();
const int firstChar = int(' ') + 1;
@@ -228,7 +228,7 @@ D3D11TextRenderer::D3D11TextRenderer(WrappedID3D11Device *wrapper)
m_pDevice->InternalRef();
rm->SetInternalResource(CharBuffer);
std::string hlsl = GetEmbeddedResource(text_hlsl);
rdcstr hlsl = GetEmbeddedResource(text_hlsl);
D3D11ShaderCache *shaderCache = wrapper->GetShaderCache();
@@ -48,7 +48,7 @@ D3D11DebugManager::CacheElem &D3D11DebugManager::GetCachedElem(ResourceId id, Co
m_ShaderItemCache.pop_back();
}
m_ShaderItemCache.push_front(CacheElem(id, typeCast, raw));
m_ShaderItemCache.insert(0, CacheElem(id, typeCast, raw));
return m_ShaderItemCache.front();
}
+9 -9
View File
@@ -111,7 +111,7 @@ void D3D11Replay::CreateResources(IDXGIFactory *factory)
m_DriverInfo.vendor = GPUVendorFromPCIVendor(desc.VendorId);
std::string descString = GetDriverVersion(desc);
rdcstr descString = GetDriverVersion(desc);
descString.resize(RDCMIN(descString.size(), ARRAY_COUNT(m_DriverInfo.version) - 1));
memcpy(m_DriverInfo.version, descString.c_str(), descString.size());
@@ -265,7 +265,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id)
{
WrappedID3D11Texture1D *d3dtex = (WrappedID3D11Texture1D *)it1D->second.m_Texture;
std::string str = GetDebugName(d3dtex);
rdcstr str = GetDebugName(d3dtex);
D3D11_TEXTURE1D_DESC desc;
d3dtex->GetDesc(&desc);
@@ -312,7 +312,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id)
{
WrappedID3D11Texture2D1 *d3dtex = (WrappedID3D11Texture2D1 *)it2D->second.m_Texture;
std::string str = GetDebugName(d3dtex);
rdcstr str = GetDebugName(d3dtex);
D3D11_TEXTURE2D_DESC desc;
d3dtex->GetDesc(&desc);
@@ -371,7 +371,7 @@ TextureDescription D3D11Replay::GetTexture(ResourceId id)
{
WrappedID3D11Texture3D1 *d3dtex = (WrappedID3D11Texture3D1 *)it3D->second.m_Texture;
std::string str = GetDebugName(d3dtex);
rdcstr str = GetDebugName(d3dtex);
D3D11_TEXTURE3D_DESC desc;
d3dtex->GetDesc(&desc);
@@ -626,7 +626,7 @@ BufferDescription D3D11Replay::GetBuffer(ResourceId id)
WrappedID3D11Buffer *d3dbuf = it->second.m_Buffer;
std::string str = GetDebugName(d3dbuf);
rdcstr str = GetDebugName(d3dbuf);
ret.resourceId = m_pDevice->GetResourceManager()->GetOriginalID(it->first);
@@ -705,7 +705,7 @@ void D3D11Replay::SavePipelineState(uint32_t eventId)
if(rs->IA.Layout)
{
const std::vector<D3D11_INPUT_ELEMENT_DESC> &vec = m_pDevice->GetLayoutDesc(rs->IA.Layout);
const rdcarray<D3D11_INPUT_ELEMENT_DESC> &vec = m_pDevice->GetLayoutDesc(rs->IA.Layout);
ResourceId layoutId = GetIDForResource(rs->IA.Layout);
@@ -2532,7 +2532,7 @@ void D3D11Replay::BuildShader(ShaderEncoding sourceEncoding, const bytebuf &sour
return;
}
std::string hlsl;
rdcstr hlsl;
hlsl.assign((const char *)source.data(), source.size());
ID3DBlob *blob = NULL;
@@ -3023,7 +3023,7 @@ uint32_t D3D11Replay::PickVertex(uint32_t eventId, int32_t width, int32_t height
bytebuf idxs;
GetBufferData(cfg.position.indexResourceId, cfg.position.indexByteOffset, 0, idxs);
std::vector<uint32_t> outidxs;
rdcarray<uint32_t> outidxs;
outidxs.resize(cfg.position.numIndices);
uint16_t *idxs16 = (uint16_t *)&idxs[0];
@@ -3137,7 +3137,7 @@ uint32_t D3D11Replay::PickVertex(uint32_t eventId, int32_t width, int32_t height
}
}
std::vector<FloatVector> vbData;
rdcarray<FloatVector> vbData;
vbData.resize(maxIndex + 1);
byte *data = &oldData[0];
+7 -9
View File
@@ -67,7 +67,7 @@ std::map<ResourceId, WrappedID3D11Texture3D1::TextureEntry>
std::map<ResourceId, WrappedID3D11Buffer::BufferEntry> WrappedID3D11Buffer::m_BufferList;
std::map<ResourceId, WrappedShader::ShaderEntry *> WrappedShader::m_ShaderList;
Threading::CriticalSection WrappedShader::m_ShaderListLock;
std::vector<WrappedID3DDeviceContextState *> WrappedID3DDeviceContextState::m_List;
rdcarray<WrappedID3DDeviceContextState *> WrappedID3DDeviceContextState::m_List;
Threading::CriticalSection WrappedID3DDeviceContextState::m_Lock;
const GUID RENDERDOC_ID3D11ShaderGUID_ShaderDebugMagicValue = RENDERDOC_ShaderDebugMagicValue_struct;
@@ -76,7 +76,7 @@ void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode()
{
if(!DXBC::DXBCContainer::CheckForDebugInfo((const void *)&m_Bytecode[0], m_Bytecode.size()))
{
std::string originalPath = m_DebugInfoPath;
rdcstr originalPath = m_DebugInfoPath;
if(originalPath.empty())
originalPath =
@@ -97,7 +97,7 @@ void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode()
size_t numSearchPaths = m_DebugInfoSearchPaths ? m_DebugInfoSearchPaths->size() : 0;
std::string foundPath;
rdcstr foundPath;
// while we haven't found a file, keep trying through the search paths. For i==0
// check the path on its own, in case it's an absolute path.
@@ -111,7 +111,7 @@ void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode()
}
else
{
const std::string &searchPath = (*m_DebugInfoSearchPaths)[i - 1];
const rdcstr &searchPath = (*m_DebugInfoSearchPaths)[i - 1];
foundPath = searchPath + "/" + originalPath;
originalShaderFile = FileIO::fopen(foundPath.c_str(), "rb");
}
@@ -126,7 +126,7 @@ void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode()
if(lz4 || originalShaderSize >= m_Bytecode.size())
{
std::vector<byte> originalBytecode;
rdcarray<byte> originalBytecode;
originalBytecode.resize((size_t)originalShaderSize);
FileIO::fread(&originalBytecode[0], sizeof(byte), (size_t)originalShaderSize,
@@ -134,7 +134,7 @@ void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode()
if(lz4)
{
std::vector<byte> decompressed;
rdcarray<byte> decompressed;
// first try decompressing to 1MB flat
decompressed.resize(100 * 1024);
@@ -648,8 +648,6 @@ WrappedID3DDeviceContextState::~WrappedID3DDeviceContextState()
{
SCOPED_LOCK(WrappedID3DDeviceContextState::m_Lock);
auto it = std::find(WrappedID3DDeviceContextState::m_List.begin(),
WrappedID3DDeviceContextState::m_List.end(), this);
WrappedID3DDeviceContextState::m_List.erase(it);
WrappedID3DDeviceContextState::m_List.removeOne(this);
}
}
+7 -7
View File
@@ -293,7 +293,7 @@ public:
const char *pStrData = (const char *)pData;
if(DataSize != 0 && pStrData[DataSize - 1] != '\0')
{
std::string sName(pStrData, DataSize);
rdcstr sName(pStrData, DataSize);
m_pDevice->SetResourceName(this, sName.c_str());
}
else
@@ -305,7 +305,7 @@ public:
{
const wchar_t *pStrData = (const wchar_t *)pData;
rdcwstr wName(pStrData, DataSize / 2);
std::string sName = StringFormat::Wide2UTF8(wName);
rdcstr sName = StringFormat::Wide2UTF8(wName);
m_pDevice->SetResourceName(this, sName.c_str());
}
@@ -909,7 +909,7 @@ public:
ShaderEntry(WrappedID3D11Device *device, ResourceId id, const byte *code, size_t codeLen)
{
m_ID = id;
m_Bytecode.assign(code, code + codeLen);
m_Bytecode.assign(code, codeLen);
m_DebugInfoSearchPaths = device->GetShaderDebugInfoSearchPaths();
m_DXBCFile = NULL;
}
@@ -919,7 +919,7 @@ public:
SAFE_DELETE(m_DXBCFile);
}
void SetDebugInfoPath(const std::string &path) { m_DebugInfoPath = path; }
void SetDebugInfoPath(const rdcstr &path) { m_DebugInfoPath = path; }
DXBC::DXBCContainer *GetDXBC()
{
if(m_DXBCFile == NULL && !m_Bytecode.empty())
@@ -955,10 +955,10 @@ public:
ResourceId m_ID;
std::string m_DebugInfoPath;
rdcstr m_DebugInfoPath;
rdcarray<rdcstr> *m_DebugInfoSearchPaths;
std::vector<byte> m_Bytecode;
rdcarray<byte> m_Bytecode;
bool m_Built = false;
DXBC::DXBCContainer *m_DXBCFile;
@@ -1336,7 +1336,7 @@ class WrappedID3DDeviceContextState : public WrappedDeviceChild11<ID3DDeviceCont
public:
ALLOCATE_WITH_WRAPPED_POOL(WrappedID3DDeviceContextState);
static std::vector<WrappedID3DDeviceContextState *> m_List;
static rdcarray<WrappedID3DDeviceContextState *> m_List;
static Threading::CriticalSection m_Lock;
D3D11RenderState *state;
@@ -82,13 +82,13 @@ struct D3DBlobShaderCallbacks
struct EmbeddedD3D11Includer : public ID3DInclude
{
std::string texsample = GetEmbeddedResource(hlsl_texsample_h);
std::string cbuffers = GetEmbeddedResource(hlsl_cbuffers_h);
rdcstr texsample = GetEmbeddedResource(hlsl_texsample_h);
rdcstr cbuffers = GetEmbeddedResource(hlsl_cbuffers_h);
virtual HRESULT STDMETHODCALLTYPE Open(D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName,
LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) override
{
std::string *str;
rdcstr *str;
if(!strcmp(pFileName, "hlsl_texsample.h"))
str = &texsample;
@@ -132,9 +132,9 @@ D3D11ShaderCache::~D3D11ShaderCache()
}
}
std::string D3D11ShaderCache::GetShaderBlob(const char *source, const char *entry,
const uint32_t compileFlags, const char *profile,
ID3DBlob **srcblob)
rdcstr D3D11ShaderCache::GetShaderBlob(const char *source, const char *entry,
const uint32_t compileFlags, const char *profile,
ID3DBlob **srcblob)
{
EmbeddedD3D11Includer includer;
@@ -176,13 +176,13 @@ std::string D3D11ShaderCache::GetShaderBlob(const char *source, const char *entr
hr = compileFunc(source, strlen(source), entry, NULL, &includer, entry, profile, flags, 0,
&byteBlob, &errBlob);
std::string errors = "";
rdcstr errors = "";
if(errBlob)
{
errors = (char *)errBlob->GetBufferPointer();
std::string logerror = errors;
rdcstr logerror = errors;
if(logerror.length() > 1024)
logerror = logerror.substr(0, 1024) + "...";
@@ -213,7 +213,7 @@ std::string D3D11ShaderCache::GetShaderBlob(const char *source, const char *entr
ID3D11VertexShader *D3D11ShaderCache::MakeVShader(const char *source, const char *entry,
const char *profile, int numInputDescs,
D3D11_INPUT_ELEMENT_DESC *inputs,
ID3D11InputLayout **ret, std::vector<byte> *blob)
ID3D11InputLayout **ret, rdcarray<byte> *blob)
{
ID3DBlob *byteBlob = NULL;
+3 -3
View File
@@ -37,11 +37,11 @@ public:
D3D11ShaderCache(WrappedID3D11Device *wrapper);
~D3D11ShaderCache();
std::string GetShaderBlob(const char *source, const char *entry, const uint32_t compileFlags,
const char *profile, ID3DBlob **srcblob);
rdcstr GetShaderBlob(const char *source, const char *entry, const uint32_t compileFlags,
const char *profile, ID3DBlob **srcblob);
ID3D11VertexShader *MakeVShader(const char *source, const char *entry, const char *profile,
int numInputDescs = 0, D3D11_INPUT_ELEMENT_DESC *inputs = NULL,
ID3D11InputLayout **ret = NULL, std::vector<byte> *blob = NULL);
ID3D11InputLayout **ret = NULL, rdcarray<byte> *blob = NULL);
ID3D11GeometryShader *MakeGShader(const char *source, const char *entry, const char *profile);
ID3D11PixelShader *MakePShader(const char *source, const char *entry, const char *profile);
ID3D11ComputeShader *MakeCShader(const char *source, const char *entry, const char *profile);
+27 -28
View File
@@ -649,7 +649,7 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
{
using namespace DXBCBytecode;
std::string funcRet = "";
rdcstr funcRet = "";
DXGI_FORMAT retFmt = DXGI_FORMAT_UNKNOWN;
if(opcode == OPCODE_SAMPLE_C || opcode == OPCODE_SAMPLE_C_LZ || opcode == OPCODE_GATHER4_C ||
@@ -659,13 +659,13 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
funcRet = "float4";
}
std::string samplerDecl = "";
rdcstr samplerDecl = "";
if(samplerData.mode == SAMPLER_MODE_DEFAULT)
samplerDecl = "SamplerState s";
else if(samplerData.mode == SAMPLER_MODE_COMPARISON)
samplerDecl = "SamplerComparisonState s";
std::string textureDecl = "";
rdcstr textureDecl = "";
int texdim = 2;
int offsetDim = 2;
bool useOffsets = true;
@@ -897,18 +897,18 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
StringFormat::snprintf(buf3, 255, formats[offsetDim + texdimOffs - 1][ddyType], ddyCalc.value.i.x,
ddyCalc.value.i.y, ddyCalc.value.i.z, ddyCalc.value.i.w);
std::string texcoords = buf;
std::string ddx = buf2;
std::string ddy = buf3;
rdcstr texcoords = buf;
rdcstr ddx = buf2;
rdcstr ddy = buf3;
if(opcode == OPCODE_LD_MS)
{
StringFormat::snprintf(buf, 255, formats[0][1], multisampleIndex);
}
std::string sampleIdx = buf;
rdcstr sampleIdx = buf;
std::string offsets = "";
rdcstr offsets = "";
if(useOffsets)
{
@@ -925,13 +925,13 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
}
char elems[] = "xyzw";
std::string strSwizzle = ".";
rdcstr strSwizzle = ".";
for(int i = 0; i < 4; ++i)
{
strSwizzle += elems[swizzle[i]];
}
std::string strGatherChannel;
rdcstr strGatherChannel;
switch(gatherChannel)
{
case ShaderDebug::GatherChannel::Red: strGatherChannel = "Red"; break;
@@ -940,11 +940,11 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
case ShaderDebug::GatherChannel::Alpha: strGatherChannel = "Alpha"; break;
}
std::string vsProgram = "float4 main(uint id : SV_VertexID) : SV_Position {\n";
rdcstr vsProgram = "float4 main(uint id : SV_VertexID) : SV_Position {\n";
vsProgram += "return float4((id == 2) ? 3.0f : -1.0f, (id == 0) ? -3.0f : 1.0f, 0.5, 1.0);\n";
vsProgram += "}";
std::string sampleProgram;
rdcstr sampleProgram;
if(opcode == OPCODE_SAMPLE || opcode == OPCODE_SAMPLE_B || opcode == OPCODE_SAMPLE_D)
{
@@ -969,7 +969,7 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
// these operations need derivatives but have no hlsl function to call to provide them, so
// we fake it in the vertex shader
std::string uvDim = "1";
rdcstr uvDim = "1";
uvDim[0] += char(texdim + texdimOffs - 1);
vsProgram = "void main(uint id : SV_VertexID, out float4 pos : SV_Position, out float" + uvDim +
@@ -980,19 +980,19 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
uv.value.f.x + ddyCalc.value.f.x * 2.0f, uv.value.f.y + ddyCalc.value.f.y * 2.0f,
uv.value.f.z + ddyCalc.value.f.z * 2.0f, uv.value.f.w + ddyCalc.value.f.w * 2.0f);
vsProgram += "if(id == 0) uv = " + std::string(buf) + ";\n";
vsProgram += "if(id == 0) uv = " + rdcstr(buf) + ";\n";
StringFormat::snprintf(buf, 255, formats[texdim + texdimOffs - 1][texcoordType], uv.value.f.x,
uv.value.f.y, uv.value.f.z, uv.value.f.w);
vsProgram += "if(id == 1) uv = " + std::string(buf) + ";\n";
vsProgram += "if(id == 1) uv = " + rdcstr(buf) + ";\n";
StringFormat::snprintf(
buf, 255, formats[texdim + texdimOffs - 1][texcoordType],
uv.value.f.x + ddxCalc.value.f.x * 2.0f, uv.value.f.y + ddxCalc.value.f.y * 2.0f,
uv.value.f.z + ddxCalc.value.f.z * 2.0f, uv.value.f.w + ddxCalc.value.f.w * 2.0f);
vsProgram += "if(id == 2) uv = " + std::string(buf) + ";\n";
vsProgram += "if(id == 2) uv = " + rdcstr(buf) + ";\n";
vsProgram += "pos = float4((id == 2) ? 3.0f : -1.0f, (id == 0) ? -3.0f : 1.0f, 0.5, 1.0);\n";
vsProgram += "}";
@@ -1005,8 +1005,7 @@ bool D3D11DebugAPIWrapper::CalculateSampleGather(
sampleProgram = textureDecl + " : register(t0);\n" + samplerDecl + " : register(s0);\n\n";
sampleProgram += funcRet + " main(float4 pos : SV_Position, float" + uvDim +
" uv : uvs) : SV_Target0\n{\n";
sampleProgram +=
"return t.SampleCmpLevelZero(s, uv, " + std::string(buf) + offsets + ").xxxx;";
sampleProgram += "return t.SampleCmpLevelZero(s, uv, " + rdcstr(buf) + offsets + ").xxxx;";
sampleProgram += "\n}\n";
}
else if(opcode == OPCODE_LOD)
@@ -1266,7 +1265,7 @@ bool D3D11DebugAPIWrapper::CalculateMathIntrinsic(DXBCBytecode::OpcodeType opcod
const ShaderVariable &input,
ShaderVariable &output1, ShaderVariable &output2)
{
std::string csProgram =
rdcstr csProgram =
"RWBuffer<float4> outval : register(u0);\n"
"cbuffer srcOper : register(b0) { float4 inval; };\n"
"[numthreads(1, 1, 1)]\n"
@@ -1729,7 +1728,7 @@ ShaderDebugTrace D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uin
D3D11RenderState *rs = m_pImmediateContext->GetCurrentPipelineState();
std::vector<D3D11_INPUT_ELEMENT_DESC> inputlayout = m_pDevice->GetLayoutDesc(rs->IA.Layout);
rdcarray<D3D11_INPUT_ELEMENT_DESC> inputlayout = m_pDevice->GetLayoutDesc(rs->IA.Layout);
std::set<UINT> vertexbuffers;
uint32_t trackingOffs[32] = {0};
@@ -1812,11 +1811,11 @@ ShaderDebugTrace D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uin
{
const D3D11_INPUT_ELEMENT_DESC *el = NULL;
std::string signame = strlower(dxbc->GetReflection()->InputSig[i].semanticName);
rdcstr signame = strlower(dxbc->GetReflection()->InputSig[i].semanticName);
for(size_t l = 0; l < inputlayout.size(); l++)
{
std::string layoutname = strlower(inputlayout[l].SemanticName);
rdcstr layoutname = strlower(inputlayout[l].SemanticName);
if(signame == layoutname &&
dxbc->GetReflection()->InputSig[i].semanticIndex == inputlayout[l].SemanticIndex)
@@ -2050,7 +2049,7 @@ ShaderDebugTrace D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uin
State last;
std::vector<ShaderDebugState> states;
rdcarray<ShaderDebugState> states;
if(dxbc->GetDebugInfo())
dxbc->GetDebugInfo()->GetLocals(0, dxbc->GetDXBCByteCode()->GetInstruction(0).offset,
@@ -2368,7 +2367,7 @@ void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, uint prim
keyMask |= (1 << (key.firstComponent + i));
// find the name of the variable matching the operand, in the case of merged input variables.
std::string name, swizzle = "xyzw";
rdcstr name, swizzle = "xyzw";
for(size_t i = 0; i < dxbc->GetReflection()->InputSig.size(); i++)
{
if(dxbc->GetReflection()->InputSig[i].regIndex == (uint32_t)key.inputRegisterIndex &&
@@ -2396,7 +2395,7 @@ void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, uint prim
name = StringFormat::Fmt("IN.%s.%s", name.c_str(), swizzle.c_str());
// we must write all components, so just swizzle the values - they'll be ignored later.
std::string expandSwizzle = swizzle;
rdcstr expandSwizzle = swizzle;
while(expandSwizzle.size() < 4)
expandSwizzle.push_back('x');
@@ -2420,7 +2419,7 @@ void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, uint prim
for(size_t i = 0; i < floatInputs.size(); i++)
{
const std::string &name = floatInputs[i];
const rdcstr &name = floatInputs[i];
extractHlsl += " PSInitialBuffer[idx].INddx." + name + " = ddx(IN." + name + ");\n";
extractHlsl += " PSInitialBuffer[idx].INddy." + name + " = ddy(IN." + name + ");\n";
extractHlsl += " PSInitialBuffer[idx].INddxfine." + name + " = ddx_fine(IN." + name + ");\n";
@@ -2819,7 +2818,7 @@ void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, uint prim
SAFE_DELETE_ARRAY(initialData);
SAFE_DELETE_ARRAY(evalData);
std::vector<ShaderDebugState> states;
rdcarray<ShaderDebugState> states;
if(dxbc->GetDebugInfo())
dxbc->GetDebugInfo()->GetLocals(0, dxbc->GetDXBCByteCode()->GetInstruction(0).offset,
@@ -3030,7 +3029,7 @@ ShaderDebugTrace D3D11Replay::DebugThread(uint32_t eventId, const uint32_t group
initialState.semantics.ThreadID[i] = threadid[i];
}
std::vector<ShaderDebugState> states;
rdcarray<ShaderDebugState> states;
if(dxbc->GetDebugInfo())
dxbc->GetDebugInfo()->GetLocals(0, dxbc->GetDXBCByteCode()->GetInstruction(0).offset,
+3 -4
View File
@@ -555,7 +555,7 @@ APP_DEPRECATED_HRESULT STDMETHODCALLTYPE WrappedID3D11VideoContext2::DecoderExte
D3D11_VIDEO_DECODER_EXTENSION unwrappedExt = *pExtensionData;
std::vector<ID3D11Resource *> unwrappedRes;
rdcarray<ID3D11Resource *> unwrappedRes;
unwrappedRes.resize(unwrappedExt.ResourceCount);
for(UINT i = 0; i < unwrappedExt.ResourceCount; i++)
@@ -943,8 +943,7 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11VideoContext2::VideoProcessorBlt(
/* [annotation] */ _In_ UINT OutputFrame, /* [annotation] */ _In_ UINT StreamCount,
/* [annotation] */ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM *pStreams)
{
std::vector<D3D11_VIDEO_PROCESSOR_STREAM> unwrappedStreams;
unwrappedStreams.insert(unwrappedStreams.begin(), pStreams, pStreams + StreamCount);
rdcarray<D3D11_VIDEO_PROCESSOR_STREAM> unwrappedStreams(pStreams, StreamCount);
size_t numFrames = 0;
@@ -961,7 +960,7 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11VideoContext2::VideoProcessorBlt(
numFrames += stream.FutureFrames;
}
std::vector<ID3D11VideoProcessorInputView *> inputViews;
rdcarray<ID3D11VideoProcessorInputView *> inputViews;
inputViews.resize(numFrames);