blitter: Correctly emit extension in GLES shaders

The extension declaration must come before the precision definition, and
in GLES we have to emit the OES extension instead of the ARB extension.

Fixes pihlit :
  spec/arb_get_texture_sub_image/arb_get_texture_sub_image-cubemap

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>.
macos/master
Gert Wollny 3 years ago
parent b422b8b7b7
commit caacbe8c7d
  1. 6
      src/vrend_blitter.c
  2. 34
      src/vrend_blitter.h

@ -257,8 +257,12 @@ static GLuint blit_build_frag_tex_col(struct vrend_blitter_ctx *blit_ctx,
if (msaa && !blit_ctx->use_gles)
ext_str = "#extension GL_ARB_texture_multisample : enable\n";
else if (tgsi_tex_target == TGSI_TEXTURE_CUBE_ARRAY ||
tgsi_tex_target == TGSI_TEXTURE_SHADOWCUBE_ARRAY)
tgsi_tex_target == TGSI_TEXTURE_SHADOWCUBE_ARRAY) {
if (blit_ctx->use_gles)
ext_str = "#extension GL_EXT_texture_cube_map_array : require\n";
else
ext_str = "#extension GL_ARB_texture_cube_map_array : require\n";
}
if (blit_ctx->use_gles)
flags |= BLIT_USE_GLES;

@ -29,6 +29,24 @@
/* shaders for blitting */
#define FS_HEADER_GL \
"#version 130\n" \
"// Blitter\n" \
"%s" \
#define FS_HEADER_GLES \
"#version 310 es\n" \
"// Blitter\n" \
"%s" \
"precision mediump float;\n" \
#define FS_HEADER_GLES_MS_ARRAY \
"#version 310 es\n" \
"// Blitter\n" \
"#extension GL_OES_texture_storage_multisample_2d_array: require\n" \
"%s" \
"precision mediump float;\n" \
#define HEADER_GL \
"#version 130\n" \
"// Blitter\n" \
@ -44,7 +62,6 @@
"#extension GL_OES_texture_storage_multisample_2d_array: require\n" \
"precision mediump float;\n" \
#define VS_PASSTHROUGH_BODY \
"in vec4 arg0;\n" \
"in vec4 arg1;\n" \
@ -59,7 +76,6 @@
#define FS_TEXFETCH_COL_BODY \
"%s" \
"#define cvec4 %s\n" \
"uniform mediump %csampler%s samp;\n" \
"in vec4 tc;\n" \
@ -70,7 +86,6 @@
"}\n"
#define FS_TEXFETCH_COL_GLES_1D_BODY \
"%s" \
"#define cvec4 %s\n" \
"uniform mediump %csampler%s samp;\n" \
"in vec4 tc;\n" \
@ -80,12 +95,11 @@
" FragColor = cvec4(%s);\n" \
"}\n"
#define FS_TEXFETCH_COL_GL HEADER_GL FS_TEXFETCH_COL_BODY
#define FS_TEXFETCH_COL_GLES HEADER_GLES FS_TEXFETCH_COL_BODY
#define FS_TEXFETCH_COL_GLES_1D HEADER_GLES FS_TEXFETCH_COL_GLES_1D_BODY
#define FS_TEXFETCH_COL_GL FS_HEADER_GL FS_TEXFETCH_COL_BODY
#define FS_TEXFETCH_COL_GLES FS_HEADER_GLES FS_TEXFETCH_COL_BODY
#define FS_TEXFETCH_COL_GLES_1D FS_HEADER_GLES FS_TEXFETCH_COL_GLES_1D_BODY
#define FS_TEXFETCH_COL_MSAA_BODY \
"%s" \
"#define cvec4 %s\n" \
"uniform mediump %csampler%s samp;\n" \
"in vec4 tc;\n" \
@ -99,9 +113,9 @@
" FragColor = cvec4(%s);\n" \
"}\n"
#define FS_TEXFETCH_COL_MSAA_GL HEADER_GL FS_TEXFETCH_COL_MSAA_BODY
#define FS_TEXFETCH_COL_MSAA_GLES HEADER_GLES FS_TEXFETCH_COL_MSAA_BODY
#define FS_TEXFETCH_COL_MSAA_ARRAY_GLES HEADER_GLES_MS_ARRAY FS_TEXFETCH_COL_MSAA_BODY
#define FS_TEXFETCH_COL_MSAA_GL FS_HEADER_GL FS_TEXFETCH_COL_MSAA_BODY
#define FS_TEXFETCH_COL_MSAA_GLES FS_HEADER_GLES FS_TEXFETCH_COL_MSAA_BODY
#define FS_TEXFETCH_COL_MSAA_ARRAY_GLES FS_HEADER_GLES_MS_ARRAY FS_TEXFETCH_COL_MSAA_BODY
#define FS_TEXFETCH_DS_BODY \
"uniform mediump sampler%s samp;\n" \

Loading…
Cancel
Save