Fix line endings in the Uniform source and header files to be UNIX-style.

TRAC #22858 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2304 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 6d7b61c2
// //
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. // 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
#include "compiler/Uniform.h" #include "compiler/Uniform.h"
namespace sh namespace sh
{ {
Uniform::Uniform(GLenum type, GLenum precision, const char *name, int arraySize, int registerIndex) Uniform::Uniform(GLenum type, GLenum precision, const char *name, int arraySize, int registerIndex)
{ {
this->type = type; this->type = type;
this->precision = precision; this->precision = precision;
this->name = name; this->name = name;
this->arraySize = arraySize; this->arraySize = arraySize;
this->registerIndex = registerIndex; this->registerIndex = registerIndex;
} }
} }
// //
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. // 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
#ifndef COMPILER_UNIFORM_H_ #ifndef COMPILER_UNIFORM_H_
#define COMPILER_UNIFORM_H_ #define COMPILER_UNIFORM_H_
#include <string> #include <string>
#include <vector> #include <vector>
#define GL_APICALL #define GL_APICALL
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
namespace sh namespace sh
{ {
struct Uniform struct Uniform
{ {
Uniform(GLenum type, GLenum precision, const char *name, int arraySize, int registerIndex); Uniform(GLenum type, GLenum precision, const char *name, int arraySize, int registerIndex);
GLenum type; GLenum type;
GLenum precision; GLenum precision;
std::string name; std::string name;
unsigned int arraySize; unsigned int arraySize;
int registerIndex; int registerIndex;
}; };
typedef std::vector<Uniform> ActiveUniforms; typedef std::vector<Uniform> ActiveUniforms;
} }
#endif // COMPILER_UNIFORM_H_ #endif // COMPILER_UNIFORM_H_
#include "precompiled.h" #include "precompiled.h"
// //
// Copyright (c) 2010-2013 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2010-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
#include "libGLESv2/Uniform.h" #include "libGLESv2/Uniform.h"
#include "libGLESv2/utilities.h" #include "libGLESv2/utilities.h"
namespace gl namespace gl
{ {
Uniform::Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize) Uniform::Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize)
: type(type), precision(precision), name(name), arraySize(arraySize) : type(type), precision(precision), name(name), arraySize(arraySize)
{ {
int bytes = gl::UniformInternalSize(type) * elementCount(); int bytes = gl::UniformInternalSize(type) * elementCount();
data = new unsigned char[bytes]; data = new unsigned char[bytes];
memset(data, 0, bytes); memset(data, 0, bytes);
dirty = true; dirty = true;
psRegisterIndex = -1; psRegisterIndex = -1;
vsRegisterIndex = -1; vsRegisterIndex = -1;
registerCount = VariableRowCount(type) * elementCount(); registerCount = VariableRowCount(type) * elementCount();
} }
Uniform::~Uniform() Uniform::~Uniform()
{ {
delete[] data; delete[] data;
} }
bool Uniform::isArray() const bool Uniform::isArray() const
{ {
return arraySize > 0; return arraySize > 0;
} }
unsigned int Uniform::elementCount() const unsigned int Uniform::elementCount() const
{ {
return arraySize > 0 ? arraySize : 1; return arraySize > 0 ? arraySize : 1;
} }
} }
// //
// Copyright (c) 2010-2013 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2010-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
#ifndef LIBGLESV2_UNIFORM_H_ #ifndef LIBGLESV2_UNIFORM_H_
#define LIBGLESV2_UNIFORM_H_ #define LIBGLESV2_UNIFORM_H_
#include <string> #include <string>
#include <vector> #include <vector>
#define GL_APICALL #define GL_APICALL
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include "common/debug.h" #include "common/debug.h"
namespace gl namespace gl
{ {
// Helper struct representing a single shader uniform // Helper struct representing a single shader uniform
struct Uniform struct Uniform
{ {
Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize); Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize);
~Uniform(); ~Uniform();
bool isArray() const; bool isArray() const;
unsigned int elementCount() const; unsigned int elementCount() const;
const GLenum type; const GLenum type;
const GLenum precision; const GLenum precision;
const std::string name; const std::string name;
const unsigned int arraySize; const unsigned int arraySize;
unsigned char *data; unsigned char *data;
bool dirty; bool dirty;
int psRegisterIndex; int psRegisterIndex;
int vsRegisterIndex; int vsRegisterIndex;
unsigned int registerCount; unsigned int registerCount;
}; };
typedef std::vector<Uniform*> UniformArray; typedef std::vector<Uniform*> UniformArray;
} }
#endif // LIBGLESV2_UNIFORM_H_ #endif // LIBGLESV2_UNIFORM_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment