intel: Add colorAttachmentCount
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Tue, 10 Feb 2015 21:06:25 +0000 (14:06 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Tue, 17 Feb 2015 17:28:43 +0000 (10:28 -0700)
bug #13268
header revision: r29554
Add colorAttachmentCount to CREATE_RENDER_PASS_INFO to aid tracing tools.

demos/cube.c
demos/tri.c
glave-generate.py
include/xgl.h

index 1e961a7..e49916a 100644 (file)
@@ -311,6 +311,7 @@ static void demo_draw_build_cmd(struct demo *demo)
     rp_info.sType = XGL_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
     rp_info.renderArea.extent.width = demo->width;
     rp_info.renderArea.extent.height = demo->height;
+    rp_info.colorAttachmentCount = 1;
     rp_info.pColorLoadOps = &load_op;
     rp_info.pColorStoreOps = &store_op;
     rp_info.depthLoadOp = XGL_ATTACHMENT_LOAD_OP_DONT_CARE;
index 3cfb86d..a9e3d62 100644 (file)
@@ -145,6 +145,7 @@ static void demo_draw_build_cmd(struct demo *demo)
     rp_info.sType = XGL_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
     rp_info.renderArea.extent.width = demo->width;
     rp_info.renderArea.extent.height = demo->height;
+    rp_info.colorAttachmentCount = 1;
     rp_info.pColorLoadOps = &load_op;
     rp_info.pColorStoreOps = &store_op;
     rp_info.depthLoadOp = XGL_ATTACHMENT_LOAD_OP_DONT_CARE;
index a1c7cc1..ecc449a 100755 (executable)
@@ -470,9 +470,7 @@ class Subcommand(object):
                         func_body.append('    customSize = colorCount * sizeof(XGL_COLOR_ATTACHMENT_BIND_INFO) + dsSize;')
                         func_body.append('    CREATE_TRACE_PACKET(xglCreateFramebuffer, sizeof(XGL_FRAMEBUFFER_CREATE_INFO) + sizeof(XGL_FRAMEBUFFER) + customSize);')
                     elif 'CreateRenderPass' == proto.name:
-# HACK ALERT, TODO this API currently has insufficient parameters to determine the count of the colorLoadOps, colorStoreOps, in the CREATE_INFO struct
-# assume number of colorAttachments  == 1  for now rather than tracing code keeping a list of framebuffer objects with colorAttachmentCounts
-                        func_body.append('    uint32_t colorCount = (pCreateInfo != NULL && pCreateInfo->pColorLoadOps != NULL && pCreateInfo->pColorStoreOps != NULL && pCreateInfo->pColorLoadClearValues != NULL) ? 1 : 0; //TODO fixme')
+                        func_body.append('    uint32_t colorCount = (pCreateInfo != NULL && pCreateInfo->pColorLoadOps != NULL && pCreateInfo->pColorStoreOps != NULL && pCreateInfo->pColorLoadClearValues != NULL) ? pCreateInfo->colorAttachmentCount : 0;')
                         func_body.append('    customSize = colorCount * (sizeof(XGL_ATTACHMENT_LOAD_OP) + sizeof(XGL_ATTACHMENT_STORE_OP) + sizeof(XGL_CLEAR_COLOR));')
                         func_body.append('    CREATE_TRACE_PACKET(xglCreateRenderPass, sizeof(XGL_RENDER_PASS_CREATE_INFO) + sizeof(XGL_RENDER_PASS) + customSize);')
                     elif 'BeginCommandBuffer' == proto.name:
index cd6f4ba..ec71157 100644 (file)
@@ -33,7 +33,7 @@
 #include "xglPlatform.h"
 
 // XGL API version supported by this file
-#define XGL_API_VERSION XGL_MAKE_VERSION(0, 48, 2)
+#define XGL_API_VERSION XGL_MAKE_VERSION(0, 50, 1)
 
 #ifdef __cplusplus
 extern "C"
@@ -2111,6 +2111,7 @@ typedef struct _XGL_RENDER_PASS_CREATE_INFO
 
     XGL_RECT                                renderArea;
     XGL_FRAMEBUFFER                         framebuffer;
+    uint32_t                                colorAttachmentCount;
     const XGL_ATTACHMENT_LOAD_OP*           pColorLoadOps;               // Array of size equivalent to the number of attachments in the framebuffer
     const XGL_ATTACHMENT_STORE_OP*          pColorStoreOps;              // Array of size equivalent to the number of attachments in the framebuffer
     const XGL_CLEAR_COLOR*                  pColorLoadClearValues;       // Array of size equivalent to the number of attachments in the framebuffer