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;
68 return uint64_t(
uint64_t(this->step_function) ^ (this->step_rate << 4) ^ (this->stride << 8));
101 for (
const int a :
IndexRange(this->max_attribute_value + 1)) {
102 if (!(this->attributes[a] == other.
attributes[a])) {
107 for (
const int b :
IndexRange(this->num_vert_buffers)) {
122 for (
const int a :
IndexRange(this->max_attribute_value + 1)) {
123 hash ^= this->attributes[a].
hash() << a;
126 for (
const int b :
IndexRange(this->num_vert_buffers)) {
127 hash ^= this->buffer_layouts[
b].
hash() << (
b + 10);
254 hash ^=
uint64_t(this->stencil_attachment_format) << 20;
260 if (this->num_color_attachments > 0) {
270 hash ^=
uint64_t(this->color_attachment_format[c]) << (c + 52);
274 hash |=
uint64_t((this->blending_enabled && (this->num_color_attachments > 0)) ? 1 : 0) << 62;
MINLINE unsigned int float_as_uint(float f)
static constexpr int GPU_BATCH_VBO_MAX_LEN
unsigned long long int uint64_t
static unsigned long seed
#define GPU_FB_MAX_COLOR_ATTACHMENT
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
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
MTLVertexAttributeDescriptorPSO attributes[GPU_VERT_ATTR_MAX_LEN]
MTLVertexBufferLayoutDescriptorPSO buffer_layouts[GPU_BATCH_VBO_MAX_LEN]
bool operator==(const MTLVertexDescriptor &other) const
MTLPrimitiveTopologyClass prim_topology_class
SpecializationStateDescriptor()=default
SpecializationStateDescriptor(Vector< shader::SpecializationConstant::Value > source)
bool operator==(const SpecializationStateDescriptor &other) const
Vector< shader::SpecializationConstant::Value > values