spirv-cross 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -9
- data/exe/spirv-dump +9 -0
- data/lib/spirv/cross/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb194ce8b2a446d9a001e805612cda73fab6a8427fc2e5f26f28b6fcdcbd2ac8
|
4
|
+
data.tar.gz: d5026e933273619449fcac4b51813dc2ac1157ee2602057c790e753d963dc0ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44bd431febeed0c878bebb574bbcd43626eec98021fe9b28332751347cecf9b76d557cd8277e7301d552b25dafa7ac9d3a8ab7029d7b4e057ef47ea2a5cde609
|
7
|
+
data.tar.gz: 896b277dfeaf2074a7904082c28f091285cecf52a5a0530a0bcd754fcb2de6555fb52db6d2fc4ab095fa23acff36f1bbc78952bbff513461b7943b66199c7bf3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
Provides Ruby bindings for [SPIRV-Cross](https://github.com/KhronosGroup/SPIRV-Cross).
|
4
4
|
|
5
|
+
* **NOTE:** In addition to reflection,
|
6
|
+
[SPIRV-Cross](https://github.com/KhronosGroup/SPIRV-Cross) provides the ability
|
7
|
+
to compile a shader to other languages (GLSL, HLSL, C++, etc). However, that
|
8
|
+
functionality has not been exposed to Ruby by this gem as of this writing.
|
9
|
+
If this functionality is desired, [create an issue](https://github.com/sinisterchipmunk/spirv-cross-ruby/issues)
|
10
|
+
so that the need can be tracked. Or better yet, add it yourself and send a pull
|
11
|
+
request. (Unit tests, please.)
|
12
|
+
|
13
|
+
|
5
14
|
## Installation
|
6
15
|
|
7
16
|
Add this line to your application's Gemfile:
|
@@ -18,17 +27,18 @@ Or install it yourself as:
|
|
18
27
|
|
19
28
|
$ gem install spirv-cross
|
20
29
|
|
21
|
-
##
|
30
|
+
## CLI
|
22
31
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
32
|
+
In addition to the Ruby API (see below), this gem bundles an executable called
|
33
|
+
`spirv-dump`. It takes in a single command line argument (filename) and prints
|
34
|
+
all information that can be reflected from it by this gem. This is useful for
|
35
|
+
quickly taking a look at a SPIR-V shader, for example for debugging purposes.
|
36
|
+
|
37
|
+
$ spirv-dump path/to/shader.spv
|
38
|
+
|
39
|
+
## API
|
30
40
|
|
31
|
-
compiler = SPIRV::Cross::Compiler(File.open('path/to/shader', 'rb').read)
|
41
|
+
compiler = SPIRV::Cross::Compiler(File.open('path/to/shader.spv', 'rb').read)
|
32
42
|
|
33
43
|
pp compiler.specialization_constants
|
34
44
|
#=> [{:constant_id=>20, :name=>"Const"}]
|
data/exe/spirv-dump
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/bin/env ruby
|
2
|
+
require 'spirv-cross'
|
3
|
+
require 'pp'
|
4
|
+
compiler = SPIRV::Cross::Compiler.new(File.open(ARGV[0], 'rb').read)
|
5
|
+
pp({
|
6
|
+
shader_resources: compiler.shader_resources,
|
7
|
+
specialization_constants: compiler.specialization_constants,
|
8
|
+
entry_points: compiler.entry_points
|
9
|
+
})
|
data/lib/spirv/cross/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spirv-cross
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin MacKenzie IV
|
@@ -69,7 +69,8 @@ dependencies:
|
|
69
69
|
description:
|
70
70
|
email:
|
71
71
|
- sinisterchipmunk@gmail.com
|
72
|
-
executables:
|
72
|
+
executables:
|
73
|
+
- spirv-dump
|
73
74
|
extensions:
|
74
75
|
- ext/spirv_cross/extconf.rb
|
75
76
|
extra_rdoc_files: []
|
@@ -83,6 +84,7 @@ files:
|
|
83
84
|
- Rakefile
|
84
85
|
- bin/console
|
85
86
|
- bin/setup
|
87
|
+
- exe/spirv-dump
|
86
88
|
- ext/spirv_cross/extconf.rb
|
87
89
|
- ext/spirv_cross/rb_spirv_cross.h
|
88
90
|
- ext/spirv_cross/rb_spvx_compiler.cpp
|