Hash :
a53ab517
Author :
Date :
2014-03-17T09:47:44
Fix linking of struct varyings. The dEQP varying struct linkage tests were triggering asserts when we tried to query component info of struct types. BUG=angle:580 Change-Id: I61e33573c5577a327c58fec7a07ae7718690ac42 Reviewed-on: https://chromium-review.googlesource.com/189194 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
//
// Copyright (c) 2014 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.
//
// DynamicHLSL.h: Interface for link and run-time HLSL generation
//
#ifndef LIBGLESV2_DYNAMIC_HLSL_H_
#define LIBGLESV2_DYNAMIC_HLSL_H_
#include "common/angleutils.h"
namespace sh
{
struct ShaderVariable;
struct Attribute;
}
namespace rx
{
class Renderer;
}
namespace gl
{
class InfoLog;
class FragmentShader;
class VertexShader;
struct VariableLocation;
class VertexAttribute;
struct VertexFormat;
class DynamicHLSL
{
public:
explicit DynamicHLSL(rx::Renderer *const renderer);
int packVaryings(InfoLog &infoLog, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader);
std::string generateInputLayoutHLSL(const VertexFormat inputLayout[], const sh::Attribute shaderAttributes[]) const;
bool generateShaderLinkHLSL(InfoLog &infoLog, int registers, const sh::ShaderVariable *packing[][4],
std::string& pixelHLSL, std::string& vertexHLSL,
FragmentShader *fragmentShader, VertexShader *vertexShader,
std::map<int, VariableLocation> *programOutputVars) const;
std::string generateGeometryShaderHLSL(int registers, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
static const std::string VERTEX_ATTRIBUTE_STUB_STRING;
private:
DISALLOW_COPY_AND_ASSIGN(DynamicHLSL);
rx::Renderer *const mRenderer;
std::string generateVaryingHLSL(FragmentShader *fragmentShader, const std::string &varyingSemantic) const;
void defineOutputVariables(FragmentShader *fragmentShader, std::map<int, VariableLocation> *programOutputVars) const;
std::string generatePointSpriteHLSL(int registers, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
// Prepend an underscore
static std::string decorateVariable(const std::string &name);
std::string generateAttributeConversionHLSL(const VertexFormat &vertexFormat, const sh::ShaderVariable &shaderAttrib) const;
};
// Utility method shared between ProgramBinary and DynamicHLSL
std::string ArrayString(unsigned int i);
}
#endif // LIBGLESV2_DYNAMIC_HLSL_H_