]> git.cworth.org Git - apitrace-tests/commitdiff
Add a d3d10 level 9 test case.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 25 Oct 2012 10:45:59 +0000 (11:45 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 25 Oct 2012 10:46:13 +0000 (11:46 +0100)
14 files changed:
apps/d3d10/tri.cpp
apps/d3d10_1/CMakeLists.txt
apps/d3d10_1/tri.cpp
apps/d3d10_1/tri_level_9_1.cpp [new file with mode: 0644]
apps/d3d10_1/tri_level_9_1.ref.txt [new file with mode: 0644]
apps/d3d11/tri.cpp
apps/d3d11_1/tri.cpp
apps/d3dcommon/CMakeLists.txt
apps/d3dcommon/tri_ps.h [deleted file]
apps/d3dcommon/tri_ps_4_0.h [new file with mode: 0755]
apps/d3dcommon/tri_ps_4_0_level_9_1.h [new file with mode: 0755]
apps/d3dcommon/tri_vs.h [deleted file]
apps/d3dcommon/tri_vs_4_0.h [new file with mode: 0755]
apps/d3dcommon/tri_vs_4_0_level_9_1.h [new file with mode: 0755]

index 737d27d589a4d37c08d3d58a8831a1318cabcba3..8c26be958ab027a0584f829f21b6db0235ff3c4f 100644 (file)
@@ -34,8 +34,8 @@
 
 #include <d3d10.h>
 
 
 #include <d3d10.h>
 
-#include "tri_vs.h"
-#include "tri_ps.h"
+#include "tri_vs_4_0.h"
+#include "tri_ps_4_0.h"
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
@@ -88,6 +88,11 @@ int main(int argc, char *argv[]){
 
     ShowWindow(hWnd, SW_SHOW);
 
 
     ShowWindow(hWnd, SW_SHOW);
 
+    UINT Flags = 0;
+    if (LoadLibraryA("d3d10sdklayers")) {
+        Flags |= D3D10_CREATE_DEVICE_DEBUG;
+    }
+
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
@@ -105,7 +110,7 @@ int main(int argc, char *argv[]){
     hr = D3D10CreateDeviceAndSwapChain(NULL,
                                        D3D10_DRIVER_TYPE_HARDWARE,
                                        NULL,
     hr = D3D10CreateDeviceAndSwapChain(NULL,
                                        D3D10_DRIVER_TYPE_HARDWARE,
                                        NULL,
-                                       D3D10_CREATE_DEVICE_DEBUG,
+                                       Flags,
                                        D3D10_SDK_VERSION,
                                        &SwapChainDesc,
                                        &g_pSwapChain,
                                        D3D10_SDK_VERSION,
                                        &SwapChainDesc,
                                        &g_pSwapChain,
@@ -211,8 +216,12 @@ int main(int argc, char *argv[]){
     RasterizerDesc.CullMode = D3D10_CULL_NONE;
     RasterizerDesc.FillMode = D3D10_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
     RasterizerDesc.CullMode = D3D10_CULL_NONE;
     RasterizerDesc.FillMode = D3D10_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
+    RasterizerDesc.DepthClipEnable = true;
     ID3D10RasterizerState* pRasterizerState = NULL;
     ID3D10RasterizerState* pRasterizerState = NULL;
-    g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    hr = g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    if (FAILED(hr)) {
+        return 1;
+    }
     g_pDevice->RSSetState(pRasterizerState);
 
     g_pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
     g_pDevice->RSSetState(pRasterizerState);
 
     g_pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
index 2f4355c55285f835130fb624a4b147ebf6f5a642..83455bc0f0b0295cead0bccb1ffe6212c9be980e 100644 (file)
@@ -11,6 +11,7 @@ set (api d3d10_1)
 
 set (targets
     tri
 
 set (targets
     tri
+    tri_level_9_1
 )
 
 foreach (target ${targets})
 )
 
 foreach (target ${targets})
index 3efa49b78c4c19a975b064541e21da2ccdf8af52..2186d39411cd37bc848eecfe640e2befce5bef94 100644 (file)
@@ -34,8 +34,8 @@
 
 #include <d3d10_1.h>
 
 
 #include <d3d10_1.h>
 
-#include "tri_vs.h"
-#include "tri_ps.h"
+#include "tri_vs_4_0.h"
+#include "tri_ps_4_0.h"
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
@@ -88,6 +88,11 @@ int main(int argc, char *argv[]){
 
     ShowWindow(hWnd, SW_SHOW);
 
 
     ShowWindow(hWnd, SW_SHOW);
 
+    UINT Flags = 0;
+    if (LoadLibraryA("d3d10sdklayers")) {
+        Flags |= D3D10_CREATE_DEVICE_DEBUG;
+    }
+
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
@@ -105,7 +110,7 @@ int main(int argc, char *argv[]){
     hr = D3D10CreateDeviceAndSwapChain1(NULL,
                                         D3D10_DRIVER_TYPE_HARDWARE,
                                         NULL,
     hr = D3D10CreateDeviceAndSwapChain1(NULL,
                                         D3D10_DRIVER_TYPE_HARDWARE,
                                         NULL,
-                                        D3D10_CREATE_DEVICE_DEBUG,
+                                        Flags,
                                         D3D10_FEATURE_LEVEL_10_0,
                                         D3D10_1_SDK_VERSION,
                                         &SwapChainDesc,
                                         D3D10_FEATURE_LEVEL_10_0,
                                         D3D10_1_SDK_VERSION,
                                         &SwapChainDesc,
@@ -212,8 +217,12 @@ int main(int argc, char *argv[]){
     RasterizerDesc.CullMode = D3D10_CULL_NONE;
     RasterizerDesc.FillMode = D3D10_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
     RasterizerDesc.CullMode = D3D10_CULL_NONE;
     RasterizerDesc.FillMode = D3D10_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
+    RasterizerDesc.DepthClipEnable = true;
     ID3D10RasterizerState* pRasterizerState = NULL;
     ID3D10RasterizerState* pRasterizerState = NULL;
-    g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    hr = g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    if (FAILED(hr)) {
+        return 1;
+    }
     g_pDevice->RSSetState(pRasterizerState);
 
     g_pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
     g_pDevice->RSSetState(pRasterizerState);
 
     g_pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
diff --git a/apps/d3d10_1/tri_level_9_1.cpp b/apps/d3d10_1/tri_level_9_1.cpp
new file mode 100644 (file)
index 0000000..4c65e76
--- /dev/null
@@ -0,0 +1,265 @@
+/**************************************************************************
+ *
+ * Copyright 2012 Jose Fonseca
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include <stdio.h>
+#include <stddef.h>
+
+#include <initguid.h>
+#include <windows.h>
+
+#include "compat.h"
+
+#include <d3d10_1.h>
+
+#include "tri_vs_4_0_level_9_1.h"
+#include "tri_ps_4_0_level_9_1.h"
+
+
+static IDXGISwapChain* g_pSwapChain = NULL;
+static ID3D10Device1 * g_pDevice = NULL;
+
+
+int main(int argc, char *argv[]){
+    HRESULT hr;
+
+    HINSTANCE hInstance = GetModuleHandle(NULL);
+
+    WNDCLASSEX wc = {
+        sizeof(WNDCLASSEX),
+        CS_CLASSDC,
+        DefWindowProc,
+        0,
+        0,
+        hInstance,
+        NULL,
+        NULL,
+        NULL,
+        NULL,
+        "SimpleDX10",
+        NULL
+    };
+    RegisterClassEx(&wc);
+
+    const int WindowWidth = 250;
+    const int WindowHeight = 250;
+    BOOL Windowed = TRUE;
+
+    DWORD dwStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW;
+
+    RECT rect = {0, 0, WindowWidth, WindowHeight};
+    AdjustWindowRect(&rect, dwStyle, FALSE);
+
+    HWND hWnd = CreateWindow(wc.lpszClassName,
+                             "Simple example using DirectX10",
+                             dwStyle,
+                             CW_USEDEFAULT, CW_USEDEFAULT,
+                             rect.right - rect.left,
+                             rect.bottom - rect.top,
+                             NULL,
+                             NULL,
+                             hInstance,
+                             NULL);
+    if (!hWnd) {
+        return 1;
+    }
+
+    ShowWindow(hWnd, SW_SHOW);
+
+    UINT Flags = 0;
+    if (LoadLibraryA("d3d10sdklayers")) {
+        Flags |= D3D10_CREATE_DEVICE_DEBUG;
+    }
+
+    DXGI_SWAP_CHAIN_DESC SwapChainDesc;
+    ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
+    SwapChainDesc.BufferDesc.Width = WindowWidth;
+    SwapChainDesc.BufferDesc.Height = WindowHeight;
+    SwapChainDesc.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;;
+    SwapChainDesc.BufferDesc.RefreshRate.Numerator = 60;
+    SwapChainDesc.BufferDesc.RefreshRate.Denominator = 1;
+    SwapChainDesc.SampleDesc.Quality = 0;
+    SwapChainDesc.SampleDesc.Count = 1;
+    SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+    SwapChainDesc.BufferCount = 2;
+    SwapChainDesc.OutputWindow = hWnd;
+    SwapChainDesc.Windowed = true;
+
+    hr = D3D10CreateDeviceAndSwapChain1(NULL,
+                                        D3D10_DRIVER_TYPE_HARDWARE,
+                                        NULL,
+                                        Flags,
+                                        D3D10_FEATURE_LEVEL_9_1,
+                                        D3D10_1_SDK_VERSION,
+                                        &SwapChainDesc,
+                                        &g_pSwapChain,
+                                        &g_pDevice);
+    if (FAILED(hr)) {
+        return 1;
+    }
+
+    ID3D10RenderTargetView *pRenderTargetView = NULL;
+    ID3D10Texture2D* pBackBuffer;
+    hr = g_pSwapChain->GetBuffer(0, IID_ID3D10Texture2D, (void **)&pBackBuffer);
+    if (FAILED(hr)) {
+        return 1;
+    }
+    hr = g_pDevice->CreateRenderTargetView(pBackBuffer, NULL, &pRenderTargetView);
+    if (FAILED(hr)) {
+        return 1;
+    }
+    pBackBuffer->Release();
+
+    g_pDevice->OMSetRenderTargets(1, &pRenderTargetView, NULL);
+
+    const float clearColor[4] = { 0.3f, 0.1f, 0.3f, 1.0f };
+    g_pDevice->ClearRenderTargetView(pRenderTargetView, clearColor);
+
+    ID3D10VertexShader * pVertexShader;
+    hr = g_pDevice->CreateVertexShader(g_VS, sizeof g_VS, &pVertexShader);
+    if (FAILED(hr)) {
+        return 1;
+    }
+
+    struct Vertex {
+        float position[4];
+        float color[4];
+    };
+
+    static const D3D10_INPUT_ELEMENT_DESC InputElementDescs[] = {
+        { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, offsetof(Vertex, position), D3D10_INPUT_PER_VERTEX_DATA, 0 },
+        { "COLOR",    0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, offsetof(Vertex, color),    D3D10_INPUT_PER_VERTEX_DATA, 0 }
+    };
+
+    ID3D10InputLayout *pVertexLayout = NULL;
+    hr = g_pDevice->CreateInputLayout(InputElementDescs,
+                                      2,
+                                      g_VS,
+                                      sizeof g_VS,
+                                      &pVertexLayout);
+    if (FAILED(hr)) {
+        return 1;
+    }
+
+    g_pDevice->IASetInputLayout(pVertexLayout);
+
+    ID3D10PixelShader * pPixelShader;
+    hr = g_pDevice->CreatePixelShader(g_PS, sizeof g_PS, &pPixelShader);
+    if (FAILED(hr)) {
+        return 1;
+    }
+
+    g_pDevice->VSSetShader(pVertexShader);
+    g_pDevice->PSSetShader(pPixelShader);
+
+    static const Vertex vertices[] = {
+        { { -0.9f, -0.9f, 0.5f, 1.0f}, { 0.8f, 0.0f, 0.0f, 0.1f } },
+        { {  0.9f, -0.9f, 0.5f, 1.0f}, { 0.0f, 0.9f, 0.0f, 0.1f } },
+        { {  0.0f,  0.9f, 0.5f, 1.0f}, { 0.0f, 0.0f, 0.7f, 0.1f } },
+    };
+
+    D3D10_BUFFER_DESC BufferDesc;
+    ZeroMemory(&BufferDesc, sizeof BufferDesc);
+    BufferDesc.Usage = D3D10_USAGE_DYNAMIC;
+    BufferDesc.ByteWidth = sizeof vertices;
+    BufferDesc.BindFlags = D3D10_BIND_VERTEX_BUFFER;
+    BufferDesc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
+    BufferDesc.MiscFlags = 0;
+
+    ID3D10Buffer *pVertexBuffer;
+    hr = g_pDevice->CreateBuffer(&BufferDesc, NULL, &pVertexBuffer);
+    if (FAILED(hr)) {
+        return 1;
+    }
+
+    void *pMap = NULL;
+    pVertexBuffer->Map(D3D10_MAP_WRITE_DISCARD, 0, &pMap);
+    memcpy(pMap, vertices, sizeof vertices);
+    pVertexBuffer->Unmap();
+
+    UINT Stride = sizeof(Vertex);
+    UINT Offset = 0;
+    g_pDevice->IASetVertexBuffers(0, 1, &pVertexBuffer, &Stride, &Offset);
+    
+    D3D10_VIEWPORT ViewPort;
+    ViewPort.TopLeftX = 0;
+    ViewPort.TopLeftY = 0;
+    ViewPort.Width = WindowWidth;
+    ViewPort.Height = WindowHeight;
+    ViewPort.MinDepth = 0.0f;
+    ViewPort.MaxDepth = 1.0f;
+    g_pDevice->RSSetViewports(1, &ViewPort);
+    
+    D3D10_RASTERIZER_DESC RasterizerDesc;
+    ZeroMemory(&RasterizerDesc, sizeof RasterizerDesc);
+    RasterizerDesc.CullMode = D3D10_CULL_NONE;
+    RasterizerDesc.FillMode = D3D10_FILL_SOLID;
+    RasterizerDesc.FrontCounterClockwise = true;
+    RasterizerDesc.DepthClipEnable = true;
+    ID3D10RasterizerState* pRasterizerState = NULL;
+    hr = g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    if (FAILED(hr)) {
+        return 1;
+    }
+    g_pDevice->RSSetState(pRasterizerState);
+
+    g_pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+    g_pDevice->Draw(3, 0);
+
+    g_pSwapChain->Present(0, 0);
+
+
+    ID3D10Buffer *pNullBuffer = NULL;
+    UINT NullStride = 0;
+    UINT NullOffset = 0;
+    g_pDevice->IASetVertexBuffers(0, 1, &pNullBuffer, &NullStride, &NullOffset);
+    pVertexBuffer->Release();
+
+    g_pDevice->OMSetRenderTargets(0, NULL, NULL);
+    pRenderTargetView->Release();
+
+    g_pDevice->IASetInputLayout(NULL);
+    pVertexLayout->Release();
+
+    g_pDevice->VSSetShader(NULL);
+    pVertexShader->Release();
+
+    g_pDevice->PSSetShader(NULL);
+    pPixelShader->Release();
+
+    g_pDevice->RSSetState(NULL);
+    pRasterizerState->Release();
+
+    g_pSwapChain->Release();
+    g_pSwapChain = NULL;
+
+    g_pDevice->Release();
+    g_pDevice = NULL;
+
+    DestroyWindow(hWnd);
+
+    return 0;
+}
+
diff --git a/apps/d3d10_1/tri_level_9_1.ref.txt b/apps/d3d10_1/tri_level_9_1.ref.txt
new file mode 100644 (file)
index 0000000..e69de29
index 28f930298e2a30b45d0b442947cfb1f2c2ba77f9..b8a2c042903806ebc62b7e0c0a4c0c6001fd1acb 100644 (file)
@@ -34,8 +34,8 @@
 
 #include <d3d11.h>
 
 
 #include <d3d11.h>
 
-#include "tri_vs.h"
-#include "tri_ps.h"
+#include "tri_vs_4_0.h"
+#include "tri_ps_4_0.h"
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
@@ -89,6 +89,11 @@ int main(int argc, char *argv[]){
 
     ShowWindow(hWnd, SW_SHOW);
 
 
     ShowWindow(hWnd, SW_SHOW);
 
+    UINT Flags = 0;
+    if (LoadLibraryA("d3d11sdklayers")) {
+        Flags |= D3D11_CREATE_DEVICE_DEBUG;
+    }
+
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
@@ -112,7 +117,7 @@ int main(int argc, char *argv[]){
     hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */
                                        D3D_DRIVER_TYPE_HARDWARE,
                                        NULL, /* Software */
     hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */
                                        D3D_DRIVER_TYPE_HARDWARE,
                                        NULL, /* Software */
-                                       D3D11_CREATE_DEVICE_DEBUG,
+                                       Flags,
                                        FeatureLevels,
                                        sizeof FeatureLevels / sizeof FeatureLevels[0],
                                        D3D11_SDK_VERSION,
                                        FeatureLevels,
                                        sizeof FeatureLevels / sizeof FeatureLevels[0],
                                        D3D11_SDK_VERSION,
@@ -222,8 +227,12 @@ int main(int argc, char *argv[]){
     RasterizerDesc.CullMode = D3D11_CULL_NONE;
     RasterizerDesc.FillMode = D3D11_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
     RasterizerDesc.CullMode = D3D11_CULL_NONE;
     RasterizerDesc.FillMode = D3D11_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
+    RasterizerDesc.DepthClipEnable = true;
     ID3D11RasterizerState* pRasterizerState = NULL;
     ID3D11RasterizerState* pRasterizerState = NULL;
-    g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    hr = g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    if (FAILED(hr)) {
+        return 1;
+    }
     g_pDeviceContext->RSSetState(pRasterizerState);
 
     g_pDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
     g_pDeviceContext->RSSetState(pRasterizerState);
 
     g_pDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
index bf962fca9e6349f416d2f43cb60823341415a8c3..f86ab7c2b46168902c79d2dd763c8357cdd23c67 100644 (file)
@@ -34,8 +34,8 @@
 
 #include <d3d11_1.h>
 
 
 #include <d3d11_1.h>
 
-#include "tri_vs.h"
-#include "tri_ps.h"
+#include "tri_vs_4_0.h"
+#include "tri_ps_4_0.h"
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
 
 
 static IDXGISwapChain* g_pSwapChain = NULL;
@@ -91,6 +91,11 @@ int main(int argc, char *argv[]){
 
     ShowWindow(hWnd, SW_SHOW);
 
 
     ShowWindow(hWnd, SW_SHOW);
 
+    UINT Flags = 0;
+    if (LoadLibraryA("d3d11sdklayers")) {
+        Flags |= D3D11_CREATE_DEVICE_DEBUG;
+    }
+
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
     DXGI_SWAP_CHAIN_DESC SwapChainDesc;
     ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc);
     SwapChainDesc.BufferDesc.Width = WindowWidth;
@@ -115,7 +120,7 @@ int main(int argc, char *argv[]){
     hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */
                                        D3D_DRIVER_TYPE_HARDWARE,
                                        NULL, /* Software */
     hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */
                                        D3D_DRIVER_TYPE_HARDWARE,
                                        NULL, /* Software */
-                                       D3D11_CREATE_DEVICE_DEBUG,
+                                       Flags,
                                        FeatureLevels,
                                        sizeof FeatureLevels / sizeof FeatureLevels[0],
                                        D3D11_SDK_VERSION,
                                        FeatureLevels,
                                        sizeof FeatureLevels / sizeof FeatureLevels[0],
                                        D3D11_SDK_VERSION,
@@ -235,8 +240,12 @@ int main(int argc, char *argv[]){
     RasterizerDesc.CullMode = D3D11_CULL_NONE;
     RasterizerDesc.FillMode = D3D11_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
     RasterizerDesc.CullMode = D3D11_CULL_NONE;
     RasterizerDesc.FillMode = D3D11_FILL_SOLID;
     RasterizerDesc.FrontCounterClockwise = true;
+    RasterizerDesc.DepthClipEnable = true;
     ID3D11RasterizerState* pRasterizerState = NULL;
     ID3D11RasterizerState* pRasterizerState = NULL;
-    g_pDevice1->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    hr = g_pDevice1->CreateRasterizerState(&RasterizerDesc, &pRasterizerState);
+    if (FAILED(hr)) {
+        return 1;
+    }
     g_pDeviceContext1->RSSetState(pRasterizerState);
 
     g_pDeviceContext1->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
     g_pDeviceContext1->RSSetState(pRasterizerState);
 
     g_pDeviceContext1->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
index 2bf14fee114def8c797ac17c04b44d60764e03a5..0bf6111e5991187d23428b0625a29d10b8fadfdb 100644 (file)
@@ -1,13 +1,25 @@
-add_custom_command (
-    OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tri_vs.h
-    COMMAND ${DirectX_FXC_EXECUTABLE} /nologo /T vs_4_0 /E VS /Fh ${CMAKE_CURRENT_SOURCE_DIR}/tri_vs.h ${CMAKE_CURRENT_SOURCE_DIR}/tri.fx
-    DEPENDS tri.fx
-)
-
-add_custom_command (
-    OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tri_ps.h
-    COMMAND ${DirectX_FXC_EXECUTABLE} /nologo /T ps_4_0 /E PS /Fh ${CMAKE_CURRENT_SOURCE_DIR}/tri_ps.h ${CMAKE_CURRENT_SOURCE_DIR}/tri.fx
-    DEPENDS tri.fx
-)
-
-add_custom_target (hlsl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tri_vs.h ${CMAKE_CURRENT_SOURCE_DIR}/tri_ps.h)
+set (HEADERS)
+
+macro (fxc VS_PROFILE PS_PROFILE)
+    set (VS_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/tri_${VS_PROFILE}.h)
+    set (PS_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/tri_${PS_PROFILE}.h)
+
+    add_custom_command (
+        OUTPUT ${VS_HEADER}
+        COMMAND ${DirectX_FXC_EXECUTABLE} /nologo /Qstrip_reflect /T ${VS_PROFILE} /E VS /Fh ${VS_HEADER} ${CMAKE_CURRENT_SOURCE_DIR}/tri.fx
+        DEPENDS tri.fx
+    )
+
+    add_custom_command (
+        OUTPUT ${PS_HEADER}
+        COMMAND ${DirectX_FXC_EXECUTABLE} /nologo /Qstrip_reflect /T ${PS_PROFILE} /E PS /Fh ${PS_HEADER} ${CMAKE_CURRENT_SOURCE_DIR}/tri.fx
+        DEPENDS tri.fx
+    )
+
+    set (HEADERS ${HEADERS} ${VS_HEADER} ${PS_HEADER})
+endmacro ()
+
+fxc (vs_4_0 ps_4_0)
+fxc (vs_4_0_level_9_1 ps_4_0_level_9_1)
+
+add_custom_target (hlsl DEPENDS ${HEADERS})
diff --git a/apps/d3dcommon/tri_ps.h b/apps/d3dcommon/tri_ps.h
deleted file mode 100644 (file)
index 0c9302a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
-//
-//
-//   fxc /T ps_4_0 /E PS /Fh apps\d3d10\tri_ps.h apps\d3d10\tri.fx
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue Format   Used
-// -------------------- ----- ------ -------- -------- ------ ------
-// SV_POSITION              0   xyzw        0      POS  float       
-// COLOR                    0   xyzw        1     NONE  float   xyzw
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue Format   Used
-// -------------------- ----- ------ -------- -------- ------ ------
-// SV_Target                0   xyzw        0   TARGET  float   xyzw
-//
-ps_4_0
-dcl_input_ps linear v1.xyzw
-dcl_output o0.xyzw
-mov o0.xyzw, v1.xyzw
-ret 
-// Approximately 2 instruction slots used
-#endif
-
-const BYTE g_PS[] =
-{
-     68,  88,  66,  67, 150,  24, 
-     98, 193, 223, 185,  25,  11, 
-    105,   3, 199, 138,  10,  93, 
-     81,  50,   1,   0,   0,   0, 
-    208,   1,   0,   0,   5,   0, 
-      0,   0,  52,   0,   0,   0, 
-    140,   0,   0,   0, 224,   0, 
-      0,   0,  20,   1,   0,   0, 
-     84,   1,   0,   0,  82,  68, 
-     69,  70,  80,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-     28,   0,   0,   0,  77, 105, 
-     99, 114, 111, 115, 111, 102, 
-    116,  32,  40,  82,  41,  32, 
-     72,  76,  83,  76,  32,  83, 
-    104,  97, 100, 101, 114,  32, 
-     67, 111, 109, 112, 105, 108, 
-    101, 114,  32,  57,  46,  50, 
-     57,  46,  57,  53,  50,  46, 
-     51,  49,  49,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     76,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,  15,  15,   0,   0, 
-     83,  86,  95,  80,  79,  83, 
-     73,  84,  73,  79,  78,   0, 
-     67,  79,  76,  79,  82,   0, 
-    171, 171,  79,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     83,  86,  95,  84,  97, 114, 
-    103, 101, 116,   0, 171, 171, 
-     83,  72,  68,  82,  56,   0, 
-      0,   0,  64,   0,   0,   0, 
-     14,   0,   0,   0,  98,  16, 
-      0,   3, 242,  16,  16,   0, 
-      1,   0,   0,   0, 101,   0, 
-      0,   3, 242,  32,  16,   0, 
-      0,   0,   0,   0,  54,   0, 
-      0,   5, 242,  32,  16,   0, 
-      0,   0,   0,   0,  70,  30, 
-     16,   0,   1,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0
-};
diff --git a/apps/d3dcommon/tri_ps_4_0.h b/apps/d3dcommon/tri_ps_4_0.h
new file mode 100755 (executable)
index 0000000..27583cb
--- /dev/null
@@ -0,0 +1,76 @@
+#if 0
+//
+// Generated by Microsoft (R) D3D Shader Disassembler
+//
+//
+//   fxc /nologo /Qstrip_reflect /T ps_4_0 /E PS /Fh
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri_ps_4_0.h
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri.fx
+//
+//
+// Input signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION              0   xyzw        0      POS   float       
+// COLOR                    0   xyzw        1     NONE   float   xyzw
+//
+//
+// Output signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_Target                0   xyzw        0   TARGET   float   xyzw
+//
+ps_4_0
+dcl_input_ps linear v1.xyzw
+dcl_output o0.xyzw
+mov o0.xyzw, v1.xyzw
+ret 
+// Approximately 0 instruction slots used
+#endif
+
+const BYTE g_PS[] =
+{
+     68,  88,  66,  67,  89,  62, 
+    128, 137,  52, 137, 121,  63, 
+    223, 129, 145, 249,  18, 101, 
+     85, 245,   1,   0,   0,   0, 
+    244,   0,   0,   0,   3,   0, 
+      0,   0,  44,   0,   0,   0, 
+    128,   0,   0,   0, 180,   0, 
+      0,   0,  73,  83,  71,  78, 
+     76,   0,   0,   0,   2,   0, 
+      0,   0,   8,   0,   0,   0, 
+     56,   0,   0,   0,   0,   0, 
+      0,   0,   1,   0,   0,   0, 
+      3,   0,   0,   0,   0,   0, 
+      0,   0,  15,   0,   0,   0, 
+     68,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   1,   0, 
+      0,   0,  15,  15,   0,   0, 
+     83,  86,  95,  80,  79,  83, 
+     73,  84,  73,  79,  78,   0, 
+     67,  79,  76,  79,  82,   0, 
+    171, 171,  79,  83,  71,  78, 
+     44,   0,   0,   0,   1,   0, 
+      0,   0,   8,   0,   0,   0, 
+     32,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   0,   0, 
+      0,   0,  15,   0,   0,   0, 
+     83,  86,  95,  84,  97, 114, 
+    103, 101, 116,   0, 171, 171, 
+     83,  72,  68,  82,  56,   0, 
+      0,   0,  64,   0,   0,   0, 
+     14,   0,   0,   0,  98,  16, 
+      0,   3, 242,  16,  16,   0, 
+      1,   0,   0,   0, 101,   0, 
+      0,   3, 242,  32,  16,   0, 
+      0,   0,   0,   0,  54,   0, 
+      0,   5, 242,  32,  16,   0, 
+      0,   0,   0,   0,  70,  30, 
+     16,   0,   1,   0,   0,   0, 
+     62,   0,   0,   1
+};
diff --git a/apps/d3dcommon/tri_ps_4_0_level_9_1.h b/apps/d3dcommon/tri_ps_4_0_level_9_1.h
new file mode 100755 (executable)
index 0000000..4f71090
--- /dev/null
@@ -0,0 +1,97 @@
+#if 0
+//
+// Generated by Microsoft (R) D3D Shader Disassembler
+//
+//
+//   fxc /nologo /Qstrip_reflect /T ps_4_0_level_9_1 /E PS /Fh
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri_ps_4_0_level_9_1.h
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri.fx
+//
+//
+// Input signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION              0   xyzw        0      POS   float       
+// COLOR                    0   xyzw        1     NONE   float   xyzw
+//
+//
+// Output signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_Target                0   xyzw        0   TARGET   float   xyzw
+//
+//
+// Level9 shader bytecode:
+//
+    ps_2_0
+    dcl t0
+    mov oC0, t0
+
+// approximately 1 instruction slot used
+ps_4_0
+dcl_input_ps linear v1.xyzw
+dcl_output o0.xyzw
+mov o0.xyzw, v1.xyzw
+ret 
+// Approximately 0 instruction slots used
+#endif
+
+const BYTE g_PS[] =
+{
+     68,  88,  66,  67,   8,  63, 
+     40,  44,  59, 203, 211, 142, 
+    142, 105, 222, 159, 151, 231, 
+    222,  81,   1,   0,   0,   0, 
+     68,   1,   0,   0,   4,   0, 
+      0,   0,  48,   0,   0,   0, 
+    124,   0,   0,   0, 188,   0, 
+      0,   0,  16,   1,   0,   0, 
+     65, 111, 110,  57,  68,   0, 
+      0,   0,  68,   0,   0,   0, 
+      0,   2, 255, 255,  32,   0, 
+      0,   0,  36,   0,   0,   0, 
+      0,   0,  36,   0,   0,   0, 
+     36,   0,   0,   0,  36,   0, 
+      0,   0,  36,   0,   0,   0, 
+     36,   0,   0,   2, 255, 255, 
+     31,   0,   0,   2,   0,   0, 
+      0, 128,   0,   0,  15, 176, 
+      1,   0,   0,   2,   0,   8, 
+     15, 128,   0,   0, 228, 176, 
+    255, 255,   0,   0,  83,  72, 
+     68,  82,  56,   0,   0,   0, 
+     64,   0,   0,   0,  14,   0, 
+      0,   0,  98,  16,   0,   3, 
+    242,  16,  16,   0,   1,   0, 
+      0,   0, 101,   0,   0,   3, 
+    242,  32,  16,   0,   0,   0, 
+      0,   0,  54,   0,   0,   5, 
+    242,  32,  16,   0,   0,   0, 
+      0,   0,  70,  30,  16,   0, 
+      1,   0,   0,   0,  62,   0, 
+      0,   1,  73,  83,  71,  78, 
+     76,   0,   0,   0,   2,   0, 
+      0,   0,   8,   0,   0,   0, 
+     56,   0,   0,   0,   0,   0, 
+      0,   0,   1,   0,   0,   0, 
+      3,   0,   0,   0,   0,   0, 
+      0,   0,  15,   0,   0,   0, 
+     68,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   1,   0, 
+      0,   0,  15,  15,   0,   0, 
+     83,  86,  95,  80,  79,  83, 
+     73,  84,  73,  79,  78,   0, 
+     67,  79,  76,  79,  82,   0, 
+    171, 171,  79,  83,  71,  78, 
+     44,   0,   0,   0,   1,   0, 
+      0,   0,   8,   0,   0,   0, 
+     32,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   0,   0, 
+      0,   0,  15,   0,   0,   0, 
+     83,  86,  95,  84,  97, 114, 
+    103, 101, 116,   0, 171, 171
+};
diff --git a/apps/d3dcommon/tri_vs.h b/apps/d3dcommon/tri_vs.h
deleted file mode 100644 (file)
index 478e5e2..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
-//
-//
-//   fxc /T vs_4_0 /E VS /Fh apps\d3d10\tri_vs.h apps\d3d10\tri.fx
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue Format   Used
-// -------------------- ----- ------ -------- -------- ------ ------
-// POSITION                 0   xyzw        0     NONE  float   xyzw
-// COLOR                    0   xyzw        1     NONE  float   xyzw
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue Format   Used
-// -------------------- ----- ------ -------- -------- ------ ------
-// SV_POSITION              0   xyzw        0      POS  float   xyzw
-// COLOR                    0   xyzw        1     NONE  float   xyzw
-//
-vs_4_0
-dcl_input v0.xyzw
-dcl_input v1.xyzw
-dcl_output_siv o0.xyzw, position
-dcl_output o1.xyzw
-mov o0.xyzw, v0.xyzw
-mov o1.xyzw, v1.xyzw
-ret 
-// Approximately 3 instruction slots used
-#endif
-
-const BYTE g_VS[] =
-{
-     68,  88,  66,  67, 190, 171, 
-    186,  20,  44, 105,  95, 129, 
-    137, 204, 223,  72, 251, 159, 
-    126, 176,   1,   0,   0,   0, 
-     28,   2,   0,   0,   5,   0, 
-      0,   0,  52,   0,   0,   0, 
-    140,   0,   0,   0, 220,   0, 
-      0,   0,  48,   1,   0,   0, 
-    160,   1,   0,   0,  82,  68, 
-     69,  70,  80,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    254, 255,   0,   1,   0,   0, 
-     28,   0,   0,   0,  77, 105, 
-     99, 114, 111, 115, 111, 102, 
-    116,  32,  40,  82,  41,  32, 
-     72,  76,  83,  76,  32,  83, 
-    104,  97, 100, 101, 114,  32, 
-     67, 111, 109, 112, 105, 108, 
-    101, 114,  32,  57,  46,  50, 
-     57,  46,  57,  53,  50,  46, 
-     51,  49,  49,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     72,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,  15,   0,   0, 
-     65,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,  15,  15,   0,   0, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0,  67,  79,  76, 
-     79,  82,   0, 171,  79,  83, 
-     71,  78,  76,   0,   0,   0, 
-      2,   0,   0,   0,   8,   0, 
-      0,   0,  56,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  68,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,  15,   0, 
-      0,   0,  83,  86,  95,  80, 
-     79,  83,  73,  84,  73,  79, 
-     78,   0,  67,  79,  76,  79, 
-     82,   0, 171, 171,  83,  72, 
-     68,  82, 104,   0,   0,   0, 
-     64,   0,   1,   0,  26,   0, 
-      0,   0,  95,   0,   0,   3, 
-    242,  16,  16,   0,   0,   0, 
-      0,   0,  95,   0,   0,   3, 
-    242,  16,  16,   0,   1,   0, 
-      0,   0, 103,   0,   0,   4, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   1,   0,   0,   0, 
-     54,   0,   0,   5, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70,  30,  16,   0,   0,   0, 
-      0,   0,  54,   0,   0,   5, 
-    242,  32,  16,   0,   1,   0, 
-      0,   0,  70,  30,  16,   0, 
-      1,   0,   0,   0,  62,   0, 
-      0,   1,  83,  84,  65,  84, 
-    116,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0
-};
diff --git a/apps/d3dcommon/tri_vs_4_0.h b/apps/d3dcommon/tri_vs_4_0.h
new file mode 100755 (executable)
index 0000000..c338838
--- /dev/null
@@ -0,0 +1,93 @@
+#if 0
+//
+// Generated by Microsoft (R) D3D Shader Disassembler
+//
+//
+//   fxc /nologo /Qstrip_reflect /T vs_4_0 /E VS /Fh
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri_vs_4_0.h
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri.fx
+//
+//
+// Input signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// POSITION                 0   xyzw        0     NONE   float   xyzw
+// COLOR                    0   xyzw        1     NONE   float   xyzw
+//
+//
+// Output signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION              0   xyzw        0      POS   float   xyzw
+// COLOR                    0   xyzw        1     NONE   float   xyzw
+//
+vs_4_0
+dcl_input v0.xyzw
+dcl_input v1.xyzw
+dcl_output_siv o0.xyzw, position
+dcl_output o1.xyzw
+mov o0.xyzw, v0.xyzw
+mov o1.xyzw, v1.xyzw
+ret 
+// Approximately 0 instruction slots used
+#endif
+
+const BYTE g_VS[] =
+{
+     68,  88,  66,  67,  97, 176, 
+    115,  92,  95,  18, 113,  92, 
+     95,  52, 139,  63, 171, 185, 
+      4, 206,   1,   0,   0,   0, 
+     64,   1,   0,   0,   3,   0, 
+      0,   0,  44,   0,   0,   0, 
+    124,   0,   0,   0, 208,   0, 
+      0,   0,  73,  83,  71,  78, 
+     72,   0,   0,   0,   2,   0, 
+      0,   0,   8,   0,   0,   0, 
+     56,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   0,   0, 
+      0,   0,  15,  15,   0,   0, 
+     65,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   1,   0, 
+      0,   0,  15,  15,   0,   0, 
+     80,  79,  83,  73,  84,  73, 
+     79,  78,   0,  67,  79,  76, 
+     79,  82,   0, 171,  79,  83, 
+     71,  78,  76,   0,   0,   0, 
+      2,   0,   0,   0,   8,   0, 
+      0,   0,  56,   0,   0,   0, 
+      0,   0,   0,   0,   1,   0, 
+      0,   0,   3,   0,   0,   0, 
+      0,   0,   0,   0,  15,   0, 
+      0,   0,  68,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      0,   0,   3,   0,   0,   0, 
+      1,   0,   0,   0,  15,   0, 
+      0,   0,  83,  86,  95,  80, 
+     79,  83,  73,  84,  73,  79, 
+     78,   0,  67,  79,  76,  79, 
+     82,   0, 171, 171,  83,  72, 
+     68,  82, 104,   0,   0,   0, 
+     64,   0,   1,   0,  26,   0, 
+      0,   0,  95,   0,   0,   3, 
+    242,  16,  16,   0,   0,   0, 
+      0,   0,  95,   0,   0,   3, 
+    242,  16,  16,   0,   1,   0, 
+      0,   0, 103,   0,   0,   4, 
+    242,  32,  16,   0,   0,   0, 
+      0,   0,   1,   0,   0,   0, 
+    101,   0,   0,   3, 242,  32, 
+     16,   0,   1,   0,   0,   0, 
+     54,   0,   0,   5, 242,  32, 
+     16,   0,   0,   0,   0,   0, 
+     70,  30,  16,   0,   0,   0, 
+      0,   0,  54,   0,   0,   5, 
+    242,  32,  16,   0,   1,   0, 
+      0,   0,  70,  30,  16,   0, 
+      1,   0,   0,   0,  62,   0, 
+      0,   1
+};
diff --git a/apps/d3dcommon/tri_vs_4_0_level_9_1.h b/apps/d3dcommon/tri_vs_4_0_level_9_1.h
new file mode 100755 (executable)
index 0000000..83e6695
--- /dev/null
@@ -0,0 +1,132 @@
+#if 0
+//
+// Generated by Microsoft (R) D3D Shader Disassembler
+//
+//
+//   fxc /nologo /Qstrip_reflect /T vs_4_0_level_9_1 /E VS /Fh
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri_vs_4_0_level_9_1.h
+//    Z:/projects/apitrace/tests/apps/d3dcommon/tri.fx
+//
+//
+// Input signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// POSITION                 0   xyzw        0     NONE   float   xyzw
+// COLOR                    0   xyzw        1     NONE   float   xyzw
+//
+//
+// Output signature:
+//
+// Name                 Index   Mask Register SysValue  Format   Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION              0   xyzw        0      POS   float   xyzw
+// COLOR                    0   xyzw        1     NONE   float   xyzw
+//
+//
+// Runtime generated constant mappings:
+//
+// Target Reg                               Constant Description
+// ---------- --------------------------------------------------
+// c0                              Vertex Shader position offset
+//
+//
+// Level9 shader bytecode:
+//
+    vs_2_0
+    dcl_texcoord v0
+    dcl_texcoord1 v1
+    mad oPos.xy, v0.w, c0, v0
+    mov oPos.zw, v0
+    mov oT0, v1
+
+// approximately 3 instruction slots used
+vs_4_0
+dcl_input v0.xyzw
+dcl_input v1.xyzw
+dcl_output_siv o0.xyzw, position
+dcl_output o1.xyzw
+mov o0.xyzw, v0.xyzw
+mov o1.xyzw, v1.xyzw
+ret 
+// Approximately 0 instruction slots used
+#endif
+
+const BYTE g_VS[] =
+{
+     68,  88,  66,  67, 200, 135, 
+    140, 149, 126, 224, 232,  55, 
+    199, 118,  64,  71, 204, 172, 
+     65, 111,   1,   0,   0,   0, 
+    192,   1,   0,   0,   4,   0, 
+      0,   0,  48,   0,   0,   0, 
+    172,   0,   0,   0,  28,   1, 
+      0,   0, 108,   1,   0,   0, 
+     65, 111, 110,  57, 116,   0, 
+      0,   0, 116,   0,   0,   0, 
+      0,   2, 254, 255,  76,   0, 
+      0,   0,  40,   0,   0,   0, 
+      0,   0,  36,   0,   0,   0, 
+     36,   0,   0,   0,  36,   0, 
+      0,   0,  36,   0,   1,   0, 
+     36,   0,   0,   0,   0,   0, 
+      0,   2, 254, 255,  31,   0, 
+      0,   2,   5,   0,   0, 128, 
+      0,   0,  15, 144,  31,   0, 
+      0,   2,   5,   0,   1, 128, 
+      1,   0,  15, 144,   4,   0, 
+      0,   4,   0,   0,   3, 192, 
+      0,   0, 255, 144,   0,   0, 
+    228, 160,   0,   0, 228, 144, 
+      1,   0,   0,   2,   0,   0, 
+     12, 192,   0,   0, 228, 144, 
+      1,   0,   0,   2,   0,   0, 
+     15, 224,   1,   0, 228, 144, 
+    255, 255,   0,   0,  83,  72, 
+     68,  82, 104,   0,   0,   0, 
+     64,   0,   1,   0,  26,   0, 
+      0,   0,  95,   0,   0,   3, 
+    242,  16,  16,   0,   0,   0, 
+      0,   0,  95,   0,   0,   3, 
+    242,  16,  16,   0,   1,   0, 
+      0,   0, 103,   0,   0,   4, 
+    242,  32,  16,   0,   0,   0, 
+      0,   0,   1,   0,   0,   0, 
+    101,   0,   0,   3, 242,  32, 
+     16,   0,   1,   0,   0,   0, 
+     54,   0,   0,   5, 242,  32, 
+     16,   0,   0,   0,   0,   0, 
+     70,  30,  16,   0,   0,   0, 
+      0,   0,  54,   0,   0,   5, 
+    242,  32,  16,   0,   1,   0, 
+      0,   0,  70,  30,  16,   0, 
+      1,   0,   0,   0,  62,   0, 
+      0,   1,  73,  83,  71,  78, 
+     72,   0,   0,   0,   2,   0, 
+      0,   0,   8,   0,   0,   0, 
+     56,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   0,   0, 
+      0,   0,  15,  15,   0,   0, 
+     65,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      3,   0,   0,   0,   1,   0, 
+      0,   0,  15,  15,   0,   0, 
+     80,  79,  83,  73,  84,  73, 
+     79,  78,   0,  67,  79,  76, 
+     79,  82,   0, 171,  79,  83, 
+     71,  78,  76,   0,   0,   0, 
+      2,   0,   0,   0,   8,   0, 
+      0,   0,  56,   0,   0,   0, 
+      0,   0,   0,   0,   1,   0, 
+      0,   0,   3,   0,   0,   0, 
+      0,   0,   0,   0,  15,   0, 
+      0,   0,  68,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
+      0,   0,   3,   0,   0,   0, 
+      1,   0,   0,   0,  15,   0, 
+      0,   0,  83,  86,  95,  80, 
+     79,  83,  73,  84,  73,  79, 
+     78,   0,  67,  79,  76,  79, 
+     82,   0, 171, 171
+};