diff options
author | Andrew Knight <andrew.knight@digia.com> | 2014-01-06 23:07:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-18 04:39:19 +0100 |
commit | 603eac2dfbd14e05a810873c1417aa8dcfa246b4 (patch) | |
tree | 498e605b337d33a221447a010ae5650b9301f04f /tests/auto/other | |
parent | a69525243f1355c7a6b68f00af0fe4fbfd1765e0 (diff) |
d3dcompiler_qt: Place compiler options in the shader file name
The compiler service needs to know what options to pass to the compiler,
and these options can affect the outcome of the shader blob. Runtime
compiled shader output must match this file name in the binary directory.
Pre-compiled shader blobs (e.g. those placed in a resource file) are
permitted to drop options from the file name if the implementor can
ensure the blob is compatible with the target.
Defines are not written out as options, but written into the shader
source, and therefore affect the cache key.
Change-Id: I11e4a43fcf6818ddb29aca5eba3d8647ba4021a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp b/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp index f86c965d84..1a34c2076b 100644 --- a/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp +++ b/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp @@ -329,8 +329,9 @@ void tst_d3dcompiler::onlineCompile() QVERIFY(path.exists(QStringLiteral("source"))); QVERIFY(path.exists(QStringLiteral("binary"))); - const QByteArray hash = QCryptographicHash::hash(data, QCryptographicHash::Sha1).toHex(); - QFile input(path.absoluteFilePath(QStringLiteral("source/") + hash)); + const QString fileName = QCryptographicHash::hash(data, QCryptographicHash::Sha1).toHex() + + QStringLiteral("!main!ps_4_0!0"); + QFile input(path.absoluteFilePath(QStringLiteral("source/") + fileName)); QTRY_VERIFY_WITH_TIMEOUT(input.exists(), 3000); QTRY_VERIFY_WITH_TIMEOUT(input.isOpen() || input.open(QFile::ReadOnly), 1000); @@ -351,7 +352,7 @@ void tst_d3dcompiler::onlineCompile() reference->Release(); // Write to output directory - QFile output(path.absoluteFilePath(QStringLiteral("binary/") + hash)); + QFile output(path.absoluteFilePath(QStringLiteral("binary/") + fileName)); QVERIFY(output.open(QFile::WriteOnly)); output.write(referenceData); output.close(); |