uint16_t sampler_mask_shadow; /* in, which samplers use depth compare */
uint8_t rt_mask; /* out, which render targets are being written */
+ uint8_t fog_enable;
+ uint8_t fog_mode;
+ uint16_t projected; /* ps 1.1 to 1.3 */
+
unsigned const_i_base; /* in vec4 (16 byte) units */
unsigned const_b_base; /* in vec4 (16 byte) units */
unsigned const_used_size;
+ unsigned const_float_slots;
+ unsigned const_int_slots;
+ unsigned const_bool_slots;
+
struct nine_lconstf lconstf; /* out, NOTE: members to be free'd by user */
+ uint8_t bumpenvmat_needed;
};
-static INLINE void
+static inline void
nine_info_mark_const_f_used(struct nine_shader_info *info, int idx)
{
- unsigned size = (idx + 1) * 16;
-
- if (info->const_used_size < size)
- info->const_used_size = size;
+ if (info->const_float_slots < (idx + 1))
+ info->const_float_slots = idx + 1;
}
-static INLINE void
+static inline void
nine_info_mark_const_i_used(struct nine_shader_info *info, int idx)
{
- unsigned size = (info->const_i_base + (idx + 1)) * 16;
-
- if (info->const_used_size < size)
- info->const_used_size = size;
+ if (info->const_int_slots < (idx + 1))
+ info->const_int_slots = idx + 1;
}
-static INLINE void
+static inline void
nine_info_mark_const_b_used(struct nine_shader_info *info, int idx)
{
- unsigned size = (info->const_b_base + ((idx + 4) / 4)) * 16;
-
- if (info->const_used_size < size)
- info->const_used_size = size;
+ if (info->const_bool_slots < (idx + 1))
+ info->const_bool_slots = idx + 1;
}
HRESULT
uint32_t key;
};
-static INLINE void *
+static inline void *
nine_shader_variant_get(struct nine_shader_variant *list, uint32_t key)
{
while (list->key != key && list->next)
return NULL;
}
-static INLINE boolean
+static inline boolean
nine_shader_variant_add(struct nine_shader_variant *list,
uint32_t key, void *cso)
{
return TRUE;
}
-static INLINE void
+static inline void
nine_shader_variants_free(struct nine_shader_variant *list)
{
while (list->next) {
}
}
+struct nine_shader_variant64
+{
+ struct nine_shader_variant64 *next;
+ void *cso;
+ uint64_t key;
+};
+
+static inline void *
+nine_shader_variant_get64(struct nine_shader_variant64 *list, uint64_t key)
+{
+ while (list->key != key && list->next)
+ list = list->next;
+ if (list->key == key)
+ return list->cso;
+ return NULL;
+}
+
+static inline boolean
+nine_shader_variant_add64(struct nine_shader_variant64 *list,
+ uint64_t key, void *cso)
+{
+ while (list->next) {
+ assert(list->key != key);
+ list = list->next;
+ }
+ list->next = MALLOC_STRUCT(nine_shader_variant64);
+ if (!list->next)
+ return FALSE;
+ list->next->next = NULL;
+ list->next->key = key;
+ list->next->cso = cso;
+ return TRUE;
+}
+
+static inline void
+nine_shader_variants_free64(struct nine_shader_variant64 *list)
+{
+ while (list->next) {
+ struct nine_shader_variant64 *ptr = list->next;
+ list->next = ptr->next;
+ FREE(ptr);
+ }
+}
+
#endif /* _NINE_SHADER_H_ */