// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "common/FeatureFlagsEnum.h"
#include "common/World.ih"
// c++ shared
#include "AORendererShared.h"
#include "common/RayCone.ih"

OSPRAY_BEGIN_ISPC_NAMESPACE

struct DifferentialGeometry;
struct FrameBuffer;
struct ScreenSample;

struct SurfaceShadingInfo
{
  vec4f shadedColor;
  vec3f albedo;
};

typedef SurfaceShadingInfo SSI;

inline void computeDG(const World *uniform world,
    const AORenderer *uniform renderer,
    const Ray &ray,
    RayCone &rayCone,
    DifferentialGeometry &dg,
    const uniform FeatureFlagsHandler &ffh)
{
  postIntersect(world,
      &renderer->super,
      dg,
      ray,
      rayCone,
      DG_NG | DG_NS | DG_NORMALIZE | DG_FACEFORWARD | DG_COLOR | DG_TEXCOORD
          | DG_TANGENTS,
      ffh);
}

SYCL_EXTERNAL SSI AORenderer_computeShading(const AORenderer *uniform self,
    const World *uniform world,
    const DifferentialGeometry &dg,
    ScreenSample &sample,
    const uniform FeatureFlagsHandler &ffh);

OSPRAY_END_ISPC_NAMESPACE
