Prepare more GPU stuff
This commit is contained in:
parent
83e21bfdbf
commit
36824055e6
|
@ -1,48 +0,0 @@
|
|||
#ifndef __JABYENGINE_IO_CLASS_HELPER_HPP__
|
||||
#define __JABYENGINE_IO_CLASS_HELPER_HPP__
|
||||
#include "bits.hpp"
|
||||
|
||||
#define io_class__2option_map(option0, option1, bit_num) \
|
||||
constexpr auto& set_##option0() { \
|
||||
this->raw_value = bit::clear(this->raw_value, bit_num); \
|
||||
return *this;\
|
||||
} \
|
||||
\
|
||||
constexpr auto& set_##option1() { \
|
||||
this->raw_value = bit::set(this->raw_value, bit_num); \
|
||||
return *this; \
|
||||
}
|
||||
|
||||
#define io_class__2option_map_getter(type, option0, option1, name, bit_num) \
|
||||
io_class__2option_map(option0, option1, bit_num) \
|
||||
io_class__option_get(type, name, bit_num)
|
||||
|
||||
#define io_class__2option_map_getter_is(type, option0, option1, bit_num) \
|
||||
io_class__2option_map(option0, option1, bit_num) \
|
||||
io_class__option_is(type, option1, bit_num)
|
||||
|
||||
#define io_class__option_get(type, name, bit_num) \
|
||||
constexpr type get_##name() const { \
|
||||
return static_cast<type>(bit::is_set(this->raw_value, bit_num)); \
|
||||
}
|
||||
|
||||
#define io_class__option_is(type, name, bit_num) \
|
||||
constexpr type is_##name() const { \
|
||||
return static_cast<type>(bit::is_set(this->raw_value, bit_num)); \
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static constexpr __always_inline void io_class__update_with(T& dst, const T& src) {
|
||||
typedef decltype(dst.raw_value) DST_VALUE;
|
||||
|
||||
const_cast<volatile DST_VALUE&>(dst.raw_value) = src.raw_value;
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
static constexpr __always_inline void io_class__update_with(T& dst, const U& src) {
|
||||
typedef decltype(dst.raw_value) DST_VALUE;
|
||||
|
||||
const_cast<volatile DST_VALUE&>(dst.raw_value) = src;
|
||||
}
|
||||
|
||||
#endif //!__JABYENGINE_IO_CLASS_HELPER_HPP__
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef __JABYENGINE_GPU_IO_HPP__
|
||||
#define __JABYENGINE_GPU_IO_HPP__
|
||||
#include "IOPort.hpp"
|
||||
|
||||
namespace GPU {
|
||||
namespace Port {
|
||||
struct __no_align Command : public ComplexBitMap<uint32_t> {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif //!__JABYENGINE_GPU_IO_HPP__
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef __JABYENGINE_SPU_IO_HPP__
|
||||
#define __JABYENGINE_SPU_IO_HPP__
|
||||
#include "IOPort.hpp"
|
||||
#include <limits.h>
|
||||
|
||||
namespace SPU {
|
||||
namespace Port {
|
||||
|
|
Loading…
Reference in New Issue