11-18-2015 01:37 PM
02-19-2016 11:49 PM
02-20-2016 01:05 PM
"cybereality" wrote:
Wow!
02-23-2016 08:56 AM
02-23-2016 11:25 AM
02-23-2016 01:57 PM
"cybereality" wrote:
That's amazing!
How is framerate and on what machine?
This gives me some ideas. Maybe I will revive my engine project and update to DX12.
02-23-2016 07:47 PM
ID3D12Device::SetStablePowerState
ID3D12CommandQueue::GetTimestampFrequency
ID3D12CommandQueue::GetClockCalibration
ID3D12Device::CreateQueryHeap
ID3D12GraphicsCommandList::EndQuery
ID3D12GraphicsCommandList::ResolveQueryData
#define MyRS1 \
"RootFlags( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | DENY_PIXEL_SHADER_ROOT_ACCESS ), " \
"RootConstants(num32BitConstants=7, b0, visibility=SHADER_VISIBILITY_VERTEX)," \
"SRV(t0)" \
""
struct VSPS {
float4 pos : SV_Position;
float4 color : COLOR;
float ms : MS;
uint isMain : MAIN;
};
struct RootConstants
{
float rtWidth;
float rtHeight;
float barHeight;
uint first;
uint last;
uint freq;
float fpsWidth;
};
ConstantBuffer<RootConstants> root : register(b0);
struct Stamp {
uint high;
uint low;
};
StructuredBuffer<Stamp> stamps : register(t0);
struct IA {
uint3 location : BARPOS;
float4 color : BARCOLOR;
uint subVert : SV_VertexID;
uint instId : SV_InstanceID;
};
uint DiffStamp(uint end, uint beg) {
Stamp a = stamps[beg];
Stamp b = stamps[end];
if(a.low==b.low)
return b.high - a.high;
else
return uint(0xffffffff) - a.high + b.high + 1u;
}
[RootSignature(MyRS1)]
void main(IA input, out VSPS output) {
uint frameLen = DiffStamp(root.last,root.first);
float width;
if ( root.fpsWidth > 0.f)
width = root.rtWidth/ (float(root.freq) / root.fpsWidth);
else
width = root.rtWidth / float(frameLen);
float height = root.barHeight;
float startx = float(DiffStamp(input.location.x,root.first));
float endx = float(DiffStamp(input.location.y,root.first));
float starty = (height + 2) * float(input.location.z + 1);
float endy = starty + height;
float y = (input.subVert & 1) ? endy : starty;
float x = input.subVert < 2 ? startx : endx;
output.ms = x * 1000.f / float(root.freq);
output.isMain = input.location.z == 0;
x *= width;
float2 pos = float2(x, y);
pos /= float2(root.rtWidth, root.rtHeight);
pos.y = 1 - pos.y;
pos *= 2;
pos -= 1;
output.pos = float4(pos, 0, 1);
output.color = input.color;
}
[RootSignature(MyRS1)]
float4 main(in VSPS input) : SV_TARGET {
float l = 1.f;
if (input.isMain && (int(trunc(input.ms))&1))
l = 0.2f;
return float4(input.color.rgb * l, input.color.a);
}
02-24-2016 02:37 AM
02-24-2016 08:50 AM
02-25-2016 12:40 AM
"cybereality" wrote:
That's amazing!
Maybe I will revive my engine project and update to DX12.
02-25-2016 12:43 AM