2020-12-05 13:08:24 +01:00
|
|
|
#pragma once
|
2016-04-20 01:32:27 +02:00
|
|
|
|
2018-09-29 00:12:00 +02:00
|
|
|
#include "../gcm_enums.h"
|
2015-09-28 22:51:32 +02:00
|
|
|
|
2021-05-30 16:10:46 +02:00
|
|
|
#include <span>
|
|
|
|
|
|
2015-09-28 22:51:32 +02:00
|
|
|
/*
|
|
|
|
|
* If primitive mode is not supported and need to be emulated (using an index buffer) returns false.
|
|
|
|
|
*/
|
2016-01-20 18:12:48 +01:00
|
|
|
bool is_primitive_native(rsx::primitive_type m_draw_mode);
|
2015-09-28 22:51:32 +02:00
|
|
|
|
2019-01-14 13:33:05 +01:00
|
|
|
/*
|
|
|
|
|
* Returns true if adjacency information does not matter for this type. Allows optimizations e.g removal of primitive restart index
|
|
|
|
|
*/
|
|
|
|
|
bool is_primitive_disjointed(rsx::primitive_type draw_mode);
|
|
|
|
|
|
2015-10-27 01:19:04 +01:00
|
|
|
/**
|
2015-09-28 22:51:32 +02:00
|
|
|
* Returns a fixed index count for emulated primitive, otherwise returns initial_index_count
|
|
|
|
|
*/
|
2016-08-05 23:58:35 +02:00
|
|
|
u32 get_index_count(rsx::primitive_type m_draw_mode, u32 initial_index_count);
|
2015-09-28 22:51:32 +02:00
|
|
|
|
2015-10-27 01:19:04 +01:00
|
|
|
/**
|
|
|
|
|
* Returns index type size in byte
|
|
|
|
|
*/
|
2016-08-05 23:58:35 +02:00
|
|
|
u32 get_index_type_size(rsx::index_array_type type);
|
2015-10-27 01:19:04 +01:00
|
|
|
|
|
|
|
|
/**
|
2016-01-12 00:54:07 +01:00
|
|
|
* Write count indexes using (first, first + count) ranges.
|
2017-10-17 12:09:02 +02:00
|
|
|
* Returns min/max index found during the process and the number of valid indices written to the buffer.
|
2016-07-31 23:01:31 +02:00
|
|
|
* The function expands index buffer for non native primitive type if expands(draw_mode) return true.
|
2015-09-28 22:51:32 +02:00
|
|
|
*/
|
2021-05-30 16:10:46 +02:00
|
|
|
std::tuple<u32, u32, u32> write_index_array_data_to_buffer(std::span<std::byte> dst, std::span<const std::byte> src,
|
2018-10-01 22:05:51 +02:00
|
|
|
rsx::index_array_type, rsx::primitive_type draw_mode, bool restart_index_enabled, u32 restart_index,
|
2019-06-08 07:58:04 +02:00
|
|
|
const std::function<bool(rsx::primitive_type)>& expands);
|
2015-10-15 23:06:14 +02:00
|
|
|
|
2015-10-27 01:19:04 +01:00
|
|
|
/**
|
|
|
|
|
* Write index data needed to emulate non indexed non native primitive mode.
|
|
|
|
|
*/
|
2017-06-26 23:34:22 +02:00
|
|
|
void write_index_array_for_non_indexed_non_native_primitive_to_buffer(char* dst, rsx::primitive_type draw_mode, unsigned count);
|
2015-10-31 18:08:49 +01:00
|
|
|
|
2021-12-04 23:41:53 +01:00
|
|
|
// Copy and swap data in 32-bit units
|
2022-01-23 13:20:07 +01:00
|
|
|
extern void(*const copy_data_swap_u32)(u32*, const u32*, u32);
|
2021-12-04 23:41:53 +01:00
|
|
|
|
|
|
|
|
// Copy and swap data in 32-bit units, return true if changed
|
2022-01-23 13:20:07 +01:00
|
|
|
extern bool(*const copy_data_swap_u32_cmp)(u32*, const u32*, u32);
|