Provide a stub for Renderer11::applyUniforms.

TRAC #22245 Signed-off-by: Daniel Koch Signed-off-by: Geoff Lang Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1596 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 15186aa7
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "libGLESv2/main.h" #include "libGLESv2/main.h"
#include "libGLESv2/Shader.h" #include "libGLESv2/Shader.h"
#include "libGLESv2/utilities.h"
#include <string> #include <string>
...@@ -31,30 +30,8 @@ std::string str(int i) ...@@ -31,30 +30,8 @@ std::string str(int i)
return buffer; return buffer;
} }
Uniform::Uniform(GLenum type, const std::string &_name, unsigned int arraySize)
: type(type), _name(_name), name(ProgramBinary::undecorateUniform(_name)), arraySize(arraySize)
{
int bytes = UniformInternalSize(type) * arraySize;
data = new unsigned char[bytes];
memset(data, 0, bytes);
dirty = true;
}
Uniform::~Uniform()
{
delete[] data;
}
bool Uniform::isArray()
{
size_t dot = _name.find_last_of('.');
if (dot == std::string::npos) dot = -1;
return _name.compare(dot + 1, dot + 4, "ar_") == 0;
}
UniformLocation::UniformLocation(const std::string &_name, unsigned int element, unsigned int index) UniformLocation::UniformLocation(const std::string &_name, unsigned int element, unsigned int index)
: name(ProgramBinary::undecorateUniform(_name)), element(element), index(index) : name(Uniform::undecorate(_name)), element(element), index(index)
{ {
} }
...@@ -1039,13 +1016,7 @@ void ProgramBinary::applyUniforms() ...@@ -1039,13 +1016,7 @@ void ProgramBinary::applyUniforms()
} }
} }
if (dynamic_cast<rx::Renderer9*>(mRenderer) == NULL) // D3D9_REPLACE mRenderer->applyUniforms(&mUniforms);
{
return; // UNIMPLEMENTED
}
// Set all other uniforms
rx::Renderer9::makeRenderer9(mRenderer)->applyUniforms(&mUniforms);
} }
// Packs varyings into generic varying registers, using the algorithm from [OpenGL ES Shading Language 1.00 rev. 17] appendix A section 7 page 111 // Packs varyings into generic varying registers, using the algorithm from [OpenGL ES Shading Language 1.00 rev. 17] appendix A section 7 page 111
...@@ -2212,30 +2183,6 @@ std::string ProgramBinary::decorateAttribute(const std::string &name) ...@@ -2212,30 +2183,6 @@ std::string ProgramBinary::decorateAttribute(const std::string &name)
return name; return name;
} }
std::string ProgramBinary::undecorateUniform(const std::string &_name)
{
std::string name = _name;
// Remove any structure field decoration
size_t pos = 0;
while ((pos = name.find("._", pos)) != std::string::npos)
{
name.replace(pos, 2, ".");
}
// Remove the leading decoration
if (name[0] == '_')
{
return name.substr(1);
}
else if (name.compare(0, 3, "ar_") == 0)
{
return name.substr(3);
}
return name;
}
bool ProgramBinary::isValidated() const bool ProgramBinary::isValidated() const
{ {
return mValidated; return mValidated;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <D3Dcompiler.h> #include <D3Dcompiler.h>
#include "libGLESv2/Texture.h" #include "libGLESv2/Texture.h"
#include "libGLESv2/Uniform.h"
#include "libGLESv2/angletypes.h" #include "libGLESv2/angletypes.h"
#include "libGLESv2/renderer/ShaderExecutable.h" #include "libGLESv2/renderer/ShaderExecutable.h"
...@@ -96,6 +97,7 @@ class Renderer ...@@ -96,6 +97,7 @@ class Renderer
virtual bool applyRenderTarget(gl::Framebuffer *frameBuffer) = 0; virtual bool applyRenderTarget(gl::Framebuffer *frameBuffer) = 0;
virtual void applyShaders(gl::ProgramBinary *programBinary) = 0; virtual void applyShaders(gl::ProgramBinary *programBinary) = 0;
virtual void applyUniforms(const gl::UniformArray *uniformArray) = 0;
virtual bool applyPrimitiveType(GLenum primitiveType, GLsizei elementCount) = 0; virtual bool applyPrimitiveType(GLenum primitiveType, GLsizei elementCount) = 0;
virtual GLenum applyVertexBuffer(gl::ProgramBinary *programBinary, gl::VertexAttribute vertexAttributes[], GLint first, GLsizei count, GLsizei instances) = 0; virtual GLenum applyVertexBuffer(gl::ProgramBinary *programBinary, gl::VertexAttribute vertexAttributes[], GLint first, GLsizei count, GLsizei instances) = 0;
virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo) = 0; virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo) = 0;
......
...@@ -710,6 +710,15 @@ void Renderer11::applyShaders(gl::ProgramBinary *programBinary) ...@@ -710,6 +710,15 @@ void Renderer11::applyShaders(gl::ProgramBinary *programBinary)
} }
} }
void Renderer11::applyUniforms(const gl::UniformArray *uniformArray)
{
// TODO
if (uniformArray->size() != 0)
{
UNIMPLEMENTED();
}
}
void Renderer11::clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer) void Renderer11::clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer)
{ {
if (clearParams.mask & GL_COLOR_BUFFER_BIT) if (clearParams.mask & GL_COLOR_BUFFER_BIT)
......
...@@ -62,6 +62,7 @@ class Renderer11 : public Renderer ...@@ -62,6 +62,7 @@ class Renderer11 : public Renderer
virtual bool applyPrimitiveType(GLenum mode, GLsizei count); virtual bool applyPrimitiveType(GLenum mode, GLsizei count);
virtual bool applyRenderTarget(gl::Framebuffer *frameBuffer); virtual bool applyRenderTarget(gl::Framebuffer *frameBuffer);
virtual void applyShaders(gl::ProgramBinary *programBinary); virtual void applyShaders(gl::ProgramBinary *programBinary);
virtual void applyUniforms(const gl::UniformArray *uniformArray);
virtual GLenum applyVertexBuffer(gl::ProgramBinary *programBinary, gl::VertexAttribute vertexAttributes[], GLint first, GLsizei count, GLsizei instances); virtual GLenum applyVertexBuffer(gl::ProgramBinary *programBinary, gl::VertexAttribute vertexAttributes[], GLint first, GLsizei count, GLsizei instances);
virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo); virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libGLESv2/mathutil.h" #include "libGLESv2/mathutil.h"
#include "libGLESv2/Context.h" #include "libGLESv2/Context.h"
#include "libGLESv2/ProgramBinary.h"
#include "libGLESv2/renderer/ShaderCache.h" #include "libGLESv2/renderer/ShaderCache.h"
#include "libGLESv2/renderer/VertexDeclarationCache.h" #include "libGLESv2/renderer/VertexDeclarationCache.h"
#include "libGLESv2/renderer/Renderer.h" #include "libGLESv2/renderer/Renderer.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