void FVulkanCommandListContext::SubmitCurrentCommands()
{
	if (IsImmediate())
	{
		//#todo-rco: Will submit the cmd buffers at this point
	}
}
Example #2
0
void CRUTask::ComputeCost()
{
    if (TRUE == IsReady() && TRUE == IsImmediate())
    {
        cost_ = CRUTask::MAX_COST;
    }
    else
    {
        // Cost is computed differently for different task types
        cost_ = GetComputedCost();
    }
}
void FVulkanCommandListContext::RHIEndDrawPrimitiveUP()
{
	int32 UPBufferIndex = GFrameNumberRenderThread % 3;

	SCOPE_CYCLE_COUNTER(STAT_VulkanDrawCallTime);

	FVulkanBoundShaderState& Shader = PendingState->GetBoundShaderState();

	PendingState->SetStreamSource(0, PendingDrawPrimUPVertexAllocInfo.GetHandle(), PendingVertexDataStride, PendingDrawPrimUPVertexAllocInfo.GetBindOffset());
	
	FVulkanCmdBuffer* CmdBuffer = CommandBufferManager->GetActiveCmdBuffer();
	PendingState->PrepareDraw(this, CmdBuffer, UEToVulkanType((EPrimitiveType)PendingPrimitiveType));
	VulkanRHI::vkCmdDraw(CmdBuffer->GetHandle(), PendingNumVertices, 1, PendingMinVertexIndex, 0);

	if (IsImmediate())
	{
		VulkanRHI::GManager.GPUProfilingData.RegisterGPUWork(PendingNumPrimitives, PendingNumVertices);
	}
}
void FVulkanCommandListContext::RHIEndDrawIndexedPrimitiveUP()
{
	SCOPE_CYCLE_COUNTER(STAT_VulkanDrawCallTime);

	FVulkanBoundShaderState& Shader = PendingState->GetBoundShaderState();

	PendingState->SetStreamSource(0, PendingDrawPrimUPVertexAllocInfo.GetHandle(), PendingVertexDataStride, PendingDrawPrimUPVertexAllocInfo.GetBindOffset());

	FVulkanCmdBuffer* CmdBuffer = CommandBufferManager->GetActiveCmdBuffer();
	VkCommandBuffer Cmd = CmdBuffer->GetHandle();
	PendingState->PrepareDraw(this, CmdBuffer, UEToVulkanType((EPrimitiveType)PendingPrimitiveType));
	uint32 NumIndices = GetVertexCountForPrimitiveCount(PendingNumPrimitives, PendingPrimitiveType);
	VulkanRHI::vkCmdBindIndexBuffer(Cmd, PendingDrawPrimUPIndexAllocInfo.GetHandle(), PendingDrawPrimUPIndexAllocInfo.GetBindOffset(), PendingPrimitiveIndexType);
	VulkanRHI::vkCmdDrawIndexed(Cmd, NumIndices, 1, PendingMinVertexIndex, 0, 0);

	if (IsImmediate())
	{
		VulkanRHI::GManager.GPUProfilingData.RegisterGPUWork(PendingNumPrimitives, PendingNumVertices);
	}
}
void FVulkanCommandListContext::RHIDrawIndexedPrimitiveIndirect(uint32 PrimitiveType,FIndexBufferRHIParamRef IndexBufferRHI,FVertexBufferRHIParamRef ArgumentBufferRHI,uint32 ArgumentOffset)
{
	check(Device);

	SCOPE_CYCLE_COUNTER(STAT_VulkanDrawCallTime);
#if 0
	//@NOTE: don't prepare draw without actually drawing
#if !PLATFORM_ANDROID
	PendingState->PrepareDraw(UEToVulkanType((EPrimitiveType)PrimitiveType));
	FVulkanIndexBuffer* IndexBuffer = ResourceCast(IndexBufferRHI);
#if 0
	FVulkanVertexBuffer* ArgumentBuffer = ResourceCast(ArgumentBufferRHI);
#endif
#endif
#endif
	VULKAN_SIGNAL_UNIMPLEMENTED();

	if (IsImmediate())
	{
		VulkanRHI::GManager.GPUProfilingData.RegisterGPUWork(0);
	}
}
void FVulkanCommandListContext::RHIDrawIndexedPrimitive(FIndexBufferRHIParamRef IndexBufferRHI, uint32 PrimitiveType, int32 BaseVertexIndex, uint32 FirstInstance,
	uint32 NumVertices, uint32 StartIndex, uint32 NumPrimitives, uint32 NumInstances)
{
	check(Device);
	SCOPE_CYCLE_COUNTER(STAT_VulkanDrawCallTime);

	FVulkanBoundShaderState& BSS = PendingState->GetBoundShaderState();

	FVulkanIndexBuffer* IndexBuffer = ResourceCast(IndexBufferRHI);
	FVulkanCmdBuffer* Cmd = CommandBufferManager->GetActiveCmdBuffer();
	VkCommandBuffer CmdBuffer = Cmd->GetHandle();
	PendingState->PrepareDraw(this, Cmd, UEToVulkanType((EPrimitiveType)PrimitiveType));

	VulkanRHI::vkCmdBindIndexBuffer(CmdBuffer, IndexBuffer->GetHandle(), IndexBuffer->GetOffset(), IndexBuffer->GetIndexType());

	uint32 NumIndices = GetVertexCountForPrimitiveCount(NumPrimitives, PrimitiveType);
	NumInstances = FMath::Max(1U, NumInstances);
	VulkanRHI::vkCmdDrawIndexed(CmdBuffer, NumIndices, NumInstances, StartIndex, BaseVertexIndex, FirstInstance);

	if (IsImmediate())
	{
		VulkanRHI::GManager.GPUProfilingData.RegisterGPUWork(NumPrimitives * NumInstances, NumVertices * NumInstances);
	}
}
#include "catch/catch.hpp"
#include "Common/Instructions/ARM/DataProcessingInstructions.hpp"
#include "Common/MathHelper.hpp"

TEST_CASE("Data Processing Instructions", "Checks that the data processing instruction structures are working")
{
    auto and = new ARM::DataProcessingInstruction(0xE2004020);

    REQUIRE(and->GetOpcode() == ARM::ARMOpcodes::AND);
    REQUIRE(and->GetFirstOperand() == 0);
    REQUIRE(and->IsImmediate() == true);
    REQUIRE(and->GetDestinationRegister() == 4);
    REQUIRE(and->GetShiftedSecondOperandImmediate() == 32);
    delete and;

    auto mov = new ARM::DataProcessingInstruction(0xE1A00005);
    REQUIRE(mov->GetOpcode() == ARM::ARMOpcodes::MOV);
    REQUIRE(mov->GetFirstOperand() == 0);
    REQUIRE(mov->IsImmediate() == false);
    REQUIRE(mov->GetSecondOperand() == 5);
    delete mov;
}