summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakePresets.json15
m---------external/slang-rhi0
-rw-r--r--tests/bugs/ray-query-in-generic.slang2
-rw-r--r--tests/compute/byte-address-buffer-aligned.slang1
-rw-r--r--tests/compute/byte-address-buffer-array.slang1
-rw-r--r--tools/render-test/options.cpp4
-rw-r--r--tools/render-test/options.h2
-rw-r--r--tools/render-test/render-test-main.cpp53
-rw-r--r--tools/slang-test/slang-test-main.cpp2
9 files changed, 41 insertions, 39 deletions
diff --git a/CMakePresets.json b/CMakePresets.json
index 3f8c92a51..c89394857 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -105,6 +105,21 @@
"configuration": "RelWithDebInfo"
},
{
+ "name": "vs2022-debug",
+ "configurePreset": "vs2022",
+ "configuration": "Debug"
+ },
+ {
+ "name": "vs2022-release",
+ "configurePreset": "vs2022",
+ "configuration": "Release"
+ },
+ {
+ "name": "vs2022-releaseWithDebugInfo",
+ "configurePreset": "vs2022",
+ "configuration": "RelWithDebInfo"
+ },
+ {
"name": "emscripten",
"configurePreset": "emscripten",
"configuration": "Release",
diff --git a/external/slang-rhi b/external/slang-rhi
-Subproject e3393c5067e49e327e6d56ced5509428fcda5d1
+Subproject 6b6cc8f9513732c2f8627eeefce7ea7e1a95415
diff --git a/tests/bugs/ray-query-in-generic.slang b/tests/bugs/ray-query-in-generic.slang
index 62cbf11b6..c416f2780 100644
--- a/tests/bugs/ray-query-in-generic.slang
+++ b/tests/bugs/ray-query-in-generic.slang
@@ -36,8 +36,6 @@ struct Ray
float3 eval(float t) { return origin + t * dir; }
};
-RaytracingAccelerationStructure sceneBVH;
-
uint getCommittedStatus<let Flags : int>(RayQuery<Flags> q)
{
return q.CommittedStatus();
diff --git a/tests/compute/byte-address-buffer-aligned.slang b/tests/compute/byte-address-buffer-aligned.slang
index f959ec66d..0e848b75c 100644
--- a/tests/compute/byte-address-buffer-aligned.slang
+++ b/tests/compute/byte-address-buffer-aligned.slang
@@ -9,6 +9,7 @@
// Confirm compilation of `(RW)ByteAddressBuffer` with aligned load / stores to wider data types.
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=buffer0
[vk::binding(2, 3)] RWByteAddressBuffer buffer0;
[shader("compute")]
diff --git a/tests/compute/byte-address-buffer-array.slang b/tests/compute/byte-address-buffer-array.slang
index 4ac4a612a..77cfb07d2 100644
--- a/tests/compute/byte-address-buffer-array.slang
+++ b/tests/compute/byte-address-buffer-array.slang
@@ -9,6 +9,7 @@
// Confirm compilation of `(RW)ByteAddressBuffer` with aligned load / stores to wider data types.
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=buffer
[vk::binding(2, 3)] RWByteAddressBuffer buffer;
struct Block {
float4 val[2];
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index e0b38bf31..ed6c6a3c6 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -249,9 +249,9 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType)
{
SLANG_RETURN_ON_FAIL(reader.expectArg(outOptions.entryPointName));
}
- else if (argValue == "-enable-backend-validation")
+ else if (argValue == "-enable-debug-layers")
{
- outOptions.enableBackendValidation = true;
+ outOptions.enableDebugLayers = true;
}
else if (argValue == "-dx12-experimental")
{
diff --git a/tools/render-test/options.h b/tools/render-test/options.h
index f041c3e84..d94504c10 100644
--- a/tools/render-test/options.h
+++ b/tools/render-test/options.h
@@ -87,7 +87,7 @@ struct Options
bool generateSPIRVDirectly = true;
- bool enableBackendValidation = false;
+ bool enableDebugLayers = false;
bool dx12Experimental = false;
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index c9f367c30..f6a303d62 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -355,7 +355,7 @@ struct AssignValsFromLayoutContext
if (field.name.getLength() == 0)
{
// If no name was given, assume by-indexing matching is requested
- auto fieldCursor = dstCursor.getElement((GfxIndex)fieldIndex);
+ auto fieldCursor = dstCursor.getElement((uint32_t)fieldIndex);
if (!fieldCursor.isValid())
{
StdWriters::getError().print(
@@ -638,7 +638,7 @@ SlangResult RenderTestApp::initialize(
SLANG_RETURN_ON_FAIL(
device->createBuffer(vertexBufferDesc, kVertexData, m_vertexBuffer.writeRef()));
- ColorTargetState colorTarget;
+ ColorTargetDesc colorTarget;
colorTarget.format = Format::R8G8B8A8_UNORM;
RenderPipelineDesc desc;
desc.program = m_shaderProgram;
@@ -653,7 +653,7 @@ SlangResult RenderTestApp::initialize(
case Options::ShaderProgramType::GraphicsMeshCompute:
case Options::ShaderProgramType::GraphicsTaskMeshCompute:
{
- ColorTargetState colorTarget;
+ ColorTargetDesc colorTarget;
colorTarget.format = Format::R8G8B8A8_UNORM;
RenderPipelineDesc desc;
desc.program = m_shaderProgram;
@@ -986,15 +986,10 @@ Result RenderTestApp::update()
auto encoder = m_queue->createCommandEncoder();
if (m_options.shaderType == Options::ShaderProgramType::Compute)
{
- auto rootObject = m_device->createRootShaderObject(m_pipeline);
- applyBinding(rootObject);
- rootObject->finalize();
-
auto passEncoder = encoder->beginComputePass();
- ComputeState state;
- state.pipeline = static_cast<IComputePipeline*>(m_pipeline.get());
- state.rootObject = rootObject;
- passEncoder->setComputeState(state);
+ auto rootObject =
+ passEncoder->bindPipeline(static_cast<IComputePipeline*>(m_pipeline.get()));
+ applyBinding(rootObject);
passEncoder->dispatchCompute(
m_options.computeDispatchSize[0],
m_options.computeDispatchSize[1],
@@ -1003,16 +998,11 @@ Result RenderTestApp::update()
}
else if (m_options.shaderType == Options::ShaderProgramType::RayTracing)
{
- auto rootObject = m_device->createRootShaderObject(m_pipeline);
- applyBinding(rootObject);
- rootObject->finalize();
-
auto passEncoder = encoder->beginRayTracingPass();
- RayTracingState state;
- state.pipeline = static_cast<IRayTracingPipeline*>(m_pipeline.get());
- state.rootObject = rootObject;
- state.shaderTable = m_shaderTable;
- passEncoder->setRayTracingState(state);
+ auto rootObject = passEncoder->bindPipeline(
+ static_cast<IRayTracingPipeline*>(m_pipeline.get()),
+ m_shaderTable);
+ applyBinding(rootObject);
passEncoder->dispatchRays(
0,
m_options.computeDispatchSize[0],
@@ -1022,11 +1012,6 @@ Result RenderTestApp::update()
}
else
{
- auto rootObject = m_device->createRootShaderObject(m_pipeline);
- applyBinding(rootObject);
- setProjectionMatrix(rootObject);
- rootObject->finalize();
-
RenderPassColorAttachment colorAttachment = {};
colorAttachment.view = m_colorBufferView;
colorAttachment.loadOp = LoadOp::Clear;
@@ -1041,13 +1026,15 @@ Result RenderTestApp::update()
renderPass.depthStencilAttachment = &depthStencilAttachment;
auto passEncoder = encoder->beginRenderPass(renderPass);
+ auto rootObject =
+ passEncoder->bindPipeline(static_cast<IRenderPipeline*>(m_pipeline.get()));
+ applyBinding(rootObject);
+ setProjectionMatrix(rootObject);
RenderState state;
- state.pipeline = static_cast<IRenderPipeline*>(m_pipeline.get());
- state.rootObject = rootObject;
- state.viewports[0] = Viewport((float)gWindowWidth, (float)gWindowHeight);
+ state.viewports[0] = Viewport::fromSize(gWindowWidth, gWindowHeight);
state.viewportCount = 1;
- state.scissorRects[0] = ScissorRect(gWindowWidth, gWindowHeight);
+ state.scissorRects[0] = ScissorRect::fromSize(gWindowWidth, gWindowHeight);
state.scissorRectCount = 1;
if (m_options.shaderType == Options::ShaderProgramType::GraphicsMeshCompute ||
@@ -1413,9 +1400,6 @@ static SlangResult _innerMain(
desc.debugCallback = &debugCallback;
#endif
- if (options.enableBackendValidation)
- desc.enableBackendValidation = true;
-
desc.slang.lineDirectiveMode = SLANG_LINE_DIRECTIVE_MODE_NONE;
if (options.generateSPIRVDirectly)
desc.slang.targetFlags = SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY;
@@ -1460,7 +1444,10 @@ static SlangResult _innerMain(
desc.slang.slangGlobalSession = session;
desc.slang.targetProfile = options.profileName.getBuffer();
{
- getRHI()->enableDebugLayers();
+ if (options.enableDebugLayers)
+ {
+ getRHI()->enableDebugLayers();
+ }
SlangResult res = getRHI()->createDevice(desc, device.writeRef());
if (SLANG_FAILED(res))
{
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 57328c210..b8fb45c47 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -3528,7 +3528,7 @@ TestResult runComputeComparisonImpl(
// This is due to the limitation that Slang RPC implementation expects only
// one time communication.
if (input.spawnType != SpawnType::UseTestServer)
- cmdLine.addArg("-enable-backend-validation");
+ cmdLine.addArg("-enable-debug-layers");
#endif
if (context->isExecuting())