Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
shader_program2.h
Go to the documentation of this file.
1 // shader_program2 [rms2] - Tag Definition //
3 // -------- //
4 // Part of the Blamite Game Engine //
5 // Copyright (c) Elaztek Studios 2013 - 2023 //
7 
8 
9 #pragma once
10 
11 #include <string>
12 #include <blam/api/v1/types/tags.h>
14 
15 #ifndef BLAM
16 #define BLAM
17 #endif
18 
19 #define tag_rms2 "rms2"
20 
22 {
23  float1,
24  float2,
25  float3,
26  float4,
27  uint,
28  float3x3,
29  float3x4,
30  float4x4,
31 };
32 
33 
34 #pragma pack(push, 1)
36 {
37  TAG_ENUM8(shader_type,
38  {
39  pixel,
40  vertex,
41  domain,
42  hull,
43  geometry,
44  compute,
45  universal,
46  });
47 
48  TAG_BLOCK(global_parameters,
49  {
50  });
51  TAG_BLOCK(instance_parameters,
52  {
54  struct bitfield8_flags
55  {
56  bool is_array : 1;
57  bool pass_to_pixel_shader : 1;
58  bool unused2 : 1;
59  bool unused3 : 1;
60  bool unused4 : 1;
61  bool unused5 : 1;
62  bool unused6 : 1;
63  bool unused7 : 1;
64  };
65 
66  bitfield8_flags flags;
67  data_reference name;
68  int16_t array_size;
69  });
71 };
72 #pragma pack(pop)
73 
75 {
76 public:
78  {
79  class_name_long = "shader_program2";
80  class_name_short = "rms2";
81  version = 0;
82 
83  revisions = {
84 
85  };
86 
87  tag_size = 97;
88 
89  fields =
90  {
91  new Enum8Field("shader type", "",
92  {
93  "pixel/fragment",
94  "vertex",
95  "domain",
96  "hull",
97  "geometry",
98  "compute",
99  "universal",
100  }),
101  new BlockField(0, "global parameters", "",
102  {
103  }),
104  new BlockField(36, "instance parameters", "",
105  {
106  new Enum8Field("type", "",
107  {
108  "float",
109  "float2",
110  "float3",
111  "float4",
112  "uint",
113  "float3x3",
114  "float3x4",
115  "float4x4",
116  }),
117  new Bitfield8Field("flags", "",
118  {
119  "is array",
120  "pass to pixel shader",
121  }),
122  new DataReferenceField("name", ""),
123  new Int16Field("array size", "only used if is_array flag is enabled"),
124  }),
125  new DataReferenceField("source", ""),
126 
127  };
128  }
129 };
130 
131 namespace Blam::Content::Tags
132 {
133  BLAM shader_program2* GetShaderProgram2Tag(std::string tag_path);
134 }
Int16Field
Class representing an int16 tag field.
Definition: int.h:59
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:181
shader_parameter_type::uint
@ uint
shader_parameter_type::float2
@ float2
tag_rms2
#define tag_rms2
Definition: shader_program2.h:19
shader_parameter_type::float3x3
@ float3x3
uint8_t
unsigned char uint8_t
Definition: stdint.h:15
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:19
shader_parameter_type::float3x4
@ float3x4
ShaderProgram2TagClass::ShaderProgram2TagClass
ShaderProgram2TagClass()
Definition: shader_program2.h:77
shader_program2::source
data_reference source
Definition: shader_program2.h:70
Blam::Content::Tags::GetShaderProgram2Tag
BLAM shader_program2 * GetShaderProgram2Tag(std::string tag_path)
Definition: shader_program2.cpp:13
shader_parameter_type::float4x4
@ float4x4
Blam::API::v1::Tags::GetTagData
BLAM_EXT_API BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: api.cpp:208
BlamTagClass::fields
std::vector< BlamTagClassField * > fields
A series of tag fields that store the layout of the tag.
Definition: tags.h:209
BlamTagClass::revisions
std::vector< BlamTagClassRevision > revisions
List of all tag class revisions. Does not get written to tags, but is included in plugin files.
Definition: tags.h:208
plugins.h
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tags.h:206
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:207
BLAM
#define BLAM
Definition: shader_program2.h:16
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tags.h:205
Enum8Field
Definition: enum.h:33
ShaderProgram2TagClass
Definition: shader_program2.h:74
shader_program2::TAG_ENUM8
TAG_ENUM8(shader_type, { pixel, vertex, domain, hull, geometry, compute, universal, })
data_reference
Structure representing a data reference.
Definition: tags.h:342
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:210
shader_parameter_type::float4
@ float4
shader_program2::TAG_BLOCK
TAG_BLOCK(global_parameters, { })
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:132
tags.h
shader_parameter_type::float3
@ float3
int16_t
short int16_t
Definition: stdint.h:12
shader_program2
Definition: shader_program2.h:35
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:125
BlockField
Class representing a tag block field, also sometimes referred to as a struct or reflexive in the modd...
Definition: block.h:19
shader_parameter_type
shader_parameter_type
Definition: shader.h:21
shader_program2.h
BlamTagClass
Class representing a tag class.
Definition: tags.h:202
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:33
shader_parameter_type::float1
@ float1
api.h
BlamTagData::tag_class
std::string tag_class
The tag's short class name.
Definition: tags.h:146