 5da1f038d8
			
		
	
	
		5da1f038d8
		
	
	
	
	
		
			
			This is a partial implemention of structurebuffers supporting: * structured buffer types of: * StructuredBuffer * RWStructuredBuffer * ByteAddressBuffer * RWByteAddressBuffer * Atomic operations on RWByteAddressBuffer * Load/Load[234], Store/Store[234], GetDimensions methods (where allowed by type) * globallycoherent flag But NOT yet supporting: * AppendStructuredBuffer / ConsumeStructuredBuffer types * IncrementCounter/DecrementCounter methods Please note: the stride returned by GetDimensions is as calculated by glslang for std430, and may not match other environments in all cases.
		
			
				
	
	
		
			16 lines
		
	
	
		
			302 B
		
	
	
	
		
			GLSL
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			302 B
		
	
	
	
		
			GLSL
		
	
	
	
	
	
| 
 | |
| RWByteAddressBuffer sbuf;
 | |
| 
 | |
| float4 main(uint pos : FOO) : SV_Target0
 | |
| {
 | |
|     uint size;
 | |
|     sbuf.GetDimensions(size);
 | |
| 
 | |
|     sbuf.Store(pos,  sbuf.Load(pos));
 | |
|     sbuf.Store2(pos, sbuf.Load2(pos));
 | |
|     sbuf.Store3(pos, sbuf.Load3(pos));
 | |
|     sbuf.Store4(pos, sbuf.Load4(pos));
 | |
| 
 | |
|     return sbuf.Load(pos);
 | |
| }
 |