Ignore:
Timestamp:
Apr 11, 2012, 1:14:16 AM (9 years ago)
Author:
sam
Message:

win32: the uniform handling code was completely broken; we now properly
retrieve the constant's register index in the description table. This also
allows us to use a single uniform handle for both the vertex and pixel
shaders in a PS3 Cg program.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/shader.h

    r1180 r1214  
    1717#define __LOL_SHADER_H__
    1818
     19#include <stdint.h>
     20
    1921namespace lol
    2022{
     23
     24struct ShaderUniform
     25{
     26    friend class Shader;
     27
     28public:
     29    ShaderUniform() : flags(0) {}
     30
     31private:
     32    uintptr_t frag, vert;
     33    /* FIXME: do we really need this to indicate which locations are valid? */
     34    uint32_t flags;
     35};
    2136
    2237class ShaderData;
     
    3045    int GetAttribLocation(char const *attr) const;
    3146
    32     int GetUniformLocation(char const *uni) const;
    33     void SetUniform(int uni, float f);
    34     void SetUniform(int uni, vec2 const &v);
    35     void SetUniform(int uni, vec3 const &v);
    36     void SetUniform(int uni, vec4 const &v);
    37     void SetUniform(int uni, mat4 const &m);
     47    ShaderUniform GetUniformLocation(char const *uni) const;
     48    void SetUniform(ShaderUniform const &uni, float f);
     49    void SetUniform(ShaderUniform const &uni, vec2 const &v);
     50    void SetUniform(ShaderUniform const &uni, vec3 const &v);
     51    void SetUniform(ShaderUniform const &uni, vec4 const &v);
     52    void SetUniform(ShaderUniform const &uni, mat4 const &m);
    3853
    3954    void Bind() const;
Note: See TracChangeset for help on using the changeset viewer.