shader.go 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // SPDX-License-Identifier: Unlicense OR MIT
  2. package shader
  3. type Sources struct {
  4. Name string
  5. SPIRV string
  6. GLSL100ES string
  7. GLSL150 string
  8. DXBC string
  9. MetalLib string
  10. Uniforms UniformsReflection
  11. Inputs []InputLocation
  12. Textures []TextureBinding
  13. StorageBuffers []BufferBinding
  14. Images []ImageBinding
  15. WorkgroupSize [3]int
  16. }
  17. type UniformsReflection struct {
  18. Locations []UniformLocation
  19. Size int
  20. }
  21. type ImageBinding struct {
  22. Name string
  23. Binding int
  24. }
  25. type BufferBinding struct {
  26. Name string
  27. Binding int
  28. }
  29. type TextureBinding struct {
  30. Name string
  31. Binding int
  32. }
  33. type UniformLocation struct {
  34. Name string
  35. Type DataType
  36. Size int
  37. Offset int
  38. }
  39. type InputLocation struct {
  40. // For GLSL.
  41. Name string
  42. Location int
  43. // For HLSL.
  44. Semantic string
  45. SemanticIndex int
  46. Type DataType
  47. Size int
  48. }
  49. type DataType uint8
  50. const (
  51. DataTypeFloat DataType = iota
  52. DataTypeInt
  53. DataTypeShort
  54. )