for others, and being cleaner with types in fragment/vertex program structures.
One warning in r300_shader.c is still concerning.
include $(TOP)/configs/current
LIBNAME = r300_dri.so
-DEFINES += -DCOMPILE_R300 -DGLX_DIRECT_RENDERING
+DEFINES += -DCOMPILE_R300 -DGLX_DIRECT_RENDERING -DR200_MERGED=0
MINIGLX_SOURCES = server/radeon_dri.c
#include "matrix.h"
#include "extensions.h"
#include "state.h"
+#include "bufferobj.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
0,
};
-void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
+static void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
const GLvoid *data, GLenum usage, struct gl_buffer_object *obj)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
#endif
}
-void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj)
+static void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
typedef GLuint uint32_t;
typedef GLubyte uint8_t;
+struct r300_fragment_program;
/* We should probably change types within vertex_shader
and pixel_shader structure later on */
#include "glheader.h"
#include "macros.h"
#include "enums.h"
+#include "arbfragparse.h"
#include "program.h"
#include "nvfragprog.h"
/* - Init structures
* - Determine what hwregs each input corresponds to
*/
-void init_program(struct r300_fragment_program *rp)
+static void init_program(struct r300_fragment_program *rp)
{
struct fragment_program *mp = &rp->mesa_program;
struct fp_instruction *fpi;
rp->temp_in_use = temps_used;
}
-void update_params(struct r300_fragment_program *rp) {
+static void update_params(struct r300_fragment_program *rp) {
struct fragment_program *mp = &rp->mesa_program;
int i;
#define PFS_FLAG_SAT (1 << 0)
#define PFS_FLAG_ABS (1 << 1)
-#endif
+extern void translate_fragment_shader(struct r300_fragment_program *rp);
+
+#endif /* __R300_FRAGPROG_H_ */
((arg1) << R300_FPI2_ARG1A_SHIFT) | \
((arg2) << R300_FPI2_ARG2A_SHIFT))
+extern void debug_vp(GLcontext *ctx, struct vertex_program *vp);
+extern void dump_program_params(GLcontext *ctx, struct vertex_program *vp);
+
#endif /* __R300_PROGRAM_H__ */
#include "swrast_setup/swrast_setup.h"
#include "array_cache/acache.h"
#include "tnl/tnl.h"
+#include "tnl/t_vp_build.h"
#include "radeon_reg.h"
#include "radeon_macros.h"
(void)stage;
}
-GLboolean r300_create_render(GLcontext *ctx, struct tnl_pipeline_stage *stage){
+static GLboolean r300_create_render(GLcontext *ctx,
+ struct tnl_pipeline_stage *stage)
+{
return GL_TRUE;
}
if(ctx->VertexProgram._Enabled == GL_FALSE){
_tnl_UpdateFixedFunctionProgram(ctx);
}
- vp = CURRENT_VERTEX_SHADER(ctx);
+ vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
if(vp->translated == GL_FALSE)
translate_vertex_shader(vp);
if(vp->translated == GL_FALSE){
fprintf(stderr, "Failing back to sw-tcl\n");
- debug_vp(ctx, vp);
+ debug_vp(ctx, &vp->mesa_program);
hw_tcl_on=future_hw_tcl_on=0;
r300ResetHwState(rmesa);
return GL_TRUE;
_mesa_delete_program(ctx, prog);
}
-
-void r300ProgramStringNotify(GLcontext *ctx, GLenum target,
+
+static void r300ProgramStringNotify(GLcontext *ctx, GLenum target,
struct program *prog)
{
struct r300_vertex_program *vp=(void *)prog;
#define SUBPIXEL_X 0.125
#define SUBPIXEL_Y 0.125
-void r300UpdateWindow(GLcontext * ctx)
+static void r300UpdateWindow(GLcontext * ctx)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->radeon.dri.drawable;
while leaving colors intact. Nothing fancy (like lights)
If implementing lights make a copy first, so it is easy to switch between the two versions */
-void r300GenerateSimpleVertexShader(r300ContextPtr r300)
+static void r300GenerateSimpleVertexShader(r300ContextPtr r300)
{
int i;
GLuint o_reg = 0;
* But it works for most things. I'll fix it later if someone
* else with a better clue doesn't
*/
-unsigned int r300PackFloat24(float f)
+static unsigned int r300PackFloat24(float f)
{
float mantissa;
int exponent;
void r300SetupPixelShader(r300ContextPtr rmesa)
{
GLcontext *ctx = rmesa->radeon.glCtx;
- struct r300_fragment_program *rp = ctx->FragmentProgram._Current;
+ struct r300_fragment_program *rp =
+ (struct r300_fragment_program *)ctx->FragmentProgram._Current;
int i,k;
if (!rp) /* should only happenen once, just after context is created */
return;
- translate_fragment_shader(ctx->FragmentProgram._Current);
+ translate_fragment_shader(rp);
if (!rp->translated) {
fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__);
exit(-1);
/* Checks that r300ResetHwState actually modifies all states.
Should probably be burried in somewhere else as this file is getting longish. */
-void verify_r300ResetHwState(r300ContextPtr r300, int stage)
+static void verify_r300ResetHwState(r300ContextPtr r300, int stage)
{
struct r300_state_atom* atom;
int i;
extern void r300InitState(r300ContextPtr r300);
extern void r300InitStateFuncs(struct dd_function_table* functions);
+extern void r300SetupVertexShader(r300ContextPtr rmesa);
+extern void r300SetupPixelShader(r300ContextPtr rmesa);
+
+extern void r300_setup_textures(GLcontext *ctx);
+extern void r300_setup_rs_unit(GLcontext *ctx);
#endif /* __R300_STATE_H__ */
#include "program.h"
#include "r300_context.h"
+#include "r300_program.h"
#include "nvvertprog.h"
#define SCALAR_FLAG (1<<31)
}
}
-void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
+static void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
{
int i;