LCOV - code coverage report
Current view: top level - gfx/angle/src/compiler/translator - blocklayoutHLSL.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 3 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //
       2             : // Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved.
       3             : // Use of this source code is governed by a BSD-style license that can be
       4             : // found in the LICENSE file.
       5             : //
       6             : // blocklayout.h:
       7             : //   Methods and classes related to uniform layout and packing in GLSL and HLSL.
       8             : //
       9             : 
      10             : #ifndef COMMON_BLOCKLAYOUTHLSL_H_
      11             : #define COMMON_BLOCKLAYOUTHLSL_H_
      12             : 
      13             : #include <cstddef>
      14             : #include <vector>
      15             : 
      16             : #include "angle_gl.h"
      17             : #include "blocklayout.h"
      18             : #include <GLSLANG/ShaderLang.h>
      19             : 
      20             : namespace sh
      21             : {
      22             : // Block layout packed according to the D3D9 or default D3D10+ register packing rules
      23             : // See http://msdn.microsoft.com/en-us/library/windows/desktop/bb509632(v=vs.85).aspx
      24             : // The strategy should be ENCODE_LOOSE for D3D9 constant blocks, and ENCODE_PACKED
      25             : // for everything else (D3D10+ constant blocks and all attributes/varyings).
      26             : 
      27           0 : class HLSLBlockEncoder : public BlockLayoutEncoder
      28             : {
      29             :   public:
      30             :     enum HLSLBlockEncoderStrategy
      31             :     {
      32             :         ENCODE_PACKED,
      33             :         ENCODE_LOOSE
      34             :     };
      35             : 
      36             :     HLSLBlockEncoder(HLSLBlockEncoderStrategy strategy);
      37             : 
      38             :     virtual void enterAggregateType();
      39             :     virtual void exitAggregateType();
      40             :     void skipRegisters(unsigned int numRegisters);
      41             : 
      42           0 :     bool isPacked() const { return mEncoderStrategy == ENCODE_PACKED; }
      43           0 :     void setTransposeMatrices(bool enabled) { mTransposeMatrices = enabled; }
      44             : 
      45             :     static HLSLBlockEncoderStrategy GetStrategyFor(ShShaderOutput outputType);
      46             : 
      47             :   protected:
      48             :     virtual void getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut);
      49             :     virtual void advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride);
      50             : 
      51             :     HLSLBlockEncoderStrategy mEncoderStrategy;
      52             :     bool mTransposeMatrices;
      53             : };
      54             : 
      55             : // This method returns the number of used registers for a ShaderVariable. It is dependent on the HLSLBlockEncoder
      56             : // class to count the number of used registers in a struct (which are individually packed according to the same rules).
      57             : unsigned int HLSLVariableRegisterCount(const Varying &variable, bool transposeMatrices);
      58             : unsigned int HLSLVariableRegisterCount(const Uniform &variable, ShShaderOutput outputType);
      59             : }
      60             : 
      61             : #endif // COMMON_BLOCKLAYOUTHLSL_H_

Generated by: LCOV version 1.13