Skip to content

Commit e005415

Browse files
authored
add missing Result to IRayTracingCommandEncoder::bindPipline (shader-slang#4148)
1 parent 86a9da1 commit e005415

8 files changed

+12
-11
lines changed

slang-gfx.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,7 @@ class IRayTracingCommandEncoder : public IResourceCommandEncoder
18421842
virtual SLANG_NO_THROW void SLANG_MCALL
18431843
deserializeAccelerationStructure(IAccelerationStructure* dest, DeviceAddress source) = 0;
18441844

1845-
virtual SLANG_NO_THROW void SLANG_MCALL
1845+
virtual SLANG_NO_THROW Result SLANG_MCALL
18461846
bindPipeline(IPipelineState* state, IShaderObject** outRootObject) = 0;
18471847
// Sets the current pipeline state along with a pre-created mutable root shader object.
18481848
virtual SLANG_NO_THROW Result SLANG_MCALL

tools/gfx/d3d12/d3d12-command-encoder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1339,10 +1339,10 @@ void RayTracingCommandEncoderImpl::deserializeAccelerationStructure(
13391339
D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE);
13401340
}
13411341

1342-
void RayTracingCommandEncoderImpl::bindPipeline(
1342+
Result RayTracingCommandEncoderImpl::bindPipeline(
13431343
IPipelineState* state, IShaderObject** outRootObject)
13441344
{
1345-
bindPipelineImpl(state, outRootObject);
1345+
return bindPipelineImpl(state, outRootObject);
13461346
}
13471347

13481348
Result RayTracingCommandEncoderImpl::dispatchRays(

tools/gfx/d3d12/d3d12-command-encoder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class RayTracingCommandEncoderImpl
328328
serializeAccelerationStructure(DeviceAddress dest, IAccelerationStructure* source) override;
329329
virtual SLANG_NO_THROW void SLANG_MCALL deserializeAccelerationStructure(
330330
IAccelerationStructure* dest, DeviceAddress source) override;
331-
virtual SLANG_NO_THROW void SLANG_MCALL
331+
virtual SLANG_NO_THROW Result SLANG_MCALL
332332
bindPipeline(IPipelineState* state, IShaderObject** outRootObject) override;
333333
virtual SLANG_NO_THROW Result SLANG_MCALL
334334
bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override

tools/gfx/debug-layer/debug-command-encoder.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -470,16 +470,17 @@ void DebugRayTracingCommandEncoder::deserializeAccelerationStructure(
470470
baseObject->deserializeAccelerationStructure(getInnerObj(dest), source);
471471
}
472472

473-
void DebugRayTracingCommandEncoder::bindPipeline(
473+
Result DebugRayTracingCommandEncoder::bindPipeline(
474474
IPipelineState* state, IShaderObject** outRootObject)
475475
{
476476
SLANG_GFX_API_FUNC;
477477
auto innerPipeline = getInnerObj(state);
478478
IShaderObject* innerRootObject = nullptr;
479479
commandBuffer->rootObject.reset();
480-
baseObject->bindPipeline(innerPipeline, &innerRootObject);
480+
Result result = baseObject->bindPipeline(innerPipeline, &innerRootObject);
481481
commandBuffer->rootObject.baseObject.attach(innerRootObject);
482482
*outRootObject = &commandBuffer->rootObject;
483+
return result;
483484
}
484485

485486
Result DebugRayTracingCommandEncoder::bindPipelineWithRootObject(

tools/gfx/debug-layer/debug-command-encoder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ class DebugRayTracingCommandEncoder
276276
virtual SLANG_NO_THROW void SLANG_MCALL deserializeAccelerationStructure(
277277
IAccelerationStructure* dest,
278278
DeviceAddress source) override;
279-
virtual SLANG_NO_THROW void SLANG_MCALL
279+
virtual SLANG_NO_THROW Result SLANG_MCALL
280280
bindPipeline(IPipelineState* state, IShaderObject** outRootObject) override;
281281
virtual SLANG_NO_THROW Result SLANG_MCALL
282282
bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override;

tools/gfx/gfx.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ public interface IRayTracingCommandEncoder : IResourceCommandEncoder
15191519
public void serializeAccelerationStructure(DeviceAddress dest, IAccelerationStructure source);
15201520
public void deserializeAccelerationStructure(IAccelerationStructure dest, DeviceAddress source);
15211521

1522-
public void bindPipeline(IPipelineState state, out IShaderObject rootObject);
1522+
public Result bindPipeline(IPipelineState state, out IShaderObject rootObject);
15231523
// Sets the current pipeline state along with a pre-created mutable root shader object.
15241524
public Result bindPipelineWithRootObject(IPipelineState state, IShaderObject rootObject);
15251525

tools/gfx/vulkan/vk-command-encoder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1443,9 +1443,9 @@ void RayTracingCommandEncoder::deserializeAccelerationStructure(
14431443
m_commandBuffer->m_commandBuffer, &copyInfo);
14441444
}
14451445

1446-
void RayTracingCommandEncoder::bindPipeline(IPipelineState* pipeline, IShaderObject** outRootObject)
1446+
Result RayTracingCommandEncoder::bindPipeline(IPipelineState* pipeline, IShaderObject** outRootObject)
14471447
{
1448-
setPipelineStateImpl(pipeline, outRootObject);
1448+
return setPipelineStateImpl(pipeline, outRootObject);
14491449
}
14501450

14511451
Result RayTracingCommandEncoder::bindPipelineWithRootObject(

tools/gfx/vulkan/vk-command-encoder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class RayTracingCommandEncoder
336336
virtual SLANG_NO_THROW void SLANG_MCALL deserializeAccelerationStructure(
337337
IAccelerationStructure* dest, DeviceAddress source) override;
338338

339-
virtual SLANG_NO_THROW void SLANG_MCALL
339+
virtual SLANG_NO_THROW Result SLANG_MCALL
340340
bindPipeline(IPipelineState* pipeline, IShaderObject** outRootObject) override;
341341

342342
virtual SLANG_NO_THROW Result SLANG_MCALL bindPipelineWithRootObject(

0 commit comments

Comments
 (0)