Hash :
440dc749
Author :
Date :
2013-06-20T11:55:55
Redesign the code that uses block layouts to use a generic base class. The cleaner code also has the benefit of allowing us to separate the HLSL-specific parts out of the shader validator. TRAC #23083 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef TRANSLATOR_HLSL_HLSLLAYOUTENCODER_H_
#define TRANSLATOR_HLSL_HLSLLAYOUTENCODER_H_
#include "compiler/BlockLayoutEncoder.h"
namespace sh
{
// Block layout packed according to the default D3D11 register packing rules
// See http://msdn.microsoft.com/en-us/library/windows/desktop/bb509632(v=vs.85).aspx
class HLSLBlockEncoder : public BlockLayoutEncoder
{
public:
HLSLBlockEncoder(std::vector<BlockMemberInfo> *blockInfoOut);
protected:
virtual void enterAggregateType();
virtual void exitAggregateType();
virtual void getBlockLayoutInfo(const sh::Uniform &uniform, int *arrayStrideOut, int *matrixStrideOut);
virtual void advanceOffset(const sh::Uniform &uniform, int arrayStride, int matrixStride);
};
}
#endif // TRANSLATOR_HLSL_HLSLLAYOUTENCODER_H_