summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_image.c
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2015-08-20 22:59:19 -0700
committerKristian Høgsberg Kristensen <[email protected]>2015-08-24 13:45:41 -0700
commitf1455ffac78b1369d9c4187b7f1d36c2d96e0bab (patch)
treeb49a3230e3820c62866883a6dbdbca5be8545efd /src/vulkan/anv_image.c
parent891995e55bbadf75699e659c9d5ded24419e3ad3 (diff)
vk: Add gen7 support
With all the previous commits in place, we can now drop in support for multiple platforms. First up is gen7 (Ivybridge). Signed-off-by: Kristian Høgsberg Kristensen <[email protected]>
Diffstat (limited to 'src/vulkan/anv_image.c')
-rw-r--r--src/vulkan/anv_image.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c
index 51f2cf5244c..15a736c25bc 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -414,6 +414,9 @@ anv_image_view_init(struct anv_image_view *iview,
struct anv_cmd_buffer *cmd_buffer)
{
switch (device->info.gen) {
+ case 7:
+ gen7_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+ break;
case 8:
gen8_image_view_init(iview, device, pCreateInfo, cmd_buffer);
break;
@@ -428,15 +431,19 @@ anv_CreateImageView(VkDevice _device,
VkImageView *pView)
{
ANV_FROM_HANDLE(anv_device, device, _device);
+ struct anv_image_view *view;
- switch (device->info.gen) {
- case 8:
- return gen8_CreateImageView(_device, pCreateInfo, pView);
- default:
- unreachable("unsupported gen\n");
- }
-}
+ view = anv_device_alloc(device, sizeof(*view), 8,
+ VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+ if (view == NULL)
+ return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+
+ anv_image_view_init(view, device, pCreateInfo, NULL);
+
+ *pView = anv_image_view_to_handle(view);
+ return VK_SUCCESS;
+}
VkResult
anv_DestroyImageView(VkDevice _device, VkImageView _iview)
@@ -484,6 +491,9 @@ anv_color_attachment_view_init(struct anv_color_attachment_view *aview,
struct anv_cmd_buffer *cmd_buffer)
{
switch (device->info.gen) {
+ case 7:
+ gen7_color_attachment_view_init(aview, device, pCreateInfo, cmd_buffer);
+ break;
case 8:
gen8_color_attachment_view_init(aview, device, pCreateInfo, cmd_buffer);
break;