ctx->DrawBuffer is much more sensible than brw->intel.ctx.DrawBuffer.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
* to a user-created FBO then our native pixel coordinate system
* works just fine, and there's no window system to worry about.
*/
- if (_mesa_is_winsys_fbo(brw->intel.ctx.DrawBuffer))
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer))
OUT_BATCH((32 - (ctx->DrawBuffer->Height & 31)) & 31);
else
OUT_BATCH(0);
struct brw_sf_unit_state *sf;
drm_intel_bo *bo = brw->batch.bo;
int chipset_max_threads;
- bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
+ bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
sf = brw_state_batch(brw, AUB_TRACE_SF_STATE,
sizeof(*sf), 64, &brw->sf.state_offset);
uint32_t dw1, dw2, dw3, dw4, dw16, dw17;
int i;
/* _NEW_BUFFER */
- bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
+ bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
bool multisampled_fbo = ctx->DrawBuffer->Visual.samples > 1;
int attr = 0, input_index = 0;
static void
upload_vs_state(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
+ struct gl_context *ctx = &brw->intel.ctx;
uint32_t floating_point_mode = 0;
/* From the BSpec, Volume 2a, Part 3 "Vertex Shader", Section
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
*/
- if (intel->ctx.Shader.CurrentVertexProgram == NULL)
+ if (ctx->Shader.CurrentVertexProgram == NULL)
floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
BEGIN_BATCH(6);
uint32_t dw1, dw2, dw3;
float point_size;
/* _NEW_BUFFERS */
- bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
+ bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
bool multisampled_fbo = ctx->DrawBuffer->Visual.samples > 1;
dw1 = GEN6_SF_STATISTICS_ENABLE |
static void
upload_vs_state(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
+ struct gl_context *ctx = &brw->intel.ctx;
uint32_t floating_point_mode = 0;
const int max_threads_shift = brw->intel.is_haswell ?
HSW_VS_MAX_THREADS_SHIFT : GEN6_VS_MAX_THREADS_SHIFT;
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
*/
- if (intel->ctx.Shader.CurrentVertexProgram == NULL)
+ if (ctx->Shader.CurrentVertexProgram == NULL)
floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
BEGIN_BATCH(6);
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
uint32_t dw2, dw4, dw5;
- const int max_threads_shift = brw->intel.is_haswell ?
+ const int max_threads_shift = intel->is_haswell ?
HSW_PS_MAX_THREADS_SHIFT : IVB_PS_MAX_THREADS_SHIFT;
/* BRW_NEW_PS_BINDING_TABLE */
* rendering, CurrentFragmentProgram is used for this check to
* differentiate between the GLSL and non-GLSL cases.
*/
- if (intel->ctx.Shader.CurrentFragmentProgram == NULL)
+ if (ctx->Shader.CurrentFragmentProgram == NULL)
dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
if (intel->is_haswell)
void
intel_check_front_buffer_rendering(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
- const struct gl_framebuffer *fb = intel->ctx.DrawBuffer;
+ struct gl_context *ctx = &brw->intel.ctx;
+ const struct gl_framebuffer *fb = ctx->DrawBuffer;
if (_mesa_is_winsys_fbo(fb)) {
/* drawing to window system buffer */
if (fb->_NumColorDrawBuffers > 0) {
if (ctx->API != API_OPENGL_CORE)
ctx->Extensions.ARB_color_buffer_float = true;
- if (intel->ctx.Mesa_DXTn
- || driQueryOptionb(&brw->optionCache, "force_s3tc_enable"))
+ if (ctx->Mesa_DXTn || driQueryOptionb(&brw->optionCache, "force_s3tc_enable"))
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
* except they're less useful because you can't texture with
* them.
*/
- rb->Format = intel->ctx.Driver.ChooseTextureFormat(ctx, GL_TEXTURE_2D,
- internalFormat,
- GL_NONE, GL_NONE);
+ rb->Format = ctx->Driver.ChooseTextureFormat(ctx, GL_TEXTURE_2D,
+ internalFormat,
+ GL_NONE, GL_NONE);
break;
case GL_STENCIL_INDEX:
case GL_STENCIL_INDEX1_EXT:
void
intel_fbo_init(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
- intel->ctx.Driver.NewFramebuffer = intel_new_framebuffer;
- intel->ctx.Driver.NewRenderbuffer = intel_new_renderbuffer;
- intel->ctx.Driver.MapRenderbuffer = intel_map_renderbuffer;
- intel->ctx.Driver.UnmapRenderbuffer = intel_unmap_renderbuffer;
- intel->ctx.Driver.RenderTexture = intel_render_texture;
- intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
- intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer;
- intel->ctx.Driver.BlitFramebuffer = intel_blit_framebuffer;
- intel->ctx.Driver.EGLImageTargetRenderbufferStorage =
+ struct dd_function_table *dd = &brw->intel.ctx.Driver;
+ dd->NewFramebuffer = intel_new_framebuffer;
+ dd->NewRenderbuffer = intel_new_renderbuffer;
+ dd->MapRenderbuffer = intel_map_renderbuffer;
+ dd->UnmapRenderbuffer = intel_unmap_renderbuffer;
+ dd->RenderTexture = intel_render_texture;
+ dd->FinishRenderTexture = intel_finish_render_texture;
+ dd->ValidateFramebuffer = intel_validate_framebuffer;
+ dd->BlitFramebuffer = intel_blit_framebuffer;
+ dd->EGLImageTargetRenderbufferStorage =
intel_image_target_renderbuffer_storage;
}
GLenum format, GLenum type, const void *pixels)
{
struct intel_texture_image *intelImage = intel_texture_image(image);
- struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
GLuint src_offset;
DBG("trying pbo upload\n");
- if (intel->ctx._ImageTransferState ||
- unpack->SkipPixels || unpack->SkipRows) {
+ if (ctx->_ImageTransferState || unpack->SkipPixels || unpack->SkipRows) {
DBG("%s: image transfer\n", __FUNCTION__);
return false;
}
{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
- struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
+ struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj);
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
GLuint face, i;