#ifndef U_UPLOAD_MGR_H
#define U_UPLOAD_MGR_H
-#include "pipe/p_error.h"
+#include "pipe/p_defines.h"
struct pipe_screen;
struct pipe_buffer;
key->urb_size = brw->urb.vsize;
/* */
- key->depth_clamp = 0; // XXX: add this to gallium: ctx->Transform.DepthClamp;
+ key->depth_clamp = 0; /* XXX: add this to gallium: ctx->Transform.DepthClamp; */
}
static enum pipe_error
struct brw_immediate_data immediates;
unsigned iz_lookup;
- //unsigned wm_lookup;
+ /*unsigned wm_lookup;*/
unsigned uses_depth:1;
unsigned has_flow_control:1;
/** Input sizes, calculated from active vertex program.
* One bit per fragment program input attribute.
*/
- //GLbitfield input_size_masks[4];
+ /*GLbitfield input_size_masks[4];*/
/** Array of surface default colors (texture border color) */
struct brw_winsys_buffer *sdc_bo[BRW_MAX_TEX_UNIT];
prim_packet.start_vert_location += brw->ib.start_vertex_offset;
prim_packet.instance_count = 1;
prim_packet.start_instance_location = 0;
- prim_packet.base_vert_location = 0; // prim->basevertex; XXX: add this to gallium
+ prim_packet.base_vert_location = 0; /* prim->basevertex; XXX: add this to gallium */
/* If we're set to always flush, do it before and after the primitive emit.
#define BRW_EU_H
#include "util/u_debug.h"
-#include "pipe/p_error.h"
+#include "pipe/p_defines.h"
#include "brw_structs.h"
#include "brw_defines.h"
* in the future:
*/
assert (reg.address_mode == BRW_ADDRESS_DIRECT);
- //assert (reg.file == BRW_GENERAL_REGISTER_FILE);
+ /*assert (reg.file == BRW_GENERAL_REGISTER_FILE); */
if (insn->header.access_mode == BRW_ALIGN_1) {
insn->bits3.da1.src1_subreg_nr = reg.subnr;
brw->state.dirty.mesa |= PIPE_NEW_BOUND_TEXTURES;
}
+static void brw_set_vertex_sampler_textures(struct pipe_context *pipe,
+ unsigned num,
+ struct pipe_texture **texture)
+{
+}
+
+static void brw_bind_vertex_sampler_state(struct pipe_context *pipe,
+ unsigned num, void **sampler)
+{
+}
+
void brw_pipe_sampler_init( struct brw_context *brw )
{
- brw->base.set_sampler_textures = brw_set_sampler_textures;
brw->base.create_sampler_state = brw_create_sampler_state;
- brw->base.bind_sampler_states = brw_bind_sampler_state;
brw->base.delete_sampler_state = brw_delete_sampler_state;
- brw->base.set_sampler_textures = brw_set_sampler_textures;
+ brw->base.set_fragment_sampler_textures = brw_set_sampler_textures;
+ brw->base.bind_fragment_sampler_states = brw_bind_sampler_state;
+
+ brw->base.set_vertex_sampler_textures = brw_set_vertex_sampler_textures;
+ brw->base.bind_vertex_sampler_states = brw_bind_vertex_sampler_state;
+
}
void brw_pipe_sampler_cleanup( struct brw_context *brw )
{
brw_screen_tex_surface_init(bscreen);
brw_screen_buffer_init(bscreen);
- bscreen->no_tiling = debug_get_option("BRW_NO_TILING", FALSE);
+ bscreen->no_tiling = debug_get_option("BRW_NO_TILING", FALSE) != NULL;
return &bscreen->base;
#include "util/u_memory.h"
#include "util/u_simple_list.h"
+#include "util/u_math.h"
#include "pipe/p_screen.h"
#include "brw_screen.h"
assert(id.bits.zslice == 0);
surface->base.format = tex->base.format;
- surface->base.width = tex->base.width[id.bits.level];
- surface->base.height = tex->base.height[id.bits.level];
+ surface->base.width = u_minify(tex->base.width0, id.bits.level);
+ surface->base.height = u_minify(tex->base.height0, id.bits.level);
surface->base.offset = tex->image_offset[id.bits.level][id.bits.face];
surface->base.usage = usage;
surface->base.zslice = id.bits.zslice;
assert(tex->image_offset[level] == NULL);
assert(nr_images >= 1);
- tex->base.width[level] = w;
- tex->base.height[level] = h;
- tex->base.depth[level] = d;
-
tex->level_offset[level] = (x + y * tex->pitch) * tex->cpp;
tex->nr_images[level] = nr_images;
GLuint level;
GLuint x = 0;
GLuint y = 0;
- GLuint width = tex->base.width[0];
- GLuint height = tex->base.height[0];
+ GLuint width = tex->base.width0;
+ GLuint height = tex->base.height0;
- tex->pitch = tex->base.width[0];
+ tex->pitch = tex->base.width0;
brw_tex_alignment_unit(tex->base.format, &align_w, &align_h);
if (tex->compressed) {
- tex->pitch = align(tex->base.width[0], align_w);
+ tex->pitch = align(tex->base.width0, align_w);
}
/* May need to adjust pitch to accomodate the placement of
GLuint mip1_width;
if (tex->compressed) {
- mip1_width = align(minify(tex->base.width[0]), align_w)
- + align(minify(minify(tex->base.width[0])), align_w);
+ mip1_width = (align(u_minify(tex->base.width0, 1), align_w) +
+ align(u_minify(tex->base.width0, 2), align_w));
} else {
- mip1_width = align(minify(tex->base.width[0]), align_w)
- + minify(minify(tex->base.width[0]));
+ mip1_width = (align(u_minify(tex->base.width0, 1), align_w) +
+ u_minify(tex->base.width0, 2));
}
if (mip1_width > tex->pitch) {
y += img_height;
}
- width = minify(width);
- height = minify(height);
+ width = u_minify(width, 1);
+ height = u_minify(height, 1);
}
}
GLuint level;
GLuint x = 0;
GLuint y = 0;
- GLuint width = tex->base.width[0];
- GLuint height = tex->base.height[0];
+ GLuint width = tex->base.width0;
+ GLuint height = tex->base.height0;
GLuint qpitch = 0;
GLuint y_pitch = 0;
- tex->pitch = tex->base.width[0];
+ tex->pitch = tex->base.width0;
brw_tex_alignment_unit(tex->base.format, &align_w, &align_h);
y_pitch = align(height, align_h);
if (tex->compressed) {
- tex->pitch = align(tex->base.width[0], align_w);
+ tex->pitch = align(tex->base.width0, align_w);
}
if (tex->base.last_level != 0) {
GLuint mip1_width;
if (tex->compressed) {
- mip1_width = (align(minify(tex->base.width[0]), align_w) +
- align(minify(minify(tex->base.width[0])), align_w));
+ mip1_width = (align(u_minify(tex->base.width0, 1), align_w) +
+ align(u_minify(tex->base.width0, 2), align_w));
} else {
- mip1_width = (align(minify(tex->base.width[0]), align_w) +
- minify(minify(tex->base.width[0])));
+ mip1_width = (align(u_minify(tex->base.width0, 1), align_w) +
+ u_minify(tex->base.width0, 2));
}
if (mip1_width > tex->pitch) {
if (tex->compressed) {
qpitch = ((y_pitch +
- align(minify(y_pitch), align_h) +
+ align(u_minify(y_pitch, 1), align_h) +
11 * align_h) / 4) * tex->pitch * tex->cpp;
tex->total_height = ((y_pitch +
- align(minify(y_pitch), align_h) +
+ align(u_minify(y_pitch, 1), align_h) +
11 * align_h) / 4) * 6;
} else {
qpitch = (y_pitch +
- align(minify(y_pitch), align_h) +
+ align(u_minify(y_pitch, 1), align_h) +
11 * align_h) * tex->pitch * tex->cpp;
tex->total_height = (y_pitch +
- align(minify(y_pitch), align_h) +
+ align(u_minify(y_pitch, 1), align_h) +
11 * align_h) * 6;
}
y += img_height;
}
- width = minify(width);
- height = minify(height);
+ width = u_minify(width, 1);
+ height = u_minify(height, 1);
}
return TRUE;
static boolean
brw_layout_3d_cube( struct brw_texture *tex )
{
- GLuint width = tex->base.width[0];
- GLuint height = tex->base.height[0];
- GLuint depth = tex->base.depth[0];
+ GLuint width = tex->base.width0;
+ GLuint height = tex->base.height0;
+ GLuint depth = tex->base.depth0;
GLuint pack_x_pitch, pack_x_nr;
GLuint pack_y_pitch;
GLuint level;
tex->pitch = align(width, align_w);
pack_y_pitch = (height + 3) / 4;
} else {
- tex->pitch = brw_tex_pitch_align(tex, tex->base.width[0]);
- pack_y_pitch = align(tex->base.height[0], align_h);
+ tex->pitch = brw_tex_pitch_align(tex, tex->base.width0);
+ pack_y_pitch = align(tex->base.height0, align_h);
}
pack_x_pitch = width;
tex->total_height += y;
- width = minify(width);
- height = minify(height);
- depth = minify(depth);
+ width = u_minify(width, 1);
+ height = u_minify(height, 1);
+ depth = u_minify(depth, 1);
if (tex->compressed) {
pack_y_pitch = (height + 3) / 4;
*/
tex->ss.ss1.base_addr = 0; /* reloc */
tex->ss.ss2.mip_count = tex->base.last_level;
- tex->ss.ss2.width = tex->base.width[0] - 1;
- tex->ss.ss2.height = tex->base.height[0] - 1;
+ tex->ss.ss2.width = tex->base.width0 - 1;
+ tex->ss.ss2.height = tex->base.height0 - 1;
switch (tex->tiling) {
case BRW_TILING_NONE:
}
tex->ss.ss3.pitch = (tex->pitch * tex->cpp) - 1;
- tex->ss.ss3.depth = tex->base.depth[0] - 1;
+ tex->ss.ss3.depth = tex->base.depth0 - 1;
tex->ss.ss4.min_lod = 0;
if (templ->target != PIPE_TEXTURE_2D ||
templ->last_level != 0 ||
- templ->depth[0] != 1)
+ templ->depth0 != 1)
return NULL;
if (pf_is_compressed(templ->format))
*/
tex->ss.ss1.base_addr = 0; /* reloc */
tex->ss.ss2.mip_count = tex->base.last_level;
- tex->ss.ss2.width = tex->base.width[0] - 1;
- tex->ss.ss2.height = tex->base.height[0] - 1;
+ tex->ss.ss2.width = tex->base.width0 - 1;
+ tex->ss.ss2.height = tex->base.height0 - 1;
switch (tex->tiling) {
case BRW_TILING_NONE:
}
tex->ss.ss3.pitch = (tex->pitch * tex->cpp) - 1;
- tex->ss.ss3.depth = tex->base.depth[0] - 1;
+ tex->ss.ss3.depth = tex->base.depth0 - 1;
tex->ss.ss4.min_lod = 0;
#ifndef BRW_STATE_H
#define BRW_STATE_H
-#include "pipe/p_error.h"
+#include "pipe/p_defines.h"
#include "util/u_memory.h"
#include "brw_context.h"
-static inline void
+static INLINE void
brw_add_validated_bo(struct brw_context *brw, struct brw_winsys_buffer *bo)
{
assert(brw->state.validated_bo_count < Elements(brw->state.validated_bos));
const struct brw_tracked_state *atoms[] =
{
-// &brw_wm_input_sizes,
+/* &brw_wm_input_sizes, */
&brw_vs_prog,
&brw_gs_prog,
&brw_clip_prog,
&brw_cc_unit,
&brw_vs_surfaces, /* must do before unit */
- //&brw_wm_constant_surface, /* must do before wm surfaces/bind bo */
+ /*&brw_wm_constant_surface,*/ /* must do before wm surfaces/bind bo */
&brw_wm_surfaces, /* must do before samplers and unit */
&brw_wm_samplers,
{
struct brw_reg reg;
- if (src->SrcRegister.File == TGSI_FILE_NULL)
+ if (src->Register.File == TGSI_FILE_NULL)
return brw_null_reg();
reg = get_src_reg(c, argIndex,
- src->SrcRegister.File,
- src->SrcRegister.Index,
- src->SrcRegister.Indirect);
+ src->Register.File,
+ src->Register.Index,
+ src->Register.Indirect);
/* Convert 3-bit swizzle to 2-bit.
*/
- reg.dw1.bits.swizzle = BRW_SWIZZLE4(src->SrcRegister.SwizzleX,
- src->SrcRegister.SwizzleY,
- src->SrcRegister.SwizzleZ,
- src->SrcRegister.SwizzleW);
+ reg.dw1.bits.swizzle = BRW_SWIZZLE4(src->Register.SwizzleX,
+ src->Register.SwizzleY,
+ src->Register.SwizzleZ,
+ src->Register.SwizzleW);
- reg.negate = src->SrcRegister.Negate ? 1 : 0;
+ reg.negate = src->Register.Negate ? 1 : 0;
/* XXX: abs, absneg
*/
const struct tgsi_full_instruction *inst)
{
unsigned opcode = inst->Instruction.Opcode;
- unsigned label = inst->InstructionExtLabel.Label;
+ unsigned label = inst->Label.Label;
struct brw_compile *p = &c->func;
struct brw_reg args[3], dst;
GLuint i;
/* Get argument regs.
*/
for (i = 0; i < 3; i++) {
- args[i] = get_arg(c, &inst->FullSrcRegisters[i], i);
+ args[i] = get_arg(c, &inst->Src[i], i);
}
/* Get dest regs. Note that it is possible for a reg to be both
* care needs to be taken emitting multi-operation instructions.
*/
dst = get_dst(c,
- inst->FullDstRegisters[0].DstRegister.File,
- inst->FullDstRegisters[0].DstRegister.Index,
- inst->FullDstRegisters[0].DstRegister.WriteMask);
+ inst->Dst[0].Register.File,
+ inst->Dst[0].Register.Index,
+ inst->Dst[0].Register.WriteMask);
/* XXX: saturate
*/
struct tgsi_parse_context parse;
struct tgsi_full_instruction *inst;
-// if (BRW_DEBUG & DEBUG_VS)
+ if (BRW_DEBUG & DEBUG_VS)
tgsi_dump(c->vp->tokens, 0);
c->stack_index = brw_indirect(0, 0);
#define BRW_WINSYS_H
#include "pipe/p_compiler.h"
-#include "pipe/p_error.h"
+#include "pipe/p_defines.h"
#include "pipe/p_refcnt.h"
struct brw_winsys;
/* XXX: GLSL support
*/
exit(1);
- //brw_wm_branching_shader_emit(brw, c);
+ /* brw_wm_branching_shader_emit(brw, c); */
}
else {
c->dispatch_width = 16;
brw_push_insn_state(p);
brw_set_mask_control(p, BRW_MASK_DISABLE);
- brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); //IMASK
+ brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); /* IMASK */
brw_AND(p, r0uw, c->emit_mask_reg, r0uw);
brw_pop_insn_state(p);
}
{
struct brw_fp_dst out;
- out.file = dst->DstRegister.File;
- out.index = dst->DstRegister.Index;
- out.writemask = dst->DstRegister.WriteMask;
- out.indirect = dst->DstRegister.Indirect;
+ out.file = dst->Register.File;
+ out.index = dst->Register.Index;
+ out.writemask = dst->Register.WriteMask;
+ out.indirect = dst->Register.Indirect;
out.saturate = (saturate == TGSI_SAT_ZERO_ONE);
if (out.indirect) {
- assert(dst->DstRegisterInd.File == TGSI_FILE_ADDRESS);
- assert(dst->DstRegisterInd.Index == 0);
+ assert(dst->Indirect.File == TGSI_FILE_ADDRESS);
+ assert(dst->Indirect.Index == 0);
}
return out;
{
struct brw_fp_src out;
- out.file = src->SrcRegister.File;
- out.index = src->SrcRegister.Index;
- out.indirect = src->SrcRegister.Indirect;
+ out.file = src->Register.File;
+ out.index = src->Register.Index;
+ out.indirect = src->Register.Indirect;
- out.swizzle = ((src->SrcRegister.SwizzleX << 0) |
- (src->SrcRegister.SwizzleY << 2) |
- (src->SrcRegister.SwizzleZ << 4) |
- (src->SrcRegister.SwizzleW << 6));
+ out.swizzle = ((src->Register.SwizzleX << 0) |
+ (src->Register.SwizzleY << 2) |
+ (src->Register.SwizzleZ << 4) |
+ (src->Register.SwizzleW << 6));
switch (tgsi_util_get_full_src_register_sign_mode( src, 0 )) {
case TGSI_UTIL_SIGN_CLEAR:
}
if (out.indirect) {
- assert(src->SrcRegisterInd.File == TGSI_FILE_ADDRESS);
- assert(src->SrcRegisterInd.Index == 0);
+ assert(src->Indirect.File == TGSI_FILE_ADDRESS);
+ assert(src->Indirect.Index == 0);
}
return out;
struct brw_fp_src src[3];
int i;
- dst = translate_dst( c, &inst->FullDstRegisters[0],
+ dst = translate_dst( c, &inst->Dst[0],
inst->Instruction.Saturate );
for (i = 0; i < inst->Instruction.NumSrcRegs; i++)
- src[i] = translate_src( c, &inst->FullSrcRegisters[i] );
+ src[i] = translate_src( c, &inst->Src[i] );
switch (opcode) {
case TGSI_OPCODE_ABS:
case TGSI_OPCODE_TEX:
precalc_tex(c, dst,
- inst->InstructionExtTexture.Texture,
+ inst->Texture.Texture,
src[1].index, /* use sampler unit for tex idx */
src[0], /* coord */
src[1]); /* sampler */
case TGSI_OPCODE_TXP:
precalc_txp(c, dst,
- inst->InstructionExtTexture.Texture,
+ inst->Texture.Texture,
src[1].index, /* use sampler unit for tex idx */
src[0], /* coord */
src[1]); /* sampler */
/* XXX: TXB not done
*/
precalc_tex(c, dst,
- inst->InstructionExtTexture.Texture,
+ inst->Texture.Texture,
src[1].index, /* use sampler unit for tex idx*/
src[0],
src[1]);
unsigned first, last, mask;
unsigned attrib;
- first = decl->DeclarationRange.First;
- last = decl->DeclarationRange.Last;
+ first = decl->Range.First;
+ last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
for (attrib = first; attrib <= last; attrib++) {
emit_interp(c,
attrib,
- decl->Semantic.SemanticName,
+ decl->Semantic.Name,
decl->Declaration.Interpolate );
}
}