mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
Clean up warnings in r300 code by making some symbols static, adding prototypes
for others, and being cleaner with types in fragment/vertex program structures. One warning in r300_shader.c is still concerning.
This commit is contained in:
parent
aeb0ee771b
commit
3e8efc3753
11 changed files with 36 additions and 18 deletions
|
|
@ -5,7 +5,7 @@ TOP = ../../../../..
|
|||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "matrix.h"
|
||||
#include "extensions.h"
|
||||
#include "state.h"
|
||||
#include "bufferobj.h"
|
||||
|
||||
#include "swrast/swrast.h"
|
||||
#include "swrast_setup/swrast_setup.h"
|
||||
|
|
@ -191,7 +192,7 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = {
|
|||
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);
|
||||
|
|
@ -239,7 +240,7 @@ void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
|
|||
#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);
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ typedef struct r300_context *r300ContextPtr;
|
|||
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "glheader.h"
|
||||
#include "macros.h"
|
||||
#include "enums.h"
|
||||
#include "arbfragparse.h"
|
||||
|
||||
#include "program.h"
|
||||
#include "nvfragprog.h"
|
||||
|
|
@ -905,7 +906,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
|
|||
/* - 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;
|
||||
|
|
@ -1003,7 +1004,7 @@ void init_program(struct r300_fragment_program *rp)
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,5 +43,7 @@ typedef struct _pfs_reg_t {
|
|||
#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_ */
|
||||
|
||||
|
|
|
|||
|
|
@ -145,4 +145,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
((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__ */
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#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"
|
||||
|
|
@ -646,7 +647,9 @@ static void dtr(struct tnl_pipeline_stage *stage)
|
|||
(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;
|
||||
}
|
||||
|
||||
|
|
@ -678,12 +681,12 @@ static GLboolean r300_run_tcl_render(GLcontext *ctx,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ static void r300DeleteProgram(GLcontext *ctx, struct program *prog)
|
|||
|
||||
_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;
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ static void r300ClearStencil(GLcontext * ctx, GLint s)
|
|||
#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;
|
||||
|
|
@ -1326,7 +1326,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa);
|
|||
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;
|
||||
|
|
@ -1559,7 +1559,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa)
|
|||
* 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;
|
||||
|
|
@ -1587,13 +1587,14 @@ unsigned int r300PackFloat24(float f)
|
|||
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);
|
||||
|
|
@ -1849,7 +1850,7 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
|
|||
|
||||
/* 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;
|
||||
|
|
|
|||
|
|
@ -60,5 +60,10 @@ extern void r300ResetHwState(r300ContextPtr r300);
|
|||
|
||||
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__ */
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include "program.h"
|
||||
#include "r300_context.h"
|
||||
#include "r300_program.h"
|
||||
#include "nvvertprog.h"
|
||||
|
||||
#define SCALAR_FLAG (1<<31)
|
||||
|
|
@ -365,7 +366,7 @@ static unsigned long t_swizzle(GLubyte swizzle)
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue