mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:02:45 +00:00 
			
		
		
		
	 f1de4f8872
			
		
	
	
		f1de4f8872
		
	
	
	
	
		
			
			For now, this is limited to strings that are 3 bytes or less. We can use 7 bytes on 64-bit platforms, but we do not yet assume 64-bit for Lagom hosts (e.g. wasm).
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			928 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			928 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibGLSL/Linker.h>
 | |
| 
 | |
| namespace GLSL {
 | |
| 
 | |
| ErrorOr<NonnullOwnPtr<LinkedShader>> Linker::link(Vector<ObjectFile const*> const&)
 | |
| {
 | |
|     // FIXME: implement this function
 | |
|     m_messages = {};
 | |
| 
 | |
|     GPU::IR::Shader shader;
 | |
| 
 | |
|     auto input_name = TRY(String::from_utf8("input0"sv));
 | |
|     auto output_name = TRY(String::from_utf8("output0"sv));
 | |
|     TRY(shader.inputs.try_append({ move(input_name), GPU::IR::StorageType::Vector4 }));
 | |
|     TRY(shader.outputs.try_append({ move(output_name), GPU::IR::StorageType::Vector4 }));
 | |
|     GPU::IR::Instruction instruction {
 | |
|         GPU::IR::Opcode::Move,
 | |
|         { { GPU::IR::StorageLocation::Input, 0 } },
 | |
|         { GPU::IR::StorageLocation::Output, 0 }
 | |
|     };
 | |
|     TRY(shader.instructions.try_append(instruction));
 | |
| 
 | |
|     return adopt_own(*new LinkedShader(shader));
 | |
| }
 | |
| 
 | |
| }
 |