From dd7847d9e2b0729799d3e953f7872719e6ab70c0 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 1 Mar 2019 20:55:44 -0800 Subject: Updated test to compy with the new API --- Tests/TestApp/assets/TestComputeShaders.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Tests/TestApp/assets/TestComputeShaders.lua') diff --git a/Tests/TestApp/assets/TestComputeShaders.lua b/Tests/TestApp/assets/TestComputeShaders.lua index 695c482..d5e12d2 100644 --- a/Tests/TestApp/assets/TestComputeShaders.lua +++ b/Tests/TestApp/assets/TestComputeShaders.lua @@ -170,12 +170,9 @@ FillTextureCS = Shader.Create{ UseCombinedTextureSamplers = true, Desc = { - ShaderType = "SHADER_TYPE_COMPUTE", - VariableDesc = {{Name = "g_tex2DTestUAV", Type = "SHADER_VARIABLE_TYPE_DYNAMIC"}} + ShaderType = "SHADER_TYPE_COMPUTE" } } -assert(FillTextureCS.Desc.VariableDesc[1].Name == "g_tex2DTestUAV"); -assert(FillTextureCS.Desc.VariableDesc[1].Type == "SHADER_VARIABLE_TYPE_DYNAMIC"); UpdateVertBuffCS = Shader.Create{ FilePath = GetShaderPath("CSTest\\UpdateVertBuff", "csh", true), @@ -216,12 +213,20 @@ RenderPS = Shader.Create{ FillTexturePSO = PipelineState.Create { Name = "FillTexturePSO", + ResourceLayout = + { + Variables = {{ShaderStages = "SHADER_TYPE_COMPUTE", Name = "g_tex2DTestUAV", Type = "SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC"}} + }, IsComputePipeline=true, ComputePipeline = { pCS = FillTextureCS } } +assert(FillTexturePSO.ResourceLayout.Variables[1].ShaderStages[1] == "SHADER_TYPE_COMPUTE"); +assert(FillTexturePSO.ResourceLayout.Variables[1].Name == "g_tex2DTestUAV"); +assert(FillTexturePSO.ResourceLayout.Variables[1].Type == "SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC"); + FillTextureSRB = FillTexturePSO:CreateShaderResourceBinding() UpdateVertBuffPSO = PipelineState.Create @@ -293,14 +298,13 @@ RenderPSO = PipelineState.Create PrimitiveTopology = "PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP" } } +RenderPSO:BindStaticResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) RenderSRB = RenderPSO:CreateShaderResourceBinding() -UpdateVertBuffCS:BindResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED", "BIND_SHADER_RESOURCES_UPDATE_STATIC"} ) -UpdateIndBuffCS:BindResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED", "BIND_SHADER_RESOURCES_UPDATE_ALL"}) -UpdateDrawArgsBuffCS:BindResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) -UpdateDispatchArgsBuffCS:BindResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) -RenderVS:BindResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) -RenderPS:BindResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) +UpdateVertBuffPSO:BindStaticResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED", "BIND_SHADER_RESOURCES_UPDATE_STATIC"} ) +UpdateIndBuffPSO:BindStaticResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED", "BIND_SHADER_RESOURCES_UPDATE_ALL"}) +UpdateDrawArgsBuffPSO:BindStaticResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) +UpdateDispatchArgsBuffPSO:BindStaticResources(ResMapping, {"BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED"}) FillTextureSRB:InitializeStaticResources() UpdateVertBuffSRB:InitializeStaticResources() -- cgit v1.2.3