Fix gen_framework.py - it ignored the arrays in function parameters.
authorscygan <slawomir.cygan@intel.com>
Mon, 19 Oct 2015 18:11:02 +0000 (20:11 +0200)
committerscygan <slawomir.cygan@intel.com>
Mon, 19 Oct 2015 18:17:08 +0000 (20:17 +0200)
This makes wrapped cmdSetBlendConstants not accept 4  blendConstants

external/vulkancts/framework/vulkan/vkConcreteDeviceInterface.inl
external/vulkancts/framework/vulkan/vkDeviceDriverImpl.inl
external/vulkancts/framework/vulkan/vkFunctionPointerTypes.inl
external/vulkancts/framework/vulkan/vkNullDriverImpl.inl
external/vulkancts/framework/vulkan/vkVirtualDeviceInterface.inl
external/vulkancts/gen_framework.py

index 3e4ec226d0ec47c64bf087473da4859124e3c79d..bb45bd948613369f0abd33d175abca53228c95a9 100644 (file)
@@ -90,7 +90,7 @@ virtual void          cmdSetViewport                                                                  (VkCmdBuffer cmdBuffer, deUint32 viewportCo
 virtual void           cmdSetScissor                                                                   (VkCmdBuffer cmdBuffer, deUint32 scissorCount, const VkRect2D* pScissors) const;
 virtual void           cmdSetLineWidth                                                                 (VkCmdBuffer cmdBuffer, float lineWidth) const;
 virtual void           cmdSetDepthBias                                                                 (VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) const;
-virtual void           cmdSetBlendConstants                                                    (VkCmdBuffer cmdBuffer, const float blendConst) const;
+virtual void           cmdSetBlendConstants                                                    (VkCmdBuffer cmdBuffer, const float blendConst[4]) const;
 virtual void           cmdSetDepthBounds                                                               (VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) const;
 virtual void           cmdSetStencilCompareMask                                                (VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, deUint32 stencilCompareMask) const;
 virtual void           cmdSetStencilWriteMask                                                  (VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, deUint32 stencilWriteMask) const;
index ea35740f8635c0ab243586ac0e1a3a3274ad285d..984440d0e894097c5a27113f880ca63641ea12bd 100644 (file)
@@ -447,7 +447,7 @@ void DeviceDriver::cmdSetDepthBias (VkCmdBuffer cmdBuffer, float depthBias, floa
        m_vk.cmdSetDepthBias(cmdBuffer, depthBias, depthBiasClamp, slopeScaledDepthBias);
 }
 
-void DeviceDriver::cmdSetBlendConstants (VkCmdBuffer cmdBuffer, const float blendConst) const
+void DeviceDriver::cmdSetBlendConstants (VkCmdBuffer cmdBuffer, const float blendConst[4]) const
 {
        m_vk.cmdSetBlendConstants(cmdBuffer, blendConst);
 }
index 96173a2c22c474572eff2225573b57e235d38cf2..440e2efbdcff947d2a299e233c3b8493dcfed5da 100644 (file)
@@ -106,7 +106,7 @@ typedef VK_APICALL void                                     (VK_APIENTRY* CmdSetViewportFunc)                                                               (VkCmdBuffe
 typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetScissorFunc)                                                                (VkCmdBuffer cmdBuffer, deUint32 scissorCount, const VkRect2D* pScissors);
 typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetLineWidthFunc)                                                              (VkCmdBuffer cmdBuffer, float lineWidth);
 typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetDepthBiasFunc)                                                              (VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias);
-typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetBlendConstantsFunc)                                                 (VkCmdBuffer cmdBuffer, const float blendConst);
+typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetBlendConstantsFunc)                                                 (VkCmdBuffer cmdBuffer, const float blendConst[4]);
 typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetDepthBoundsFunc)                                                    (VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds);
 typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetStencilCompareMaskFunc)                                             (VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, deUint32 stencilCompareMask);
 typedef VK_APICALL void                                        (VK_APIENTRY* CmdSetStencilWriteMaskFunc)                                               (VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, deUint32 stencilWriteMask);
index 3c3433f3405ae1671210edc6678af985cbb87fc9..cdce08b854c1ac602c1c2830f15fdb472a31d378 100644 (file)
@@ -625,7 +625,7 @@ void cmdSetDepthBias (VkCmdBuffer cmdBuffer, float depthBias, float depthBiasCla
        DE_UNREF(slopeScaledDepthBias);
 }
 
-void cmdSetBlendConstants (VkCmdBuffer cmdBuffer, const float blendConst)
+void cmdSetBlendConstants (VkCmdBuffer cmdBuffer, const float blendConst[4])
 {
        DE_UNREF(cmdBuffer);
        DE_UNREF(blendConst);
index 93ff2ad101395a6a87d35241fd3b5d043f24770c..d0febaf970b4fd218f9df59403aa6d7492d731b9 100644 (file)
@@ -90,7 +90,7 @@ virtual void          cmdSetViewport                                                                  (VkCmdBuffer cmdBuffer, deUint32 viewportCo
 virtual void           cmdSetScissor                                                                   (VkCmdBuffer cmdBuffer, deUint32 scissorCount, const VkRect2D* pScissors) const = 0;
 virtual void           cmdSetLineWidth                                                                 (VkCmdBuffer cmdBuffer, float lineWidth) const = 0;
 virtual void           cmdSetDepthBias                                                                 (VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) const = 0;
-virtual void           cmdSetBlendConstants                                                    (VkCmdBuffer cmdBuffer, const float blendConst) const = 0;
+virtual void           cmdSetBlendConstants                                                    (VkCmdBuffer cmdBuffer, const float blendConst[4]) const = 0;
 virtual void           cmdSetDepthBounds                                                               (VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) const = 0;
 virtual void           cmdSetStencilCompareMask                                                (VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, deUint32 stencilCompareMask) const = 0;
 virtual void           cmdSetStencilWriteMask                                                  (VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, deUint32 stencilWriteMask) const = 0;
index 6c3cd847315b339bbbb95f27a2adca54992309e8..2e799fa55dd461d35ff02178f1911056580c6bae 100644 (file)
@@ -106,9 +106,10 @@ class Bitfield:
                self.values     = values
 
 class Variable:
-       def __init__ (self, type, name):
-               self.type       = type
-               self.name       = name
+       def __init__ (self, type, name, arraySize = None):
+               self.type               = type
+               self.name               = name
+               self.arraySize  = arraySize
 
 class CompositeType:
        CLASS_STRUCT    = 0
@@ -188,7 +189,7 @@ def fixupType (type):
        return type
 
 def fixupFunction (function):
-       fixedArgs               = [Variable(fixupType(a.type), a.name) for a in function.arguments]
+       fixedArgs               = [Variable(fixupType(a.type), a.name, a.arraySize) for a in function.arguments]
        fixedReturnType = fixupType(function.returnType)
 
        return Function(function.name, fixedReturnType, fixedArgs)
@@ -266,12 +267,12 @@ def parseHandles (src):
        return handles
 
 def parseArgList (src):
-       typeNamePtrn    = r'(' + TYPE_PTRN + ')(\s' + IDENT_PTRN + r')'
+       typeNamePtrn    = r'(' + TYPE_PTRN + ')(\s' + IDENT_PTRN + r')(\[[^\]]+\])?'
        args                    = []
 
        for rawArg in src.split(','):
                m = re.search(typeNamePtrn, rawArg)
-               args.append(Variable(m.group(1).strip(), m.group(2).strip()))
+               args.append(Variable(m.group(1).strip(), m.group(2).strip(), m.group(3)))
 
        return args
 
@@ -410,7 +411,7 @@ def writeCompositeTypes (api, filename):
        writeInlFile(filename, INL_HEADER, gen())
 
 def argListToStr (args):
-       return ", ".join("%s %s" % (v.type, v.name) for v in args)
+       return ", ".join("%s %s%s" % (v.type, v.name, v.arraySize if v.arraySize != None else "") for v in args)
 
 def writeInterfaceDecl (api, filename, functionTypes, concrete):
        def genProtos ():