intel: Remove scissor enable and scissor count
bug #12925
header version: r29511
Remove separate scissor enable and scissor count. Scissor always
enabled and must always provide scissor rect for every viewport.
diff --git a/glave-generate.py b/glave-generate.py
index a136cec..a1c7cc1 100755
--- a/glave-generate.py
+++ b/glave-generate.py
@@ -479,9 +479,8 @@
func_body.append(' customSize = calculate_begin_cmdbuf_size(pBeginInfo->pNext);')
func_body.append(' CREATE_TRACE_PACKET(xglBeginCommandBuffer, sizeof(XGL_CMD_BUFFER_BEGIN_INFO) + customSize);')
elif 'CreateDynamicViewportState' == proto.name:
- func_body.append(' uint32_t vpCount = (pCreateInfo != NULL && pCreateInfo->pViewports != NULL) ? pCreateInfo->viewportCount : 0;')
- func_body.append(' uint32_t scCount = (pCreateInfo != NULL && pCreateInfo->pScissors != NULL) ? pCreateInfo->scissorCount : 0;')
- func_body.append(' customSize = vpCount * sizeof(XGL_VIEWPORT) + scCount * sizeof(XGL_RECT);')
+ func_body.append(' uint32_t vpsCount = (pCreateInfo != NULL && pCreateInfo->pViewports != NULL) ? pCreateInfo->viewportAndScissorCount : 0;')
+ func_body.append(' customSize = vpsCount * sizeof(XGL_VIEWPORT) + vpsCount * sizeof(XGL_RECT);')
func_body.append(' CREATE_TRACE_PACKET(xglCreateDynamicViewportState, sizeof(XGL_DYNAMIC_VP_STATE_CREATE_INFO) + sizeof(XGL_DYNAMIC_VP_STATE_OBJECT) + customSize);')
elif 'AllocMemory' == proto.name:
func_body.append(' customSize = calculate_alloc_memory_size(pAllocInfo->pNext);')
@@ -585,8 +584,8 @@
elif 'BeginCommandBuffer' == proto.name:
func_body.append(' add_begin_cmdbuf_to_trace_packet(pHeader, (void**)&(pPacket->pBeginInfo->pNext), pBeginInfo->pNext);')
elif 'CreateDynamicViewportState' == proto.name:
- func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pCreateInfo->pViewports), vpCount * sizeof(XGL_VIEWPORT), pCreateInfo->pViewports);')
- func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pCreateInfo->pScissors), scCount * sizeof(XGL_RECT), pCreateInfo->pScissors);')
+ func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pCreateInfo->pViewports), vpsCount * sizeof(XGL_VIEWPORT), pCreateInfo->pViewports);')
+ func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pCreateInfo->pScissors), vpsCount * sizeof(XGL_RECT), pCreateInfo->pScissors);')
func_body.append(' glv_finalize_buffer_address(pHeader, (void**)&(pPacket->pCreateInfo->pViewports));')
func_body.append(' glv_finalize_buffer_address(pHeader, (void**)&(pPacket->pCreateInfo->pScissors));')
elif 'AllocMemory' == proto.name:
diff --git a/include/xgl.h b/include/xgl.h
index 968ab23..e27b910 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, 47, 1)
+#define XGL_API_VERSION XGL_MAKE_VERSION(0, 48, 1)
#ifdef __cplusplus
extern "C"
@@ -1919,7 +1919,6 @@
XGL_STRUCTURE_TYPE sType; // Must be XGL_STRUCTURE_TYPE_PIPELINE_VP_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t numViewports;
- uint32_t scissorEnable;
XGL_COORDINATE_ORIGIN clipOrigin; // optional (GL45)
XGL_DEPTH_MODE depthMode; // optional (GL45)
} XGL_PIPELINE_VP_STATE_CREATE_INFO;
@@ -2033,9 +2032,8 @@
{
XGL_STRUCTURE_TYPE sType; // Must be XGL_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
- uint32_t viewportCount; // number of entries in pViewports
+ uint32_t viewportAndScissorCount; // number of entries in pViewports and pScissors
const XGL_VIEWPORT* pViewports;
- uint32_t scissorCount; // number of entries in pScissors
const XGL_RECT* pScissors;
} XGL_DYNAMIC_VP_STATE_CREATE_INFO;
diff --git a/layers/draw_state.c b/layers/draw_state.c
index c07367f..0fa5b7c 100644
--- a/layers/draw_state.c
+++ b/layers/draw_state.c
@@ -293,13 +293,13 @@
if (XGL_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO == pCreateInfo->sType) {
XGL_DYNAMIC_VP_STATE_CREATE_INFO* pVPCI = (XGL_DYNAMIC_VP_STATE_CREATE_INFO*)pStateNode->pCreateInfo;
XGL_VIEWPORT** ppViewports = (XGL_VIEWPORT**)&pVPCI->pViewports;
- size_t vpSize = sizeof(XGL_VIEWPORT) * pVPCI->viewportCount;
+ size_t vpSize = sizeof(XGL_VIEWPORT) * pVPCI->viewportAndScissorCount;
if (vpSize) {
*ppViewports = (XGL_VIEWPORT*)malloc(vpSize);
memcpy(*ppViewports, ((XGL_DYNAMIC_VP_STATE_CREATE_INFO*)pCreateInfo)->pViewports, vpSize);
}
XGL_RECT** ppScissors = (XGL_RECT**)&pVPCI->pScissors;
- size_t scSize = sizeof(XGL_RECT) * pVPCI->scissorCount;
+ size_t scSize = sizeof(XGL_RECT) * pVPCI->viewportAndScissorCount;
if (scSize) {
*ppScissors = (XGL_RECT*)malloc(scSize);
memcpy(*ppScissors, ((XGL_DYNAMIC_VP_STATE_CREATE_INFO*)pCreateInfo)->pScissors, scSize);
diff --git a/tests/xglrenderframework.cpp b/tests/xglrenderframework.cpp
index e8ce14d..9fc0786 100644
--- a/tests/xglrenderframework.cpp
+++ b/tests/xglrenderframework.cpp
@@ -121,18 +121,23 @@
XGL_RESULT err;
XGL_VIEWPORT viewport;
+ XGL_RECT scissor;
XGL_DYNAMIC_VP_STATE_CREATE_INFO viewportCreate = {};
viewportCreate.sType = XGL_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO;
- viewportCreate.viewportCount = 1;
- viewportCreate.scissorCount = 0;
+ viewportCreate.viewportAndScissorCount = 1;
viewport.originX = 0;
viewport.originY = 0;
viewport.width = 1.f * width;
viewport.height = 1.f * height;
viewport.minDepth = 0.f;
viewport.maxDepth = 1.f;
+ scissor.extent.width = width;
+ scissor.extent.height = height;
+ scissor.offset.x = 0;
+ scissor.offset.y = 0;
viewportCreate.pViewports = &viewport;
+ viewportCreate.pScissors = &scissor;
err = xglCreateDynamicViewportState( device(), &viewportCreate, &m_stateViewport );
ASSERT_XGL_SUCCESS( err );