PIPE_ASSERT(PIPE_FUNC_ALWAYS == MALI_FUNC_ALWAYS);
}
+static inline enum mali_sample_pattern
+panfrost_sample_pattern(unsigned samples)
+{
+ switch (samples) {
+ case 1: return MALI_SAMPLE_PATTERN_SINGLE_SAMPLED;
+ case 4: return MALI_SAMPLE_PATTERN_ROTATED_4X_GRID;
+ case 8: return MALI_SAMPLE_PATTERN_D3D_8X_GRID;
+ case 16: return MALI_SAMPLE_PATTERN_D3D_16X_GRID;
+ default: unreachable("Unsupported sample count");
+ }
+}
+
/* Gets a GPU address for the associated index buffer. Only gauranteed to be
* good for the duration of the draw (transient), could last longer. Also get
* the bounds on the index buffer for the range accessed by the draw. We do
}
}
+static void
+panfrost_get_sample_position(struct pipe_context *context,
+ unsigned sample_count,
+ unsigned sample_index,
+ float *out_value)
+{
+ panfrost_query_sample_position(
+ panfrost_sample_pattern(sample_count),
+ sample_index,
+ out_value);
+}
+
void
panfrost_cmdstream_screen_init(struct panfrost_screen *screen)
{
pipe->create_sampler_view = panfrost_create_sampler_view;
pipe->create_sampler_state = panfrost_create_sampler_state;
pipe->create_blend_state = panfrost_create_blend_state;
+
+ pipe->get_sample_position = panfrost_get_sample_position;
}
#include "pan_job.h"
-static inline enum mali_sample_pattern
-panfrost_sample_pattern(unsigned samples)
-{
- switch (samples) {
- case 1: return MALI_SAMPLE_PATTERN_SINGLE_SAMPLED;
- case 4: return MALI_SAMPLE_PATTERN_ROTATED_4X_GRID;
- case 8: return MALI_SAMPLE_PATTERN_D3D_8X_GRID;
- case 16: return MALI_SAMPLE_PATTERN_D3D_16X_GRID;
- default: unreachable("Unsupported sample count");
- }
-}
-
#endif /* __PAN_CMDSTREAM_H__ */
}
static void
-panfrost_get_sample_position(struct pipe_context *context,
- unsigned sample_count,
- unsigned sample_index,
- float *out_value)
-{
- panfrost_query_sample_position(
- panfrost_sample_pattern(sample_count),
- sample_index,
- out_value);
-}
-
-static void
panfrost_set_clip_state(struct pipe_context *pipe,
const struct pipe_clip_state *clip)
{
gallium->set_sample_mask = panfrost_set_sample_mask;
gallium->set_min_samples = panfrost_set_min_samples;
- gallium->get_sample_position = panfrost_get_sample_position;
gallium->set_clip_state = panfrost_set_clip_state;
gallium->set_viewport_states = panfrost_set_viewport_states;