Remove backbuffer comparisons from test suite, simplify default triangle
* It's not particularly scalable and can be brittle to driver changes, and we can use targeted specific pixel tests to check what we really want - to see if the output has rendered correctly. * Overlay tests still check files directly - this is a future refactor to remove.
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
@@ -56,7 +56,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
Vec4f col(0.4f, 0.5f, 0.6f, 1.0f);
|
||||
Vec4f col(0.2f, 0.2f, 0.2f, 1.0f);
|
||||
ClearRenderTargetView(bbRTV, col);
|
||||
|
||||
ctx->ClearUnorderedAccessViewUint(uav, (uint32_t *)&col.x);
|
||||
|
||||
@@ -93,7 +93,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -65,7 +65,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
Vec4f col(0.4f, 0.5f, 0.6f, 1.0f);
|
||||
Vec4f col(0.2f, 0.2f, 0.2f, 1.0f);
|
||||
ClearRenderTargetView(bbRTV, col);
|
||||
|
||||
ctx->ClearUnorderedAccessViewUint(uav, (uint32_t *)&col.x);
|
||||
|
||||
@@ -291,7 +291,7 @@ float4 main() : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -184,7 +184,7 @@ RD_TEST(D3D11_Counter_Query_Pred, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -87,7 +87,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
Vec4f *data = NULL;
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -163,7 +163,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -143,7 +143,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -233,7 +233,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->CSSetShader(cs, NULL, 0);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ RD_TEST(D3D11_Empty_Drawcall, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -47,7 +47,7 @@ RD_TEST(D3D11_Empty_Viewports, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -73,7 +73,7 @@ float4 main() : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -142,7 +142,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->ClearDepthStencilView(bbDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -115,9 +115,9 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
for(int i = 0; i < NumMips; i++)
|
||||
ClearRenderTargetView(rtv[i], {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(rtv[i], {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->UpdateSubresource(rt, 0, NULL, ramp, 1024 * sizeof(uint32_t),
|
||||
1024 * 1024 * sizeof(uint32_t));
|
||||
|
||||
@@ -71,9 +71,9 @@ float4 main() : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
for(int i = 0; i < 4; i++)
|
||||
ClearRenderTargetView(rtv[i], {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(rtv[i], {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ RD_TEST(D3D11_Overdraw_Stress, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->ClearDepthStencilView(bbDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ RD_TEST(D3D11_Overlay_Test, D3D11GraphicsTest)
|
||||
|
||||
ctx->OMSetRenderTargets(1, &bbRTV.GetInterfacePtr(), dsv);
|
||||
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ctx->ClearDepthStencilView(dsv, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
|
||||
|
||||
// draw the setup triangles
|
||||
|
||||
@@ -44,23 +44,23 @@ RD_TEST(D3D11_Primitive_Restart, D3D11GraphicsTest)
|
||||
ID3D11PixelShaderPtr ps = CreatePS(psblob);
|
||||
|
||||
DefaultA2V strip[] = {
|
||||
{Vec3f(-0.8f, 0.2f, 0.0f), Vec4f(1.0f, 0.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.8f, 0.2f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.8f, 0.7f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, 0.2f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, 0.7f, 0.0f), Vec4f(1.0f, 0.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, 0.2f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, 0.7f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, 0.2f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, 0.7f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, 0.2f, 0.0f), Vec4f(1.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, 0.7f, 0.0f), Vec4f(1.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, 0.7f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, 0.2f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, 0.7f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
|
||||
{Vec3f(-0.8f, -0.7f, 0.0f), Vec4f(1.0f, 0.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.8f, -0.2f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.8f, -0.7f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.8f, -0.2f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, -0.7f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, -0.2f, 0.0f), Vec4f(1.0f, 0.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, -0.7f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.4f, -0.2f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, -0.7f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, -0.2f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, -0.7f, 0.0f), Vec4f(1.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, -0.2f, 0.0f), Vec4f(1.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, -0.7f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.4f, -0.2f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
};
|
||||
|
||||
ID3D11BufferPtr vb = MakeBuffer().Vertex().Data(strip);
|
||||
@@ -93,7 +93,7 @@ RD_TEST(D3D11_Primitive_Restart, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetIndexBuffer(ib, DXGI_FORMAT_R16_UINT, 0);
|
||||
@@ -109,7 +109,7 @@ RD_TEST(D3D11_Primitive_Restart, D3D11GraphicsTest)
|
||||
|
||||
ctx->DrawIndexed(17, 0, 0);
|
||||
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->IASetIndexBuffer(ib2, DXGI_FORMAT_R16_UINT, 0);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ RD_TEST(D3D11_Refcount_Check, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -42,7 +42,8 @@ struct v2f
|
||||
|
||||
Texture2D smiley : register(t0);
|
||||
Texture2D checker : register(t1);
|
||||
SamplerState samp : register(s0);
|
||||
SamplerState smileysamp : register(s0);
|
||||
SamplerState checkersamp : register(s1);
|
||||
|
||||
cbuffer consts : register(b0)
|
||||
{
|
||||
@@ -54,7 +55,9 @@ float4 main(v2f IN) : SV_Target0
|
||||
if(flags.x != 1.0f || flags.y != 2.0f || flags.z != 4.0f || flags.w != 8.0f)
|
||||
return float4(1.0f, 0.0f, 1.0f, 1.0f);
|
||||
|
||||
return smiley.Sample(samp, IN.uv * 2.0f) * checker.Sample(samp, IN.uv * 5.0f);
|
||||
float4 col = smiley.Sample(smileysamp, IN.uv * 2.0f) * checker.Sample(checkersamp, IN.uv * 5.0f);
|
||||
col.w = 1.0f;
|
||||
return col;
|
||||
}
|
||||
|
||||
)EOSHADER";
|
||||
@@ -84,7 +87,13 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
ctx->UpdateSubresource(smiley, 0, NULL, rgba8.data.data(), rgba8.width * sizeof(uint32_t), 0);
|
||||
|
||||
ID3D11SamplerStatePtr samp = MakeSampler().Address(D3D11_TEXTURE_ADDRESS_WRAP);
|
||||
ID3D11SamplerStatePtr smileysamp = MakeSampler()
|
||||
.AddressU(D3D11_TEXTURE_ADDRESS_CLAMP)
|
||||
.AddressV(D3D11_TEXTURE_ADDRESS_WRAP)
|
||||
.AddressW(D3D11_TEXTURE_ADDRESS_WRAP)
|
||||
.Filter(D3D11_FILTER_MIN_MAG_MIP_POINT);
|
||||
ID3D11SamplerStatePtr checkersamp =
|
||||
MakeSampler().Address(D3D11_TEXTURE_ADDRESS_WRAP).Filter(D3D11_FILTER_MIN_MAG_MIP_POINT);
|
||||
|
||||
auto SetupBuf = [this]() {
|
||||
const Vec4f flags = {1.0f, 2.0f, 4.0f, 8.0f};
|
||||
@@ -155,16 +164,20 @@ float4 main(v2f IN) : SV_Target0
|
||||
srv = NULL;
|
||||
};
|
||||
|
||||
ID3D11ShaderResourceView *srvs[2] = {smileysrv};
|
||||
ID3D11Texture2DPtr clearTex = MakeTexture(DXGI_FORMAT_R8G8B8A8_UNORM, 128, 128).RTV();
|
||||
ID3D11RenderTargetViewPtr clearRTV = MakeRTV(clearTex);
|
||||
|
||||
ctx->PSSetSamplers(0, 1, &samp.GetInterfacePtr());
|
||||
ID3D11ShaderResourceView *srvs[2] = {smileysrv};
|
||||
ID3D11SamplerState *samps[2] = {smileysamp, checkersamp};
|
||||
|
||||
ctx->PSSetSamplers(0, 2, samps);
|
||||
|
||||
ID3D11BufferPtr cb = SetupBuf();
|
||||
ID3D11ShaderResourceViewPtr srv = SetupSRV();
|
||||
srvs[1] = srv;
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
@@ -174,6 +187,12 @@ float4 main(v2f IN) : SV_Target0
|
||||
ctx->PSSetShader(ps, NULL, 0);
|
||||
ctx->OMSetRenderTargets(1, &bbRTV.GetInterfacePtr(), NULL);
|
||||
|
||||
// lazy partial clears!
|
||||
ClearRenderTargetView(clearRTV, {0.0f, 1.0f, 0.0f, 1.0f});
|
||||
ctx->CopySubresourceRegion(bbTex, 0, 0, 0, 0, clearTex, 0, NULL);
|
||||
ClearRenderTargetView(clearRTV, {0.0f, 0.0f, 1.0f, 1.0f});
|
||||
ctx->CopySubresourceRegion(bbTex, 0, 128, 0, 0, clearTex, 0, NULL);
|
||||
|
||||
// render with last frame's resources
|
||||
RSSetViewport({0.0f, 0.0f, 128.0f, 128.0f, 0.0f, 1.0f});
|
||||
ctx->Draw(3, 0);
|
||||
|
||||
@@ -79,9 +79,9 @@ void main(float4 pos : SV_Position, out float4 a : SV_Target0, out float4 b : SV
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(fltRT[0], {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT[1], {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT[0], {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(fltRT[1], {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -657,8 +657,8 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(fltRT, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(ConstsA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -78,8 +78,8 @@ float4 main() : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -52,8 +52,8 @@ RD_TEST(D3D11_Shader_ISA, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -76,7 +76,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
ctx->ClearRenderTargetView(bbRTV, col);
|
||||
|
||||
ctx->CSSetShader(cs, NULL, 0);
|
||||
|
||||
@@ -52,8 +52,8 @@ RD_TEST(D3D11_Simple_Triangle, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -101,7 +101,7 @@ RD_TEST(D3D11_Stream_Out, D3D11GraphicsTest)
|
||||
ctx->UpdateSubresource(so[0], 0, NULL, empty, 2048, 2048);
|
||||
ctx->UpdateSubresource(so[1], 0, NULL, empty, 2048, 2048);
|
||||
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
@@ -124,14 +124,14 @@ RD_TEST(D3D11_Stream_Out, D3D11GraphicsTest)
|
||||
ctx->UpdateSubresource(so[0], 0, NULL, empty, 2048, 2048);
|
||||
ctx->UpdateSubresource(so[1], 0, NULL, empty, 2048, 2048);
|
||||
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->Draw(3, 0);
|
||||
|
||||
ctx->UpdateSubresource(so[0], 0, NULL, empty, 2048, 2048);
|
||||
ctx->UpdateSubresource(so[1], 0, NULL, empty, 2048, 2048);
|
||||
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
// test using offsets of NULL. Should be equivalent to passing -1
|
||||
bufs[0] = so[1];
|
||||
|
||||
@@ -57,7 +57,7 @@ RD_TEST(D3D11_Stripped_Shaders, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -93,7 +93,7 @@ float4 main() : SV_Target0
|
||||
{
|
||||
ctx->Flush();
|
||||
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
// map the buffer, but only update a misaligned section - so the update won't be aligned to
|
||||
// structured size.
|
||||
|
||||
@@ -107,7 +107,7 @@ float4 main() : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -79,7 +79,7 @@ float4 main() : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -241,7 +241,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -1029,7 +1029,7 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0
|
||||
while(Running())
|
||||
{
|
||||
ctx->ClearState();
|
||||
ClearRenderTargetView(fltRT, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(fltRT, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ RD_TEST(D3D11_Untyped_Backbuffer_Descriptor, D3D11GraphicsTest)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -206,7 +206,7 @@ void main(triangle v2f input[3], inout TriangleStream<v2f> TriStream)
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(vertin), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -755,7 +755,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
while(Running())
|
||||
{
|
||||
ClearRenderTargetView(bbRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(bbRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(vb, sizeof(DefaultA2V), 0);
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
@@ -355,11 +355,11 @@ float4 main() : SV_Target0
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE bbrtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, bbrtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, bbrtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE offrtv = MakeRTV(rtvtex).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, offrtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, offrtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
OMSetRenderTargets(cmd, {rtv}, MakeDSV(dsv).CreateCPU(0));
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearDepthStencilView(cmd, dsv, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 1.0f, 0);
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -161,7 +161,7 @@ RD_TEST(D3D12_Overlay_Test, D3D12GraphicsTest)
|
||||
|
||||
OMSetRenderTargets(cmd, {rtv}, MakeDSV(dsv).CreateCPU(0));
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearDepthStencilView(cmd, dsv, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 1.0f, 0);
|
||||
|
||||
cmd->OMSetStencilRef(0x55);
|
||||
|
||||
@@ -42,7 +42,8 @@ struct v2f
|
||||
|
||||
Texture2D smiley : register(t0);
|
||||
Texture2D checker : register(t1);
|
||||
SamplerState samp : register(s0);
|
||||
SamplerState smileysamp : register(s0);
|
||||
SamplerState checkersamp : register(s1);
|
||||
|
||||
cbuffer consts : register(b0)
|
||||
{
|
||||
@@ -54,7 +55,9 @@ float4 main(v2f IN) : SV_Target0
|
||||
if(flags.x != 1.0f || flags.y != 2.0f || flags.z != 4.0f || flags.w != 8.0f)
|
||||
return float4(1.0f, 0.0f, 1.0f, 1.0f);
|
||||
|
||||
return smiley.Sample(samp, IN.uv * 2.0f) * checker.Sample(samp, IN.uv * 5.0f);
|
||||
float4 col = smiley.Sample(smileysamp, IN.uv * 2.0f) * checker.Sample(checkersamp, IN.uv * 5.0f);
|
||||
col.w = 1.0f;
|
||||
return col;
|
||||
}
|
||||
|
||||
)EOSHADER";
|
||||
@@ -71,8 +74,8 @@ float4 main(v2f IN) : SV_Target0
|
||||
ID3D12ResourcePtr vb = MakeBuffer().Data(DefaultTri);
|
||||
|
||||
D3D12_STATIC_SAMPLER_DESC samp = {
|
||||
D3D12_FILTER_MIN_MAG_MIP_LINEAR,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_WRAP,
|
||||
D3D12_FILTER_MIN_MAG_MIP_POINT,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_CLAMP,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_WRAP,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_WRAP,
|
||||
0.0f,
|
||||
@@ -86,13 +89,18 @@ float4 main(v2f IN) : SV_Target0
|
||||
D3D12_SHADER_VISIBILITY_PIXEL,
|
||||
};
|
||||
|
||||
D3D12_STATIC_SAMPLER_DESC samps[2];
|
||||
samps[0] = samps[1] = samp;
|
||||
samps[1].ShaderRegister = 1;
|
||||
samps[1].AddressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP;
|
||||
|
||||
ID3D12RootSignaturePtr sig = MakeSig(
|
||||
{
|
||||
tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 0, 0, 1, 0),
|
||||
tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 0, 1, 1, 1),
|
||||
tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 0, 0, 1, 2),
|
||||
},
|
||||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT, 1, &samp);
|
||||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT, 2, samps);
|
||||
|
||||
ID3D12PipelineStatePtr pso = MakePSO().RootSig(sig).InputLayout().VS(vsblob).PS(psblob);
|
||||
|
||||
@@ -420,7 +428,15 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
rtv = MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
D3D12_RECT rect = {0, 0, 128, 128};
|
||||
Vec4f col(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
cmd->ClearRenderTargetView(rtv, &col.x, 1, &rect);
|
||||
|
||||
rect = {128, 0, 256, 128};
|
||||
col = Vec4f(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
cmd->ClearRenderTargetView(rtv, &col.x, 1, &rect);
|
||||
|
||||
cmd->Close();
|
||||
|
||||
|
||||
@@ -716,7 +716,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(1);
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ID3D12PipelineStatePtr psos[2] = {pso_5_0, pso_5_1};
|
||||
float blitOffsets[2] = {0.0f, 4.0f};
|
||||
@@ -726,7 +726,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
// Clear, draw, and blit to backbuffer twice - once for SM 5.0 and again for SM 5.1
|
||||
for(int i = 0; i < 2; ++i)
|
||||
{
|
||||
ClearRenderTargetView(cmd, fltRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, fltRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
IASetVertexBuffer(cmd, vb, sizeof(ConstsA2V), 0);
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
@@ -93,8 +93,8 @@ float4 main() : SV_Target0
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE offrtv = MakeRTV(rtvtex).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, offrtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, bbrtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, offrtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
ClearRenderTargetView(cmd, bbrtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ RD_TEST(D3D12_Shader_ISA, D3D12GraphicsTest)
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ClearRenderTargetView(cmd, MakeRTV(rtvtex).CreateCPU(1), {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, MakeRTV(rtvtex).CreateCPU(1), {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ RD_TEST(D3D12_Simple_Triangle, D3D12GraphicsTest)
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
ClearRenderTargetView(cmd, MakeRTV(rtvtex).CreateCPU(1), {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, MakeRTV(rtvtex).CreateCPU(1), {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -260,6 +260,9 @@ bool D3D12GraphicsTest::Init()
|
||||
bbDesc.SampleDesc.Quality = 0;
|
||||
bbDesc.Width = screenWidth;
|
||||
|
||||
if(bbDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM)
|
||||
bbDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
|
||||
|
||||
D3D12_HEAP_PROPERTIES heapProps;
|
||||
heapProps.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
heapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
|
||||
|
||||
@@ -1127,7 +1127,7 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE fltRTV = MakeRTV(fltTex).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, fltRTV, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, fltRTV, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
@@ -1195,7 +1195,7 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
OMSetRenderTargets(cmd, {rtv}, {});
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ RD_TEST(D3D12_Untyped_Backbuffer_Descriptor, D3D12GraphicsTest)
|
||||
// create a descriptor with an UNKNOWN format
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv = MakeRTV(bb).Format(DXGI_FORMAT_UNKNOWN).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ void main(triangle v2f input[3], inout TriangleStream<v2f> TriStream)
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
||||
|
||||
@@ -648,7 +648,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
|
||||
OMSetRenderTargets(cmd, {rtv}, {});
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ float4 main(v2f IN) : SV_Target0
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
|
||||
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
|
||||
|
||||
ClearRenderTargetView(cmd, rtv, {0.4f, 0.5f, 0.6f, 1.0f});
|
||||
ClearRenderTargetView(cmd, rtv, {0.2f, 0.2f, 0.2f, 1.0f});
|
||||
|
||||
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -278,7 +278,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -105,7 +105,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -383,7 +383,7 @@ void main()
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
|
||||
@@ -162,7 +162,7 @@ void main()
|
||||
GLenum bufs[] = {GL_COLOR_ATTACHMENT0};
|
||||
glDrawBuffers(1, bufs);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0);
|
||||
|
||||
|
||||
@@ -157,8 +157,8 @@ void main()
|
||||
ID3D11ShaderResourceViewPtr srv = d3d.MakeSRV(d3d_tod3d);
|
||||
ID3D11RenderTargetViewPtr rtv2 = d3d.MakeRTV(d3d_tod3d);
|
||||
|
||||
float black[4] = {};
|
||||
d3d.ctx->ClearRenderTargetView(rtv2, black);
|
||||
float base[4] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
d3d.ctx->ClearRenderTargetView(rtv2, base);
|
||||
|
||||
// initialise, create window, create context, etc
|
||||
if(!Init())
|
||||
@@ -244,7 +244,7 @@ void main()
|
||||
|
||||
TEST_ASSERT(res, "wglDXLockObjectsNV buffer failed");
|
||||
|
||||
float col2[] = {0.6f, 0.4f, 0.6f, 1.0f};
|
||||
float col2[] = {0.0f, 1.0f, 0.0f, 1.0f};
|
||||
ctx->ClearRenderTargetView(rtv, col2);
|
||||
|
||||
ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
@@ -273,13 +273,11 @@ void main()
|
||||
|
||||
glUseProgram(program);
|
||||
|
||||
glUniform2f(glGetUniformLocation(program, "wave"), sinf(delta * 0.9f), -cosf(delta * 2.7f));
|
||||
|
||||
delta += 0.1f;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl_fromd3d);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {1.0f, 0.0f, 0.0f, 1.0f};
|
||||
|
||||
// render back into d3d
|
||||
glViewport(0, 0, 1024, 1024);
|
||||
|
||||
@@ -79,7 +79,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -166,7 +166,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -104,7 +104,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -211,7 +211,7 @@ void main()
|
||||
while(Running())
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0);
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glUseProgram(program);
|
||||
|
||||
@@ -109,7 +109,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void main()
|
||||
{
|
||||
ActivateContext(mainWindow, mainContext);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -192,7 +192,7 @@ void main()
|
||||
glViewport(10, 10, GLsizei(screenWidth) - 20, GLsizei(screenHeight) - 20);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0);
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -378,15 +378,16 @@ void main()
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearNamedFramebufferfv(0, GL_COLOR, 0, col);
|
||||
|
||||
// render with last frame's resources
|
||||
float col1[] = {0.5f, 0.1f, 0.1f, 1.0f};
|
||||
float col1[] = {0.0f, 1.0f, 0.0f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col1);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, NULL);
|
||||
glBlitNamedFramebuffer(fbo, 0, 0, 0, 128, 128, 0, 0, 128, 128, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
glBlitNamedFramebuffer(fbo, 0, 0, 0, 128, 128, 0, screenHeight - 128, 128, screenHeight,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
|
||||
// trash last frame's resources
|
||||
TrashFBO(fbo);
|
||||
@@ -407,12 +408,12 @@ void main()
|
||||
pipe = SetupPipe(vsprog, fsprog);
|
||||
tex = SetupTex();
|
||||
buf = SetupBuf();
|
||||
float col2[] = {0.1f, 0.1f, 0.5f, 1.0f};
|
||||
float col2[] = {0.0f, 0.0f, 1.0f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col2);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, NULL);
|
||||
glBlitNamedFramebuffer(fbo, 0, 0, 0, 128, 128, 128, 0, 256, 128, GL_COLOR_BUFFER_BIT,
|
||||
GL_NEAREST);
|
||||
glBlitNamedFramebuffer(fbo, 0, 0, 0, 128, 128, 128, screenHeight - 128, 256, screenHeight,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
TrashFBO(fbo);
|
||||
TrashVAO(vao);
|
||||
TrashSampler(sampler);
|
||||
|
||||
@@ -114,7 +114,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -184,7 +184,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -177,7 +177,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -105,7 +105,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glClearTexImage(tex, 0, GL_RGBA, GL_FLOAT, col);
|
||||
|
||||
@@ -105,7 +105,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glClearTexImage(tex, 0, GL_RGBA, GL_FLOAT, col);
|
||||
|
||||
@@ -224,7 +224,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
GLsizei w = GLsizei(screenWidth) >> 1;
|
||||
|
||||
@@ -188,7 +188,7 @@ void main()
|
||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, outbuf);
|
||||
glClearBufferSubData(GL_SHADER_STORAGE_BUFFER, GL_RGBA32F, 0, 1024, GL_RGBA, GL_FLOAT, zeros);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -967,7 +967,7 @@ void main()
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -133,7 +133,7 @@ void main()
|
||||
GLenum bufs[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1};
|
||||
glDrawBuffers(2, bufs);
|
||||
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
// try to delete VAO 0. Should do nothing
|
||||
|
||||
@@ -244,7 +244,7 @@ void main()
|
||||
|
||||
while(Running())
|
||||
{
|
||||
float col[] = {0.4f, 0.5f, 0.6f, 1.0f};
|
||||
float col[] = {0.2f, 0.2f, 0.2f, 1.0f};
|
||||
glClearBufferfv(GL_COLOR, 0, col);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
#include <algorithm>
|
||||
|
||||
const DefaultA2V DefaultTri[3] = {
|
||||
{Vec3f(-0.5f, -0.5f, 0.0f), Vec4f(1.0f, 0.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(-0.5f, -0.5f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 0.0f)},
|
||||
{Vec3f(0.0f, 0.5f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(0.0f, 1.0f)},
|
||||
{Vec3f(0.5f, -0.5f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(1.0f, 0.0f)},
|
||||
{Vec3f(0.5f, -0.5f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(1.0f, 0.0f)},
|
||||
};
|
||||
|
||||
/* XPM */
|
||||
|
||||
@@ -373,7 +373,7 @@ void main()
|
||||
StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL);
|
||||
|
||||
vkCmdClearColorImage(cmd, swapimg, VK_IMAGE_LAYOUT_GENERAL,
|
||||
vkh::ClearColorValue(0.4f, 0.5f, 0.6f, 1.0f), 1,
|
||||
vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1,
|
||||
vkh::ImageSubresourceRange());
|
||||
|
||||
vkCmdBeginRenderPass(
|
||||
|
||||