mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 14:28:40 +00:00
default to no d3d11 debug features; use command line flag to enable
This commit is contained in:
@@ -143,7 +143,7 @@ r_init(CmdLine *cmdln)
|
|||||||
//- rjf: create base device
|
//- rjf: create base device
|
||||||
UINT creation_flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
|
UINT creation_flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
|
||||||
#if !defined(NDEBUG)
|
#if !defined(NDEBUG)
|
||||||
if(!cmd_line_has_flag(cmdln, str8_lit("disable_d3d11_debug")))
|
if(cmd_line_has_flag(cmdln, str8_lit("d3d11_debug")))
|
||||||
{
|
{
|
||||||
creation_flags |= D3D11_CREATE_DEVICE_DEBUG;
|
creation_flags |= D3D11_CREATE_DEVICE_DEBUG;
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ r_init(CmdLine *cmdln)
|
|||||||
|
|
||||||
//- rjf: enable break-on-error
|
//- rjf: enable break-on-error
|
||||||
#if !defined(NDEBUG)
|
#if !defined(NDEBUG)
|
||||||
if(!cmd_line_has_flag(cmdln, str8_lit("disable_d3d11_debug")))
|
if(cmd_line_has_flag(cmdln, str8_lit("d3d11_debug")))
|
||||||
{
|
{
|
||||||
ID3D11InfoQueue *info = 0;
|
ID3D11InfoQueue *info = 0;
|
||||||
error = r_d3d11_state->base_device->QueryInterface(__uuidof(ID3D11InfoQueue), (void **)(&info));
|
error = r_d3d11_state->base_device->QueryInterface(__uuidof(ID3D11InfoQueue), (void **)(&info));
|
||||||
@@ -1219,12 +1219,12 @@ r_window_submit(OS_Handle window, R_Handle window_equip, R_PassList *passes)
|
|||||||
|
|
||||||
// rjf: setup scissor rect
|
// rjf: setup scissor rect
|
||||||
{
|
{
|
||||||
D3D11_RECT rect = { 0 };
|
D3D11_RECT rect = { 0 };
|
||||||
rect.left = 0;
|
rect.left = 0;
|
||||||
rect.right = (LONG)wnd->last_resolution.x;
|
rect.right = (LONG)wnd->last_resolution.x;
|
||||||
rect.top = 0;
|
rect.top = 0;
|
||||||
rect.bottom = (LONG)wnd->last_resolution.y;
|
rect.bottom = (LONG)wnd->last_resolution.y;
|
||||||
d_ctx->RSSetScissorRects(1, &rect);
|
d_ctx->RSSetScissorRects(1, &rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rjf: set up uniforms
|
// rjf: set up uniforms
|
||||||
@@ -1262,15 +1262,15 @@ r_window_submit(OS_Handle window, R_Handle window_equip, R_PassList *passes)
|
|||||||
// thus w=w0+w1 and t=w1/w
|
// thus w=w0+w1 and t=w1/w
|
||||||
for (U64 idx = 1; idx < blur_count; idx += 2)
|
for (U64 idx = 1; idx < blur_count; idx += 2)
|
||||||
{
|
{
|
||||||
F32 w0 = weights[idx + 0];
|
F32 w0 = weights[idx + 0];
|
||||||
F32 w1 = weights[idx + 1];
|
F32 w1 = weights[idx + 1];
|
||||||
F32 w = w0 + w1;
|
F32 w = w0 + w1;
|
||||||
F32 t = w1 / w;
|
F32 t = w1 / w;
|
||||||
|
|
||||||
// each kernel element is float2(weight, offset)
|
// each kernel element is float2(weight, offset)
|
||||||
// weights & offsets are adjusted for bilinear sampling
|
// weights & offsets are adjusted for bilinear sampling
|
||||||
// zw elements are not used, a bit of waste but it allows for simpler shader code
|
// zw elements are not used, a bit of waste but it allows for simpler shader code
|
||||||
uniforms.kernel[(idx+1)/2] = v4f32(w, (F32)idx + t, 0, 0);
|
uniforms.kernel[(idx+1)/2] = v4f32(w, (F32)idx + t, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uniforms.kernel[0].x = weights[0];
|
uniforms.kernel[0].x = weights[0];
|
||||||
@@ -1300,14 +1300,14 @@ r_window_submit(OS_Handle window, R_Handle window_equip, R_PassList *passes)
|
|||||||
|
|
||||||
U32 uniform_offset[Axis2_COUNT][2] =
|
U32 uniform_offset[Axis2_COUNT][2] =
|
||||||
{
|
{
|
||||||
{ 0 * sizeof(R_D3D11_Uniforms_BlurPass) / 16, (U32)OffsetOf(R_D3D11_Uniforms_Blur, kernel) / 16 },
|
{ 0 * sizeof(R_D3D11_Uniforms_BlurPass) / 16, (U32)OffsetOf(R_D3D11_Uniforms_Blur, kernel) / 16 },
|
||||||
{ 1 * sizeof(R_D3D11_Uniforms_BlurPass) / 16, (U32)OffsetOf(R_D3D11_Uniforms_Blur, kernel) / 16 },
|
{ 1 * sizeof(R_D3D11_Uniforms_BlurPass) / 16, (U32)OffsetOf(R_D3D11_Uniforms_Blur, kernel) / 16 },
|
||||||
};
|
};
|
||||||
|
|
||||||
U32 uniform_count[Axis2_COUNT][2] =
|
U32 uniform_count[Axis2_COUNT][2] =
|
||||||
{
|
{
|
||||||
{ sizeof(R_D3D11_Uniforms_BlurPass) / 16, sizeof(uniforms.kernel) / 16 },
|
{ sizeof(R_D3D11_Uniforms_BlurPass) / 16, sizeof(uniforms.kernel) / 16 },
|
||||||
{ sizeof(R_D3D11_Uniforms_BlurPass) / 16, sizeof(uniforms.kernel) / 16 },
|
{ sizeof(R_D3D11_Uniforms_BlurPass) / 16, sizeof(uniforms.kernel) / 16 },
|
||||||
};
|
};
|
||||||
|
|
||||||
// rjf: for unsetting srv
|
// rjf: for unsetting srv
|
||||||
|
|||||||
Reference in New Issue
Block a user