internal/shaderir/msl: rename the package name

Updates #2010
This commit is contained in:
Hajime Hoshi 2022-03-10 16:24:56 +09:00
parent 5f97bdc1d3
commit 6f00221051
5 changed files with 10 additions and 10 deletions

View File

@ -67,7 +67,7 @@ func (s *Shader) init(device mtl.Device) error {
f = "Fragment" f = "Fragment"
) )
src := metal.Compile(s.ir, v, f) src := msl.Compile(s.ir, v, f)
lib, err := device.MakeLibrary(src, mtl.CompileOptions{}) lib, err := device.MakeLibrary(src, mtl.CompileOptions{})
if err != nil { if err != nil {
return fmt.Errorf("metal: device.MakeLibrary failed: %v, source: %s", err, src) return fmt.Errorf("metal: device.MakeLibrary failed: %v, source: %s", err, src)

View File

@ -46,8 +46,8 @@ func glslFragmentNormalize(str string) string {
} }
func metalNormalize(str string) string { func metalNormalize(str string) string {
if strings.HasPrefix(str, metal.Prelude) { if strings.HasPrefix(str, msl.Prelude) {
str = str[len(metal.Prelude):] str = str[len(msl.Prelude):]
} }
return strings.TrimSpace(str) return strings.TrimSpace(str)
} }
@ -176,7 +176,7 @@ func TestCompile(t *testing.T) {
} }
if tc.Metal != nil { if tc.Metal != nil {
m := metal.Compile(s, "Vertex", "Fragment") m := msl.Compile(s, "Vertex", "Fragment")
if got, want := metalNormalize(m), metalNormalize(string(tc.Metal)); got != want { if got, want := metalNormalize(m), metalNormalize(string(tc.Metal)); got != want {
compare(t, "Metal", got, want) compare(t, "Metal", got, want)
} }
@ -184,7 +184,7 @@ func TestCompile(t *testing.T) {
// Just check that Compile doesn't cause panic. // Just check that Compile doesn't cause panic.
// TODO: Should the results be tested? // TODO: Should the results be tested?
metal.Compile(s, "Vertex", "Fragmentp") msl.Compile(s, "Vertex", "Fragmentp")
}) })
} }
} }

View File

@ -783,7 +783,7 @@ void F0(in float l0, in float l1, out float l2) {
l2 = l4; l2 = l4;
} }
}`, }`,
Metal: metal.Prelude + ` Metal: msl.Prelude + `
void F0(float l0, float l1, thread float& l2); void F0(float l0, float l1, thread float& l2);
@ -879,7 +879,7 @@ void F0(in float l0, in float l1, out float l2) {
l2 = l5; l2 = l5;
} }
}`, }`,
Metal: metal.Prelude + ` Metal: msl.Prelude + `
void F0(float l0, float l1, thread float& l2); void F0(float l0, float l1, thread float& l2);
@ -1046,7 +1046,7 @@ void main(void) {
t.Errorf("%s fragment: got: %s, want: %s", tc.Name, got, want) t.Errorf("%s fragment: got: %s, want: %s", tc.Name, got, want)
} }
} }
m := metal.Compile(&tc.Program, "Vertex", "Fragment") m := msl.Compile(&tc.Program, "Vertex", "Fragment")
if tc.Metal != "" { if tc.Metal != "" {
got := m got := m
want := tc.Metal + "\n" want := tc.Metal + "\n"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package metal package msl
import ( import (
"fmt" "fmt"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package metal package msl
import ( import (
"fmt" "fmt"