Fifo: const correctness
PushFifoAuxBuffer only memcpys data using ptr as the source pointer, so it can be a pointer to const data because of that.
This commit is contained in:
parent
76cece8157
commit
62db55dee2
|
@ -191,7 +191,7 @@ void SyncGPU(SyncGPUReason reason, bool may_move_read_ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PushFifoAuxBuffer(void* ptr, size_t size)
|
void PushFifoAuxBuffer(const void* ptr, size_t size)
|
||||||
{
|
{
|
||||||
if (size > (size_t)(s_fifo_aux_data + FIFO_SIZE - s_fifo_aux_write_ptr))
|
if (size > (size_t)(s_fifo_aux_data + FIFO_SIZE - s_fifo_aux_write_ptr))
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ enum class SyncGPUReason
|
||||||
// In deterministic GPU thread mode this waits for the GPU to be done with pending work.
|
// In deterministic GPU thread mode this waits for the GPU to be done with pending work.
|
||||||
void SyncGPU(SyncGPUReason reason, bool may_move_read_ptr = true);
|
void SyncGPU(SyncGPUReason reason, bool may_move_read_ptr = true);
|
||||||
|
|
||||||
void PushFifoAuxBuffer(void* ptr, size_t size);
|
void PushFifoAuxBuffer(const void* ptr, size_t size);
|
||||||
void* PopFifoAuxBuffer(size_t size);
|
void* PopFifoAuxBuffer(size_t size);
|
||||||
|
|
||||||
void FlushGpu();
|
void FlushGpu();
|
||||||
|
|
|
@ -288,12 +288,13 @@ void LoadIndexedXF(u32 val, int refarray)
|
||||||
|
|
||||||
void PreprocessIndexedXF(u32 val, int refarray)
|
void PreprocessIndexedXF(u32 val, int refarray)
|
||||||
{
|
{
|
||||||
int index = val >> 16;
|
const int index = val >> 16;
|
||||||
int size = ((val >> 12) & 0xF) + 1;
|
const int size = ((val >> 12) & 0xF) + 1;
|
||||||
|
|
||||||
u32* new_data = (u32*)Memory::GetPointer(g_preprocess_cp_state.array_bases[refarray] +
|
const u32* new_data =
|
||||||
g_preprocess_cp_state.array_strides[refarray] * index);
|
(u32*)Memory::GetPointer(g_preprocess_cp_state.array_bases[refarray] +
|
||||||
|
g_preprocess_cp_state.array_strides[refarray] * index);
|
||||||
|
|
||||||
size_t buf_size = size * sizeof(u32);
|
const size_t buf_size = size * sizeof(u32);
|
||||||
Fifo::PushFifoAuxBuffer(new_data, buf_size);
|
Fifo::PushFifoAuxBuffer(new_data, buf_size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue