[dxbc] Drop unused major/minor from DxbcProgramVersion

This commit is contained in:
Andre Heider 2018-10-08 09:22:58 +02:00 committed by Philip Rebohle
parent 781ee00f5c
commit 8492f0501e
3 changed files with 10 additions and 30 deletions

View File

@ -6,9 +6,9 @@ namespace dxvk {
// The shader version and type are stored in a 32-bit unit,
// where the first byte contains the major and minor version
// numbers, and the high word contains the program type.
auto pVersion = reader.readu16() & 0xFF;
reader.skip(2);
auto pType = reader.readEnum<DxbcProgramType>();
m_version = DxbcProgramVersion(pVersion >> 4, pVersion & 0xF, pType);
m_version = DxbcProgramVersion(pType);
// Read the actual shader code as an array of DWORDs.
auto codeLength = reader.readu32() - 2;
@ -21,4 +21,4 @@ namespace dxvk {
}
}
}

View File

@ -21,35 +21,17 @@ namespace dxvk {
/**
* \brief DXBC shader version info
* \brief DXBC shader info
*
* Stores the shader model version
* as well as the program type.
* Stores the shader program type.
*/
class DxbcProgramVersion {
public:
DxbcProgramVersion() { }
DxbcProgramVersion(
uint8_t major, uint8_t minor, DxbcProgramType type)
: m_major(major), m_minor(minor), m_type(type) { }
/**
* \brief Major version
* \returns Major version
*/
uint32_t major() const {
return m_major;
}
/**
* \brief Minor version
* \returns Minor version
*/
uint32_t minor() const {
return m_minor;
}
DxbcProgramVersion(DxbcProgramType type)
: m_type(type) { }
/**
* \brief Program type
@ -79,10 +61,8 @@ namespace dxvk {
private:
uint8_t m_major = 0;
uint8_t m_minor = 0;
DxbcProgramType m_type = DxbcProgramType::PixelShader;
};
}
}

View File

@ -32,8 +32,8 @@ namespace dxvk {
~DxbcModule();
/**
* \brief Shader type and version
* \returns Shader type and version
* \brief Shader type
* \returns Shader type
*/
DxbcProgramVersion version() const {
return m_shexChunk->version();