brwInitFragProgFuncs( functions );
brw_init_common_queryobj_functions(functions);
- if (screen->gen >= 6)
+ if (screen->devinfo->gen >= 6)
gen6_init_queryobj_functions(functions);
else
gen4_init_queryobj_functions(functions);
functions->QuerySamplesForFormat = brw_query_samples_for_format;
- if (screen->gen >= 7) {
+ if (screen->devinfo->gen >= 7) {
functions->BeginTransformFeedback = gen7_begin_transform_feedback;
functions->EndTransformFeedback = gen7_end_transform_feedback;
} else {
functions->EndTransformFeedback = brw_end_transform_feedback;
}
- if (screen->gen >= 6)
+ if (screen->devinfo->gen >= 6)
functions->GetSamplePosition = gen6_get_sample_position;
}
__DRIscreen *sPriv = driContextPriv->driScreenPriv;
struct gl_context *shareCtx = (struct gl_context *) sharedContextPrivate;
struct intel_screen *screen = sPriv->driverPrivate;
+ const struct brw_device_info *devinfo = screen->devinfo;
struct dd_function_table functions;
struct gl_config visual;
brw->driContext = driContextPriv;
brw->intelScreen = screen;
brw->bufmgr = screen->bufmgr;
- brw->gen = screen->gen;
-
- const int devID = screen->deviceID;
- if (IS_SNB_GT1(devID) || IS_IVB_GT1(devID) || IS_HSW_GT1(devID))
- brw->gt = 1;
- else if (IS_SNB_GT2(devID) || IS_IVB_GT2(devID) || IS_HSW_GT2(devID))
- brw->gt = 2;
- else if (IS_HSW_GT3(devID))
- brw->gt = 3;
- else
- brw->gt = 0;
-
- if (IS_HASWELL(devID)) {
- brw->is_haswell = true;
- } else if (IS_BAYTRAIL(devID)) {
- brw->is_baytrail = true;
- brw->gt = 1;
- } else if (IS_G4X(devID)) {
- brw->is_g4x = true;
- }
- brw->has_separate_stencil = screen->hw_has_separate_stencil;
+ brw->gen = devinfo->gen;
+ brw->gt = devinfo->gt;
+ brw->is_g4x = devinfo->is_g4x;
+ brw->is_baytrail = devinfo->is_baytrail;
+ brw->is_haswell = devinfo->is_haswell;
+ brw->has_llc = devinfo->has_llc;
+ brw->has_hiz = devinfo->has_hiz_and_separate_stencil;
+ brw->has_separate_stencil = devinfo->has_hiz_and_separate_stencil;
+
brw->must_use_separate_stencil = screen->hw_must_use_separate_stencil;
- brw->has_hiz = brw->gen >= 6;
- brw->has_llc = screen->hw_has_llc;
brw->has_swizzling = screen->hw_has_swizzling;
brwInitVtbl( brw );
unsigned
intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples)
{
- switch (intel->gen) {
+ switch (intel->devinfo->gen) {
case 6:
/* Gen6 supports only 4x multisampling. */
if (num_samples > 0)
if (mesaVis->depthBits == 24) {
assert(mesaVis->stencilBits == 8);
- if (screen->hw_has_separate_stencil) {
+ if (screen->devinfo->has_hiz_and_separate_stencil) {
rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24,
num_samples);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
static const uint8_t multisample_samples[2] = {4, 8};
struct intel_screen *screen = dri_screen->driverPrivate;
+ const struct brw_device_info *devinfo = screen->devinfo;
uint8_t depth_bits[4], stencil_bits[4];
__DRIconfig **configs = NULL;
if (formats[i] == MESA_FORMAT_RGB565) {
depth_bits[1] = 16;
stencil_bits[1] = 0;
- if (screen->gen >= 6) {
+ if (devinfo->gen >= 6) {
depth_bits[2] = 24;
stencil_bits[2] = 8;
num_depth_stencil_bits = 3;
* them.
*/
for (int i = 0; i < ARRAY_SIZE(formats); i++) {
- if (screen->gen < 6)
+ if (devinfo->gen < 6)
break;
__DRIconfig **new_configs;
stencil_bits[1] = 8;
}
- if (screen->gen >= 7)
+ if (devinfo->gen >= 7)
num_msaa_modes = 2;
- else if (screen->gen == 6)
+ else if (devinfo->gen == 6)
num_msaa_modes = 1;
new_configs = driCreateConfigs(formats[i],
{
__DRIscreen *psp = screen->driScrnPriv;
- switch (screen->gen) {
+ switch (screen->devinfo->gen) {
case 7:
psp->max_gl_core_version = 32;
psp->max_gl_compat_version = 30;
intelScreen->deviceID = drm_intel_bufmgr_gem_get_devid(intelScreen->bufmgr);
intelScreen->devinfo = brw_get_device_info(intelScreen->deviceID);
- if (IS_GEN7(intelScreen->deviceID)) {
- intelScreen->gen = 7;
- } else if (IS_GEN6(intelScreen->deviceID)) {
- intelScreen->gen = 6;
- } else if (IS_GEN5(intelScreen->deviceID)) {
- intelScreen->gen = 5;
- } else {
- intelScreen->gen = 4;
- }
-
- intelScreen->hw_has_separate_stencil = intelScreen->gen >= 6;
- intelScreen->hw_must_use_separate_stencil = intelScreen->gen >= 7;
-
- int has_llc = 0;
- bool success = intel_get_param(intelScreen->driScrnPriv, I915_PARAM_HAS_LLC,
- &has_llc);
- if (success && has_llc)
- intelScreen->hw_has_llc = true;
- else if (!success && intelScreen->gen >= 6)
- intelScreen->hw_has_llc = true;
+ intelScreen->hw_must_use_separate_stencil = intelScreen->devinfo->gen >= 7;
intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen);
int deviceID;
const struct brw_device_info *devinfo;
- int gen;
-
__DRIscreen *driScrnPriv;
bool no_hw;
- /*
- * The hardware hiz and separate stencil fields are needed in intel_screen,
- * rather than solely in brw_context, because glXCreatePbuffer and
- * glXCreatePixmap are not passed a GLXContext.
- */
- bool hw_has_separate_stencil;
bool hw_must_use_separate_stencil;
- bool hw_has_llc;
bool hw_has_swizzling;
dri_bufmgr *bufmgr;