renderer: fix blitter cube map array shader

this needs an extension enabled to work.
macos/master
Dave Airlie 10 years ago
parent ae4c0331fb
commit d0f866ad4b
  1. 8
      src/vrend_blitter.c
  2. 1
      src/vrend_blitter.h

@ -107,7 +107,7 @@ static GLuint blit_build_frag_tex_col(struct vrend_blitter_ctx *blit_ctx, int tg
char shader_buf[4096]; char shader_buf[4096];
int is_shad; int is_shad;
const char *twm; const char *twm;
char *ext_str = "";
switch (tgsi_tex_target) { switch (tgsi_tex_target) {
case TGSI_TEXTURE_1D: case TGSI_TEXTURE_1D:
case TGSI_TEXTURE_BUFFER: case TGSI_TEXTURE_BUFFER:
@ -138,7 +138,11 @@ static GLuint blit_build_frag_tex_col(struct vrend_blitter_ctx *blit_ctx, int tg
break; break;
} }
snprintf(shader_buf, 4096, fs_texfetch_col, vrend_shader_samplertypeconv(tgsi_tex_target, &is_shad), twm, ""); if (tgsi_tex_target == TGSI_TEXTURE_CUBE_ARRAY ||
tgsi_tex_target == TGSI_TEXTURE_SHADOWCUBE_ARRAY)
ext_str = "#extension GL_ARB_texture_cube_map_array : require\n";
snprintf(shader_buf, 4096, fs_texfetch_col, ext_str, vrend_shader_samplertypeconv(tgsi_tex_target, &is_shad), twm, "");
fs_id = glCreateShader(GL_FRAGMENT_SHADER); fs_id = glCreateShader(GL_FRAGMENT_SHADER);

@ -16,6 +16,7 @@ static const char *vs_passthrough = {
static const char *fs_texfetch_col = { static const char *fs_texfetch_col = {
"#version 130\n" "#version 130\n"
"%s"
"uniform sampler%s samp;\n" "uniform sampler%s samp;\n"
"in vec4 tc;\n" "in vec4 tc;\n"
"void main() {\n" "void main() {\n"

Loading…
Cancel
Save