mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
Add a callback to set post-fragment state in the metaops utility.
Useful for accelerating read/draw/copy pixels when blitting isn't sufficient.
This commit is contained in:
parent
4aea628194
commit
8d349798da
2 changed files with 29 additions and 3 deletions
|
|
@ -39,13 +39,14 @@
|
|||
#include "i915_context.h"
|
||||
#include "i915_reg.h"
|
||||
|
||||
/* A large amount of state doesn't need to be uploaded.
|
||||
/* We touch almost everything:
|
||||
*/
|
||||
#define ACTIVE (I915_UPLOAD_INVARIENT | \
|
||||
I915_UPLOAD_PROGRAM | \
|
||||
I915_UPLOAD_STIPPLE | \
|
||||
I915_UPLOAD_CTX | \
|
||||
I915_UPLOAD_BUFFERS | \
|
||||
I915_UPLOAD_STIPPLE | \
|
||||
I915_UPLOAD_PROGRAM | \
|
||||
I915_UPLOAD_FOG | \
|
||||
I915_UPLOAD_TEX(0))
|
||||
|
||||
#define SET_STATE( i915, STATE ) \
|
||||
|
|
@ -152,6 +153,28 @@ static void meta_color_mask( struct intel_context *intel, GLboolean state )
|
|||
|
||||
|
||||
|
||||
static void meta_import_pixel_state( struct intel_context *intel )
|
||||
{
|
||||
struct i915_context *i915 = i915_context(&intel->ctx);
|
||||
memcpy(i915->meta.Fog, i915->state.Fog, I915_FOG_SETUP_SIZE * 4);
|
||||
|
||||
i915->meta.Ctx[I915_CTXREG_LIS5] = i915->state.Ctx[I915_CTXREG_LIS5];
|
||||
i915->meta.Ctx[I915_CTXREG_LIS6] = i915->state.Ctx[I915_CTXREG_LIS6];
|
||||
i915->meta.Ctx[I915_CTXREG_STATE4] = i915->state.Ctx[I915_CTXREG_STATE4];
|
||||
i915->meta.Ctx[I915_CTXREG_BLENDCOLOR1] = i915->state.Ctx[I915_CTXREG_BLENDCOLOR1];
|
||||
i915->meta.Ctx[I915_CTXREG_IAB] = i915->state.Ctx[I915_CTXREG_IAB];
|
||||
|
||||
i915->meta.Buffer[I915_DESTREG_SENABLE] = i915->state.Buffer[I915_DESTREG_SENABLE];
|
||||
i915->meta.Buffer[I915_DESTREG_SR1] = i915->state.Buffer[I915_DESTREG_SR1];
|
||||
i915->meta.Buffer[I915_DESTREG_SR2] = i915->state.Buffer[I915_DESTREG_SR2];
|
||||
|
||||
i915->meta.emitted &= ~I915_UPLOAD_FOG;
|
||||
i915->meta.emitted &= ~I915_UPLOAD_BUFFERS;
|
||||
i915->meta.emitted &= ~I915_UPLOAD_CTX;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define REG( type, nr ) (((type)<<5)|(nr))
|
||||
|
||||
|
|
@ -421,4 +444,5 @@ void i915InitMetaFuncs( struct i915_context *i915 )
|
|||
i915->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source;
|
||||
i915->intel.vtbl.meta_draw_region = meta_draw_region;
|
||||
i915->intel.vtbl.meta_draw_format = set_draw_format;
|
||||
i915->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,8 @@ struct intel_context
|
|||
void (*meta_no_texture)( struct intel_context *intel );
|
||||
void (*meta_texture_blend_replace)( struct intel_context *intel );
|
||||
|
||||
void (*meta_import_pixel_state)( struct intel_context *intel );
|
||||
|
||||
void (*meta_tex_rect_source)( struct intel_context *intel,
|
||||
struct intel_region *region,
|
||||
GLuint textureFormat );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue