summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/GeometryShaderGen.h
blob: 03b58a036768d9bb470f81a1383f87966743fd93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2014 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include "Common/CommonTypes.h"
#include "VideoCommon/ShaderGenCommon.h"
#include "VideoCommon/VertexManagerBase.h"

enum class APIType;

#pragma pack(1)

struct geometry_shader_uid_data
{
  u32 NumValues() const { return sizeof(geometry_shader_uid_data); }
  bool IsPassthrough() const
  {
    return primitive_type == PRIMITIVE_TRIANGLES && !stereo && !wireframe;
  }

  u32 stereo : 1;
  u32 numTexGens : 4;
  u32 pixel_lighting : 1;
  u32 primitive_type : 2;
  u32 wireframe : 1;
  u32 msaa : 1;
  u32 ssaa : 1;
};

#pragma pack()

typedef ShaderUid<geometry_shader_uid_data> GeometryShaderUid;

ShaderCode GenerateGeometryShaderCode(APIType ApiType, const geometry_shader_uid_data* uid_data);
GeometryShaderUid GetGeometryShaderUid(u32 primitive_type);