Fix linestrip usage for highlight box

This commit is contained in:
baldurk
2014-11-02 19:34:22 +00:00
parent 8ca8ac4ab3
commit dcc9937bed
3 changed files with 22 additions and 1 deletions
+2 -1
View File
@@ -63,7 +63,8 @@ cbuffer DebugVertexCBuffer REG(b0)
row_major float4x4 ModelViewProj;
float Scale;
float3 dummy1;
uint LineStrip;
float2 dummy1;
};
cbuffer DebugGeometryCBuffer REG(b0)
+12
View File
@@ -37,6 +37,18 @@ v2f RENDERDOC_DebugVS(uint vertID : SV_VertexID)
float2 pos = positions[vertID];
if(LineStrip)
{
float2 strippositions[] = {
float2(0.0f, 0.0f),
float2(1.0f, 0.0f),
float2(1.0f, -1.0f),
float2(0.0f, -1.0f),
};
pos = strippositions[vertID];
}
OUT.pos = float4(Position.xy + pos.xy*TextureResolution.xy*Scale*ScreenAspect.xy, 0, 1)-float4(1.0,-1.0,0,0);
OUT.tex.xy = float2(pos.x, -pos.y);
return OUT;
+8
View File
@@ -3273,6 +3273,8 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg, bool blendAlpha)
vertexData.TextureResolution.x = 1.0f/vertexData.ScreenAspect.x;
vertexData.TextureResolution.y = 1.0f;
vertexData.LineStrip = 0;
if(cfg.rangemax <= cfg.rangemin) cfg.rangemax += 0.00001f;
pixelData.Channels.x = cfg.Red ? 1.0f : 0.0f;
@@ -3592,6 +3594,8 @@ void D3D11DebugManager::RenderHighlightBox(float w, float h, float scale)
vertCBuffer.TextureResolution.x = xdim;
vertCBuffer.TextureResolution.y = ydim;
vertCBuffer.LineStrip = 1;
vconst = MakeCBuffer((float *)&vertCBuffer, sizeof(vertCBuffer));
m_pImmediateContext->HSSetShader(NULL, NULL, 0);
@@ -3642,6 +3646,8 @@ void D3D11DebugManager::RenderCheckerboard(Vec3f light, Vec3f dark)
vertexData.TextureResolution.x = 1.0f;
vertexData.TextureResolution.y = 1.0f;
vertexData.LineStrip = 0;
FillCBuffer(m_DebugRender.GenericVSCBuffer, (float *)&vertexData, sizeof(DebugVertexCBuffer));
@@ -4460,6 +4466,8 @@ void D3D11DebugManager::RenderMesh(uint32_t frameID, const vector<uint32_t> &eve
{
DebugVertexCBuffer vertexData;
vertexData.LineStrip = 0;
D3D11PipelineState pipeState = m_WrappedDevice->GetReplay()->GetD3D11PipelineState();
D3D11RenderState *curRS = m_WrappedDevice->GetImmediateContext()->GetCurrentPipelineState();