mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Fix up the atomic functions
It seems the base atomic functions should use const for the data parameters and just a reference for the mem parameter (not entirely sure yet as I need to check with spirv-val, but there are still build issues). Using __imageTexel correctly took a little thinking since it returns a pointer but the atomic functions take a reference.
This commit is contained in:
parent
88253a847b
commit
64bbdbda44
1 changed files with 20 additions and 20 deletions
|
@ -843,22 +843,22 @@ static const char *glsl_atomic_functions =
|
|||
SRC_LINE
|
||||
"#define uint unsigned" "\n"
|
||||
"#define inout @inout" "\n"
|
||||
"@overload uint atomicAdd(inout uint mem, uint data) = " SPV(OpAtomicIAdd) ";" "\n"
|
||||
"@overload int atomicAdd(inout int mem, int data) = " SPV(OpAtomicIAdd) ";" "\n"
|
||||
"@overload uint atomicMin(inout uint mem, uint data) = " SPV(OpAtomicUMin) ";" "\n"
|
||||
"@overload int atomicMin(inout int mem, int data) = " SPV(OpAtomicSMin) ";" "\n"
|
||||
"@overload uint atomicMax(inout uint mem, uint data) = " SPV(OpAtomicUMax) ";" "\n"
|
||||
"@overload int atomicMax(inout int mem, int data) = " SPV(OpAtomicUMax) ";" "\n"
|
||||
"@overload uint atomicAnd(inout uint mem, uint data) = " SPV(OpAtomicAnd) ";" "\n"
|
||||
"@overload int atomicAnd(inout int mem, int data) = " SPV(OpAtomicAnd) ";" "\n"
|
||||
"@overload uint atomicOr(inout uint mem, uint data) = " SPV(OpAtomicOr) ";" "\n"
|
||||
"@overload int atomicOr(inout int mem, int data) = " SPV(OpAtomicOr) ";" "\n"
|
||||
"@overload uint atomicXor(inout uint mem, uint data) = " SPV(OpAtomicXor) ";" "\n"
|
||||
"@overload int atomicXor(inout int mem, int data) = " SPV(OpAtomicXor) ";" "\n"
|
||||
"@overload uint atomicExchange(inout uint mem, uint data) = " SPV(OpAtomicExchange) ";" "\n"
|
||||
"@overload int atomicExchange(inout int mem, int data) = " SPV(OpAtomicExchange) ";" "\n"
|
||||
"@overload uint atomicCompSwap(inout uint mem, uint compare, uint data) = " SPV(OpAtomicCompareExchange) ";" "\n"
|
||||
"@overload int atomicCompSwap(inout int mem, int compare, int data) = " SPV(OpAtomicCompareExchange) ";" "\n"
|
||||
"@overload uint atomicAdd(inout uint mem, const uint data) = " SPV(OpAtomicIAdd) ";" "\n"
|
||||
"@overload int atomicAdd(inout int mem, const int data) = " SPV(OpAtomicIAdd) ";" "\n"
|
||||
"@overload uint atomicMin(inout uint mem, const uint data) = " SPV(OpAtomicUMin) ";" "\n"
|
||||
"@overload int atomicMin(inout int mem, const int data) = " SPV(OpAtomicSMin) ";" "\n"
|
||||
"@overload uint atomicMax(inout uint mem, const uint data) = " SPV(OpAtomicUMax) ";" "\n"
|
||||
"@overload int atomicMax(inout int mem, const int data) = " SPV(OpAtomicUMax) ";" "\n"
|
||||
"@overload uint atomicAnd(inout uint mem, const uint data) = " SPV(OpAtomicAnd) ";" "\n"
|
||||
"@overload int atomicAnd(inout int mem, const int data) = " SPV(OpAtomicAnd) ";" "\n"
|
||||
"@overload uint atomicOr(inout uint mem, const uint data) = " SPV(OpAtomicOr) ";" "\n"
|
||||
"@overload int atomicOr(inout int mem, const int data) = " SPV(OpAtomicOr) ";" "\n"
|
||||
"@overload uint atomicXor(inout uint mem, const uint data) = " SPV(OpAtomicXor) ";" "\n"
|
||||
"@overload int atomicXor(inout int mem, const int data) = " SPV(OpAtomicXor) ";" "\n"
|
||||
"@overload uint atomicExchange(inout uint mem, const uint data) = " SPV(OpAtomicExchange) ";" "\n"
|
||||
"@overload int atomicExchange(inout int mem, const int data) = " SPV(OpAtomicExchange) ";" "\n"
|
||||
"@overload uint atomicCompSwap(inout uint mem, const uint compare, const uint data) = " SPV(OpAtomicCompareExchange) ";" "\n"
|
||||
"@overload int atomicCompSwap(inout int mem, const int compare, const int data) = " SPV(OpAtomicCompareExchange) ";" "\n"
|
||||
"#undef uint" "\n"
|
||||
"#undef inout" "\n";
|
||||
|
||||
|
@ -897,12 +897,12 @@ SRC_LINE
|
|||
"type imageAtomic##op(IMAGE_PARAMS, type data) \\" "\n"
|
||||
"{ \\" "\n"
|
||||
" auto ptr = __imageTexel(image, P, 0); \\" "\n"
|
||||
" return atomic##op(ptr, data); \\" "\n"
|
||||
" return atomic##op(*ptr, data); \\" "\n"
|
||||
"} \\" "\n"
|
||||
"type imageAtomic##op(IMAGE_PARAMS_MS, type data) \\" "\n"
|
||||
"{ \\" "\n"
|
||||
" auto ptr = __imageTexel(image, P, sample); \\" "\n"
|
||||
" return atomic##op(ptr, data); \\" "\n"
|
||||
" return atomic##op(*ptr, data); \\" "\n"
|
||||
"}" "\n"
|
||||
"#define imageAtomic(op) \\" "\n"
|
||||
"__imageAtomic(op,uint) \\" "\n"
|
||||
|
@ -920,12 +920,12 @@ SRC_LINE
|
|||
"type imageAtomicCompSwap(IMAGE_PARAMS, type data) \\" "\n"
|
||||
"{ \\" "\n"
|
||||
" auto ptr = __imageTexel(image, P, 0); \\" "\n"
|
||||
" return atomicCompSwap(ptr, data); \\" "\n"
|
||||
" return atomicCompSwap(*ptr, data); \\" "\n"
|
||||
"} \\" "\n"
|
||||
"type imageAtomicCompSwap(IMAGE_PARAMS_MS, type data) \\" "\n"
|
||||
"{ \\" "\n"
|
||||
" auto ptr = __imageTexel(image, P, sample); \\" "\n"
|
||||
" return atomicCompSwap(ptr, data); \\" "\n"
|
||||
" return atomicCompSwap(*ptr, data); \\" "\n"
|
||||
"}" "\n"
|
||||
"__imageAtomicCompSwap(uint)" "\n"
|
||||
"__imageAtomicCompSwap(int)" "\n"
|
||||
|
|
Loading…
Reference in a new issue