summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_header.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dxvk-native-1.9.2a/src/dxso/dxso_header.cpp')
-rw-r--r--src/libs/dxvk-native-1.9.2a/src/dxso/dxso_header.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_header.cpp b/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_header.cpp
new file mode 100644
index 00000000..81077c95
--- /dev/null
+++ b/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_header.cpp
@@ -0,0 +1,24 @@
+#include "dxso_header.h"
+
+namespace dxvk {
+
+ DxsoHeader::DxsoHeader(DxsoReader& reader) {
+ uint32_t headerToken = reader.readu32();
+
+ uint32_t headerTypeMask = headerToken & 0xffff0000;
+
+ DxsoProgramType programType;
+ if (headerTypeMask == 0xffff0000)
+ programType = DxsoProgramTypes::PixelShader;
+ else if (headerTypeMask == 0xfffe0000)
+ programType = DxsoProgramTypes::VertexShader;
+ else
+ throw DxvkError("DxsoHeader: invalid header - invalid version");
+
+ const uint32_t majorVersion = (headerToken >> 8) & 0xff;
+ const uint32_t minorVersion = headerToken & 0xff;
+
+ m_info = DxsoProgramInfo{ programType, minorVersion, majorVersion };
+ }
+
+} \ No newline at end of file