mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
54ed8f0bb0
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de> Co-authored-by: Robin Kertels <robin.kertels@gmail.com> Co-authored-by: pchome <pchome@users.noreply.github.com> Co-authored-by: Christopher Egert <cme3000@gmail.com> Co-authored-by: Derek Lesho <dereklesho52@Gmail.com> Co-authored-by: Luis Cáceres <lacaceres97@gmail.com> Co-authored-by: Nelson Chen <crazysim@gmail.com> Co-authored-by: Edmondo Tommasina <edmondo.tommasina@gmail.com> Co-authored-by: Riesi <riesi@opentrash.com> Co-authored-by: gbMichelle <gbmichelle.dev@gmail.com>
54 lines
776 B
C++
54 lines
776 B
C++
#pragma once
|
|
|
|
#include "dxso_include.h"
|
|
#include "dxso_reader.h"
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
namespace dxvk {
|
|
|
|
/**
|
|
* \brief DXBC code iterator
|
|
*
|
|
* Convenient pointer wrapper that allows
|
|
* reading the code token stream.
|
|
*/
|
|
class DxsoCodeIter {
|
|
|
|
public:
|
|
|
|
DxsoCodeIter(
|
|
const uint32_t* ptr)
|
|
: m_ptr(ptr) { }
|
|
|
|
const uint32_t* ptrAt(uint32_t id) const;
|
|
|
|
uint32_t at(uint32_t id) const;
|
|
uint32_t read();
|
|
|
|
DxsoCodeIter skip(uint32_t n) const;
|
|
|
|
private:
|
|
|
|
const uint32_t* m_ptr = nullptr;
|
|
|
|
};
|
|
|
|
class DxsoCode {
|
|
|
|
public:
|
|
|
|
DxsoCode(DxsoReader& reader);
|
|
|
|
DxsoCodeIter iter() const {
|
|
return DxsoCodeIter(m_code);
|
|
}
|
|
|
|
private:
|
|
|
|
const uint32_t* m_code;
|
|
|
|
};
|
|
|
|
} |