Skip to content

Commit

Permalink
Add RHIService a dependent of XRSystem (#242)
Browse files Browse the repository at this point in the history
* Make XRSystem depend on RHIService so that RHI is activated before XRSystem is activated

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Minor tab

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Minor tab issue

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

---------

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
  • Loading branch information
moudgils authored Mar 30, 2023
1 parent 9bf51f0 commit 50e5ddb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gems/XR/Code/Include/XR/XRSystemComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace XR
AZ_COMPONENT(SystemComponent, "{93A3A7E7-5188-49CD-8C37-26816476A3AE}");

static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& required);
static void Reflect(AZ::ReflectContext* context);

SystemComponent() = default;
Expand Down
2 changes: 1 addition & 1 deletion Gems/XR/Code/Source/XRSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ namespace XR
imageDescriptor.m_size.m_width = aznumeric_cast<uint32_t>(ceil(static_cast<float>(outputWidth) / tileSize.m_width));
imageDescriptor.m_size.m_height = aznumeric_cast<uint32_t>(ceil(static_cast<float>(outputHeight) / tileSize.m_height));

// Find the appropiate format for the image
// Find the appropriate format for the image
for (uint32_t i = 0; i < static_cast<uint32_t>(AZ::RHI::Format::Count); ++i)
{
AZ::RHI::Format format = static_cast<AZ::RHI::Format>(i);
Expand Down
5 changes: 5 additions & 0 deletions Gems/XR/Code/Source/XRSystemComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ namespace XR
provided.push_back(AZ_CRC_CE("XRSystemService"));
}

void SystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC_CE("RHIService"));
}

void SystemComponent::Reflect(AZ::ReflectContext* context)
{
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
Expand Down

0 comments on commit 50e5ddb

Please sign in to comment.