internal/cmd/convertshaders: target 9.1 compatibility shader model

Direct3D 11 supports Direct3D 9.1 level hardware, but only if the shaders are
compiled for target 4_0_level_9_1.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-28 15:19:31 +01:00
parent 1d3a9fb2d6
commit b194a0ce58
3 changed files with 21 additions and 15 deletions
+8 -2
View File
@@ -115,9 +115,15 @@ func generate() error {
return fmt.Errorf("unrecognized shader type %s", shader)
}
var hlslc []byte
hlslc, err = compileHLSL(hlsl, "main", hlslProf+"_4_0")
hlslc, err = compileHLSL(hlsl, "main", hlslProf+"_4_0_level_9_1")
if err != nil {
return err
// Attempt shader model 4.0. Only the app/headless
// test shaders use features not supported by level
// 9.1.
hlslc, err = compileHLSL(hlsl, "main", hlslProf+"_4_0")
if err != nil {
return err
}
}
// OpenGL 3.2 Core only accepts GLSL version 1.50, but is
// otherwise compatible with version 1.30.