31 lines
		
	
	
		
			376 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			376 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package shader
 | 
						|
 | 
						|
import "zworld/engine/renderapi/device"
 | 
						|
 | 
						|
type Ref interface {
 | 
						|
	Key() string
 | 
						|
	Version() int
 | 
						|
 | 
						|
	Load(device.T) T
 | 
						|
}
 | 
						|
 | 
						|
type ref struct {
 | 
						|
	name string
 | 
						|
}
 | 
						|
 | 
						|
func NewRef(name string) Ref {
 | 
						|
	return &ref{name: name}
 | 
						|
}
 | 
						|
 | 
						|
func (r *ref) Key() string {
 | 
						|
	return r.name
 | 
						|
}
 | 
						|
 | 
						|
func (r *ref) Version() int {
 | 
						|
	return 1
 | 
						|
}
 | 
						|
 | 
						|
func (r *ref) Load(dev device.T) T {
 | 
						|
	return New(dev, r.name)
 | 
						|
}
 |