[Mesa-dev] [PATCH V2 06/22] glsl: add support for ARB_texture_multisample
Eric Anholt
eric at anholt.net
Tue Feb 5 14:26:59 PST 2013
> diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py
> index 654eb06..37fb749 100755
> --- a/src/glsl/builtins/tools/texture_builtins.py
> +++ b/src/glsl/builtins/tools/texture_builtins.py
> @@ -57,6 +57,12 @@ def get_txs_dim(sampler_type):
> return 2
> return get_coord_dim(sampler_type)
>
> +def has_lod(sampler_type):
> + if 'Buffer' in sampler_type: return False
> + if 'Rect' in sampler_type: return False
> + if 'MS' in sampler_type: return False
> + return True
> +
> def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
> coord_dim = get_coord_dim(sampler_type)
> extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields)
> @@ -74,11 +80,13 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
> print " (parameters"
> print " (declare (in) " + g + "sampler" + sampler_type + " sampler)",
> if tex_inst != "txs":
> - print "\n (declare (in) " + vec_type("i" if tex_inst == "txf" else "", coord_dim + extra_dim) + " P)",
> + print "\n (declare (in) " + vec_type("i" if tex_inst in ['txf','txf_ms'] else "", coord_dim + extra_dim) + " P)",
> if tex_inst == "txl":
> print "\n (declare (in) float lod)",
> - elif ((tex_inst == "txf" or tex_inst == "txs") and "Buffer" not in sampler_type and "Rect" not in sampler_type):
> + elif tex_inst in ['txf', 'txs'] and has_lod(sampler_type):
> print "\n (declare (in) int lod)",
> + elif tex_inst == "txf_ms":
> + print "\n (declare (in) int sample)",
Weird indentation
> diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
> index 4a2c879..0970522 100644
> --- a/src/glsl/glsl_types.cpp
> +++ b/src/glsl/glsl_types.cpp
> @@ -178,6 +178,8 @@ glsl_type::sampler_index() const
> return TEXTURE_BUFFER_INDEX;
> case GLSL_SAMPLER_DIM_EXTERNAL:
> return TEXTURE_EXTERNAL_INDEX;
> + case GLSL_SAMPLER_DIM_MS:
> + return (t->sampler_array) ? TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX: TEXTURE_2D_MULTISAMPLE_INDEX;
Missing space before ":"
Other than that, patch 4 through this one are:
Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130205/090d4cbd/attachment.pgp>
More information about the mesa-dev
mailing list