aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/cube.c1
-rw-r--r--demos/tri.c1
-rwxr-xr-xglave-generate.py4
-rw-r--r--include/xgl.h3
4 files changed, 5 insertions, 4 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 1e961a78..e49916a9 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -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;
diff --git a/demos/tri.c b/demos/tri.c
index 3cfb86d9..a9e3d626 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -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;
diff --git a/glave-generate.py b/glave-generate.py
index a1c7cc1e..ecc449ab 100755
--- a/glave-generate.py
+++ b/glave-generate.py
@@ -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:
diff --git a/include/xgl.h b/include/xgl.h
index cd6f4ba4..ec71157e 100644
--- a/include/xgl.h
+++ b/include/xgl.h
@@ -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