2017-11-01 00:01:40 +01:00
|
|
|
#pragma once
|
|
|
|
|
2018-03-06 18:34:34 +01:00
|
|
|
#include <cctype>
|
|
|
|
|
2017-11-01 00:01:40 +01:00
|
|
|
#include "dxbc_common.h"
|
|
|
|
#include "dxbc_decoder.h"
|
|
|
|
#include "dxbc_enums.h"
|
|
|
|
#include "dxbc_reader.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Signature entry
|
|
|
|
*
|
|
|
|
* Stores the semantic name of an input or
|
|
|
|
* output and the corresponding register.
|
|
|
|
*/
|
|
|
|
struct DxbcSgnEntry {
|
|
|
|
std::string semanticName;
|
|
|
|
uint32_t semanticIndex;
|
|
|
|
uint32_t registerId;
|
2017-12-14 12:53:53 +01:00
|
|
|
DxbcRegMask componentMask;
|
2017-11-01 00:01:40 +01:00
|
|
|
DxbcScalarType componentType;
|
|
|
|
DxbcSystemValue systemValue;
|
2018-05-31 22:13:08 +02:00
|
|
|
uint32_t streamId;
|
2017-11-01 00:01:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Input/Output signature chunk
|
|
|
|
*
|
|
|
|
* Stores information about the input and
|
|
|
|
* output registers used by the shader stage.
|
|
|
|
*/
|
|
|
|
class DxbcIsgn : public RcObject {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-05-31 22:13:08 +02:00
|
|
|
DxbcIsgn(DxbcReader reader, DxbcTag tag);
|
2017-11-01 00:01:40 +01:00
|
|
|
~DxbcIsgn();
|
|
|
|
|
2017-11-07 15:10:38 +01:00
|
|
|
auto begin() const { return m_entries.cbegin(); }
|
|
|
|
auto end () const { return m_entries.cend(); }
|
2017-11-01 16:43:04 +01:00
|
|
|
|
2018-01-01 23:31:01 +01:00
|
|
|
const DxbcSgnEntry* findByRegister(
|
|
|
|
uint32_t registerId) const;
|
|
|
|
|
2017-12-07 12:45:02 +01:00
|
|
|
const DxbcSgnEntry* find(
|
|
|
|
const std::string& semanticName,
|
2018-06-23 20:13:00 +02:00
|
|
|
uint32_t semanticIndex,
|
|
|
|
uint32_t streamIndex) const;
|
2017-12-07 12:45:02 +01:00
|
|
|
|
2018-07-01 15:24:21 +02:00
|
|
|
DxbcRegMask regMask(
|
|
|
|
uint32_t registerId) const;
|
|
|
|
|
2019-01-26 17:11:49 +01:00
|
|
|
uint32_t maxRegisterCount() const;
|
2019-07-10 23:57:37 +02:00
|
|
|
|
|
|
|
void printEntries() const;
|
2019-01-26 17:11:49 +01:00
|
|
|
|
2022-08-10 14:11:47 +02:00
|
|
|
static bool compareSemanticNames(
|
|
|
|
const std::string& a,
|
|
|
|
const std::string& b);
|
|
|
|
|
2017-11-01 00:01:40 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
std::vector<DxbcSgnEntry> m_entries;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-07-10 23:57:37 +02:00
|
|
|
}
|