14#include <Metal/Metal.h>
42 return uint64_t((
uint64_t(this->format) ^ (this->offset << 4) ^ (this->buffer_index << 8) ^
43 (this->format_conversion_mode << 12)));
48 format = MTLVertexFormatInvalid;
69 return uint64_t(
uint64_t(this->step_function) ^ (this->step_rate << 4) ^ (this->stride << 8) ^
70 (
uint64_t(this->buffer_slot) << 32));
102 for (
const int a :
IndexRange(this->max_attribute_value + 1)) {
103 if (!(this->attributes[a] == other.
attributes[a])) {
123 for (
const int a :
IndexRange(this->max_attribute_value + 1)) {
124 hash ^= this->attributes[a].
hash() << a;
127 for (
const int b :
IndexRange(this->num_vert_buffers)) {
128 hash ^= this->buffer_layouts[
b].
hash() << (
b + 10);
154 hash ^= seed ^ value.u;
257 hash ^=
uint64_t(this->stencil_attachment_format) << 20;
262 if (this->num_color_attachments > 0) {
273 hash ^=
uint64_t(this->color_attachment_format[c]) << (c + 52);
277 hash |=
uint64_t((this->blending_enabled && (this->num_color_attachments > 0)) ? 1 : 0) << 62;
296 for (
int i = 0; i < GPU_VERT_ATTR_MAX_LEN; i++) {
constexpr IndexRange()=default
#define GPU_FB_MAX_COLOR_ATTACHMENT
unsigned __int64 uint64_t
MINLINE unsigned int float_as_uint(float f)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool operator==(const MTLComputePipelineStateDescriptor &other) const
MTLComputePipelineStateDescriptor()=default
SpecializationStateDescriptor specialization_state
MTLComputePipelineStateDescriptor(Vector< shader::SpecializationConstant::Value > values)
uchar clipping_plane_enable_mask
MTLBlendFactor dest_alpha_blend_factor
void reset_vertex_descriptor()
MTLBlendOperation alpha_blend_op
MTLPixelFormat color_attachment_format[GPU_FB_MAX_COLOR_ATTACHMENT]
MTLPixelFormat depth_attachment_format
MTLVertexDescriptor vertex_descriptor
int num_color_attachments
MTLColorWriteMask color_write_mask
MTLBlendFactor dest_rgb_blend_factor
MTLBlendFactor src_alpha_blend_factor
MTLBlendFactor src_rgb_blend_factor
MTLPixelFormat stencil_attachment_format
MTLBlendOperation rgb_blend_op
uint8_t color_attachment_mask
bool operator==(const MTLRenderPipelineStateDescriptor &other) const
SpecializationStateDescriptor specialization_state
GPUVertFetchMode format_conversion_mode
bool operator==(const MTLVertexAttributeDescriptorPSO &other) const
::MTLVertexStepFunction step_function
bool operator==(const MTLVertexBufferLayoutDescriptorPSO &other) const
::MTLPrimitiveTopologyClass prim_topology_class
MTLVertexAttributeDescriptorPSO attributes[GPU_VERT_ATTR_MAX_LEN]
MTLVertexBufferLayoutDescriptorPSO buffer_layouts[GPU_BATCH_VBO_MAX_LEN]
bool operator==(const MTLVertexDescriptor &other) const
SpecializationStateDescriptor()=default
SpecializationStateDescriptor(Vector< shader::SpecializationConstant::Value > source)
bool operator==(const SpecializationStateDescriptor &other) const
Vector< shader::SpecializationConstant::Value > values