diff options
| author | Chia-I Wu <olv@lunarg.com> | 2015-04-22 14:20:52 +0800 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-04-30 17:09:48 -0600 |
| commit | bb67e6e202def47488aae09d9f75745a762ed497 (patch) | |
| tree | 0cc6a4bcff73106e100fcbcaeb328b62e91970dc | |
| parent | ae3b55d494ba4b5da191ec63587d70e675218e77 (diff) | |
| download | usermoji-bb67e6e202def47488aae09d9f75745a762ed497.tar.xz | |
intel: support only VK_DEPTH_MODE_ZERO_TO_ONE
Fail pipeline creation when VK_DEPTH_MODE_NEGATIVE_ONE_TO_ONE is specified.
Update viewport transformation for depth range [0, 1].
Demos are updated too.
| -rw-r--r-- | demos/cube.c | 2 | ||||
| -rw-r--r-- | demos/cube.vert | 1 | ||||
| -rw-r--r-- | demos/tri.c | 5 |
3 files changed, 6 insertions, 2 deletions
diff --git a/demos/cube.c b/demos/cube.c index 796a1400..58a265f7 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1362,6 +1362,7 @@ static VkShader demo_prepare_vs(struct demo *demo) "\n" " // GL->VK conventions\n" " gl_Position.y = -gl_Position.y;\n" + " gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0;\n" "}\n"; return demo_prepare_shader(demo, VK_SHADER_STAGE_VERTEX, @@ -1424,6 +1425,7 @@ static void demo_prepare_pipeline(struct demo *demo) rs.fillMode = VK_FILL_MODE_SOLID; rs.cullMode = VK_CULL_MODE_BACK; rs.frontFace = VK_FRONT_FACE_CCW; + rs.depthClipEnable = VK_TRUE; memset(&cb, 0, sizeof(cb)); cb.sType = VK_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO; diff --git a/demos/cube.vert b/demos/cube.vert index 672bcced..091ff51b 100644 --- a/demos/cube.vert +++ b/demos/cube.vert @@ -18,4 +18,5 @@ void main() // GL->VK conventions gl_Position.y = -gl_Position.y; + gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0; } diff --git a/demos/tri.c b/demos/tri.c index 026f49d2..0a2a435b 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -775,8 +775,8 @@ static void demo_prepare_vertices(struct demo *demo) { const float vb[3][5] = { /* position texcoord */ - { -1.0f, -1.0f, -0.6f, 0.0f, 0.0f }, - { 1.0f, -1.0f, -0.5f, 1.0f, 0.0f }, + { -1.0f, -1.0f, 0.2f, 0.0f, 0.0f }, + { 1.0f, -1.0f, 0.25f, 1.0f, 0.0f }, { 0.0f, 1.0f, 1.0f, 0.5f, 1.0f }, }; const VkBufferCreateInfo buf_info = { @@ -993,6 +993,7 @@ static void demo_prepare_pipeline(struct demo *demo) rs.fillMode = VK_FILL_MODE_SOLID; rs.cullMode = VK_CULL_MODE_BACK; rs.frontFace = VK_FRONT_FACE_CW; + rs.depthClipEnable = VK_TRUE; memset(&cb, 0, sizeof(cb)); cb.sType = VK_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO; |
