v3d: Rename gallium-local limits defines from VC5 to V3D.

The compiler has its limits under V3D_* (like most V3D stuff), so sync up
with that.
This commit is contained in:
Eric Anholt
2019-01-18 15:53:06 -08:00
parent b4870a15ae
commit 533b3f0541
11 changed files with 33 additions and 33 deletions

View File

@@ -224,7 +224,7 @@ v3d_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
V3D_DEBUG |= saved_shaderdb_flag;
v3d->sample_mask = (1 << VC5_MAX_SAMPLES) - 1;
v3d->sample_mask = (1 << V3D_MAX_SAMPLES) - 1;
v3d->active_queries = true;
return &v3d->base;

View File

@@ -190,10 +190,10 @@ struct v3d_vertexbuf_stateobj {
};
struct v3d_vertex_stateobj {
struct pipe_vertex_element pipe[VC5_MAX_ATTRIBUTES];
struct pipe_vertex_element pipe[V3D_MAX_ATTRIBUTES];
unsigned num_elements;
uint8_t attrs[16 * VC5_MAX_ATTRIBUTES];
uint8_t attrs[16 * V3D_MAX_ATTRIBUTES];
struct pipe_resource *defaults;
uint32_t defaults_offset;
};

View File

@@ -62,7 +62,7 @@ v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
}
}
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (job->cbufs[i]) {
remove_from_ht(v3d->write_jobs, job->cbufs[i]->texture);
pipe_surface_reference(&job->cbufs[i], NULL);
@@ -204,7 +204,7 @@ v3d_job_set_tile_buffer_size(struct v3d_job *job)
tile_size_index++;
int max_bpp = RENDER_TARGET_MAXIMUM_32BPP;
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (job->cbufs[i]) {
struct v3d_surface *surf = v3d_surface(job->cbufs[i]);
max_bpp = MAX2(max_bpp, surf->internal_bpp);
@@ -251,7 +251,7 @@ v3d_get_job(struct v3d_context *v3d,
*/
struct v3d_job *job = v3d_job_create(v3d);
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (cbufs[i]) {
v3d_flush_jobs_reading_resource(v3d, cbufs[i]->texture);
pipe_surface_reference(&job->cbufs[i], cbufs[i]);
@@ -267,7 +267,7 @@ v3d_get_job(struct v3d_context *v3d,
job->msaa = true;
}
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (cbufs[i])
_mesa_hash_table_insert(v3d->write_jobs,
cbufs[i]->texture, job);

View File

@@ -515,7 +515,7 @@ v3d_update_compiled_fs(struct v3d_context *v3d, uint8_t prim_mode)
if (job->msaa) {
key->msaa = v3d->rasterizer->base.multisample;
key->sample_coverage = (v3d->rasterizer->base.multisample &&
v3d->sample_mask != (1 << VC5_MAX_SAMPLES) - 1);
v3d->sample_mask != (1 << V3D_MAX_SAMPLES) - 1);
key->sample_alpha_to_coverage = v3d->blend->base.alpha_to_coverage;
key->sample_alpha_to_one = v3d->blend->base.alpha_to_one;
}

View File

@@ -123,7 +123,7 @@ struct v3d_resource {
struct pipe_resource base;
struct v3d_bo *bo;
struct renderonly_scanout *scanout;
struct v3d_resource_slice slices[VC5_MAX_MIP_LEVELS];
struct v3d_resource_slice slices[V3D_MAX_MIP_LEVELS];
uint32_t cube_map_stride;
uint32_t size;
int cpp;

View File

@@ -181,7 +181,7 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
return VC5_MAX_MIP_LEVELS;
return V3D_MAX_MIP_LEVELS;
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
return 2048;
@@ -260,14 +260,14 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
case PIPE_SHADER_CAP_MAX_INPUTS:
if (shader == PIPE_SHADER_FRAGMENT)
return VC5_MAX_FS_INPUTS / 4;
return V3D_MAX_FS_INPUTS / 4;
else
return VC5_MAX_ATTRIBUTES;
return V3D_MAX_ATTRIBUTES;
case PIPE_SHADER_CAP_MAX_OUTPUTS:
if (shader == PIPE_SHADER_FRAGMENT)
return 4;
else
return VC5_MAX_FS_INPUTS / 4;
return V3D_MAX_FS_INPUTS / 4;
case PIPE_SHADER_CAP_MAX_TEMPS:
return 256; /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
@@ -300,7 +300,7 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
return 1;
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
return VC5_MAX_TEXTURE_SAMPLERS;
return V3D_MAX_TEXTURE_SAMPLERS;
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
return PIPE_MAX_SHADER_BUFFERS;
@@ -340,7 +340,7 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen,
if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
return false;
if (sample_count > 1 && sample_count != VC5_MAX_SAMPLES)
if (sample_count > 1 && sample_count != V3D_MAX_SAMPLES)
return FALSE;
if (target >= PIPE_MAX_TEXTURE_TYPES) {

View File

@@ -35,11 +35,11 @@
struct v3d_bo;
#define VC5_MAX_MIP_LEVELS 12
#define VC5_MAX_TEXTURE_SAMPLERS 32
#define VC5_MAX_SAMPLES 4
#define VC5_MAX_DRAW_BUFFERS 4
#define VC5_MAX_ATTRIBUTES 16
#define V3D_MAX_MIP_LEVELS 12
#define V3D_MAX_TEXTURE_SAMPLERS 32
#define V3D_MAX_SAMPLES 4
#define V3D_MAX_DRAW_BUFFERS 4
#define V3D_MAX_ATTRIBUTES 16
/* These are tunable parameters in the HW design, but all the V3D
* implementations agree.

View File

@@ -317,7 +317,7 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d,
attr.maximum_index = 0xffffff;
#endif
}
STATIC_ASSERT(sizeof(vtx->attrs) >= VC5_MAX_ATTRIBUTES * size);
STATIC_ASSERT(sizeof(vtx->attrs) >= V3D_MAX_ATTRIBUTES * size);
}
if (vtx->num_elements == 0) {
@@ -700,7 +700,7 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
rsc->initialized_buffers |= PIPE_CLEAR_STENCIL;
}
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
uint32_t bit = PIPE_CLEAR_COLOR0 << i;
int blend_rt = v3d->blend->base.independent_blend_enable ? i : 0;
@@ -780,7 +780,7 @@ v3d_tlb_clear(struct v3d_job *job, unsigned buffers,
buffers &= ~PIPE_CLEAR_DEPTHSTENCIL;
}
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
uint32_t bit = PIPE_CLEAR_COLOR0 << i;
if (!(buffers & bit))
continue;

View File

@@ -291,7 +291,7 @@ emit_rt_blend(struct v3d_context *v3d, struct v3d_job *job,
if (blend->independent_blend_enable)
config.render_target_mask = 1 << rt;
else
config.render_target_mask = (1 << VC5_MAX_DRAW_BUFFERS) - 1;
config.render_target_mask = (1 << V3D_MAX_DRAW_BUFFERS) - 1;
#else
assert(rt == 0);
#endif
@@ -588,7 +588,7 @@ v3dX(emit_state)(struct pipe_context *pctx)
#endif
if (blend->base.independent_blend_enable) {
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++)
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++)
emit_rt_blend(v3d, job, &blend->base, i);
} else {
emit_rt_blend(v3d, job, &blend->base, 0);

View File

@@ -207,7 +207,7 @@ v3d_rcl_emit_loads(struct v3d_job *job, struct v3d_cl *cl)
{
uint32_t loads_pending = job->load;
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
uint32_t bit = PIPE_CLEAR_COLOR0 << i;
if (!(loads_pending & bit))
continue;
@@ -305,7 +305,7 @@ v3d_rcl_emit_stores(struct v3d_job *job, struct v3d_cl *cl)
* perspective. Non-MSAA surfaces will use
* STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_EXTENDED.
*/
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
uint32_t bit = PIPE_CLEAR_COLOR0 << i;
if (!(job->store & bit))
continue;
@@ -507,7 +507,7 @@ v3dX(emit_rcl)(struct v3d_job *job)
v3d_job_add_bo(job, job->rcl.bo);
int nr_cbufs = 0;
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (job->cbufs[i])
nr_cbufs = i + 1;
}

View File

@@ -78,7 +78,7 @@ static void
v3d_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask)
{
struct v3d_context *v3d = v3d_context(pctx);
v3d->sample_mask = sample_mask & ((1 << VC5_MAX_SAMPLES) - 1);
v3d->sample_mask = sample_mask & ((1 << V3D_MAX_SAMPLES) - 1);
v3d->dirty |= VC5_DIRTY_SAMPLE_STATE;
}
@@ -131,7 +131,7 @@ v3d_create_blend_state(struct pipe_context *pctx,
so->base = *cso;
if (cso->independent_blend_enable) {
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
so->blend_enables |= cso->rt[i].blend_enable << i;
/* V3D 4.x is when we got independent blend enables. */
@@ -140,7 +140,7 @@ v3d_create_blend_state(struct pipe_context *pctx,
}
} else {
if (cso->rt[0].blend_enable)
so->blend_enables = (1 << VC5_MAX_DRAW_BUFFERS) - 1;
so->blend_enables = (1 << V3D_MAX_DRAW_BUFFERS) - 1;
}
return so;
@@ -407,10 +407,10 @@ v3d_vertex_state_create(struct pipe_context *pctx, unsigned num_elements,
*/
uint32_t *attrs;
u_upload_alloc(v3d->state_uploader, 0,
VC5_MAX_ATTRIBUTES * 4 * sizeof(float), 16,
V3D_MAX_ATTRIBUTES * 4 * sizeof(float), 16,
&so->defaults_offset, &so->defaults, (void **)&attrs);
for (int i = 0; i < VC5_MAX_ATTRIBUTES; i++) {
for (int i = 0; i < V3D_MAX_ATTRIBUTES; i++) {
attrs[i * 4 + 0] = 0;
attrs[i * 4 + 1] = 0;
attrs[i * 4 + 2] = 0;