From f44c7d6f1fd40f9424eaaece79fd9bb6f7745cdc Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 5 Jul 2018 12:22:51 -0700 Subject: Updated broken shader & comput shader tests --- DiligentCore | 2 +- README.md | 3 +++ Tests/TestApp/assets/TestComputeShaders.lua | 11 +++++++++-- Tests/TestApp/src/TestBrokenShader.cpp | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/DiligentCore b/DiligentCore index c9dda7e..a5f7f78 160000 --- a/DiligentCore +++ b/DiligentCore @@ -1 +1 @@ -Subproject commit c9dda7eea9152a6636faa653169f29114bf47ad6 +Subproject commit a5f7f7836865e02c265704b6b4abf7ab1916962d diff --git a/README.md b/README.md index 83f29d2..b777894 100644 --- a/README.md +++ b/README.md @@ -421,6 +421,9 @@ and adds implementation using Diligent Engine API to allow comparing performance with `PRIMITIVE_TOPOLOGY GraphicsPipelineDesc::PrimitiveTopology`; removed `DrawAttribs::Topology` * Removed `pStrides` prarameter from `IDeviceContext::SetVertexBuffers()`. Strides are now defined through vertex layout. +* API Changes: + * Math library functions `SetNearFarClipPlanes()`, `GetNearFarPlaneFromProjMatrix()`, `Projection()`, + `OrthoOffCenter()`, and `Ortho()` take `bIsGL` flag instead of `bIsDirectX` * Samples: * Added fullscreen mode selection dialog box * Implemented fullscreen mode toggle on UWP with shift + enter diff --git a/Tests/TestApp/assets/TestComputeShaders.lua b/Tests/TestApp/assets/TestComputeShaders.lua index ba9fb38..69689f3 100644 --- a/Tests/TestApp/assets/TestComputeShaders.lua +++ b/Tests/TestApp/assets/TestComputeShaders.lua @@ -29,6 +29,7 @@ TestTexture:GetDefaultView("TEXTURE_VIEW_SHADER_RESOURCE"):SetSampler(LinearSamp PositionsBuffer = Buffer.Create( { + Name = "Position buffer", Usage = "USAGE_DEFAULT", BindFlags = {"BIND_VERTEX_BUFFER", "BIND_UNORDERED_ACCESS"}, Mode = "BUFFER_MODE_FORMATTED", @@ -39,6 +40,7 @@ PositionsBuffer = Buffer.Create( TexcoordBuffer = Buffer.Create( { + Name = "Texcoord buffer", Usage = "USAGE_DEFAULT", BindFlags = {"BIND_VERTEX_BUFFER", "BIND_UNORDERED_ACCESS"}, Mode = "BUFFER_MODE_FORMATTED", @@ -49,6 +51,7 @@ TexcoordBuffer = Buffer.Create( OffsetsBuffer = Buffer.Create( { + Name = "Offsets buffer", Usage = "USAGE_DEFAULT", BindFlags = {"BIND_UNORDERED_ACCESS", "BIND_SHADER_RESOURCE"}, --uiSizeInBytes = 64, @@ -61,6 +64,7 @@ OffsetsBuffer = Buffer.Create( IndexBuffer = Buffer.Create( { + Name = "Index buffer", Usage = "USAGE_DEFAULT", BindFlags = {"BIND_INDEX_BUFFER", "BIND_UNORDERED_ACCESS"}, Mode = "BUFFER_MODE_FORMATTED", @@ -72,6 +76,7 @@ IndexBuffer = Buffer.Create( IndirectDrawArgsBuffer = Buffer.Create( { + Name = "Indirect Draw Args Buffer", Usage = "USAGE_DEFAULT", BindFlags = {"BIND_INDIRECT_DRAW_ARGS", "BIND_UNORDERED_ACCESS"}, Format = {ValueType = "VT_UINT32", NumComponents = 4, IsNormalized = false}, @@ -82,6 +87,7 @@ IndirectDrawArgsBuffer = Buffer.Create( IndirectDispatchArgsBuffer = Buffer.Create( { + Name = "Indirect Dispatch Args Buffer", Usage = "USAGE_DEFAULT", BindFlags = {"BIND_INDIRECT_DRAW_ARGS", "BIND_UNORDERED_ACCESS"}, Format = {ValueType = "VT_UINT32", NumComponents = 4, IsNormalized = false}, @@ -90,7 +96,7 @@ IndirectDispatchArgsBuffer = Buffer.Create( } ) -if Constants.DeviceType == "D3D11" or Constants.DeviceType == "D3D12" then +if Constants.DeviceType == "D3D11" or Constants.DeviceType == "D3D12" or Constants.DeviceType == "Vulkan" then TexcoordDataOffset = 0 -- Non-zero byte offset is only supported for structured buffers in DirectX else TexcoordDataOffset = 2*4*4 @@ -117,7 +123,7 @@ function GetShaderPath( ShaderName, ShaderExt, GLESSpecial ) local ProcessedShaderPath = "" if Constants.DeviceType == "D3D11" or Constants.DeviceType == "D3D12" then ProcessedShaderPath = "Shaders\\" .. ShaderName .. "DX." .. ShaderExt - elseif Constants.DeviceType == "OpenGL" or not GLESSpecial then + elseif Constants.DeviceType == "OpenGL" or Constants.DeviceType == "Vulkan" or not GLESSpecial then ProcessedShaderPath = "Shaders\\" .. ShaderName .. "GL." .. ShaderExt else ProcessedShaderPath = "Shaders\\" .. ShaderName .. "GLES." .. ShaderExt @@ -239,6 +245,7 @@ RenderPSO = PipelineState.Create { InputIndex = 1, BufferSlot = 1, NumComponents = 2, ValueType = "VT_FLOAT32", IsNormalized = false, Stride = 4*4} }, RTVFormats = {extBackBufferFormat}, + DSVFormat = extDepthBufferFormat, PrimitiveTopology = "PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP" } } diff --git a/Tests/TestApp/src/TestBrokenShader.cpp b/Tests/TestApp/src/TestBrokenShader.cpp index 7282828..3ec798c 100644 --- a/Tests/TestApp/src/TestBrokenShader.cpp +++ b/Tests/TestApp/src/TestBrokenShader.cpp @@ -49,13 +49,14 @@ TestBrokenShader::TestBrokenShader(IRenderDevice *pDevice) : RefCntAutoPtr pBrokenShader; IDataBlob *pErrors = nullptr; Attrs.ppCompilerOutput = &pErrors; - LOG_INFO_MESSAGE("No worries, testing broken shader..."); + LOG_INFO_MESSAGE("\n\nNo worries, testing broken shader..."); pDevice->CreateShader(Attrs, &pBrokenShader); VERIFY_EXPR(!pBrokenShader); VERIFY_EXPR(pErrors != nullptr); const char* Msg = reinterpret_cast(pErrors->GetDataPtr()); LOG_INFO_MESSAGE("Compiler output:\n", Msg); pErrors->Release(); + LOG_INFO_MESSAGE("No worries, errors above are result of the broken shader test.\n"); SetStatus(TestResult::Succeeded); } -- cgit v1.2.3