brwInitFragProgFuncs( functions );
brw_init_common_queryobj_functions(functions);
- if (devinfo->gen >= 8 || brw->is_haswell)
+ if (devinfo->gen >= 8 || devinfo->is_haswell)
hsw_init_queryobj_functions(functions);
else if (devinfo->gen >= 6)
gen6_init_queryobj_functions(functions);
}
unsigned max_samplers =
- devinfo->gen >= 8 || brw->is_haswell ? BRW_MAX_TEX_UNIT : 16;
+ devinfo->gen >= 8 || devinfo->is_haswell ? BRW_MAX_TEX_UNIT : 16;
ctx->Const.MaxDualSourceDrawBuffers = 1;
ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS;
brw->screen = screen;
brw->bufmgr = screen->bufmgr;
- brw->is_haswell = devinfo->is_haswell;
brw->is_cherryview = devinfo->is_cherryview;
brw->is_broxton = devinfo->is_broxton || devinfo->is_geminilake;
brw->has_llc = devinfo->has_llc;
uint64_t max_gtt_map_object_size;
- bool is_haswell;
bool is_cherryview;
bool is_broxton;
* number of threads per subslice.
*/
const unsigned scratch_ids_per_subslice =
- brw->is_haswell ? 16 * 8 : devinfo->max_cs_threads;
+ devinfo->is_haswell ? 16 * 8 : devinfo->max_cs_threads;
brw_alloc_stage_scratch(brw, &brw->cs.base,
prog_data.base.total_scratch,
brw->vb.inputs[i].glarray = arrays[i];
}
- if (devinfo->gen < 8 && !brw->is_haswell) {
+ if (devinfo->gen < 8 && !devinfo->is_haswell) {
uint64_t mask = ctx->VertexProgram._Current->info.inputs_read;
/* Prior to Haswell, the hardware can't natively support GL_FIXED or
* 2_10_10_10_REV vertex formats. Set appropriate workaround flags.
int size = glarray->Size;
const struct gen_device_info *devinfo = &brw->screen->devinfo;
const bool is_ivybridge_or_older =
- devinfo->gen <= 7 && !devinfo->is_baytrail && !brw->is_haswell;
+ devinfo->gen <= 7 && !devinfo->is_baytrail && !devinfo->is_haswell;
if (unlikely(INTEL_DEBUG & DEBUG_VERTS))
fprintf(stderr, "type %s size %d normalized %d\n",
return ubyte_types_norm[size];
}
case GL_FIXED:
- if (devinfo->gen >= 8 || brw->is_haswell)
+ if (devinfo->gen >= 8 || devinfo->is_haswell)
return fixed_point_types[size];
/* This produces GL_FIXED inputs as values between INT32_MIN and
*/
case GL_INT_2_10_10_10_REV:
assert(size == 4);
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
return glarray->Format == GL_BGRA
? ISL_FORMAT_B10G10R10A2_SNORM
: ISL_FORMAT_R10G10B10A2_SNORM;
return ISL_FORMAT_R10G10B10A2_UINT;
case GL_UNSIGNED_INT_2_10_10_10_REV:
assert(size == 4);
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
return glarray->Format == GL_BGRA
? ISL_FORMAT_B10G10R10A2_UNORM
: ISL_FORMAT_R10G10B10A2_UNORM;
*/
if (glarray->Type == GL_INT_2_10_10_10_REV) {
assert(size == 4);
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
return glarray->Format == GL_BGRA
? ISL_FORMAT_B10G10R10A2_SSCALED
: ISL_FORMAT_R10G10B10A2_SSCALED;
return ISL_FORMAT_R10G10B10A2_UINT;
} else if (glarray->Type == GL_UNSIGNED_INT_2_10_10_10_REV) {
assert(size == 4);
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
return glarray->Format == GL_BGRA
? ISL_FORMAT_B10G10R10A2_USCALED
: ISL_FORMAT_R10G10B10A2_USCALED;
case GL_UNSIGNED_SHORT: return ushort_types_scale[size];
case GL_UNSIGNED_BYTE: return ubyte_types_scale[size];
case GL_FIXED:
- if (devinfo->gen >= 8 || brw->is_haswell)
+ if (devinfo->gen >= 8 || devinfo->is_haswell)
return fixed_point_types[size];
/* This produces GL_FIXED inputs as values between INT32_MIN and
(pipeline == BRW_COMPUTE_PIPELINE ? 2 : 0));
ADVANCE_BATCH();
- if (devinfo->gen == 7 && !brw->is_haswell &&
+ if (devinfo->gen == 7 && !devinfo->is_haswell &&
pipeline == BRW_RENDER_PIPELINE) {
/* From "BXML » GT » MI » vol1a GPU Overview » [Instruction]
* PIPELINE_SELECT [DevBWR+]":
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- if (devinfo->gen == 7 && !brw->is_haswell) {
+ if (devinfo->gen == 7 && !devinfo->is_haswell) {
if (flags & PIPE_CONTROL_CS_STALL) {
/* If we're doing a CS stall, reset the counter and carry on. */
brw->pipe_controls_since_last_cs_stall = 0;
PIPE_CONTROL_WRITE_IMMEDIATE,
brw->workaround_bo, 0, 0);
- if (brw->is_haswell) {
+ if (devinfo->is_haswell) {
/* Haswell needs addition work-arounds:
*
* From Haswell PRM, volume 2, part 1, "End-of-Pipe Synchronization":
const struct gen_device_info *devinfo = &brw->screen->devinfo;
/* Otherwise Haswell can do it all. */
- if (devinfo->gen >= 8 || brw->is_haswell)
+ if (devinfo->gen >= 8 || devinfo->is_haswell)
return true;
if (!can_cut_index_handle_restart_index(ctx, ib)) {
/* Typed surface messages are handled by the render cache on IVB, so we
* need to flush it too.
*/
- if (devinfo->gen == 7 && !brw->is_haswell)
+ if (devinfo->gen == 7 && !devinfo->is_haswell)
bits |= PIPE_CONTROL_RENDER_TARGET_FLUSH;
brw_emit_pipe_control_flush(brw, bits);
struct gl_program *prog)
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- const bool has_shader_channel_select = brw->is_haswell || devinfo->gen >= 8;
+ const bool has_shader_channel_select = devinfo->is_haswell || devinfo->gen >= 8;
unsigned sampler_count = util_last_bit(prog->SamplersUsed);
for (unsigned i = 0; i < sampler_count; i++) {
if (!has_shader_channel_select && (prog->ShadowSamplers & (1 << i))) {
gen9_init_atoms(brw);
else if (devinfo->gen >= 8)
gen8_init_atoms(brw);
- else if (brw->is_haswell)
+ else if (devinfo->is_haswell)
gen75_init_atoms(brw);
else if (devinfo->gen >= 7)
gen7_init_atoms(brw);
brw_populate_sampler_prog_key_data(ctx, prog, &key->tex);
/* BRW_NEW_VS_ATTRIB_WORKAROUNDS */
- if (devinfo->gen < 8 && !brw->is_haswell) {
+ if (devinfo->gen < 8 && !devinfo->is_haswell) {
memcpy(key->gl_attrib_wa_flags, brw->vb.attrib_wa_flags,
sizeof(brw->vb.attrib_wa_flags));
}
/* Haswell handles texture swizzling as surface format overrides
* (except for GL_ALPHA); all other platforms need MOVs in the shader.
*/
- if (alpha_depth || (devinfo->gen < 8 && !brw->is_haswell))
+ if (alpha_depth || (devinfo->gen < 8 && !devinfo->is_haswell))
key->swizzles[s] = brw_get_texture_swizzle(ctx, t);
if (devinfo->gen < 8 &&
* leaving normal texture swizzling to SCS.
*/
unsigned src_swizzle =
- brw->is_haswell ? t->_Swizzle : key->swizzles[s];
+ devinfo->is_haswell ? t->_Swizzle : key->swizzles[s];
for (int i = 0; i < 4; i++) {
unsigned src_comp = GET_SWZ(src_swizzle, i);
if (src_comp == SWIZZLE_ONE || src_comp == SWIZZLE_W) {
* request blue. Haswell can use SCS for this, but Ivybridge
* needs a shader workaround.
*/
- if (!brw->is_haswell)
+ if (!devinfo->is_haswell)
key->gather_channel_quirk_mask |= 1 << s;
break;
}
format == ISL_FORMAT_R32G32_SINT ||
format == ISL_FORMAT_R32G32_UINT)) {
format = ISL_FORMAT_R32G32_FLOAT_LD;
- need_green_to_blue = brw->is_haswell;
+ need_green_to_blue = devinfo->is_haswell;
} else if (devinfo->gen == 6) {
/* Sandybridge's gather4 message is broken for integer formats.
* To work around this, we pretend the surface is UNORM for
int i;
const int size = prog_data->nr_params * sizeof(gl_constant_value);
gl_constant_value *param;
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
param = intel_upload_space(brw, size, 32,
&stage_state->push_const_bo,
&stage_state->push_const_offset);
* and correctly emitted the number of pixel shader invocations, but,
* whomever forgot to undo the multiply by 4.
*/
- if (devinfo->gen == 8 || brw->is_haswell)
+ if (devinfo->gen == 8 || devinfo->is_haswell)
query->Base.Result /= 4;
break;
/* Demote any clients with no ways assigned to LLC. */
OUT_BATCH(GEN7_L3SQCREG1);
- OUT_BATCH((brw->is_haswell ? HSW_L3SQCREG1_SQGHPCI_DEFAULT :
+ OUT_BATCH((devinfo->is_haswell ? HSW_L3SQCREG1_SQGHPCI_DEFAULT :
devinfo->is_baytrail ? VLV_L3SQCREG1_SQGHPCI_DEFAULT :
IVB_L3SQCREG1_SQGHPCI_DEFAULT) |
(has_dc ? 0 : GEN7_L3SQCREG1_CONV_DC_UC) |
uint32_t width, uint32_t height,
uint32_t tile_x, uint32_t tile_y)
{
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
struct gl_context *ctx = &brw->ctx;
const uint8_t mocs = GEN7_MOCS_L3;
struct gl_framebuffer *fb = ctx->DrawBuffer;
ADVANCE_BATCH();
} else {
stencil_mt->r8stencil_needs_update = true;
- const int enabled = brw->is_haswell ? HSW_STENCIL_ENABLED : 0;
+ const int enabled = devinfo->is_haswell ? HSW_STENCIL_ENABLED : 0;
BEGIN_BATCH(3);
OUT_BATCH(GEN7_3DSTATE_STENCIL_BUFFER << 16 | (3 - 2));
unsigned avail_size = 16;
unsigned multiplier =
- (devinfo->gen >= 8 || (brw->is_haswell && devinfo->gt == 3)) ? 2 : 1;
+ (devinfo->gen >= 8 || (devinfo->is_haswell && devinfo->gt == 3)) ? 2 : 1;
int stages = 2 + gs_present + 2 * tess_present;
*
* No such restriction exists for Haswell or Baytrail.
*/
- if (devinfo->gen < 8 && !brw->is_haswell && !devinfo->is_baytrail)
+ if (devinfo->gen < 8 && !devinfo->is_haswell && !devinfo->is_baytrail)
gen7_emit_cs_stall_flush(brw);
}
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
const int push_size_kB =
- (devinfo->gen >= 8 || (brw->is_haswell && devinfo->gt == 3)) ? 32 : 16;
+ (devinfo->gen >= 8 || (devinfo->is_haswell && devinfo->gt == 3)) ? 32 : 16;
/* BRW_NEW_{VS,TCS,TES,GS}_PROG_DATA */
struct brw_vue_prog_data *prog_data[4] = {
gen_get_urb_config(devinfo, 1024 * push_size_kB, 1024 * brw->urb.size,
tess_present, gs_present, entry_size, entries, start);
- if (devinfo->gen == 7 && !brw->is_haswell && !devinfo->is_baytrail)
+ if (devinfo->gen == 7 && !devinfo->is_haswell && !devinfo->is_baytrail)
gen7_emit_vs_workaround_flush(brw);
BEGIN_BATCH(8);
* and correctly emitted the number of pixel shader invocations, but,
* whomever forgot to undo the multiply by 4.
*/
- if (devinfo->gen == 8 || brw->is_haswell)
+ if (devinfo->gen == 8 || devinfo->is_haswell)
shr_gpr0_by_2_bits(brw);
break;
case GL_TIME_ELAPSED:
struct brw_context *brw = brw_context(ctx);
struct brw_transform_feedback_object *brw_obj =
(struct brw_transform_feedback_object *) obj;
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
- if (brw->is_haswell) {
+ if (devinfo->is_haswell) {
/* Flush any drawing so that the counters have the right values. */
brw_emit_mi_flush(brw);
struct brw_context *brw = brw_context(ctx);
struct brw_transform_feedback_object *brw_obj =
(struct brw_transform_feedback_object *) obj;
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
- if (brw->is_haswell) {
+ if (devinfo->is_haswell) {
/* Reload the SOL buffer offset registers. */
for (int i = 0; i < BRW_MAX_XFB_STREAMS; i++) {
BEGIN_BATCH(3);
if (devinfo->gen >= 7)
gen7_restore_default_l3_config(brw);
- if (brw->is_haswell) {
+ if (devinfo->is_haswell) {
/* From the Haswell PRM, Volume 2b, Command Reference: Instructions,
* 3DSTATE_CC_STATE_POINTERS > "Note":
*
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- assert(devinfo->gen >= 8 || brw->is_haswell);
+ assert(devinfo->gen >= 8 || devinfo->is_haswell);
BEGIN_BATCH(3);
OUT_BATCH(MI_LOAD_REGISTER_REG | (3 - 2));
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- assert(devinfo->gen >= 8 || brw->is_haswell);
+ assert(devinfo->gen >= 8 || devinfo->is_haswell);
BEGIN_BATCH(6);
OUT_BATCH(MI_LOAD_REGISTER_REG | (3 - 2));
if (devinfo->gen >= 8)
ctx->Const.GLSLVersion = 450;
- else if (brw->is_haswell && can_do_pipelined_register_writes(brw->screen))
+ else if (devinfo->is_haswell && can_do_pipelined_register_writes(brw->screen))
ctx->Const.GLSLVersion = 450;
else if (devinfo->gen >= 7 && can_do_pipelined_register_writes(brw->screen))
ctx->Const.GLSLVersion = 420;
ctx->Const.MaxComputeWorkGroupSize[0] >= 1024) {
ctx->Extensions.ARB_compute_shader = true;
ctx->Extensions.ARB_ES3_1_compatibility =
- devinfo->gen >= 8 || brw->is_haswell;
+ devinfo->gen >= 8 || devinfo->is_haswell;
}
if (can_do_predicate_writes(brw->screen))
}
}
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
ctx->Extensions.ARB_stencil_texturing = true;
ctx->Extensions.ARB_texture_stencil8 = true;
ctx->Extensions.OES_geometry_shader = true;
ctx->Extensions.OES_viewport_array = true;
}
- if (devinfo->gen >= 8 || brw->is_haswell || devinfo->is_baytrail) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell || devinfo->is_baytrail) {
ctx->Extensions.ARB_robust_buffer_access_behavior = true;
}
assert(mt->hiz_buf);
assert(mt->surf.size > 0);
- if (devinfo->gen >= 8 || brw->is_haswell) {
+ if (devinfo->gen >= 8 || devinfo->is_haswell) {
uint32_t width = minify(mt->surf.phys_level0_sa.width, level);
uint32_t height = minify(mt->surf.phys_level0_sa.height, level);