Skip to content

Commit 3b071b6

Browse files
committed
uint64 type in D3D12
1 parent 30524ce commit 3b071b6

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CrossPlatform/RenderPlatform.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,8 @@ void RenderPlatform::SetConstantBuffer(DeviceContext& deviceContext,ConstantBuff
19821982

19831983
void RenderPlatform::SetStructuredBuffer(DeviceContext& deviceContext, BaseStructuredBuffer* s, const ShaderResource& shaderResource)
19841984
{
1985+
if(!s||!s->platformStructuredBuffer)
1986+
return;
19851987
if((shaderResource.shaderResourceType & ShaderResourceType::RW) == ShaderResourceType::RW)
19861988
s->platformStructuredBuffer->ApplyAsUnorderedAccessView(deviceContext, shaderResource);
19871989
else

DirectX12/Sfx/DirectX12.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"vec4": "float4",
3131
"char4": "snorm float4",
3232
"uchar4": "unorm float4",
33+
"uint64": "uint64_t",
3334
"mat2": "float2x2",
3435
"mat3": "float3x3",
3536
"mat4": "float4x4",

Vulkan/RenderPlatform.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,11 @@ void RenderPlatform::DispatchCompute(crossplatform::DeviceContext &deviceContext
616616

617617
vulkan::EffectPass* vkEffectPass = ((vulkan::EffectPass*)deviceContext.contextState.currentEffectPass);
618618
BeginEvent(deviceContext, vkEffectPass->name.c_str());
619-
ApplyContextState(deviceContext);
620-
commandBuffer->dispatch(w, l, d);
621-
InsertFences(deviceContext);
619+
if(ApplyContextState(deviceContext))
620+
{
621+
commandBuffer->dispatch(w, l, d);
622+
InsertFences(deviceContext);
623+
}
622624
EndEvent(deviceContext);
623625
}
624626

@@ -881,7 +883,10 @@ bool RenderPlatform::ApplyContextState(crossplatform::DeviceContext &deviceConte
881883
else
882884
{
883885
// Set Compute Pipeline
884-
commandBuffer->bindPipeline(vk::PipelineBindPoint::eCompute, renderPassPipeline.pipeline);
886+
if(renderPassPipeline.pipeline)
887+
commandBuffer->bindPipeline(vk::PipelineBindPoint::eCompute, renderPassPipeline.pipeline);
888+
else
889+
return false;
885890

886891
}
887892
return true;

0 commit comments

Comments
 (0)