projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '7.8'
[mesa.git]
/
src
/
gallium
/
drivers
/
i915
/
i915_state_sampler.c
diff --git
a/src/gallium/drivers/i915/i915_state_sampler.c
b/src/gallium/drivers/i915/i915_state_sampler.c
index cbac4175c8f78fb5652718cc3a630771aa9b3eb3..d6da82254907dfd386ba11a3ad98eb6a3100efde 100644
(file)
--- a/
src/gallium/drivers/i915/i915_state_sampler.c
+++ b/
src/gallium/drivers/i915/i915_state_sampler.c
@@
-27,7
+27,6
@@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"
-#include "util/u_memory.h"
#include "i915_state_inlines.h"
#include "i915_context.h"
#include "i915_state_inlines.h"
#include "i915_context.h"
@@
-88,8
+87,8
@@
static void update_sampler(struct i915_context *i915,
state[1] = sampler->state[1];
state[2] = sampler->state[2];
state[1] = sampler->state[1];
state[2] = sampler->state[2];
- if (pt->format == PIPE_FORMAT_
YCBCR
||
- pt->format == PIPE_FORMAT_Y
CBCR_RE
V)
+ if (pt->format == PIPE_FORMAT_
UYVY
||
+ pt->format == PIPE_FORMAT_Y
UY
V)
state[0] |= SS2_COLORSPACE_CONVERSION;
/* 3D textures don't seem to respect the border color.
state[0] |= SS2_COLORSPACE_CONVERSION;
/* 3D textures don't seem to respect the border color.
@@
-145,20
+144,22
@@
void i915_update_samplers( struct i915_context *i915 )
i915->current.sampler_enable_nr = 0;
i915->current.sampler_enable_flags = 0x0;
i915->current.sampler_enable_nr = 0;
i915->current.sampler_enable_flags = 0x0;
- for (unit = 0; unit < i915->num_
texture
s && unit < i915->num_samplers;
+ for (unit = 0; unit < i915->num_
fragment_sampler_view
s && unit < i915->num_samplers;
unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
- if (i915->texture[unit]) {
+ if (i915->fragment_sampler_views[unit]) {
+ struct i915_texture *texture = (struct i915_texture *)i915->fragment_sampler_views[unit]->texture;
+
update_sampler( i915,
unit,
i915->sampler[unit], /* sampler state */
update_sampler( i915,
unit,
i915->sampler[unit], /* sampler state */
-
i915->texture[unit],
/* texture */
+
texture,
/* texture */
i915->current.sampler[unit] /* the result */
);
i915_update_texture( i915,
unit,
i915->current.sampler[unit] /* the result */
);
i915_update_texture( i915,
unit,
-
i915->texture[unit],
/* texture */
+
texture,
/* texture */
i915->sampler[unit], /* sampler state */
i915->current.texbuffer[unit] );
i915->sampler[unit], /* sampler state */
i915->current.texbuffer[unit] );
@@
-181,19
+182,19
@@
translate_texture_format(enum pipe_format pipeFormat)
return MAPSURF_8BIT | MT_8BIT_I8;
case PIPE_FORMAT_A8_UNORM:
return MAPSURF_8BIT | MT_8BIT_A8;
return MAPSURF_8BIT | MT_8BIT_I8;
case PIPE_FORMAT_A8_UNORM:
return MAPSURF_8BIT | MT_8BIT_A8;
- case PIPE_FORMAT_
A8L
8_UNORM:
+ case PIPE_FORMAT_
L8A
8_UNORM:
return MAPSURF_16BIT | MT_16BIT_AY88;
return MAPSURF_16BIT | MT_16BIT_AY88;
- case PIPE_FORMAT_
R5G6B
5_UNORM:
+ case PIPE_FORMAT_
B5G6R
5_UNORM:
return MAPSURF_16BIT | MT_16BIT_RGB565;
return MAPSURF_16BIT | MT_16BIT_RGB565;
- case PIPE_FORMAT_
A1R5G5B5
_UNORM:
+ case PIPE_FORMAT_
B5G5R5A1
_UNORM:
return MAPSURF_16BIT | MT_16BIT_ARGB1555;
return MAPSURF_16BIT | MT_16BIT_ARGB1555;
- case PIPE_FORMAT_
A4R4G4B
4_UNORM:
+ case PIPE_FORMAT_
B4G4R4A
4_UNORM:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
- case PIPE_FORMAT_
A8R8G8B
8_UNORM:
+ case PIPE_FORMAT_
B8G8R8A
8_UNORM:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case PIPE_FORMAT_Y
CBCR_RE
V:
+ case PIPE_FORMAT_Y
UY
V:
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
- case PIPE_FORMAT_
YCBCR
:
+ case PIPE_FORMAT_
UYVY
:
return (MAPSURF_422 | MT_422_YCRCB_SWAPY);
#if 0
case PIPE_FORMAT_RGB_FXT1:
return (MAPSURF_422 | MT_422_YCRCB_SWAPY);
#if 0
case PIPE_FORMAT_RGB_FXT1:
@@
-211,7
+212,7
@@
translate_texture_format(enum pipe_format pipeFormat)
case PIPE_FORMAT_RGBA_DXT5:
return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
#endif
case PIPE_FORMAT_RGBA_DXT5:
return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
#endif
- case PIPE_FORMAT_
S8Z24
_UNORM:
+ case PIPE_FORMAT_
Z24S8
_UNORM:
return (MAPSURF_32BIT | MT_32BIT_xI824);
default:
debug_printf("i915: translate_texture_format() bad image format %x\n",
return (MAPSURF_32BIT | MT_32BIT_xI824);
default:
debug_printf("i915: translate_texture_format() bad image format %x\n",
@@
-282,14
+283,16
@@
i915_update_textures(struct i915_context *i915)
{
uint unit;
{
uint unit;
- for (unit = 0; unit < i915->num_
texture
s && unit < i915->num_samplers;
+ for (unit = 0; unit < i915->num_
fragment_sampler_view
s && unit < i915->num_samplers;
unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
- if (i915->texture[unit]) {
+ if (i915->fragment_sampler_views[unit]) {
+ struct i915_texture *texture = (struct i915_texture *)i915->fragment_sampler_views[unit]->texture;
+
i915_update_texture( i915,
unit,
i915_update_texture( i915,
unit,
-
i915->texture[unit],
/* texture */
+
texture,
/* texture */
i915->sampler[unit], /* sampler state */
i915->current.texbuffer[unit] );
}
i915->sampler[unit], /* sampler state */
i915->current.texbuffer[unit] );
}